From 733c2f4bae8d7342da35a55598b614041253c7b4 Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Tue, 19 May 2026 16:40:45 +0200 Subject: [PATCH 01/21] highlighting PoC --- .../shared/kbn-discover-utils/src/types.ts | 13 ++-- .../src/utils/format_hit.ts | 4 +- .../src/utils/format_value.ts | 11 +++- .../packages/shared/kbn-esql-utils/index.ts | 1 + .../shared/kbn-esql-utils/src/index.ts | 1 + .../src/utils/get_columns_to_highlight.ts | 12 ++++ .../src/components/source_document.tsx | 15 ++++- .../src/utils/get_render_cell_value.tsx | 5 ++ .../data/common/search/expressions/esql.ts | 3 + .../expression_types/specs/datatable.ts | 4 ++ .../common/converters/string.tsx | 22 +++++-- .../field_formats/common/field_format.tsx | 18 ++++-- .../shared/field_formats/common/index.ts | 2 +- .../shared/field_formats/common/types.ts | 2 + .../common/utils/highlight/index.ts | 1 + .../inline_em_snippet_highlight_react.tsx | 61 +++++++++++++++++++ .../field_formats/common/utils/index.ts | 6 +- 17 files changed, 157 insertions(+), 24 deletions(-) create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts create mode 100644 src/platform/plugins/shared/field_formats/common/utils/highlight/inline_em_snippet_highlight_react.tsx diff --git a/src/platform/packages/shared/kbn-discover-utils/src/types.ts b/src/platform/packages/shared/kbn-discover-utils/src/types.ts index 8b5f47893c3f6..7887a3ee1e9b9 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/types.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/types.ts @@ -53,13 +53,12 @@ export interface DataTableRecord { /** * Custom column types per column name */ -export type DataTableColumnsMeta = Record< - string, - { - type: DatatableColumnMeta['type']; - esType?: DatatableColumnMeta['esType']; - } ->; +export interface DataTableColumnMeta { + type: DatatableColumnMeta['type']; + esType?: DatatableColumnMeta['esType']; + hasHighlights?: DatatableColumnMeta['hasHighlights']; +} +export type DataTableColumnsMeta = Record; import type { ReactNode } from 'react'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts index 5ec110e5bc421..942b72051d261 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts @@ -63,6 +63,8 @@ export function formatHitReact( const renderedPairs: PartialHitReactPair[] = []; const otherPairs: PartialHitReactPair[] = []; + // HD TODO: contemplate ES|QL highlights when ordering. + // Add each flattened field into the corresponding array for rendered or other pairs, // depending on whether the original hit had a highlight for it. That way we can ensure // highlighted fields are shown first in the document summary. @@ -114,13 +116,13 @@ export function formatHitReact( fieldName: key, columnMeta: columnsMeta?.[key], }); - pair[1] = formatFieldValueReact({ value: flattened[key], hit: hit.raw, fieldFormats, dataView, field, + columnMeta: columnsMeta?.[key], }); } diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.ts index 6d7bb2651d404..66310b2cf50d2 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.ts @@ -16,7 +16,7 @@ import type { ReactContextTypeOptions, TextContextTypeOptions, } from '@kbn/field-formats-plugin/common/types'; -import type { EsHitRecord } from '../types'; +import type { DataTableColumnMeta, EsHitRecord } from '../types'; /** Base parameters for field value formatting functions */ interface FormatFieldValueBaseParams { @@ -28,6 +28,7 @@ interface FormatFieldValueBaseParams { export interface FormatFieldValueReactParams extends FormatFieldValueBaseParams { hit: EsHitRecord; + columnMeta?: DataTableColumnMeta; options?: ReactContextTypeOptions; } @@ -61,9 +62,15 @@ export const formatFieldValueReact = ({ fieldFormats, dataView, field, + columnMeta, options, }: FormatFieldValueReactParams): ReactNode => { - const converterOptions: ReactContextTypeOptions = { ...options, hit, field }; + const converterOptions: ReactContextTypeOptions = { + ...options, + hit, + field, + hasHighlights: columnMeta?.hasHighlights ?? options?.hasHighlights, + }; return getFieldFormatter(fieldFormats, dataView, field).reactConvert(value, converterOptions); }; diff --git a/src/platform/packages/shared/kbn-esql-utils/index.ts b/src/platform/packages/shared/kbn-esql-utils/index.ts index 93a35affafca0..4d61774691e07 100644 --- a/src/platform/packages/shared/kbn-esql-utils/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/index.ts @@ -72,6 +72,7 @@ export { hasTimeseriesInfoCommand, isComputedColumn, getQuerySummary, + getColumnsToHighlight, getEsqlControls, getAllEsqlControls, convertFiltersToESQLExpression, diff --git a/src/platform/packages/shared/kbn-esql-utils/src/index.ts b/src/platform/packages/shared/kbn-esql-utils/src/index.ts index 205887ad2d23e..f0adf9f3c4389 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/index.ts @@ -74,6 +74,7 @@ export { } from './utils/cascaded_documents_helpers/utils'; export { getProjectRoutingFromEsqlQuery } from './utils/set_instructions_helpers'; export { isComputedColumn, getQuerySummary } from './utils/get_query_summary'; +export { getColumnsToHighlight } from './utils/get_columns_to_highlight'; export { getAllEsqlControls, getEsqlControls } from './utils/get_esql_controls'; export { convertFiltersToESQLExpression } from './utils/convert_filters_to_esql'; export { convertQueryToESQLExpression } from './utils/convert_query_to_esql'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts new file mode 100644 index 0000000000000..4d1d29cd7bd74 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export function getColumnsToHighlight(query: string): Set { + return new Set(['lala']); +} diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/components/source_document.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/components/source_document.tsx index 071cb8aa8ba3a..487ebffb814e8 100644 --- a/src/platform/packages/shared/kbn-unified-data-table/src/components/source_document.tsx +++ b/src/platform/packages/shared/kbn-unified-data-table/src/components/source_document.tsx @@ -68,7 +68,8 @@ export function SourceDocument({ dataView, shouldShowFieldHandler, fieldFormats, - columnsMeta + columnsMeta, + isPlainRecord ).slice(0, maxEntries) : formatHitReact(row, dataView, shouldShowFieldHandler, maxEntries, fieldFormats, columnsMeta); @@ -117,7 +118,8 @@ function getTopLevelObjectPairsReact( dataView: DataView, shouldShowFieldHandler: ShouldShowFieldInTableHandler, fieldFormats: FieldFormatsStart, - columnsMeta: DataTableColumnsMeta | undefined + columnsMeta: DataTableColumnsMeta | undefined, + isPlainRecord?: boolean ): FormattedHit { const innerColumns = getInnerColumns(row.fields as Record, columnId); // Put the most important fields first @@ -137,7 +139,14 @@ function getTopLevelObjectPairsReact( const formatted: ReactNode = values.map((value: unknown, idx) => ( {idx > 0 ? ', ' : null} - {formatFieldValueReact({ value, hit: row, fieldFormats, dataView, field: subField })} + {formatFieldValueReact({ + value, + hit: row, + fieldFormats, + dataView, + field: subField, + columnMeta: isPlainRecord ? columnsMeta?.[key] : undefined, + })} )); const pairs = highlights[key] ? highlightPairs : sourcePairs; diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/utils/get_render_cell_value.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/utils/get_render_cell_value.tsx index 03fb17d0fe906..13d9d4a67e08e 100644 --- a/src/platform/packages/shared/kbn-unified-data-table/src/utils/get_render_cell_value.tsx +++ b/src/platform/packages/shared/kbn-unified-data-table/src/utils/get_render_cell_value.tsx @@ -131,6 +131,7 @@ export const getRenderCellValueFn = ({ fieldFormats, closePopover, isPlainRecord, + columnsMeta, }); } @@ -163,6 +164,7 @@ export const getRenderCellValueFn = ({ fieldFormats, dataView, field, + columnMeta: isPlainRecord ? columnsMeta?.[columnId] : undefined, })} ); @@ -189,6 +191,7 @@ function renderPopoverContent({ fieldFormats, closePopover, isPlainRecord, + columnsMeta, }: { row: DataTableRecord; field: DataViewField | undefined; @@ -198,6 +201,7 @@ function renderPopoverContent({ fieldFormats: FieldFormatsStart; closePopover: () => void; isPlainRecord?: boolean; + columnsMeta: DataTableColumnsMeta | undefined; }) { const closeButton = ( diff --git a/src/platform/plugins/shared/data/common/search/expressions/esql.ts b/src/platform/plugins/shared/data/common/search/expressions/esql.ts index e33ba24f8f93a..1004c39e88e21 100644 --- a/src/platform/plugins/shared/data/common/search/expressions/esql.ts +++ b/src/platform/plugins/shared/data/common/search/expressions/esql.ts @@ -28,6 +28,7 @@ import { mapVariableToColumn, isComputedColumn, getQuerySummary, + getColumnsToHighlight, } from '@kbn/esql-utils'; import { zipObject } from 'lodash'; import type { Observable } from 'rxjs'; @@ -368,6 +369,7 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { // Get query summary to identify computed columns const querySummary = getQuerySummary(query); + const highlightColumnNames = getColumnsToHighlight(query); const allColumns = (body.all_columns ?? body.columns)?.map(({ name, type, original_types }) => { @@ -382,6 +384,7 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { meta: { type: kibanaFieldType, esType: type, + hasHighlights: highlightColumnNames.has(name), sourceParams: type === 'date' ? { diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.ts index 328b3bed1c7db..6247f28dbaabf 100644 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.ts +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.ts @@ -103,6 +103,10 @@ export interface DatatableColumnMeta { * any extra parameters for the source that produced this column */ sourceParams?: SerializableRecord; + /** + * True when column values includes highlitings parts. + */ + hasHighlights?: boolean; } interface SourceParamsESQL extends Record { diff --git a/src/platform/plugins/shared/field_formats/common/converters/string.tsx b/src/platform/plugins/shared/field_formats/common/converters/string.tsx index d8b0e793a4f67..afd74499a919a 100644 --- a/src/platform/plugins/shared/field_formats/common/converters/string.tsx +++ b/src/platform/plugins/shared/field_formats/common/converters/string.tsx @@ -9,7 +9,12 @@ import { i18n } from '@kbn/i18n'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; -import { asPrettyString, getHighlightReact, shortenDottedString } from '../utils'; +import { + asPrettyString, + getHighlightReact, + getInlineEmSnippetHighlightReact, + shortenDottedString, +} from '../utils'; import { FieldFormat } from '../field_format'; import type { ReactContextTypeSingleConvert, TextContextTypeConvert } from '../types'; import { FIELD_FORMAT_IDS } from '../types'; @@ -130,15 +135,24 @@ export class StringFormat extends FieldFormat { } }; - reactConvertSingle: ReactContextTypeSingleConvert = (val, { hit, field } = {}) => { + reactConvertSingle: ReactContextTypeSingleConvert = (val, options = {}) => { const missing = this.checkForMissingValueReact(val); if (missing) return missing; + const { hit, field, hasHighlights } = options; + const formatted = this.textConvert(val); const fieldName = field?.name; + + // Clasic mode if (fieldName && hit?.highlight?.[fieldName]) { - return getHighlightReact(this.textConvert(val), hit.highlight[fieldName]); + return getHighlightReact(formatted, hit.highlight[fieldName]); + } + + // ES|QL mode + if (hasHighlights && typeof formatted === 'string') { + return getInlineEmSnippetHighlightReact(formatted); } - return this.textConvert(val); + return formatted; }; } diff --git a/src/platform/plugins/shared/field_formats/common/field_format.tsx b/src/platform/plugins/shared/field_formats/common/field_format.tsx index a0971443da2b8..764f5871bbeeb 100644 --- a/src/platform/plugins/shared/field_formats/common/field_format.tsx +++ b/src/platform/plugins/shared/field_formats/common/field_format.tsx @@ -24,7 +24,7 @@ import type { FieldFormatParams, } from './types'; import { textContentTypeSetup, TEXT_CONTEXT_TYPE } from './content_types'; -import { getHighlightReact } from './utils/highlight'; +import { getHighlightReact, getInlineEmSnippetHighlightReact } from './utils/highlight'; import type { ReactContextTypeConvert, ReactContextTypeSingleConvert, @@ -112,10 +112,18 @@ export abstract class FieldFormat { : this.convert(val, TEXT_CONTEXT_TYPE, options); const fieldName = options?.field?.name; const highlights = fieldName ? options?.hit?.highlight?.[fieldName] : undefined; - // getHighlightReact expects a string; guard against edge cases where convert() returns non-string - return highlights && typeof formatted === 'string' - ? getHighlightReact(formatted, highlights) - : formatted; + if (typeof formatted !== 'string') { + return formatted; + } + // Classic search: parallel hit.highlight snippets (Kibana highlight tags). + if (highlights) { + return getHighlightReact(formatted, highlights); + } + // ES|QL: inline markup in the cell value. + if (options?.hasHighlights) { + return getInlineEmSnippetHighlightReact(formatted); + } + return formatted; }; /** diff --git a/src/platform/plugins/shared/field_formats/common/index.ts b/src/platform/plugins/shared/field_formats/common/index.ts index 7327ffd3601a8..c490d4c32d438 100644 --- a/src/platform/plugins/shared/field_formats/common/index.ts +++ b/src/platform/plugins/shared/field_formats/common/index.ts @@ -34,7 +34,7 @@ export { HistogramFormat, } from './converters'; -export { getHighlightRequest, geoUtils } from './utils'; +export { getHighlightRequest, getInlineEmSnippetHighlightReact, geoUtils } from './utils'; export { DEFAULT_CONVERTER_COLOR } from './constants/color_default'; export { FORMATS_UI_SETTINGS } from './constants/ui_settings'; diff --git a/src/platform/plugins/shared/field_formats/common/types.ts b/src/platform/plugins/shared/field_formats/common/types.ts index 9fdfb1852d45b..3582a57b14479 100644 --- a/src/platform/plugins/shared/field_formats/common/types.ts +++ b/src/platform/plugins/shared/field_formats/common/types.ts @@ -25,6 +25,8 @@ export interface ReactContextTypeOptions { field?: { name: string }; hit?: { highlight?: Record }; skipFormattingInStringifiedJSON?: boolean; + /** When true, string values may include inline `` markup to render as highlights. (ES|QL) */ + hasHighlights?: boolean; } /** diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/index.ts b/src/platform/plugins/shared/field_formats/common/utils/highlight/index.ts index ed87a28455a6b..13c6794fc44cd 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/highlight/index.ts +++ b/src/platform/plugins/shared/field_formats/common/utils/highlight/index.ts @@ -8,4 +8,5 @@ */ export { getHighlightReact } from './highlight_react'; +export { getInlineEmSnippetHighlightReact } from './inline_em_snippet_highlight_react'; export { getHighlightRequest } from './highlight_request'; diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/inline_em_snippet_highlight_react.tsx b/src/platform/plugins/shared/field_formats/common/utils/highlight/inline_em_snippet_highlight_react.tsx new file mode 100644 index 0000000000000..47dab59893b16 --- /dev/null +++ b/src/platform/plugins/shared/field_formats/common/utils/highlight/inline_em_snippet_highlight_react.tsx @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; + +const OPEN_TAG = ''; +const CLOSE_TAG = ''; + +export function getInlineEmSnippetHighlightReact(value: string): React.ReactNode { + if (!value.includes(OPEN_TAG)) { + return value; + } + + const nodes: React.ReactNode[] = []; + let rest = value; + let key = 0; + + while (rest.length > 0) { + const openIdx = rest.indexOf(OPEN_TAG); + + // No more highlights + if (openIdx === -1) { + nodes.push(rest); + break; + } + + if (openIdx > 0) { + nodes.push(rest.slice(0, openIdx)); + } + rest = rest.slice(openIdx + OPEN_TAG.length); + const closeIdx = rest.indexOf(CLOSE_TAG); + + // Malformed highlight with no closing tag, return as is + if (closeIdx === -1) { + nodes.push(`${OPEN_TAG}${rest}`); + break; + } + + const inner = rest.slice(0, closeIdx); + nodes.push( + + {inner} + + ); + rest = rest.slice(closeIdx + CLOSE_TAG.length); + } + + if (nodes.length === 0) { + return value; + } + if (nodes.length === 1) { + return nodes[0]; + } + return <>{nodes}; +} diff --git a/src/platform/plugins/shared/field_formats/common/utils/index.ts b/src/platform/plugins/shared/field_formats/common/utils/index.ts index a5c14ff478726..3b86235be474f 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/index.ts +++ b/src/platform/plugins/shared/field_formats/common/utils/index.ts @@ -8,7 +8,11 @@ */ export { asPrettyString } from './as_pretty_string'; -export { getHighlightReact, getHighlightRequest } from './highlight'; +export { + getHighlightReact, + getInlineEmSnippetHighlightReact, + getHighlightRequest, +} from './highlight'; export { shortenDottedString } from './shorten_dotted_string'; export { formatReactArray } from './format_react_array'; export * as geoUtils from './geo_utils'; From fd5bb828eed10b668bbfd901d61ac3a5b15d5eb3 Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Wed, 20 May 2026 10:58:19 +0200 Subject: [PATCH 02/21] implement getColumnsToHighlight --- .../utils/get_columns_to_highlight.test.ts | 63 ++++++++++++++++ .../src/utils/get_columns_to_highlight.ts | 73 ++++++++++++++++++- 2 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.test.ts diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.test.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.test.ts new file mode 100644 index 0000000000000..b2c4999accf4c --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.test.ts @@ -0,0 +1,63 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { getColumnsToHighlight } from './get_columns_to_highlight'; + +describe('getColumnsToHighlight', () => { + it('returns columns assigned from TOP_SNIPPETS with highlight enabled', () => { + const query = + 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": true })'; + expect(getColumnsToHighlight(query)).toEqual(new Set(['snippets'])); + }); + + it('returns columns from STATS and ROW assignments with highlight enabled', () => { + expect( + getColumnsToHighlight( + 'FROM books | STATS s = TOP_SNIPPETS(description, "Tolkien", { "highlight": true }) BY author' + ) + ).toEqual(new Set(['s'])); + expect( + getColumnsToHighlight('ROW r = TOP_SNIPPETS("text", "q", { "highlight": true })') + ).toEqual(new Set(['r'])); + }); + + it('returns multiple TOP_SNIPPETS output columns when highlight is enabled', () => { + const query = + 'FROM books | EVAL a = TOP_SNIPPETS(description, "one", { "highlight": true }) | EVAL b = TOP_SNIPPETS(title, "two", { "highlight": true })'; + expect(getColumnsToHighlight(query)).toEqual(new Set(['a', 'b'])); + }); + + it('ignores TOP_SNIPPETS without highlight option', () => { + const query = 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien")'; + expect(getColumnsToHighlight(query)).toEqual(new Set()); + }); + + it('ignores TOP_SNIPPETS with highlight set to false', () => { + const query = + 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": false })'; + expect(getColumnsToHighlight(query)).toEqual(new Set()); + }); + + it('ignores TOP_SNIPPETS with other options but no highlight', () => { + const query = + 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "num_words": 25 })'; + expect(getColumnsToHighlight(query)).toEqual(new Set()); + }); + + it('ignores TOP_SNIPPETS used only in RERANK ON clause', () => { + const query = + 'FROM books | RERANK "Tolkien" ON TOP_SNIPPETS(description, "Tolkien", { "highlight": true }) WITH { "inference_id": "x" }'; + expect(getColumnsToHighlight(query)).toEqual(new Set()); + }); + + it('returns an empty set when TOP_SNIPPETS is not used', () => { + const query = 'FROM books | KEEP title'; + expect(getColumnsToHighlight(query)).toEqual(new Set()); + }); +}); diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts index 4d1d29cd7bd74..4416006ed3114 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts @@ -7,6 +7,77 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import { + isAssignment, + isBooleanLiteral, + isColumn, + isStringLiteral, + LeafPrinter, + Parser, + Walker, +} from '@elastic/esql'; +import type { ESQLAstQueryExpression, ESQLFunction, ESQLMapEntry } from '@elastic/esql/types'; + +const TOP_SNIPPETS_FUNCTION_NAME = 'top_snippets'; +const HIGHLIGHT_OPTION_NAME = 'highlight'; + +/** + * Returns column names produced by TOP_SNIPPETS calls that enable snippet highlighting. + * These columns may contain highlight markup and need special formatting in the UI. + */ export function getColumnsToHighlight(query: string): Set { - return new Set(['lala']); + const columnsToHighlight = new Set(); + const { root } = Parser.parse(query); + + const topSnippetFunctions = Walker.matchAll(root, { + type: 'function', + name: TOP_SNIPPETS_FUNCTION_NAME, + }); + + for (const topSnippetsFunction of topSnippetFunctions) { + const fn = topSnippetsFunction as ESQLFunction; + + if (!isHighlightEnabled(fn)) { + continue; + } + + const columnName = getColumnNameForTopSnippetsFunction(root, fn); + if (columnName) { + columnsToHighlight.add(columnName); + } + } + + return columnsToHighlight; } + +const isHighlightEnabled = (topSnippetsFunction: ESQLFunction): boolean => { + const highlightKey = Walker.find( + topSnippetsFunction, + (node) => isStringLiteral(node) && node.valueUnquoted === HIGHLIGHT_OPTION_NAME + ); + if (!highlightKey) { + return false; + } + + const mapEntry = Walker.parent(topSnippetsFunction, highlightKey); + if (mapEntry?.type !== 'map-entry') { + return false; + } + + const { value } = mapEntry as ESQLMapEntry; + + return isBooleanLiteral(value) && value.value === 'true'; +}; + +const getColumnNameForTopSnippetsFunction = ( + root: ESQLAstQueryExpression, + topSnippetsFunction: ESQLFunction +): string | undefined => { + for (const parent of Walker.parents(root, topSnippetsFunction)) { + if (isAssignment(parent) && isColumn(parent.args[0])) { + return LeafPrinter.column(parent.args[0]); + } + } + + return; +}; From 58cbc1e956fdd62a9ee3c393e246c0c1202f0015 Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Wed, 20 May 2026 15:34:30 +0200 Subject: [PATCH 03/21] fix typo --- src/platform/packages/shared/kbn-esql-utils/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/index.ts b/src/platform/packages/shared/kbn-esql-utils/src/index.ts index 00870a852f030..f25b238d233d1 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/index.ts @@ -75,7 +75,7 @@ export { export { getProjectRoutingFromEsqlQuery } from './utils/set_instructions_helpers'; export { isComputedColumn, getQuerySummary } from './utils/get_query_summary'; export { getColumnsToHighlight } from './utils/get_columns_to_highlight'; -export { buildRenameSourceFieldMap } from './utils/build_rename_source_field_map';s +export { buildRenameSourceFieldMap } from './utils/build_rename_source_field_map'; export { getAllEsqlControls, getEsqlControls } from './utils/get_esql_controls'; export { convertFiltersToESQLExpression } from './utils/convert_filters_to_esql'; export { convertQueryToESQLExpression } from './utils/convert_query_to_esql'; From 32add56a80e2176405aa25b50a3173e3fa6875ba Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Wed, 27 May 2026 15:29:30 +0200 Subject: [PATCH 04/21] move highlighted columns map into the hit --- .../shared/kbn-discover-utils/src/types.ts | 7 +- .../packages/shared/kbn-esql-utils/index.ts | 3 +- .../shared/kbn-esql-utils/src/index.ts | 5 +- .../utils/get_columns_to_highlight.test.ts | 63 ------- .../src/utils/get_columns_to_highlight.ts | 83 --------- .../utils/get_columns_with_highlights.test.ts | 112 ++++++++++++ .../src/utils/get_columns_with_highlights.ts | 160 ++++++++++++++++++ .../src/utils/query_parsing_helpers.test.ts | 20 ++- .../src/utils/query_parsing_helpers.ts | 76 ++++----- .../data/common/search/expressions/esql.ts | 3 - .../main/data_fetching/fetch_esql.ts | 22 ++- .../expression_types/specs/datatable.ts | 4 - .../common/converters/string.tsx | 14 +- 13 files changed, 361 insertions(+), 211 deletions(-) delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.test.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.test.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts diff --git a/src/platform/packages/shared/kbn-discover-utils/src/types.ts b/src/platform/packages/shared/kbn-discover-utils/src/types.ts index 7887a3ee1e9b9..bb34aec5b9082 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/types.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/types.ts @@ -8,6 +8,7 @@ */ import type { SearchHit } from '@elastic/elasticsearch/lib/api/types'; +import type { EsqlColumnsWithHighlights } from '@kbn/esql-utils'; import type { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; export type { IgnoredReason, ShouldShowFieldInTableHandler } from './utils'; @@ -26,6 +27,11 @@ export interface EsHitRecord extends Omit; diff --git a/src/platform/packages/shared/kbn-esql-utils/index.ts b/src/platform/packages/shared/kbn-esql-utils/index.ts index e273b89452de1..4e631c6945a1f 100644 --- a/src/platform/packages/shared/kbn-esql-utils/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/index.ts @@ -72,7 +72,7 @@ export { hasTimeseriesInfoCommand, isComputedColumn, getQuerySummary, - getColumnsToHighlight, + getColumnsWithHighlights, buildRenameSourceFieldMap, getEsqlControls, getAllEsqlControls, @@ -80,6 +80,7 @@ export { convertQueryToESQLExpression, injectWhereClauseAfterSourceCommand, type ESQLStatsQueryMeta, + type EsqlColumnsWithHighlights, } from './src'; export { ENABLE_ESQL, GROUP_NOT_SET_VALUE } from './constants'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/index.ts b/src/platform/packages/shared/kbn-esql-utils/src/index.ts index f25b238d233d1..2e739f0a622c9 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/index.ts @@ -74,7 +74,10 @@ export { } from './utils/cascaded_documents_helpers/utils'; export { getProjectRoutingFromEsqlQuery } from './utils/set_instructions_helpers'; export { isComputedColumn, getQuerySummary } from './utils/get_query_summary'; -export { getColumnsToHighlight } from './utils/get_columns_to_highlight'; +export { + getColumnsWithHighlights, + type EsqlColumnsWithHighlights, +} from './utils/get_columns_with_highlights'; export { buildRenameSourceFieldMap } from './utils/build_rename_source_field_map'; export { getAllEsqlControls, getEsqlControls } from './utils/get_esql_controls'; export { convertFiltersToESQLExpression } from './utils/convert_filters_to_esql'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.test.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.test.ts deleted file mode 100644 index b2c4999accf4c..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.test.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { getColumnsToHighlight } from './get_columns_to_highlight'; - -describe('getColumnsToHighlight', () => { - it('returns columns assigned from TOP_SNIPPETS with highlight enabled', () => { - const query = - 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": true })'; - expect(getColumnsToHighlight(query)).toEqual(new Set(['snippets'])); - }); - - it('returns columns from STATS and ROW assignments with highlight enabled', () => { - expect( - getColumnsToHighlight( - 'FROM books | STATS s = TOP_SNIPPETS(description, "Tolkien", { "highlight": true }) BY author' - ) - ).toEqual(new Set(['s'])); - expect( - getColumnsToHighlight('ROW r = TOP_SNIPPETS("text", "q", { "highlight": true })') - ).toEqual(new Set(['r'])); - }); - - it('returns multiple TOP_SNIPPETS output columns when highlight is enabled', () => { - const query = - 'FROM books | EVAL a = TOP_SNIPPETS(description, "one", { "highlight": true }) | EVAL b = TOP_SNIPPETS(title, "two", { "highlight": true })'; - expect(getColumnsToHighlight(query)).toEqual(new Set(['a', 'b'])); - }); - - it('ignores TOP_SNIPPETS without highlight option', () => { - const query = 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien")'; - expect(getColumnsToHighlight(query)).toEqual(new Set()); - }); - - it('ignores TOP_SNIPPETS with highlight set to false', () => { - const query = - 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": false })'; - expect(getColumnsToHighlight(query)).toEqual(new Set()); - }); - - it('ignores TOP_SNIPPETS with other options but no highlight', () => { - const query = - 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "num_words": 25 })'; - expect(getColumnsToHighlight(query)).toEqual(new Set()); - }); - - it('ignores TOP_SNIPPETS used only in RERANK ON clause', () => { - const query = - 'FROM books | RERANK "Tolkien" ON TOP_SNIPPETS(description, "Tolkien", { "highlight": true }) WITH { "inference_id": "x" }'; - expect(getColumnsToHighlight(query)).toEqual(new Set()); - }); - - it('returns an empty set when TOP_SNIPPETS is not used', () => { - const query = 'FROM books | KEEP title'; - expect(getColumnsToHighlight(query)).toEqual(new Set()); - }); -}); diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts deleted file mode 100644 index 4416006ed3114..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_to_highlight.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - isAssignment, - isBooleanLiteral, - isColumn, - isStringLiteral, - LeafPrinter, - Parser, - Walker, -} from '@elastic/esql'; -import type { ESQLAstQueryExpression, ESQLFunction, ESQLMapEntry } from '@elastic/esql/types'; - -const TOP_SNIPPETS_FUNCTION_NAME = 'top_snippets'; -const HIGHLIGHT_OPTION_NAME = 'highlight'; - -/** - * Returns column names produced by TOP_SNIPPETS calls that enable snippet highlighting. - * These columns may contain highlight markup and need special formatting in the UI. - */ -export function getColumnsToHighlight(query: string): Set { - const columnsToHighlight = new Set(); - const { root } = Parser.parse(query); - - const topSnippetFunctions = Walker.matchAll(root, { - type: 'function', - name: TOP_SNIPPETS_FUNCTION_NAME, - }); - - for (const topSnippetsFunction of topSnippetFunctions) { - const fn = topSnippetsFunction as ESQLFunction; - - if (!isHighlightEnabled(fn)) { - continue; - } - - const columnName = getColumnNameForTopSnippetsFunction(root, fn); - if (columnName) { - columnsToHighlight.add(columnName); - } - } - - return columnsToHighlight; -} - -const isHighlightEnabled = (topSnippetsFunction: ESQLFunction): boolean => { - const highlightKey = Walker.find( - topSnippetsFunction, - (node) => isStringLiteral(node) && node.valueUnquoted === HIGHLIGHT_OPTION_NAME - ); - if (!highlightKey) { - return false; - } - - const mapEntry = Walker.parent(topSnippetsFunction, highlightKey); - if (mapEntry?.type !== 'map-entry') { - return false; - } - - const { value } = mapEntry as ESQLMapEntry; - - return isBooleanLiteral(value) && value.value === 'true'; -}; - -const getColumnNameForTopSnippetsFunction = ( - root: ESQLAstQueryExpression, - topSnippetsFunction: ESQLFunction -): string | undefined => { - for (const parent of Walker.parents(root, topSnippetsFunction)) { - if (isAssignment(parent) && isColumn(parent.args[0])) { - return LeafPrinter.column(parent.args[0]); - } - } - - return; -}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.test.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.test.ts new file mode 100644 index 0000000000000..5956c0e77a605 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.test.ts @@ -0,0 +1,112 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { + DEFAULT_HIGHLIGHT_POST_TAG, + DEFAULT_HIGHLIGHT_PRE_TAG, + getColumnsWithHighlights, +} from './get_columns_with_highlights'; + +describe('getColumnsWithHighlights', () => { + it('returns column with default em tags when highlight is enabled', () => { + const query = + 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": true })'; + expect(getColumnsWithHighlights(query)).toEqual({ + snippets: { + preTag: DEFAULT_HIGHLIGHT_PRE_TAG, + postTag: DEFAULT_HIGHLIGHT_POST_TAG, + }, + }); + }); + + it('returns custom pre_tag and post_tag from TOP_SNIPPETS options', () => { + const query = + 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": true, "pre_tag": "", "post_tag": "" })'; + expect(getColumnsWithHighlights(query)).toEqual({ + snippets: { + preTag: '', + postTag: '', + }, + }); + }); + + it('ignores TOP_SNIPPETS without highlight option', () => { + const query = 'FROM books | EVAL snippets = TOP_SNIPPETS(description, "Tolkien")'; + expect(getColumnsWithHighlights(query)).toEqual({}); + }); + + it('returns multiple columns with their respective tags', () => { + const query = + 'FROM books | EVAL a = TOP_SNIPPETS(description, "one", { "highlight": true }) | EVAL b = TOP_SNIPPETS(title, "two", { "highlight": true, "pre_tag": "", "post_tag": "" })'; + expect(getColumnsWithHighlights(query)).toEqual({ + a: { + preTag: DEFAULT_HIGHLIGHT_PRE_TAG, + postTag: DEFAULT_HIGHLIGHT_POST_TAG, + }, + b: { + preTag: '', + postTag: '', + }, + }); + }); + + it('handles EVAL unamed columns scenarios', () => { + const query = 'FROM books | EVAL TOP_SNIPPETS(description, "one", { "highlight": true })'; + expect(getColumnsWithHighlights(query)).toEqual({ + 'TOP_SNIPPETS(description, "one", { "highlight": true })': { + preTag: DEFAULT_HIGHLIGHT_PRE_TAG, + postTag: DEFAULT_HIGHLIGHT_POST_TAG, + }, + }); + }); + + it('handles STATS user defined columns', () => { + const query = + 'FROM books | STATS count(*) BY col0 = TOP_SNIPPETS(description, "one", { "highlight": true })'; + expect(getColumnsWithHighlights(query)).toEqual({ + col0: { + preTag: DEFAULT_HIGHLIGHT_PRE_TAG, + postTag: DEFAULT_HIGHLIGHT_POST_TAG, + }, + }); + }); + + it('handles STATS unamed user defined columns', () => { + const query = + 'FROM books | STATS count(*) BY TOP_SNIPPETS(description, "one", { "highlight": true })'; + expect(getColumnsWithHighlights(query)).toEqual({ + 'TOP_SNIPPETS(description, "one", { "highlight": true })': { + preTag: DEFAULT_HIGHLIGHT_PRE_TAG, + postTag: DEFAULT_HIGHLIGHT_POST_TAG, + }, + }); + }); + + it('applies RENAME to resolved highlight column names', () => { + const query = + 'FROM books | EVAL col0 = TOP_SNIPPETS(description, "one", { "highlight": true }) | RENAME col0 AS renamed'; + expect(getColumnsWithHighlights(query)).toEqual({ + renamed: { + preTag: DEFAULT_HIGHLIGHT_PRE_TAG, + postTag: DEFAULT_HIGHLIGHT_POST_TAG, + }, + }); + }); + + it('can handle columns defined within quotes', () => { + const query = + 'FROM books | EVAL `col0` = TOP_SNIPPETS(description, "one", { "highlight": true })'; + expect(getColumnsWithHighlights(query)).toEqual({ + col0: { + preTag: DEFAULT_HIGHLIGHT_PRE_TAG, + postTag: DEFAULT_HIGHLIGHT_POST_TAG, + }, + }); + }); +}); diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts new file mode 100644 index 0000000000000..ca2f34a7be7ad --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts @@ -0,0 +1,160 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { + isAssignment, + isBooleanLiteral, + isColumn, + isMap, + isStringLiteral, + LeafPrinter, + Parser, + Walker, +} from '@elastic/esql'; + +import type { ESQLAstQueryExpression, ESQLFunction, ESQLMap } from '@elastic/esql/types'; +import { replaceColumnNamesIfRenamed } from './query_parsing_helpers'; + +export const DEFAULT_HIGHLIGHT_PRE_TAG = ''; +export const DEFAULT_HIGHLIGHT_POST_TAG = ''; + +const HIGHLIGHT_OPTION_NAME = 'highlight'; +const PRE_TAG_OPTION_NAME = 'pre_tag'; +const POST_TAG_OPTION_NAME = 'post_tag'; + +/** + * ES|QL functions that can produce highlight markup in output columns when + * called with `{ "highlight": true }`. + */ +export const FUNCTIONS_WITH_HIGHLIGHT_SUPPORT = ['top_snippets']; + +export interface EsqlHighlight { + preTag: string; + postTag: string; +} + +export type EsqlColumnsWithHighlights = Record; + +/** + * Returns columns built using a highlighting algorithm, + * including the opening and closing markup tags configured for each column. + * + * Example: + * ``` + * FROM books + * | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": true }) + * | EVAL titles = TOP_SNIPPETS(title, "Tolkien", { "highlight": true, "pre_tag": "", "post_tag": "" }) + * ``` + * Will return the following map: + * ``` + * { + * snippets: { + * preTag: '', + * postTag: '', + * }, + * titles: { + * preTag: '', + * postTag: '', + * }, + * } + */ +export function getColumnsWithHighlights(query: string): EsqlColumnsWithHighlights { + const columnsWithHighlights: EsqlColumnsWithHighlights = {}; + const { root } = Parser.parse(query); + + const highlightFunctionsCandidates = Walker.findAll( + root, + (node) => node.type === 'function' && FUNCTIONS_WITH_HIGHLIGHT_SUPPORT.includes(node.name) + ) as ESQLFunction[]; + + for (const fn of highlightFunctionsCandidates) { + const optionsMap = fn.args.find(isMap); + + if (!optionsMap || !isHighlightEnabled(optionsMap)) { + continue; + } + + const columnName = getHighlightedColumnName(root, fn, query); + if (!columnName) { + continue; + } + + const preTag = + getHighlightTagName(optionsMap, PRE_TAG_OPTION_NAME) ?? DEFAULT_HIGHLIGHT_PRE_TAG; + const postTag = + getHighlightTagName(optionsMap, POST_TAG_OPTION_NAME) ?? DEFAULT_HIGHLIGHT_POST_TAG; + + // Check if the column name has been renamed in the query + const [resolvedColumnName] = replaceColumnNamesIfRenamed(root, [columnName]); + + columnsWithHighlights[resolvedColumnName] = { + preTag, + postTag, + }; + } + + return columnsWithHighlights; +} + +/** + * Given a map of options, returns true if the `highlight` option is set to `true`. + */ +const isHighlightEnabled = (optionsMap: ESQLMap): boolean => { + const highlightEntry = optionsMap.entries.find( + (entry) => isStringLiteral(entry.key) && entry.key.valueUnquoted === HIGHLIGHT_OPTION_NAME + ); + if (!highlightEntry?.value) { + return false; + } + + return ( + isBooleanLiteral(highlightEntry.value) && highlightEntry.value.value.toLowerCase() === 'true' + ); +}; + +/** + * Returns the tag name defined in the map options if it exists. + */ +const getHighlightTagName = (optionsMap: ESQLMap, optionName: string): string | undefined => { + const tagEntry = optionsMap.entries.find( + (entry) => isStringLiteral(entry.key) && entry.key.valueUnquoted === optionName + ); + + if (!tagEntry?.value) { + return undefined; + } + if (!isStringLiteral(tagEntry.value)) { + return undefined; + } + return tagEntry.value.valueUnquoted; +}; + +/** + * Returns the name of the column that was created using the highlight function. + * + * This function has an heuristic part, some combination of function could remove the highlighting tokens from the result. + * But it assumes that if the user used highlight:true, it's not interested in removing them. + * Doing a 100% accurate check would involve knowing the semantics of every invoked function. + * In the worst case of having a false positive, + */ +const getHighlightedColumnName = ( + root: ESQLAstQueryExpression, + highlightFunction: ESQLFunction, + query: string +): string | undefined => { + // Created using an assignment | EVAL col = TOP_SNIPPETS( ... + for (const parent of Walker.parents(root, highlightFunction)) { + if (isAssignment(parent) && isColumn(parent.args[0])) { + return LeafPrinter.column(parent.args[0]); + } + } + + // Created using an expression text | EVAL TOP_SNIPPETS( ... or STATS count(*) BY TOP_SNIPPETS( ... + return query.substring(highlightFunction.location.min, highlightFunction.location.max + 1); +}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts index 66ac5347a1b61..5ababa8f1b5ba 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ import type { DatatableColumn } from '@kbn/expressions-plugin/common'; -import type { monaco } from '@kbn/monaco'; +import type { monaco } from '@kbn/code-editor'; import type { ESQLColumn } from '@elastic/esql/types'; import { Parser, walk } from '@elastic/esql'; import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; @@ -25,6 +25,7 @@ import { fixESQLQueryWithVariables, getCategorizeColumns, getArgsFromRenameFunction, + replaceColumnNamesIfRenamed, getCategorizeField, findClosestColumn, getKqlSearchQueries, @@ -922,6 +923,23 @@ describe('esql query helpers', () => { }); }); + describe('replaceColumnNameIfRenamed', () => { + it('returns column names unchanged when there is no RENAME', () => { + const { root } = Parser.parse('FROM index | KEEP col'); + expect(replaceColumnNamesIfRenamed(root, ['col'])).toEqual(['col']); + }); + + it('replaces matching column names using RENAME', () => { + const { root } = Parser.parse('FROM index | RENAME old AS new'); + expect(replaceColumnNamesIfRenamed(root, ['old', 'other'])).toEqual(['new', 'other']); + }); + + it('applies multiple RENAME commands in order', () => { + const { root } = Parser.parse('FROM index | RENAME a AS b | RENAME b AS c'); + expect(replaceColumnNamesIfRenamed(root, ['a'])).toEqual(['c']); + }); + }); + describe('getArgsFromRenameFunction', () => { it('should return the args from an = rename function', () => { const esql = 'FROM index | RENAME renamed = original'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.ts index e1915223a0b56..052dbb402b7fb 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.ts @@ -27,6 +27,7 @@ import type { ESQLInlineCast, ESQLCommandOption, ESQLAstForkCommand, + ESQLAstQueryExpression, } from '@elastic/esql/types'; import { type ESQLControlVariable, ESQLVariableType } from '@kbn/esql-types'; import type { DatatableColumn } from '@kbn/expressions-plugin/common'; @@ -514,24 +515,7 @@ export const getCategorizeColumns = (esql: string): string[] => { } // If there is a rename command, we need to check if the column is renamed - const renameCommand = root.commands.find(({ name }) => name === 'rename'); - if (!renameCommand) { - return columns; - } - const renameFunctions: ESQLFunction[] = []; - walk(renameCommand, { - visitFunction: (node) => renameFunctions.push(node), - }); - - renameFunctions.forEach((renameFunction) => { - const { original, renamed } = getArgsFromRenameFunction(renameFunction); - const oldColumn = original.name; - const newColumn = renamed.name; - if (columns.includes(oldColumn)) { - columns[columns.indexOf(oldColumn)] = newColumn; - } - }); - return columns; + return replaceColumnNamesIfRenamed(root, columns); }; export const getSparklineColumns = (esql: string): string[] => { @@ -584,27 +568,8 @@ export const getSparklineColumns = (esql: string): string[] => { } } - const renameCommands = root.commands.filter(({ name }) => name === 'rename'); - if (renameCommands.length === 0) { - return columns; - } - const renameFunctions: ESQLFunction[] = []; - renameCommands.forEach((renameCommand) => { - walk(renameCommand, { - visitFunction: (node) => renameFunctions.push(node), - }); - }); - - renameFunctions.forEach((renameFunction) => { - const { original, renamed } = getArgsFromRenameFunction(renameFunction); - const oldColumn = original.name; - const newColumn = renamed.name; - if (columns.includes(oldColumn)) { - columns[columns.indexOf(oldColumn)] = newColumn; - } - }); - - return columns; + // If there is a rename command, we need to check if the column is renamed + return replaceColumnNamesIfRenamed(root, columns); }; /** @@ -708,3 +673,36 @@ export const hasTimeseriesInfoCommand = (esql?: string): boolean => { ({ name }) => name === CommandNames.METRICS_INFO || name === CommandNames.TS_INFO ); }; + +/** + * Given an array of column names, it returns a new array with corrected column names + * if any of the columns is renamed in the query. + */ +export const replaceColumnNamesIfRenamed = ( + root: ESQLAstQueryExpression, + columnNames: string[] +): string[] => { + const columns = [...columnNames]; + const renameCommands = root.commands.filter(({ name }) => name === 'rename'); + + if (renameCommands.length === 0) { + return columns; + } + + const renameFunctions: ESQLFunction[] = []; + renameCommands.forEach((renameCommand) => { + walk(renameCommand, { + visitFunction: (node) => renameFunctions.push(node), + }); + }); + + for (const renameFunction of renameFunctions) { + const { original, renamed } = getArgsFromRenameFunction(renameFunction); + const index = columns.indexOf(original.name); + if (index !== -1) { + columns[index] = renamed.name; + } + } + + return columns; +}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esql.ts b/src/platform/plugins/shared/data/common/search/expressions/esql.ts index 0ce25613e3262..9c38de97968eb 100644 --- a/src/platform/plugins/shared/data/common/search/expressions/esql.ts +++ b/src/platform/plugins/shared/data/common/search/expressions/esql.ts @@ -28,7 +28,6 @@ import { mapVariableToColumn, isComputedColumn, getQuerySummary, - getColumnsToHighlight, buildRenameSourceFieldMap, } from '@kbn/esql-utils'; import { zipObject } from 'lodash'; @@ -370,7 +369,6 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { // Get query summary to identify computed columns const querySummary = getQuerySummary(query); - const highlightColumnNames = getColumnsToHighlight(query); const renameSourceFieldMap: Map | null = querySummary.renamedColumnsPairs ?.size @@ -393,7 +391,6 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { meta: { type: kibanaFieldType, esType: type, - hasHighlights: highlightColumnNames.has(name), sourceParams: type === 'date' ? { diff --git a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts index 8e0f208fcc699..9ff196096ac18 100644 --- a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts +++ b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts @@ -10,7 +10,14 @@ import { pluck } from 'rxjs'; import { lastValueFrom } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import type { Query, AggregateQuery, Filter, TimeRange, ProjectRouting } from '@kbn/es-query'; +import { + type Query, + type AggregateQuery, + type Filter, + type TimeRange, + type ProjectRouting, + isOfAggregateQueryType, +} from '@kbn/es-query'; import type { Adapters } from '@kbn/inspector-plugin/common'; import type { ESQLControlVariable } from '@kbn/esql-types'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; @@ -21,6 +28,8 @@ import { textBasedQueryStateToAstWithValidation } from '@kbn/data-plugin/common' import { getDocId, type DataTableRecord } from '@kbn/discover-utils'; import type { SearchResponseWarning } from '@kbn/search-response-warnings'; import moment from 'moment'; +import type { EsqlColumnsWithHighlights } from '@kbn/esql-utils'; +import { getColumnsWithHighlights } from '@kbn/esql-utils'; import type { RecordsFetchResponse } from '../../types'; import type { ScopedProfilesManager } from '../../../context_awareness'; @@ -106,10 +115,19 @@ export function fetchEsql({ const responseTime = moment().format('YYYY-MM-DD_HH_mm_ss'); esqlQueryColumns = table?.columns ?? undefined; esqlHeaderWarning = table.warning ?? undefined; + let inlineHighlights: EsqlColumnsWithHighlights | undefined; + if (isOfAggregateQueryType(query)) { + try { + inlineHighlights = getColumnsWithHighlights(query.esql); + } catch (_e) { + inlineHighlights = undefined; + } + } finalData = rows.map((row, idx) => { + const raw = inlineHighlights ? { ...row, inline_highlights: inlineHighlights } : row; const record: DataTableRecord = { id: row._index && row._id ? getDocId(row) : `${idx + 1}@${responseTime}`, - raw: row, + raw, flattened: row, }; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.ts index 6247f28dbaabf..328b3bed1c7db 100644 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.ts +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.ts @@ -103,10 +103,6 @@ export interface DatatableColumnMeta { * any extra parameters for the source that produced this column */ sourceParams?: SerializableRecord; - /** - * True when column values includes highlitings parts. - */ - hasHighlights?: boolean; } interface SourceParamsESQL extends Record { diff --git a/src/platform/plugins/shared/field_formats/common/converters/string.tsx b/src/platform/plugins/shared/field_formats/common/converters/string.tsx index a68b6f8ad4076..e0c9d5a9fae51 100644 --- a/src/platform/plugins/shared/field_formats/common/converters/string.tsx +++ b/src/platform/plugins/shared/field_formats/common/converters/string.tsx @@ -9,12 +9,7 @@ import { i18n } from '@kbn/i18n'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; -import { - asPrettyString, - getHighlightReact, - getInlineEmSnippetHighlightReact, - shortenDottedString, -} from '../utils'; +import { asPrettyString, getHighlightReact, shortenDottedString } from '../utils'; import { FieldFormat } from '../field_format'; import type { ReactConvertFunction, TextContextTypeConvert } from '../types'; import { FIELD_FORMAT_IDS } from '../types'; @@ -139,20 +134,13 @@ export class StringFormat extends FieldFormat { const missing = this.checkForMissingValueReact(val); if (missing) return missing; - const { hit, field, hasHighlights } = options; const formatted = this.textConvert(val); const fieldName = field?.name; - // Clasic mode if (fieldName && hit?.highlight?.[fieldName]) { return getHighlightReact(formatted, hit.highlight[fieldName]); } - // ES|QL mode - if (hasHighlights && typeof formatted === 'string') { - return getInlineEmSnippetHighlightReact(formatted); - } - return formatted; }; } From 628c860522f4d7479db2343ac2122972ea7054aa Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Wed, 27 May 2026 16:24:22 +0200 Subject: [PATCH 05/21] update formatters --- .../packages/shared/kbn-esql-utils/index.ts | 1 + .../shared/kbn-esql-utils/src/index.ts | 1 + .../src/utils/get_columns_with_highlights.ts | 4 +- .../common/converters/static_lookup.ts | 5 +- .../common/converters/string.tsx | 6 +- .../field_formats/common/converters/url.tsx | 5 +- .../field_formats/common/field_format.tsx | 16 +- .../utils/highlight/highlight_react.test.tsx | 226 ++++++++++++------ .../utils/highlight/highlight_react.tsx | 102 +++++++- .../common/utils/highlight/index.ts | 1 - .../inline_em_snippet_highlight_react.tsx | 61 ----- 11 files changed, 262 insertions(+), 166 deletions(-) delete mode 100644 src/platform/plugins/shared/field_formats/common/utils/highlight/inline_em_snippet_highlight_react.tsx diff --git a/src/platform/packages/shared/kbn-esql-utils/index.ts b/src/platform/packages/shared/kbn-esql-utils/index.ts index 4e631c6945a1f..c94180048b0c9 100644 --- a/src/platform/packages/shared/kbn-esql-utils/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/index.ts @@ -81,6 +81,7 @@ export { injectWhereClauseAfterSourceCommand, type ESQLStatsQueryMeta, type EsqlColumnsWithHighlights, + type ESQLHighlightTags, } from './src'; export { ENABLE_ESQL, GROUP_NOT_SET_VALUE } from './constants'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/index.ts b/src/platform/packages/shared/kbn-esql-utils/src/index.ts index 2e739f0a622c9..36df3534a8c0d 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/index.ts @@ -77,6 +77,7 @@ export { isComputedColumn, getQuerySummary } from './utils/get_query_summary'; export { getColumnsWithHighlights, type EsqlColumnsWithHighlights, + type ESQLHighlightTags, } from './utils/get_columns_with_highlights'; export { buildRenameSourceFieldMap } from './utils/build_rename_source_field_map'; export { getAllEsqlControls, getEsqlControls } from './utils/get_esql_controls'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts index ca2f34a7be7ad..29835f8d5db8d 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts @@ -34,12 +34,12 @@ const POST_TAG_OPTION_NAME = 'post_tag'; */ export const FUNCTIONS_WITH_HIGHLIGHT_SUPPORT = ['top_snippets']; -export interface EsqlHighlight { +export interface ESQLHighlightTags { preTag: string; postTag: string; } -export type EsqlColumnsWithHighlights = Record; +export type EsqlColumnsWithHighlights = Record; /** * Returns columns built using a highlighting algorithm, diff --git a/src/platform/plugins/shared/field_formats/common/converters/static_lookup.ts b/src/platform/plugins/shared/field_formats/common/converters/static_lookup.ts index bfe0b970113ba..4a22807621544 100644 --- a/src/platform/plugins/shared/field_formats/common/converters/static_lookup.ts +++ b/src/platform/plugins/shared/field_formats/common/converters/static_lookup.ts @@ -118,10 +118,7 @@ export class StaticLookupFormat extends FieldFormat { const formatted = String(result ?? ''); const fieldName = field?.name; - if (fieldName && hit?.highlight?.[fieldName]) { - return getHighlightReact(formatted, hit.highlight[fieldName]); - } - return formatted; + return getHighlightReact(formatted, fieldName, hit); }; } diff --git a/src/platform/plugins/shared/field_formats/common/converters/string.tsx b/src/platform/plugins/shared/field_formats/common/converters/string.tsx index e0c9d5a9fae51..02bf6cd6a0f14 100644 --- a/src/platform/plugins/shared/field_formats/common/converters/string.tsx +++ b/src/platform/plugins/shared/field_formats/common/converters/string.tsx @@ -137,10 +137,6 @@ export class StringFormat extends FieldFormat { const formatted = this.textConvert(val); const fieldName = field?.name; - if (fieldName && hit?.highlight?.[fieldName]) { - return getHighlightReact(formatted, hit.highlight[fieldName]); - } - - return formatted; + return getHighlightReact(formatted, fieldName, hit); }; } diff --git a/src/platform/plugins/shared/field_formats/common/converters/url.tsx b/src/platform/plugins/shared/field_formats/common/converters/url.tsx index cd49f99b5c4d8..b5070d5585acb 100644 --- a/src/platform/plugins/shared/field_formats/common/converters/url.tsx +++ b/src/platform/plugins/shared/field_formats/common/converters/url.tsx @@ -216,10 +216,7 @@ export class UrlFormat extends FieldFormat { const linkTarget = this.param('openLinkInCurrentTab') ? '_self' : '_blank'; const fieldName = field?.name; - const linkContent = - fieldName && hit?.highlight?.[fieldName] - ? getHighlightReact(label, hit.highlight[fieldName]) - : label; + const linkContent = getHighlightReact(label, fieldName, hit); return ( diff --git a/src/platform/plugins/shared/field_formats/common/field_format.tsx b/src/platform/plugins/shared/field_formats/common/field_format.tsx index f699305ddf6b8..ac354229642b8 100644 --- a/src/platform/plugins/shared/field_formats/common/field_format.tsx +++ b/src/platform/plugins/shared/field_formats/common/field_format.tsx @@ -20,7 +20,7 @@ import type { FieldFormatMetaParams, FieldFormatParams, } from './types'; -import { getHighlightReact, getInlineEmSnippetHighlightReact } from './utils/highlight'; +import { getHighlightReact } from './utils/highlight'; import type { ReactContextTypeConvert, ReactConvertFunction, @@ -95,19 +95,7 @@ export abstract class FieldFormat { const formatted = this.convertToText(val, options); const fieldName = options?.field?.name; - const highlights = fieldName ? options?.hit?.highlight?.[fieldName] : undefined; - if (typeof formatted !== 'string') { - return formatted; - } - // Classic search: parallel hit.highlight snippets (Kibana highlight tags). - if (highlights) { - return getHighlightReact(formatted, highlights); - } - // ES|QL: inline markup in the cell value. - if (options?.hasHighlights) { - return getInlineEmSnippetHighlightReact(formatted); - } - return formatted; + return getHighlightReact(formatted, fieldName, options?.hit); }; /** diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx index 95e0c21205950..fe8dda60d3f79 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx +++ b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx @@ -11,6 +11,7 @@ import React from 'react'; import ReactDOM from 'react-dom/server'; import { highlightTags } from './highlight_tags'; import { getHighlightReact } from './highlight_react'; +import { type ESQLHighlightTags } from '@kbn/esql-utils'; /** Render the ReactNode to a plain HTML string for easy assertion. * " is decoded back to " since both are valid HTML and the difference is @@ -24,85 +25,162 @@ const hl = (word: string) => `${highlightTags.pre}${word}${highlightTags.post}`; const mark = (word: string) => `${word}`; describe('getHighlightReact', () => { - const check = (value: string, highlights: string[] | undefined | null, expected: string) => { - expect(render(getHighlightReact(value, highlights))).toBe(expected); - }; - - test('returns plain string unchanged when highlights are empty', () => { - check('lorem ipsum', undefined, 'lorem ipsum'); - check('lorem ipsum', null, 'lorem ipsum'); - check('lorem ipsum', [], 'lorem ipsum'); + it('returns plain string unchanged when no field name is provided', () => { + expect( + getHighlightReact('lorem ipsum', undefined, { highlight: { myField: ['lorem ipsum'] } }) + ).toBe('lorem ipsum'); }); - test('returns plain string unchanged when no highlight matches', () => { - check('lorem ipsum', [`${hl('dolor')}`], 'lorem ipsum'); + it('returns plain string unchanged when no hit is provided', () => { + expect(getHighlightReact('lorem ipsum', 'myField', undefined)).toBe('lorem ipsum'); }); - test('highlights a single word at the start', () => { - check('lorem ipsum dolor', [`${hl('lorem')} ipsum dolor`], `${mark('lorem')} ipsum dolor`); + describe('Highlight with DSL substrings', () => { + const check = (value: string, highlights: string[], expected: string) => { + expect( + render(getHighlightReact(value, 'myField', { highlight: { myField: highlights } })) + ).toBe(expected); + }; + + test('returns plain string unchanged when highlights are empty', () => { + check('lorem ipsum', [], 'lorem ipsum'); + }); + + test('returns plain string unchanged when no highlight matches', () => { + check('lorem ipsum', [`${hl('dolor')}`], 'lorem ipsum'); + }); + + test('highlights a single word at the start', () => { + check('lorem ipsum dolor', [`${hl('lorem')} ipsum dolor`], `${mark('lorem')} ipsum dolor`); + }); + + test('highlights a single word in the middle', () => { + check('lorem ipsum dolor', [`lorem ${hl('ipsum')} dolor`], `lorem ${mark('ipsum')} dolor`); + }); + + test('highlights a single word at the end', () => { + check('lorem ipsum dolor', [`lorem ipsum ${hl('dolor')}`], `lorem ipsum ${mark('dolor')}`); + }); + + test('highlights two words within one highlight entry', () => { + check( + 'lorem ipsum dolor sit', + [`lorem ${hl('ipsum')} dolor ${hl('sit')}`], + `lorem ${mark('ipsum')} dolor ${mark('sit')}` + ); + }); + + test('highlights the same word appearing multiple times via multiple highlight entries', () => { + check( + 'lorem ipsum lorem ipsum lorem', + [`${hl('lorem')} ipsum lorem`, `ipsum ${hl('lorem')} ipsum ${hl('lorem')}`], + `${mark('lorem')} ipsum ${mark('lorem')} ipsum ${mark('lorem')}` + ); + }); + + test('highlights words from entries with different context windows', () => { + check( + 'lorem ipsum dolor', + [`${hl('lorem')} ipsum`, `ipsum ${hl('dolor')}`], + `${mark('lorem')} ipsum ${mark('dolor')}` + ); + }); + + test('highlights the entire field value', () => { + check('lorem', [`${hl('lorem')}`], mark('lorem')); + }); + + test('does not highlight partial word matches', () => { + check( + 'loremipsum lorem ipsum', + [`lorem ${hl('ipsum')}`], + `loremipsum lorem ${mark('ipsum')}` + ); + }); + + test('escapes HTML special characters', () => { + check('bold', [`${hl('bold')}`], mark('<b>bold</b>')); + check( + 'lorem ipsum', + [`${hl('ipsum')}`], + `<em>lorem</em> ${mark('ipsum')}` + ); + check('', [], '<script>alert(1)</script>'); + }); + + test('when highlight entries share the same untagged context only the first applies', () => { + check( + 'lorem ipsum dolor sit', + [`${hl('lorem')} ipsum dolor sit`, `lorem ipsum dolor ${hl('sit')}`], + `${mark('lorem')} ipsum dolor sit` + ); + check( + 'elastic search engine', + [`${hl('elastic search')} engine`, `elastic ${hl('search engine')}`], + `${mark('elastic search')} engine` + ); + check('foobar', [`${hl('foo')}bar`, `foo${hl('bar')}`], `${mark('foo')}bar`); + }); }); - test('highlights a single word in the middle', () => { - check('lorem ipsum dolor', [`lorem ${hl('ipsum')} dolor`], `lorem ${mark('ipsum')} dolor`); - }); - - test('highlights a single word at the end', () => { - check('lorem ipsum dolor', [`lorem ipsum ${hl('dolor')}`], `lorem ipsum ${mark('dolor')}`); - }); - - test('highlights two words within one highlight entry', () => { - check( - 'lorem ipsum dolor sit', - [`lorem ${hl('ipsum')} dolor ${hl('sit')}`], - `lorem ${mark('ipsum')} dolor ${mark('sit')}` - ); - }); - - test('highlights the same word appearing multiple times via multiple highlight entries', () => { - check( - 'lorem ipsum lorem ipsum lorem', - [`${hl('lorem')} ipsum lorem`, `ipsum ${hl('lorem')} ipsum ${hl('lorem')}`], - `${mark('lorem')} ipsum ${mark('lorem')} ipsum ${mark('lorem')}` - ); - }); - - test('highlights words from entries with different context windows', () => { - check( - 'lorem ipsum dolor', - [`${hl('lorem')} ipsum`, `ipsum ${hl('dolor')}`], - `${mark('lorem')} ipsum ${mark('dolor')}` - ); - }); - - test('highlights the entire field value', () => { - check('lorem', [`${hl('lorem')}`], mark('lorem')); - }); - - test('does not highlight partial word matches', () => { - check('loremipsum lorem ipsum', [`lorem ${hl('ipsum')}`], `loremipsum lorem ${mark('ipsum')}`); - }); - - test('escapes HTML special characters', () => { - check('bold', [`${hl('bold')}`], mark('<b>bold</b>')); - check( - 'lorem ipsum', - [`${hl('ipsum')}`], - `<em>lorem</em> ${mark('ipsum')}` - ); - check('', [], '<script>alert(1)</script>'); - }); - - test('when highlight entries share the same untagged context only the first applies', () => { - check( - 'lorem ipsum dolor sit', - [`${hl('lorem')} ipsum dolor sit`, `lorem ipsum dolor ${hl('sit')}`], - `${mark('lorem')} ipsum dolor sit` - ); - check( - 'elastic search engine', - [`${hl('elastic search')} engine`, `elastic ${hl('search engine')}`], - `${mark('elastic search')} engine` - ); - check('foobar', [`${hl('foo')}bar`, `foo${hl('bar')}`], `${mark('foo')}bar`); + describe('Highlight with ES|QL inline tags', () => { + const defaultTags: ESQLHighlightTags = { + preTag: ``, + postTag: '', + }; + const inline = (word: string) => `${defaultTags.preTag}${word}${defaultTags.postTag}`; + + const check = (value: string, tags: ESQLHighlightTags, expected: string) => { + expect( + render(getHighlightReact(value, 'myField', { inline_highlights: { myField: tags } })) + ).toBe(expected); + }; + + test('returns plain string unchanged when value has no inline tags', () => { + check('lorem ipsum', defaultTags, 'lorem ipsum'); + }); + + test('returns plain string unchanged when pre or post tag is missing from config', () => { + const hit = { inline_highlights: { myField: { preTag: '', postTag: '' } } }; + expect(getHighlightReact(inline('lorem'), 'myField', hit)).toBe(inline('lorem')); + expect( + getHighlightReact(inline('lorem'), 'myField', { + inline_highlights: { myField: { preTag: '', postTag: '' } }, + }) + ).toBe(inline('lorem')); + }); + + test('highlights a single word at the start', () => { + check(`${inline('lorem')} ipsum dolor`, defaultTags, `${mark('lorem')} ipsum dolor`); + }); + + test('highlights a single word in the middle', () => { + check(`lorem ${inline('ipsum')} dolor`, defaultTags, `lorem ${mark('ipsum')} dolor`); + }); + + test('highlights a single word at the end', () => { + check(`lorem ipsum ${inline('dolor')}`, defaultTags, `lorem ipsum ${mark('dolor')}`); + }); + + test('highlights multiple tagged spans in one value', () => { + check( + `lorem ${inline('ipsum')} dolor ${inline('sit')}`, + defaultTags, + `lorem ${mark('ipsum')} dolor ${mark('sit')}` + ); + }); + + test('highlights the entire field value', () => { + check(inline('lorem'), defaultTags, mark('lorem')); + }); + + test('uses custom pre_tag and post_tag from inline highlight config', () => { + const customTags: ESQLHighlightTags = { preTag: '', postTag: '' }; + check('foo bar baz', customTags, `foo ${mark('bar')} baz`); + }); + + test('leaves text after an unclosed opening tag unchanged', () => { + check('lorem ipsum', defaultTags, 'lorem <em>ipsum'); + }); }); }); diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.tsx b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.tsx index 8d96c37917341..0d66adb7eaea2 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.tsx +++ b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.tsx @@ -8,11 +8,56 @@ */ import React from 'react'; +import type { EsHitRecord } from '@kbn/discover-utils'; +import type { ESQLHighlightTags } from '@kbn/esql-utils'; import { highlightTags } from './highlight_tags'; +/** + * Resolves the applicable highlight method for a field value. + * + * - DSL: we receive a clean fieldValue and a side list of substrings to be highlighted. + * Example: + * fieldValue = "lorem ipsum dolor" + * fieldName = "myField" + * hit = { highlight: { myField: ["ipsum", "dolor"] } } + * return = "lorem ipsum dolor" + * + * - ES|QL: we receive a fieldValue with inline (or custom) tags. + * Example: + * fieldValue = "lorem ipsum dolor" + * fieldName = "myField" + * hit = { inline_highlights: { myField: { preTag: "", postTag: "" } } } + * return = "lorem ipsum dolor" + */ +export function getHighlightReact( + fieldValue: string, + fieldName: string | undefined, + hit: EsHitRecord | undefined +): React.ReactNode { + if (!fieldName || !hit) { + return fieldValue; + } + + // DSL - we receive a clean fieldValue and a side list of substrings to be highlighted. + const highlightedSubstrings = hit.highlight?.[fieldName]; + if (highlightedSubstrings?.length) { + return highlightWithSubstrings(fieldValue, highlightedSubstrings); + } + + // ES|QL - we receive a fieldValue with inline (or custom) tags. + const inlineHighlightTags = hit.inline_highlights?.[fieldName]; + if (inlineHighlightTags) { + return highlightWithInlineTags(fieldValue, inlineHighlightTags); + } + + return fieldValue; +} + /** * Applies search highlighting to a field value, returning React nodes. * + * Receives a field value and a list of substrings that requires highlighting. + * * Step 1: for each highlight, strip its Kibana tags to get the plain substring, * then replace every occurrence of that substring in the working string with * the tagged version. React automatically escapes text node content. @@ -20,7 +65,7 @@ import { highlightTags } from './highlight_tags'; * Step 2: convert the tag-substituted string to React nodes, wrapping each * highlighted span in a element. */ -export function getHighlightReact( +function highlightWithSubstrings( fieldValue: string, highlights: string[] | undefined | null ): React.ReactNode { @@ -76,3 +121,58 @@ export function getHighlightReact( if (nodes.length === 1) return nodes[0]; return <>{nodes}; } + +/** + * Applies highlighting to a field value, returning React nodes. + * + * Receives a field value and the tags used to highlight the value. + * This function replaces them with elements in a safe manner. + */ +function highlightWithInlineTags( + fieldValue: string, + tags: ESQLHighlightTags | undefined | null +): React.ReactNode { + if (!tags?.preTag || !tags?.postTag) { + return fieldValue; + } + + const { preTag, postTag } = tags; + if (!fieldValue.includes(preTag)) { + return fieldValue; + } + + const nodes: React.ReactNode[] = []; + let remaining = fieldValue; + let key = 0; + + while (remaining.length > 0) { + const openIndex = remaining.indexOf(preTag); + if (openIndex === -1) { + nodes.push(remaining); + break; + } + + if (openIndex > 0) { + nodes.push(remaining.slice(0, openIndex)); + } + + const contentStart = openIndex + preTag.length; + const closeIndex = remaining.indexOf(postTag, contentStart); + + if (closeIndex === -1) { + nodes.push(remaining.slice(openIndex)); + break; + } + + nodes.push( + + {remaining.slice(contentStart, closeIndex)} + + ); + remaining = remaining.slice(closeIndex + postTag.length); + } + + if (nodes.length === 0) return fieldValue; + if (nodes.length === 1) return nodes[0]; + return <>{nodes}; +} diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/index.ts b/src/platform/plugins/shared/field_formats/common/utils/highlight/index.ts index 13c6794fc44cd..ed87a28455a6b 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/highlight/index.ts +++ b/src/platform/plugins/shared/field_formats/common/utils/highlight/index.ts @@ -8,5 +8,4 @@ */ export { getHighlightReact } from './highlight_react'; -export { getInlineEmSnippetHighlightReact } from './inline_em_snippet_highlight_react'; export { getHighlightRequest } from './highlight_request'; diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/inline_em_snippet_highlight_react.tsx b/src/platform/plugins/shared/field_formats/common/utils/highlight/inline_em_snippet_highlight_react.tsx deleted file mode 100644 index 47dab59893b16..0000000000000 --- a/src/platform/plugins/shared/field_formats/common/utils/highlight/inline_em_snippet_highlight_react.tsx +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; - -const OPEN_TAG = ''; -const CLOSE_TAG = ''; - -export function getInlineEmSnippetHighlightReact(value: string): React.ReactNode { - if (!value.includes(OPEN_TAG)) { - return value; - } - - const nodes: React.ReactNode[] = []; - let rest = value; - let key = 0; - - while (rest.length > 0) { - const openIdx = rest.indexOf(OPEN_TAG); - - // No more highlights - if (openIdx === -1) { - nodes.push(rest); - break; - } - - if (openIdx > 0) { - nodes.push(rest.slice(0, openIdx)); - } - rest = rest.slice(openIdx + OPEN_TAG.length); - const closeIdx = rest.indexOf(CLOSE_TAG); - - // Malformed highlight with no closing tag, return as is - if (closeIdx === -1) { - nodes.push(`${OPEN_TAG}${rest}`); - break; - } - - const inner = rest.slice(0, closeIdx); - nodes.push( - - {inner} - - ); - rest = rest.slice(closeIdx + CLOSE_TAG.length); - } - - if (nodes.length === 0) { - return value; - } - if (nodes.length === 1) { - return nodes[0]; - } - return <>{nodes}; -} From 67e2fcf68fdc5707826345ecd6a8c1fbfa0a645e Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Wed, 27 May 2026 16:34:50 +0200 Subject: [PATCH 06/21] clean --- .../packages/shared/kbn-discover-utils/src/types.ts | 12 +++++++----- .../kbn-discover-utils/src/utils/format_hit.ts | 1 - .../kbn-discover-utils/src/utils/format_value.ts | 11 ++--------- .../plugins/shared/field_formats/common/types.ts | 2 -- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/platform/packages/shared/kbn-discover-utils/src/types.ts b/src/platform/packages/shared/kbn-discover-utils/src/types.ts index bb34aec5b9082..1553652405cd3 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/types.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/types.ts @@ -59,11 +59,13 @@ export interface DataTableRecord { /** * Custom column types per column name */ -export interface DataTableColumnMeta { - type: DatatableColumnMeta['type']; - esType?: DatatableColumnMeta['esType']; -} -export type DataTableColumnsMeta = Record; +export type DataTableColumnsMeta = Record< + string, + { + type: DatatableColumnMeta['type']; + esType?: DatatableColumnMeta['esType']; + } +>; import type { ReactNode } from 'react'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts index 942b72051d261..27fed48f5aadb 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts @@ -122,7 +122,6 @@ export function formatHitReact( fieldFormats, dataView, field, - columnMeta: columnsMeta?.[key], }); } diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.ts index 7623f8affd278..7da98e4691557 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.ts @@ -16,7 +16,7 @@ import type { ReactContextTypeOptions, TextContextTypeOptions, } from '@kbn/field-formats-plugin/common/types'; -import type { DataTableColumnMeta, EsHitRecord } from '../types'; +import type { EsHitRecord } from '../types'; /** Base parameters for field value formatting functions */ interface FormatFieldValueBaseParams { @@ -28,7 +28,6 @@ interface FormatFieldValueBaseParams { export interface FormatFieldValueReactParams extends FormatFieldValueBaseParams { hit: EsHitRecord; - columnMeta?: DataTableColumnMeta; options?: ReactContextTypeOptions; } @@ -62,15 +61,9 @@ export const formatFieldValueReact = ({ fieldFormats, dataView, field, - columnMeta, options, }: FormatFieldValueReactParams): ReactNode => { - const converterOptions: ReactContextTypeOptions = { - ...options, - hit, - field, - hasHighlights: columnMeta?.hasHighlights ?? options?.hasHighlights, - }; + const converterOptions: ReactContextTypeOptions = { ...options, hit, field }; return getFieldFormatter(fieldFormats, dataView, field).convertToReact(value, converterOptions); }; diff --git a/src/platform/plugins/shared/field_formats/common/types.ts b/src/platform/plugins/shared/field_formats/common/types.ts index e586284b13425..58af079a731ba 100644 --- a/src/platform/plugins/shared/field_formats/common/types.ts +++ b/src/platform/plugins/shared/field_formats/common/types.ts @@ -19,8 +19,6 @@ export interface ReactContextTypeOptions { field?: { name: string }; hit?: { highlight?: Record }; skipFormattingInStringifiedJSON?: boolean; - /** When true, string values may include inline `` markup to render as highlights. (ES|QL) */ - hasHighlights?: boolean; } /** From a92043fd9040d9b37aee08cc8b9f75819916b4f7 Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Wed, 27 May 2026 16:45:08 +0200 Subject: [PATCH 07/21] clean --- src/platform/plugins/shared/field_formats/common/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/plugins/shared/field_formats/common/index.ts b/src/platform/plugins/shared/field_formats/common/index.ts index 7c1d30d0d16fb..570431625bf64 100644 --- a/src/platform/plugins/shared/field_formats/common/index.ts +++ b/src/platform/plugins/shared/field_formats/common/index.ts @@ -34,7 +34,7 @@ export { HistogramFormat, } from './converters'; -export { getHighlightRequest, getInlineEmSnippetHighlightReact, geoUtils } from './utils'; +export { getHighlightRequest, geoUtils } from './utils'; export { DEFAULT_CONVERTER_COLOR } from './constants/color_default'; export { FORMATS_UI_SETTINGS } from './constants/ui_settings'; From 4d8f5088055c64790a8e9dfff1cbc002e0d0fe8e Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Wed, 27 May 2026 16:48:58 +0200 Subject: [PATCH 08/21] clean --- .../src/components/source_document.tsx | 15 +++------------ .../src/utils/get_render_cell_value.tsx | 5 ----- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/components/source_document.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/components/source_document.tsx index 487ebffb814e8..071cb8aa8ba3a 100644 --- a/src/platform/packages/shared/kbn-unified-data-table/src/components/source_document.tsx +++ b/src/platform/packages/shared/kbn-unified-data-table/src/components/source_document.tsx @@ -68,8 +68,7 @@ export function SourceDocument({ dataView, shouldShowFieldHandler, fieldFormats, - columnsMeta, - isPlainRecord + columnsMeta ).slice(0, maxEntries) : formatHitReact(row, dataView, shouldShowFieldHandler, maxEntries, fieldFormats, columnsMeta); @@ -118,8 +117,7 @@ function getTopLevelObjectPairsReact( dataView: DataView, shouldShowFieldHandler: ShouldShowFieldInTableHandler, fieldFormats: FieldFormatsStart, - columnsMeta: DataTableColumnsMeta | undefined, - isPlainRecord?: boolean + columnsMeta: DataTableColumnsMeta | undefined ): FormattedHit { const innerColumns = getInnerColumns(row.fields as Record, columnId); // Put the most important fields first @@ -139,14 +137,7 @@ function getTopLevelObjectPairsReact( const formatted: ReactNode = values.map((value: unknown, idx) => ( {idx > 0 ? ', ' : null} - {formatFieldValueReact({ - value, - hit: row, - fieldFormats, - dataView, - field: subField, - columnMeta: isPlainRecord ? columnsMeta?.[key] : undefined, - })} + {formatFieldValueReact({ value, hit: row, fieldFormats, dataView, field: subField })} )); const pairs = highlights[key] ? highlightPairs : sourcePairs; diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/utils/get_render_cell_value.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/utils/get_render_cell_value.tsx index c1b85d8908771..3ebb238f7043f 100644 --- a/src/platform/packages/shared/kbn-unified-data-table/src/utils/get_render_cell_value.tsx +++ b/src/platform/packages/shared/kbn-unified-data-table/src/utils/get_render_cell_value.tsx @@ -168,7 +168,6 @@ export const getRenderCellValueFn = ({ fieldFormats, closePopover, isPlainRecord, - columnsMeta, }); } @@ -201,7 +200,6 @@ export const getRenderCellValueFn = ({ fieldFormats, dataView, field, - columnMeta: isPlainRecord ? columnsMeta?.[columnId] : undefined, })} ); @@ -228,7 +226,6 @@ function renderPopoverContent({ fieldFormats, closePopover, isPlainRecord, - columnsMeta, }: { row: DataTableRecord; field: DataViewField | undefined; @@ -238,7 +235,6 @@ function renderPopoverContent({ fieldFormats: FieldFormatsStart; closePopover: () => void; isPlainRecord?: boolean; - columnsMeta: DataTableColumnsMeta | undefined; }) { const closeButton = ( From f1b53c7894f2c30541f70b10330c86d30d8d5efa Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Wed, 27 May 2026 17:06:27 +0200 Subject: [PATCH 09/21] reorder field in the summary column --- .../shared/kbn-discover-utils/src/utils/format_hit.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts index 27fed48f5aadb..6a63df55b0e20 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.ts @@ -58,13 +58,11 @@ export function formatHitReact( return cached.formattedHit; } - const highlights = hit.raw.highlight ?? {}; + const highlights = hit.raw.highlight ?? hit.raw.inline_highlights ?? {}; const flattened = hit.flattened; const renderedPairs: PartialHitReactPair[] = []; const otherPairs: PartialHitReactPair[] = []; - // HD TODO: contemplate ES|QL highlights when ordering. - // Add each flattened field into the corresponding array for rendered or other pairs, // depending on whether the original hit had a highlight for it. That way we can ensure // highlighted fields are shown first in the document summary. From db1101b38e74d31157123a81f3dfaad6865ba353 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 27 May 2026 15:15:18 +0000 Subject: [PATCH 10/21] Changes from node scripts/lint_ts_projects --fix --- src/platform/packages/shared/kbn-esql-utils/tsconfig.json | 1 + src/platform/plugins/shared/field_formats/tsconfig.json | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json index ae962c5e0cfb8..f96d31a7d8103 100644 --- a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json +++ b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json @@ -35,5 +35,6 @@ "@kbn/controls-constants", "@kbn/presentation-publishing", "@kbn/controls-schemas", + "@kbn/code-editor", ] } diff --git a/src/platform/plugins/shared/field_formats/tsconfig.json b/src/platform/plugins/shared/field_formats/tsconfig.json index 486f7a12b3756..44e054ea849aa 100644 --- a/src/platform/plugins/shared/field_formats/tsconfig.json +++ b/src/platform/plugins/shared/field_formats/tsconfig.json @@ -18,6 +18,8 @@ "@kbn/utility-types", "@kbn/i18n", "@kbn/config-schema", + "@kbn/discover-utils", + "@kbn/esql-utils", ], "exclude": [ "target/**/*", From d682efa29a0419ea3d50c8c1c1da049bc18d5ad9 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 27 May 2026 15:20:21 +0000 Subject: [PATCH 11/21] Changes from node scripts/regenerate_moon_projects.js --update --- src/platform/packages/shared/kbn-esql-utils/moon.yml | 1 + src/platform/plugins/shared/field_formats/moon.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/platform/packages/shared/kbn-esql-utils/moon.yml b/src/platform/packages/shared/kbn-esql-utils/moon.yml index 6b1fb24c208f7..2616e0b0b626a 100644 --- a/src/platform/packages/shared/kbn-esql-utils/moon.yml +++ b/src/platform/packages/shared/kbn-esql-utils/moon.yml @@ -36,6 +36,7 @@ dependsOn: - '@kbn/controls-constants' - '@kbn/presentation-publishing' - '@kbn/controls-schemas' + - '@kbn/code-editor' tags: - shared-common - package diff --git a/src/platform/plugins/shared/field_formats/moon.yml b/src/platform/plugins/shared/field_formats/moon.yml index 3ec20c71c55ca..5f118b5e856a6 100644 --- a/src/platform/plugins/shared/field_formats/moon.yml +++ b/src/platform/plugins/shared/field_formats/moon.yml @@ -23,6 +23,8 @@ dependsOn: - '@kbn/utility-types' - '@kbn/i18n' - '@kbn/config-schema' + - '@kbn/discover-utils' + - '@kbn/esql-utils' tags: - plugin - prod From 5d8e534b44582c531d4759bd0fafefa20d797fed Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 27 May 2026 15:34:42 +0000 Subject: [PATCH 12/21] Changes from node scripts/check --- .../analytics_collection_utils/index.d.ts | 1 + .../analytics_collection_utils/src/index.d.ts | 1 + .../src/is_synthetics_monitor.d.ts | 5 + .../private/kbn-cps-common/index.d.ts | 3 + .../kbn-cps-common/src/common/constants.d.ts | 11 + .../common/get_space_default_npre_name.d.ts | 1 + .../private/kbn-panel-loader/index.d.ts | 6 + .../kbn-saved-objects-settings/index.d.ts | 2 + .../favorites/favorites_common/index.d.ts | 1 + .../favorites/favorites_server/index.d.ts | 1 + .../src/favorites_registry.d.ts | 12 + .../src/favorites_routes.d.ts | 21 + .../src/favorites_saved_object.d.ts | 9 + .../src/favorites_service.d.ts | 33 + .../src/favorites_usage_collection.d.ts | 6 + .../favorites/favorites_server/src/index.d.ts | 22 + .../shared/home/sample_data_card/index.d.ts | 6 + .../home/sample_data_card/src/constants.d.ts | 11 + .../src/footer/disabled_footer.d.ts | 11 + .../sample_data_card/src/footer/index.d.ts | 15 + .../src/footer/install_footer.d.ts | 11 + .../src/footer/remove_footer.d.ts | 13 + .../src/footer/view_button.d.ts | 11 + .../sample_data_card/src/hooks/index.d.ts | 4 + .../src/hooks/poll_sample_data_status.d.ts | 34 + .../src/hooks/use_install.d.ts | 17 + .../src/hooks/use_remove.d.ts | 17 + .../sample_data_card/src/mocks/index.d.ts | 75 + .../src/sample_data_card.component.d.ts | 16 + .../src/sample_data_card.d.ts | 16 + .../home/sample_data_card/src/services.d.ts | 67 + .../shared/home/sample_data_tab/index.d.ts | 2 + .../home/sample_data_tab/src/constants.d.ts | 19 + .../sample_data_tab/src/demo_env_panel.d.ts | 5 + .../home/sample_data_tab/src/hooks/index.d.ts | 1 + .../sample_data_tab/src/hooks/use_list.d.ts | 7 + .../src/sample_data_cards.d.ts | 13 + .../sample_data_tab/src/sample_data_tab.d.ts | 5 + .../home/sample_data_tab/src/services.d.ts | 52 + .../shared/kbn-apm-types-shared/index.d.ts | 3 + .../kbn-apm-types-shared/src/enums/index.d.ts | 1 + .../src/enums/processor_event.d.ts | 6 + .../src/interfaces/correlations.d.ts | 4 + .../src/interfaces/index.d.ts | 1 + .../src/types/common.d.ts | 1 + .../kbn-apm-types-shared/src/types/index.d.ts | 1 + .../kbn-content-management-utils/index.d.ts | 4 + .../src/saved_object_content_storage.d.ts | 63 + .../src/schema.d.ts | 265 +++ .../src/types.d.ts | 316 ++++ .../src/utils.d.ts | 7 + .../kbn-cps-utils/components/cps_icon.d.ts | 2 + .../components/project_list_item.d.ts | 9 + .../components/project_picker.d.ts | 16 + .../components/project_picker_container.d.ts | 12 + .../components/project_picker_content.d.ts | 10 + .../components/project_picker_settings.d.ts | 5 + .../kbn-cps-utils/components/strings.d.ts | 15 + .../components/use_cps_picker_access.d.ts | 23 + .../components/use_fetch_projects.d.ts | 13 + .../components/use_project_picker_tour.d.ts | 4 + .../use_route_based_cps_picker_access.d.ts | 14 + .../packages/shared/kbn-cps-utils/index.d.ts | 13 + .../packages/shared/kbn-cps-utils/types.d.ts | 52 + .../public/full_screen_bg_css.d.ts | 3 + .../kbn-css-utils/public/use_memo_css.d.ts | 23 + .../shared/kbn-data-service-server/index.d.ts | 2 + .../src/refresh_interval.d.ts | 4 + .../kbn-data-service-server/src/types.d.ts | 3 + .../shared/kbn-data-service/index.d.ts | 4 + .../kbn-data-service/src/constants.d.ts | 26 + .../src/es_query/get_es_query_config.d.ts | 7 + .../kbn-data-service/src/es_query/index.d.ts | 1 + .../src/search/tabify/index.d.ts | 1 + .../src/search/tabify/tabify_docs.d.ts | 35 + .../shared/kbn-data-service/src/types.d.ts | 11 + .../shared/kbn-data-view-utils/index.d.ts | 5 + .../kbn-data-view-utils/src/constants.d.ts | 4 + .../convert_to_data_view_field_spec.d.ts | 6 + .../src/utils/create_regexp_pattern_from.d.ts | 3 + .../utils/get_data_view_field_or_create.d.ts | 7 + .../test_pattern_against_allowed_list.d.ts | 1 + .../kbn-data-view-validation/index.d.ts | 3 + .../src/constants.d.ts | 16 + .../kbn-data-view-validation/src/types.d.ts | 5 + .../src/validation.d.ts | 8 + .../shared/kbn-discover-utils/index.d.ts | 6 + .../app_menu/app_menu_registry.d.ts | 47 + .../src/components/app_menu/types.d.ts | 60 + .../degraded_docs_control.d.ts | 11 + .../custom_control_columns/index.d.ts | 2 + .../stacktrace_control.d.ts | 6 + .../custom_control_columns/types.d.ts | 31 + .../error_callout/error_callout.d.ts | 14 + .../src/components/error_callout/index.d.ts | 2 + .../kbn-discover-utils/src/constants.d.ts | 23 + .../data_types/apm/apm_context_service.d.ts | 10 + .../apm/errors/errors_context_service.d.ts | 10 + .../src/data_types/apm/index.d.ts | 2 + .../src/data_types/index.d.ts | 4 + .../src/data_types/logs/components/index.d.ts | 1 + .../logs/components/log_level_badge.d.ts | 7 + .../src/data_types/logs/constants.d.ts | 27 + .../src/data_types/logs/index.d.ts | 8 + .../data_types/logs/logs_context_service.d.ts | 15 + .../recommended_fields/apache_error_logs.d.ts | 8 + .../logs/recommended_fields/default_logs.d.ts | 11 + .../logs/recommended_fields/index.d.ts | 5 + .../kubernetes_container_logs.d.ts | 8 + .../src/data_types/logs/types.d.ts | 99 ++ .../utils/get_all_logs_data_view_spec.d.ts | 9 + .../utils/get_available_resource_fields.d.ts | 1 + .../utils/get_available_trace_fields.d.ts | 2 + .../utils/get_log_level_coalesed_value.d.ts | 16 + .../logs/utils/get_log_level_color.d.ts | 3 + .../src/data_types/logs/utils/index.d.ts | 5 + .../src/data_types/observability/index.d.ts | 1 + .../src/data_types/observability/types.d.ts | 7 + .../src/data_types/traces/index.d.ts | 2 + .../traces/traces_context_service.d.ts | 22 + .../src/data_types/traces/types.d.ts | 45 + .../src/field_constants.d.ts | 69 + .../kbn-discover-utils/src/hooks/index.d.ts | 1 + .../src/hooks/use_pager.d.ts | 13 + .../shared/kbn-discover-utils/src/index.d.ts | 10 + .../shared/kbn-discover-utils/src/types.d.ts | 151 ++ .../src/utils/build_data_record.d.ts | 22 + .../src/utils/calc_field_counts.d.ts | 6 + .../src/utils/contains_index_pattern.d.ts | 1 + .../src/utils/convert_value_to_string.d.ts | 19 + .../src/utils/dismiss_flyouts.d.ts | 11 + .../src/utils/format_hit.d.ts | 13 + .../src/utils/format_value.d.ts | 63 + .../src/utils/get_doc_id.d.ts | 8 + .../src/utils/get_esql_data_view.d.ts | 8 + .../src/utils/get_field_value.d.ts | 2 + .../utils/get_field_value_with_fallback.d.ts | 24 + .../src/utils/get_flattened_fields.d.ts | 2 + .../src/utils/get_ignored_reason.d.ts | 17 + .../src/utils/get_log_document_overview.d.ts | 7 + ...et_log_event_type_field_with_fallback.d.ts | 12 + ...og_exception_type_field_with_fallback.d.ts | 12 + .../utils/get_log_field_with_fallback.d.ts | 15 + .../get_log_level_field_with_fallback.d.ts | 12 + .../get_message_field_with_fallbacks.d.ts | 14 + .../utils/get_should_show_field_handler.d.ts | 11 + .../src/utils/get_stack_trace_fields.d.ts | 2 + .../utils/get_trace_document_overview.d.ts | 2 + .../src/utils/get_visible_columns.d.ts | 5 + .../kbn-discover-utils/src/utils/index.d.ts | 26 + .../src/utils/is_esql_saved_search.d.ts | 19 + .../src/utils/local_storage_utils.d.ts | 38 + .../src/utils/nested_fields.d.ts | 38 + .../utils/prepare_data_view_for_editing.d.ts | 3 + .../src/utils/sorting/get_default_sort.d.ts | 7 + .../src/utils/sorting/get_es_query_sort.d.ts | 46 + .../src/utils/sorting/get_sort.d.ts | 21 + .../sorting/get_sort_for_search_source.d.ts | 16 + .../src/utils/sorting/index.d.ts | 5 + .../shared/kbn-discover-utils/types.d.ts | 1 + .../shared/kbn-elastic-agent-utils/index.d.ts | 5 + .../src/agent_guards.d.ts | 17 + .../src/agent_ingestion_path.d.ts | 1 + .../src/agent_names.d.ts | 23 + .../src/agent_sdk_name_and_language.d.ts | 6 + .../index.d.ts | 1 + .../encrypted_saved_objects_client_types.d.ts | 28 + .../packages/shared/kbn-es-types/index.d.ts | 1 + .../shared/kbn-es-types/src/index.d.ts | 17 + .../shared/kbn-es-types/src/search.d.ts | 575 +++++++ .../shared/kbn-esql-utils/constants.d.ts | 5 + .../packages/shared/kbn-esql-utils/index.d.ts | 2 + .../shared/kbn-esql-utils/src/index.d.ts | 29 + .../utils/append_to_query/append_limit.d.ts | 1 + .../append_to_query/append_metrics_info.d.ts | 7 + .../append_to_query/append_stats_by.d.ts | 1 + .../utils/append_to_query/append_where.d.ts | 12 + .../src/utils/append_to_query/utils.d.ts | 39 + .../utils/build_rename_source_field_map.d.ts | 7 + .../src/utils/callbacks/columns.d.ts | 19 + .../src/utils/callbacks/datasets.d.ts | 9 + .../src/utils/callbacks/extensions.d.ts | 27 + .../src/utils/callbacks/index.d.ts | 9 + .../src/utils/callbacks/inference.d.ts | 10 + .../src/utils/callbacks/lookup_indices.d.ts | 12 + .../src/utils/callbacks/policies.d.ts | 10 + .../src/utils/callbacks/sources.d.ts | 26 + .../utils/callbacks/timeseries_indices.d.ts | 4 + .../src/utils/callbacks/utils/cache.d.ts | 32 + .../src/utils/callbacks/views.d.ts | 9 + .../cascaded_documents_helpers/index.d.ts | 58 + .../cascaded_documents_helpers/utils.d.ts | 58 + .../src/utils/convert_filters_to_esql.d.ts | 13 + .../src/utils/convert_query_to_esql.d.ts | 9 + .../src/utils/esql_fields_utils.d.ts | 43 + .../src/utils/extract_categorize_tokens.d.ts | 8 + .../utils/get_columns_with_highlights.d.ts | 36 + .../src/utils/get_esql_adhoc_dataview.d.ts | 51 + .../src/utils/get_esql_controls.d.ts | 15 + .../utils/get_esql_time_field_from_query.d.ts | 13 + .../src/utils/get_esql_with_safe_limit.d.ts | 1 + .../utils/get_index_pattern_from_query.d.ts | 13 + .../src/utils/get_initial_esql_query.d.ts | 12 + .../src/utils/get_lookup_indices.d.ts | 7 + .../src/utils/get_query_summary.d.ts | 26 + .../src/utils/inject_where_after_source.d.ts | 15 + .../src/utils/query_cannot_be_sampled.d.ts | 18 + .../src/utils/query_parsing_helpers.d.ts | 104 ++ .../src/utils/replace_index_pattern.d.ts | 1 + .../kbn-esql-utils/src/utils/run_query.d.ts | 48 + .../src/utils/sanitaze_input.d.ts | 1 + .../src/utils/set_instructions_helpers.d.ts | 14 + .../kbn-esql-utils/src/utils/sha256.d.ts | 1 + .../shared/kbn-interpreter/index.d.ts | 1 + .../kbn-interpreter/src/common/index.d.ts | 9 + .../kbn-interpreter/src/common/lib/arg.d.ts | 14 + .../src/common/lib/ast/ast.d.ts | 31 + .../src/common/lib/ast/compare.d.ts | 9 + .../src/common/lib/ast/from_expression.d.ts | 2 + .../src/common/lib/ast/index.d.ts | 4 + .../src/common/lib/ast/patch.d.ts | 2 + .../lib/ast/safe_element_from_expression.d.ts | 1 + .../src/common/lib/ast/to_expression.d.ts | 14 + .../kbn-interpreter/src/common/lib/cast.d.ts | 1 + .../kbn-interpreter/src/common/lib/fn.d.ts | 15 + .../src/common/lib/get_by_alias.d.ts | 6 + .../src/common/lib/get_type.d.ts | 1 + .../kbn-interpreter/src/common/lib/parse.d.ts | 14 + .../src/common/lib/registry.d.ts | 14 + .../src/common/registries.d.ts | 25 + .../shared/kbn-io-ts-utils/index.d.ts | 22 + .../src/array_to_string_rt/index.d.ts | 2 + .../kbn-io-ts-utils/src/date_rt/index.d.ts | 6 + .../src/datemath_string_rt/index.d.ts | 2 + .../kbn-io-ts-utils/src/decode_or_throw.d.ts | 7 + .../src/deep_exact_rt/index.d.ts | 3 + .../src/in_range_rt/index.d.ts | 7 + .../src/index_pattern_rt/index.d.ts | 10 + .../src/is_greater_or_equal/index.d.ts | 6 + .../src/iso_to_epoch_rt/index.d.ts | 2 + .../src/iso_to_epoch_secs_rt/index.d.ts | 2 + .../kbn-io-ts-utils/src/json_rt/index.d.ts | 2 + .../index.d.ts | 2 + .../kbn-io-ts-utils/src/merge_rt/index.d.ts | 13 + .../src/non_empty_string_rt/index.d.ts | 6 + .../src/parseable_types/index.d.ts | 4 + .../src/route_validation/index.d.ts | 4 + .../src/strict_keys_rt/index.d.ts | 2 + .../src/time_key_rt/index.d.ts | 19 + .../src/to_boolean_rt/index.d.ts | 3 + .../src/to_json_schema/index.d.ts | 27 + .../src/to_number_rt/index.d.ts | 2 + .../autoops_promotion_callout/index.d.ts | 2 + .../src/callout.d.ts | 10 + .../cards_navigation/index.d.ts | 3 + .../src/cards_navigation.d.ts | 6 + .../cards_navigation/src/consts.d.ts | 3 + .../cards_navigation/src/index.d.ts | 3 + .../cards_navigation/src/types.d.ts | 82 + .../settings/setting_ids/index.d.ts | 159 ++ .../kbn-object-versioning-utils/index.d.ts | 1 + .../lib/validate_version.d.ts | 9 + .../shared/kbn-object-versioning/index.d.ts | 2 + .../content_management_services_schemas.d.ts | 36 + ...ontent_management_services_versioning.d.ts | 47 + .../lib/content_management_types.d.ts | 118 ++ .../kbn-object-versioning/lib/index.d.ts | 5 + .../lib/object_transform.d.ts | 42 + .../kbn-object-versioning/lib/types.d.ts | 34 + .../kbn-object-versioning/lib/utils.d.ts | 11 + .../shared/kbn-react-query/index.d.ts | 10 + .../shared/kbn-resizable-layout/index.d.ts | 3 + .../src/panels_resizable.d.ts | 16 + .../src/panels_static.d.ts | 10 + .../src/resizable_layout.d.ts | 55 + .../kbn-resizable-layout/src/utils.d.ts | 4 + .../shared/kbn-resizable-layout/types.d.ts | 34 + .../packages/shared/kbn-rison/index.d.ts | 10 + .../packages/shared/kbn-rison/kbn_rison.d.ts | 61 + .../packages/shared/kbn-rrule/index.d.ts | 3 + .../packages/shared/kbn-rrule/rrule.d.ts | 21 + .../packages/shared/kbn-rrule/sanitize.d.ts | 18 + .../packages/shared/kbn-rrule/types.d.ts | 44 + .../packages/shared/kbn-rrule/validate.d.ts | 2 + .../shared/kbn-rule-data-utils/index.d.ts | 11 + .../src/alerts_as_data_cases.d.ts | 1 + .../src/alerts_as_data_rbac.d.ts | 55 + .../src/alerts_as_data_severity.d.ts | 14 + .../src/alerts_as_data_status.d.ts | 6 + .../src/default_alerts_as_data.d.ts | 115 ++ .../src/legacy_alerts_as_data.d.ts | 34 + .../src/routes/stack_rule_paths.d.ts | 13 + .../src/rule_constants.d.ts | 1 + .../src/rule_locator_params.d.ts | 22 + .../src/rule_types/index.d.ts | 5 + .../src/rule_types/o11y_rules.d.ts | 54 + .../src/rule_types/stack_rules.d.ts | 10 + .../src/technical_field_names.d.ts | 116 ++ .../shared/kbn-search-errors/index.d.ts | 4 + .../src/create_es_error.d.ts | 9 + .../kbn-search-errors/src/es_error.d.ts | 16 + .../kbn-search-errors/src/painless_error.d.ts | 14 + .../src/render_search_error.d.ts | 6 + .../kbn-search-errors/src/tsdb_error.d.ts | 10 + .../shared/kbn-search-errors/src/types.d.ts | 3 + .../kbn-search-response-warnings/index.d.ts | 5 + .../search_response_warnings/badge.d.ts | 7 + .../badge_popover_content.d.ts | 8 + .../search_response_warnings/callout.d.ts | 7 + .../empty_prompt.d.ts | 7 + .../search_response_warnings/i18n_utils.d.ts | 5 + .../search_response_warnings/index.d.ts | 6 + .../view_details_popover.d.ts | 8 + .../src/extract_warnings.d.ts | 8 + .../src/handle_warnings.d.ts | 27 + ...orted_downsampled_aggregation_failure.d.ts | 2 + .../src/types.d.ts | 44 + .../shared/kbn-search-types/index.d.ts | 3 + .../kbn-search-types/src/es_search_types.d.ts | 9 + .../src/kibana_search_types.d.ts | 52 + .../shared/kbn-search-types/src/types.d.ts | 96 ++ .../index.d.ts | 3 + .../src/format_request.d.ts | 5 + .../src/parse_endpoint.d.ts | 5 + .../src/typings.d.ts | 98 ++ .../kbn-server-route-repository/index.d.ts | 7 + .../src/create_server_route_factory.d.ts | 3 + .../src/decode_request_params.d.ts | 7 + .../src/make_zod_validation_object.d.ts | 7 + .../src/register_routes.d.ts | 10 + .../src/strip_nullish_request_parameters.d.ts | 11 + .../src/validate_and_decode_params.d.ts | 3 + .../src/validation_objects.d.ts | 11 + .../shared/kbn-sse-utils-server/index.d.ts | 2 + .../observable_into_event_source_stream.d.ts | 29 + .../src/supertest_to_observable.d.ts | 20 + .../src/types/index.d.ts | 1 + .../src/types/presentable.d.ts | 57 + .../shared/kbn-use-tracked-promise/index.d.ts | 1 + .../use_tracked_promise.d.ts | 96 ++ .../presentation_publishing/constants.d.ts | 1 + .../embeddable_api_context.d.ts | 8 + .../presentation_publishing/index.d.ts | 55 + .../interfaces/can_access_view_mode.d.ts | 16 + .../interfaces/can_lock_hover_actions.d.ts | 9 + .../can_override_hover_actions.d.ts | 12 + .../containers/can_add_new_panel.d.ts | 15 + .../containers/can_add_new_section.d.ts | 4 + .../containers/can_focus_panel.d.ts | 10 + .../interfaces/containers/child_state.d.ts | 4 + .../children_unsaved_changes.d.ts | 11 + .../container_state/initialize_state_api.d.ts | 9 + .../containers/last_saved_child_state.d.ts | 6 + .../containers/panel_capabilities.d.ts | 17 + .../containers/panel_management.d.ts | 21 + .../containers/performance_trackers.d.ts | 7 + .../containers/presentation_container.d.ts | 54 + .../containers/publishes_settings.d.ts | 5 + .../interfaces/fetch/applies_filters.d.ts | 15 + .../fetch/bwc/time_range_transforms.d.ts | 7 + .../interfaces/fetch/fetch.d.ts | 4 + .../interfaces/fetch/fetch_context.d.ts | 21 + .../fetch/publishes_pause_fetch.d.ts | 9 + .../fetch/publishes_project_routing.d.ts | 14 + .../interfaces/fetch/publishes_reload.d.ts | 5 + .../fetch/publishes_search_session.d.ts | 6 + .../fetch/publishes_unified_search.d.ts | 43 + .../interfaces/fetch/time_range_manager.d.ts | 6 + .../interfaces/has_app_context.d.ts | 11 + .../interfaces/has_disable_triggers.d.ts | 5 + .../interfaces/has_edit_capabilities.d.ts | 18 + .../interfaces/has_execution_context.d.ts | 5 + .../interfaces/has_library_transforms.d.ts | 40 + .../interfaces/has_parent_api.d.ts | 7 + .../has_read_only_capabilities.d.ts | 18 + .../interfaces/has_serializable_state.d.ts | 21 + .../interfaces/has_supported_triggers.d.ts | 4 + .../interfaces/has_type.d.ts | 9 + .../interfaces/has_uuid.d.ts | 4 + .../interfaces/publishes_blocking_error.d.ts | 6 + .../interfaces/publishes_data_loading.d.ts | 5 + .../interfaces/publishes_data_views.d.ts | 12 + .../publishes_disabled_action_ids.d.ts | 11 + .../interfaces/publishes_phase_events.d.ts | 16 + .../interfaces/publishes_rendered.d.ts | 5 + .../interfaces/publishes_saved_object_id.d.ts | 11 + .../interfaces/publishes_unsaved_changes.d.ts | 5 + .../interfaces/publishes_view_mode.d.ts | 21 + .../titles/bwc/titles_transforms.d.ts | 7 + .../titles/publishes_description.d.ts | 11 + .../titles/publishes_hide_border.d.ts | 9 + .../interfaces/titles/publishes_title.d.ts | 13 + .../interfaces/titles/title_manager.d.ts | 14 + .../publishing_subject/index.d.ts | 3 + .../publishing_batcher.d.ts | 10 + .../publishing_subject.d.ts | 12 + .../publishing_subject/types.d.ts | 13 + .../state_manager/index.d.ts | 4 + .../state_manager/state_comparators.d.ts | 10 + .../state_manager/state_diff_logger.d.ts | 5 + .../state_manager/state_manager.d.ts | 8 + .../state_manager/types.d.ts | 29 + .../utils/snake_case.d.ts | 7 + .../presentation_publishing/utils/types.d.ts | 14 + .../presentation/presentation_util/index.d.ts | 2 + .../presentation_util/src/focus_helpers.d.ts | 1 + .../presentation_util/src/loading_flyout.d.ts | 2 + .../src/open_lazy_flyout.d.ts | 35 + .../src/tracks_overlays.d.ts | 47 + .../shared/react/kibana_mount/index.d.ts | 5 + .../kibana_mount/mount_point_portal.d.ts | 14 + .../react/kibana_mount/to_mount_point.d.ts | 17 + .../shared/react/kibana_mount/utils.d.ts | 1 + .../shared-ux/avatar/solution/index.d.ts | 2 + .../avatar/solution/src/solution_avatar.d.ts | 24 + .../shared-ux/avatar/solution/src/types.d.ts | 1 + .../shared-ux/card/no_data/impl/index.d.ts | 3 + .../src/elastic_agent_card_illustration.d.ts | 2 + .../impl/src/no_data_card.component.d.ts | 4 + .../card/no_data/impl/src/no_data_card.d.ts | 3 + .../card/no_data/impl/src/services.d.ts | 14 + .../shared-ux/card/no_data/types/index.d.ts | 85 + .../code_editor/impl/code_editor.d.ts | 147 ++ .../code_editor/impl/editor.styles.d.ts | 9 + .../shared-ux/code_editor/impl/index.d.ts | 17 + .../rebroadcast_mouse_down_events.d.ts | 7 + .../mods/hooks/use_context_menu_utils.d.ts | 18 + .../code_editor/impl/mods/hooks/use_copy.d.ts | 8 + .../impl/mods/hooks/use_fit_content.d.ts | 9 + .../impl/mods/hooks/use_fullscreen.d.ts | 15 + .../impl/mods/hooks/use_placeholder.d.ts | 8 + .../code_editor/impl/mods/index.d.ts | 6 + .../impl/react_monaco_editor/editor.d.ts | 97 ++ .../impl/react_monaco_editor/index.d.ts | 1 + .../languages/supported.d.ts | 1 + .../impl/utils/placeholder_widget.d.ts | 13 + .../impl/utils/remeasure_fonts.d.ts | 5 + .../link/redirect_app/impl/index.d.ts | 3 + ...precated_redirect_app_links.component.d.ts | 37 + .../shared/shared-ux/modal/tabbed/index.d.ts | 1 + .../modal/tabbed/src/context/index.d.ts | 38 + .../modal/tabbed/src/tabbed_modal.d.ts | 34 + .../page/kibana_template/impl/index.d.ts | 3 + .../impl/src/page_template.d.ts | 14 + .../impl/src/page_template_inner.d.ts | 27 + .../kibana_template/impl/src/services.d.ts | 10 + .../page/kibana_template/types/index.d.ts | 32 + .../shared-ux/page/no_data/impl/index.d.ts | 3 + .../page/no_data/impl/src/action_card.d.ts | 6 + .../page/no_data/impl/src/no_data_page.d.ts | 3 + .../page/no_data/impl/src/services.d.ts | 10 + .../shared-ux/page/no_data/types/index.d.ts | 23 + .../page/no_data_config/impl/index.d.ts | 3 + .../no_data_config/impl/src/constants.d.ts | 1 + .../impl/src/no_data_config_page.d.ts | 19 + .../no_data_config/impl/src/services.d.ts | 10 + .../page/no_data_config/types/index.d.ts | 18 + .../shared-ux/page/solution_nav/index.d.ts | 3 + .../solution_nav/src/collapse_button.d.ts | 12 + .../page/solution_nav/src/solution_nav.d.ts | 51 + .../solution_nav/src/with_solution_nav.d.ts | 18 + .../src/with_solution_nav.styles.d.ts | 2 + .../shared-ux/prompt/not_found/index.d.ts | 1 + .../not_found/src/not_found_prompt.d.ts | 13 + .../shared/shared-ux/table_persist/index.d.ts | 2 + .../table_persist/src/constants.d.ts | 3 + .../shared-ux/table_persist/src/index.d.ts | 4 + .../shared-ux/table_persist/src/storage.d.ts | 13 + .../table_persist/src/table_persist_hoc.d.ts | 26 + .../shared-ux/table_persist/src/types.d.ts | 8 + .../table_persist/src/use_table_persist.d.ts | 43 + .../src/validate_persist_data.d.ts | 11 + .../public/forward_app/forward_app.d.ts | 3 + .../public/forward_app/index.d.ts | 1 + .../navigate_to_legacy_kibana_url.d.ts | 5 + .../public/forward_app/normalize_path.d.ts | 1 + .../private/url_forwarding/public/index.d.ts | 4 + .../private/url_forwarding/public/plugin.d.ts | 60 + .../content_management/common/constants.d.ts | 2 + .../content_management/common/index.d.ts | 2 + .../common/rpc/bulk_get.d.ts | 33 + .../content_management/common/rpc/common.d.ts | 4 + .../common/rpc/constants.d.ts | 3 + .../content_management/common/rpc/create.d.ts | 24 + .../content_management/common/rpc/delete.d.ts | 24 + .../content_management/common/rpc/get.d.ts | 31 + .../content_management/common/rpc/index.d.ts | 11 + .../common/rpc/msearch.d.ts | 48 + .../content_management/common/rpc/rpc.d.ts | 138 ++ .../content_management/common/rpc/search.d.ts | 79 + .../content_management/common/rpc/types.d.ts | 12 + .../content_management/common/rpc/update.d.ts | 26 + .../content_management/common/schemas.d.ts | 1 + .../public/content_client/content_client.d.ts | 38 + .../content_client_context.d.ts | 6 + .../content_client_mutation_hooks.d.ts | 4 + .../content_client_query_hooks.d.ts | 18 + .../public/content_client/index.d.ts | 4 + .../content_client/query_observable.d.ts | 3 + .../public/crud_client/crud_client.d.ts | 9 + .../public/crud_client/index.d.ts | 1 + .../content_management/public/index.d.ts | 5 + .../content_management/public/plugin.d.ts | 19 + .../public/registry/content_type.d.ts | 12 + .../registry/content_type_definition.d.ts | 34 + .../public/registry/index.d.ts | 3 + .../public/registry/registry.d.ts | 8 + .../public/rpc_client/index.d.ts | 1 + .../public/rpc_client/rpc_client.d.ts | 25 + .../content_management/public/types.d.ts | 13 + .../server/content_client/content_client.d.ts | 20 + .../content_client_factory.d.ts | 28 + .../server/content_client/index.d.ts | 2 + .../server/content_client/types.d.ts | 39 + .../server/core/content_type.d.ts | 17 + .../content_management/server/core/core.d.ts | 50 + .../content_management/server/core/crud.d.ts | 41 + .../server/core/event_bus.d.ts | 56 + .../server/core/event_types.d.ts | 74 + .../content_management/server/core/index.d.ts | 6 + .../server/core/msearch.d.ts | 19 + .../server/core/registry.d.ts | 34 + .../content_management/server/core/types.d.ts | 80 + .../content_management/server/index.d.ts | 4 + .../content_management/server/plugin.d.ts | 20 + .../content_management/server/rpc/index.d.ts | 5 + .../server/rpc/procedures/all_procedures.d.ts | 5 + .../server/rpc/procedures/bulk_get.d.ts | 5 + .../server/rpc/procedures/create.d.ts | 4 + .../server/rpc/procedures/delete.d.ts | 4 + .../server/rpc/procedures/get.d.ts | 4 + .../server/rpc/procedures/index.d.ts | 5 + .../server/rpc/procedures/msearch.d.ts | 5 + .../server/rpc/procedures/search.d.ts | 4 + .../server/rpc/procedures/update.d.ts | 4 + .../server/rpc/routes/error_wrapper.d.ts | 2 + .../server/rpc/routes/index.d.ts | 1 + .../server/rpc/routes/routes.d.ts | 11 + .../server/rpc/rpc_service.d.ts | 12 + .../content_management/server/rpc/types.d.ts | 10 + .../content_management/server/types.d.ts | 18 + .../server/utils/index.d.ts | 2 + .../utils/services_transforms_factory.d.ts | 13 + .../server/utils/utils.d.ts | 16 + .../plugins/shared/cps/public/index.d.ts | 4 + .../plugins/shared/cps/public/plugin.d.ts | 10 + .../cps/public/services/async_services.d.ts | 7 + .../cps/public/services/cps_manager.d.ts | 84 + .../cps/public/services/project_fetcher.d.ts | 17 + .../plugins/shared/cps/public/types.d.ts | 17 + .../custom_integrations/common/index.d.ts | 76 + .../common/language_integrations.d.ts | 11 + .../server/custom_integration_registry.d.ts | 20 + .../server/external_integration/index.d.ts | 15 + .../custom_integrations/server/index.d.ts | 7 + .../server/language_clients/index.d.ts | 3 + .../custom_integrations/server/plugin.d.ts | 11 + .../server/routes/define_routes.d.ts | 3 + .../custom_integrations/server/types.d.ts | 14 + .../plugins/shared/data/common/constants.d.ts | 7 + .../datatable_utilities_service.d.ts | 44 + .../common/datatable_utilities/index.d.ts | 1 + .../shared/data/common/es_query/index.d.ts | 1 + .../shared/data/common/exports/constants.d.ts | 4 + .../data/common/exports/escape_value.d.ts | 18 + .../data/common/exports/export_csv.d.ts | 13 + .../data/common/exports/formula_checks.d.ts | 3 + .../shared/data/common/exports/index.d.ts | 4 + .../plugins/shared/data/common/index.d.ts | 20 + .../data/common/kbn_field_types/index.d.ts | 2 + .../data/common/kbn_field_types/types.d.ts | 4 + .../query/filters/persistable_state.d.ts | 11 + .../shared/data/common/query/index.d.ts | 6 + .../shared/data/common/query/is_query.d.ts | 2 + .../data/common/query/persistable_state.d.ts | 26 + .../shared/data/common/query/query_state.d.ts | 17 + .../query/text_based_query_state_to_ast.d.ts | 21 + ...ed_query_state_to_ast_with_validation.d.ts | 20 + .../common/query/timefilter/get_time.d.ts | 18 + .../data/common/query/timefilter/index.d.ts | 2 + .../query/timefilter/is_time_range.d.ts | 2 + .../data/common/query/timefilter/types.d.ts | 10 + .../shared/data/common/query/types.d.ts | 21 + .../data/common/search/aggs/agg_config.d.ts | 129 ++ .../data/common/search/aggs/agg_configs.d.ts | 143 ++ .../data/common/search/aggs/agg_groups.d.ts | 12 + .../data/common/search/aggs/agg_params.d.ts | 26 + .../data/common/search/aggs/agg_type.d.ts | 210 +++ .../data/common/search/aggs/agg_types.d.ts | 408 +++++ .../search/aggs/agg_types_registry.d.ts | 22 + .../data/common/search/aggs/aggs_service.d.ts | 29 + .../aggs/buckets/_interval_options.d.ts | 12 + .../aggs/buckets/_terms_order_helper.d.ts | 3 + .../buckets/_terms_other_bucket_helper.d.ts | 27 + .../search/aggs/buckets/bucket_agg_type.d.ts | 37 + .../search/aggs/buckets/bucket_agg_types.d.ts | 19 + .../buckets/create_filter/date_histogram.d.ts | 2 + .../buckets/create_filter/date_range.d.ts | 3 + .../aggs/buckets/create_filter/filters.d.ts | 22 + .../aggs/buckets/create_filter/histogram.d.ts | 4 + .../aggs/buckets/create_filter/ip_prefix.d.ts | 3 + .../aggs/buckets/create_filter/ip_range.d.ts | 3 + .../buckets/create_filter/multi_terms.d.ts | 6 + .../aggs/buckets/create_filter/range.d.ts | 4 + .../aggs/buckets/create_filter/terms.d.ts | 3 + .../search/aggs/buckets/date_histogram.d.ts | 29 + .../aggs/buckets/date_histogram_fn.d.ts | 16 + .../search/aggs/buckets/date_range.d.ts | 11 + .../search/aggs/buckets/date_range_fn.d.ts | 15 + .../aggs/buckets/diversified_sampler.d.ts | 22 + .../aggs/buckets/diversified_sampler_fn.d.ts | 9 + .../common/search/aggs/buckets/filter.d.ts | 13 + .../common/search/aggs/buckets/filter_fn.d.ts | 16 + .../common/search/aggs/buckets/filters.d.ts | 10 + .../search/aggs/buckets/filters_fn.d.ts | 15 + .../common/search/aggs/buckets/geo_tile.d.ts | 8 + .../search/aggs/buckets/geo_tile_fn.d.ts | 10 + .../common/search/aggs/buckets/histogram.d.ts | 29 + .../search/aggs/buckets/histogram_fn.d.ts | 15 + .../common/search/aggs/buckets/index.d.ts | 46 + .../common/search/aggs/buckets/ip_prefix.d.ts | 8 + .../search/aggs/buckets/ip_prefix_fn.d.ts | 15 + .../common/search/aggs/buckets/ip_range.d.ts | 16 + .../search/aggs/buckets/ip_range_fn.d.ts | 16 + .../search/aggs/buckets/lib/cidr_mask.d.ts | 14 + .../search/aggs/buckets/lib/date_range.d.ts | 2 + .../lib/histogram_calculate_interval.d.ts | 15 + .../search/aggs/buckets/lib/ip_prefix.d.ts | 7 + .../search/aggs/buckets/lib/ip_range.d.ts | 11 + .../lib/time_buckets/calc_auto_interval.d.ts | 28 + .../lib/time_buckets/calc_es_interval.d.ts | 23 + .../lib/time_buckets/i18n_messages.d.ts | 8 + .../aggs/buckets/lib/time_buckets/index.d.ts | 2 + .../lib/time_buckets/time_buckets.d.ts | 133 ++ .../migrate_include_exclude_format.d.ts | 7 + .../search/aggs/buckets/multi_field_key.d.ts | 23 + .../search/aggs/buckets/multi_terms.d.ts | 20 + .../search/aggs/buckets/multi_terms_fn.d.ts | 14 + .../common/search/aggs/buckets/range.d.ts | 12 + .../common/search/aggs/buckets/range_fn.d.ts | 15 + .../common/search/aggs/buckets/range_key.d.ts | 35 + .../search/aggs/buckets/rare_terms.d.ts | 7 + .../search/aggs/buckets/rare_terms_fn.d.ts | 10 + .../common/search/aggs/buckets/sampler.d.ts | 13 + .../search/aggs/buckets/sampler_fn.d.ts | 9 + .../search/aggs/buckets/shard_delay.d.ts | 7 + .../search/aggs/buckets/shard_delay_fn.d.ts | 10 + .../aggs/buckets/significant_terms.d.ts | 10 + .../aggs/buckets/significant_terms_fn.d.ts | 11 + .../search/aggs/buckets/significant_text.d.ts | 11 + .../aggs/buckets/significant_text_fn.d.ts | 11 + .../common/search/aggs/buckets/terms.d.ts | 29 + .../common/search/aggs/buckets/terms_fn.d.ts | 14 + .../search/aggs/buckets/time_series.d.ts | 5 + .../search/aggs/buckets/time_series_fn.d.ts | 10 + .../shared/data/common/search/aggs/index.d.ts | 12 + .../data/common/search/aggs/metrics/avg.d.ts | 6 + .../common/search/aggs/metrics/avg_fn.d.ts | 10 + .../search/aggs/metrics/bucket_avg.d.ts | 11 + .../search/aggs/metrics/bucket_avg_fn.d.ts | 15 + .../search/aggs/metrics/bucket_max.d.ts | 11 + .../search/aggs/metrics/bucket_max_fn.d.ts | 15 + .../search/aggs/metrics/bucket_min.d.ts | 11 + .../search/aggs/metrics/bucket_min_fn.d.ts | 15 + .../search/aggs/metrics/bucket_sum.d.ts | 11 + .../search/aggs/metrics/bucket_sum_fn.d.ts | 15 + .../search/aggs/metrics/cardinality.d.ts | 8 + .../search/aggs/metrics/cardinality_fn.d.ts | 10 + .../common/search/aggs/metrics/count.d.ts | 6 + .../common/search/aggs/metrics/count_fn.d.ts | 10 + .../search/aggs/metrics/cumulative_sum.d.ts | 13 + .../aggs/metrics/cumulative_sum_fn.d.ts | 14 + .../search/aggs/metrics/derivative.d.ts | 13 + .../search/aggs/metrics/derivative_fn.d.ts | 14 + .../search/aggs/metrics/filtered_metric.d.ts | 14 + .../aggs/metrics/filtered_metric_fn.d.ts | 15 + .../search/aggs/metrics/geo_bounds.d.ts | 6 + .../search/aggs/metrics/geo_bounds_fn.d.ts | 10 + .../search/aggs/metrics/geo_centroid.d.ts | 6 + .../search/aggs/metrics/geo_centroid_fn.d.ts | 10 + .../common/search/aggs/metrics/index.d.ts | 58 + .../aggs/metrics/lib/create_filter.d.ts | 4 + .../lib/get_response_agg_config_class.d.ts | 19 + .../aggs/metrics/lib/make_nested_label.d.ts | 2 + .../aggs/metrics/lib/nested_agg_helpers.d.ts | 18 + .../aggs/metrics/lib/ordinal_suffix.d.ts | 1 + .../lib/parent_pipeline_agg_helper.d.ts | 7 + .../lib/parent_pipeline_agg_writer.d.ts | 3 + .../lib/sibling_pipeline_agg_helper.d.ts | 7 + .../lib/sibling_pipeline_agg_writer.d.ts | 2 + .../data/common/search/aggs/metrics/max.d.ts | 6 + .../common/search/aggs/metrics/max_fn.d.ts | 10 + .../common/search/aggs/metrics/median.d.ts | 6 + .../common/search/aggs/metrics/median_fn.d.ts | 10 + .../search/aggs/metrics/metric_agg_type.d.ts | 28 + .../search/aggs/metrics/metric_agg_types.d.ts | 29 + .../data/common/search/aggs/metrics/min.d.ts | 6 + .../common/search/aggs/metrics/min_fn.d.ts | 10 + .../search/aggs/metrics/moving_avg.d.ts | 15 + .../search/aggs/metrics/moving_avg_fn.d.ts | 14 + .../search/aggs/metrics/percentile_ranks.d.ts | 13 + .../aggs/metrics/percentile_ranks_fn.d.ts | 10 + .../search/aggs/metrics/percentiles.d.ts | 9 + .../search/aggs/metrics/percentiles_fn.d.ts | 10 + .../aggs/metrics/percentiles_get_value.d.ts | 2 + .../data/common/search/aggs/metrics/rate.d.ts | 7 + .../common/search/aggs/metrics/rate_fn.d.ts | 10 + .../search/aggs/metrics/serial_diff.d.ts | 13 + .../search/aggs/metrics/serial_diff_fn.d.ts | 14 + .../aggs/metrics/single_percentile.d.ts | 7 + .../aggs/metrics/single_percentile_fn.d.ts | 10 + .../aggs/metrics/single_percentile_rank.d.ts | 8 + .../metrics/single_percentile_rank_fn.d.ts | 10 + .../search/aggs/metrics/std_deviation.d.ts | 17 + .../search/aggs/metrics/std_deviation_fn.d.ts | 10 + .../data/common/search/aggs/metrics/sum.d.ts | 7 + .../common/search/aggs/metrics/sum_fn.d.ts | 10 + .../common/search/aggs/metrics/top_hit.d.ts | 20 + .../search/aggs/metrics/top_hit_fn.d.ts | 10 + .../search/aggs/metrics/top_metrics.d.ts | 19 + .../search/aggs/metrics/top_metrics_fn.d.ts | 10 + .../search/aggs/metrics/value_count.d.ts | 8 + .../search/aggs/metrics/value_count_fn.d.ts | 10 + .../common/search/aggs/param_types/agg.d.ts | 7 + .../common/search/aggs/param_types/base.d.ts | 32 + .../common/search/aggs/param_types/field.d.ts | 23 + .../common/search/aggs/param_types/index.d.ts | 6 + .../common/search/aggs/param_types/json.d.ts | 4 + .../search/aggs/param_types/optioned.d.ts | 12 + .../search/aggs/param_types/string.d.ts | 4 + .../shared/data/common/search/aggs/types.d.ts | 191 +++ .../utils/calculate_auto_time_expression.d.ts | 8 + .../date_histogram_interval.d.ts | 25 + .../aggs/utils/date_interval_utils/index.d.ts | 8 + .../invalid_es_calendar_interval_error.d.ts | 8 + .../invalid_es_interval_format_error.d.ts | 4 + .../is_valid_es_interval.d.ts | 10 + .../is_valid_interval.d.ts | 1 + .../least_common_interval.d.ts | 13 + .../least_common_multiple.d.ts | 11 + .../parse_es_interval.d.ts | 26 + .../date_interval_utils/parse_interval.d.ts | 7 + .../to_absolute_dates.d.ts | 5 + .../search/aggs/utils/get_aggs_formats.d.ts | 15 + .../data/common/search/aggs/utils/index.d.ts | 7 + .../search/aggs/utils/infer_time_zone.d.ts | 6 + .../common/search/aggs/utils/ip_address.d.ts | 5 + .../search/aggs/utils/parse_time_shift.d.ts | 49 + .../common/search/aggs/utils/prop_filter.d.ts | 10 + .../common/search/aggs/utils/sampler.d.ts | 12 + .../common/search/aggs/utils/time_splits.d.ts | 251 +++ .../expressions/aggregate_query_to_ast.d.ts | 9 + .../data/common/search/expressions/cidr.d.ts | 7 + .../search/expressions/cidr_to_ast.d.ts | 2 + .../common/search/expressions/date_range.d.ts | 8 + .../search/expressions/date_range_to_ast.d.ts | 2 + .../data/common/search/expressions/eql.d.ts | 24 + .../search/expressions/eql_raw_response.d.ts | 36 + .../search/expressions/es_raw_response.d.ts | 10 + .../search/expressions/esaggs/esaggs_fn.d.ts | 32 + .../search/expressions/esaggs/index.d.ts | 1 + .../expressions/esaggs/request_handler.d.ts | 26 + .../data/common/search/expressions/esdsl.d.ts | 22 + .../data/common/search/expressions/esql.d.ts | 37 + .../data/common/search/expressions/essql.d.ts | 27 + .../search/expressions/exists_filter.d.ts | 9 + .../search/expressions/extended_bounds.d.ts | 8 + .../expressions/extended_bounds_to_ast.d.ts | 2 + .../data/common/search/expressions/field.d.ts | 10 + .../search/expressions/filters_to_ast.d.ts | 2 + .../search/expressions/geo_bounding_box.d.ts | 72 + .../expressions/geo_bounding_box_to_ast.d.ts | 2 + .../common/search/expressions/geo_point.d.ts | 15 + .../search/expressions/geo_point_to_ast.d.ts | 2 + .../data/common/search/expressions/index.d.ts | 43 + .../common/search/expressions/ip_prefix.d.ts | 8 + .../search/expressions/ip_prefix_to_ast.d.ts | 2 + .../common/search/expressions/ip_range.d.ts | 8 + .../search/expressions/ip_range_to_ast.d.ts | 2 + .../common/search/expressions/kibana.d.ts | 5 + .../search/expressions/kibana_context.d.ts | 11 + .../expressions/kibana_context_type.d.ts | 10 + .../search/expressions/kibana_filter.d.ts | 10 + .../data/common/search/expressions/kql.d.ts | 8 + .../common/search/expressions/lucene.d.ts | 8 + .../search/expressions/numerical_range.d.ts | 9 + .../expressions/numerical_range_to_ast.d.ts | 2 + .../search/expressions/phrase_filter.d.ts | 10 + .../search/expressions/query_filter.d.ts | 15 + .../expressions/query_filter_to_ast.d.ts | 2 + .../search/expressions/query_to_ast.d.ts | 2 + .../data/common/search/expressions/range.d.ts | 11 + .../search/expressions/range_filter.d.ts | 11 + .../search/expressions/remove_filter.d.ts | 10 + .../search/expressions/select_filter.d.ts | 10 + .../common/search/expressions/timerange.d.ts | 5 + .../search/expressions/timerange_to_ast.d.ts | 2 + .../expressions/utils/filters_adapter.d.ts | 3 + .../expressions/utils/function_wrapper.d.ts | 6 + .../search/expressions/utils/index.d.ts | 3 + .../utils/requests_side_effects.d.ts | 2 + .../shared/data/common/search/index.d.ts | 12 + .../data/common/search/poll_search.d.ts | 4 + .../search_source/create_search_source.d.ts | 22 + .../search_source/extract_references.d.ts | 5 + .../fetch/get_search_params.d.ts | 8 + .../search/search_source/fetch/index.d.ts | 3 + .../search_source/fetch/request_error.d.ts | 12 + .../search/search_source/fetch/types.d.ts | 34 + .../common/search/search_source/index.d.ts | 10 + .../search_source/inject_references.d.ts | 5 + .../search/search_source/inspect/index.d.ts | 1 + .../inspect/inspector_stats.d.ts | 7 + .../search_source/migrate_legacy_query.d.ts | 10 + .../search_source/normalize_sort_request.d.ts | 53 + .../search/search_source/parse_json.d.ts | 2 + .../search/search_source/query_to_fields.d.ts | 8 + .../search/search_source/search_source.d.ts | 205 +++ .../search_source/search_source_service.d.ts | 30 + .../common/search/search_source/types.d.ts | 184 ++ .../data/common/search/session/ebt_utils.d.ts | 5 + .../data/common/search/session/index.d.ts | 4 + .../data/common/search/session/status.d.ts | 12 + .../data/common/search/session/types.d.ts | 115 ++ .../search/strategies/eql_search/index.d.ts | 1 + .../search/strategies/eql_search/types.d.ts | 12 + .../search/strategies/es_search/index.d.ts | 2 + .../strategies/es_search/response_utils.d.ts | 38 + .../search/strategies/es_search/types.d.ts | 1 + .../search/strategies/ese_search/index.d.ts | 1 + .../search/strategies/ese_search/types.d.ts | 13 + .../search/strategies/esql_search/index.d.ts | 1 + .../search/strategies/esql_search/types.d.ts | 3 + .../search/strategies/sql_search/index.d.ts | 1 + .../search/strategies/sql_search/types.d.ts | 16 + .../data/common/search/tabify/buckets.d.ts | 12 + .../common/search/tabify/get_columns.d.ts | 9 + .../data/common/search/tabify/index.d.ts | 3 + .../common/search/tabify/response_writer.d.ts | 31 + .../data/common/search/tabify/tabify.d.ts | 7 + .../data/common/search/tabify/types.d.ts | 33 + .../shared/data/common/search/utils.d.ts | 14 + .../data/common/serializable_field.d.ts | 23 + .../shared/data/common/serialize_utils.d.ts | 27 + .../plugins/shared/data/common/types.d.ts | 4 + ...create_filters_from_multi_value_click.d.ts | 7 + .../create_filters_from_range_select.d.ts | 10 + .../create_filters_from_value_click.d.ts | 30 + .../data/public/actions/filters/index.d.ts | 6 + .../shared/data/public/actions/index.d.ts | 3 + .../actions/multi_value_click_action.d.ts | 24 + .../public/actions/select_range_action.d.ts | 17 + .../public/actions/value_click_action.d.ts | 22 + .../plugins/shared/data/public/index.d.ts | 88 + .../data/public/now_provider/index.d.ts | 2 + .../lib/get_force_now_from_url.d.ts | 2 + .../data/public/now_provider/lib/index.d.ts | 1 + .../public/now_provider/now_provider.d.ts | 14 + .../plugins/shared/data/public/plugin.d.ts | 13 + .../query/filter_manager/filter_manager.d.ts | 50 + .../public/query/filter_manager/index.d.ts | 5 + .../filter_manager/lib/generate_filters.d.ts | 15 + .../lib/generate_mapping_chain.d.ts | 2 + .../filter_manager/lib/get_display_value.d.ts | 4 + .../lib/get_index_pattern_from_filter.d.ts | 2 + .../lib/map_and_flatten_filters.d.ts | 2 + .../query/filter_manager/lib/map_filter.d.ts | 2 + .../lib/mappers/map_combined.d.ts | 6 + .../lib/mappers/map_default.d.ts | 7 + .../lib/mappers/map_exists.d.ts | 7 + .../lib/mappers/map_match_all.d.ts | 7 + .../lib/mappers/map_phrase.d.ts | 12 + .../lib/mappers/map_phrases.d.ts | 9 + .../lib/mappers/map_query_string.d.ts | 7 + .../filter_manager/lib/mappers/map_range.d.ts | 11 + .../lib/mappers/map_spatial_filter.d.ts | 7 + .../filter_manager/lib/sort_filters.d.ts | 10 + .../shared/data/public/query/index.d.ts | 9 + .../public/query/lib/add_to_query_log.d.ts | 9 + .../public/query/lib/get_default_query.d.ts | 6 + .../data/public/query/lib/get_query_log.d.ts | 5 + .../shared/data/public/query/lib/index.d.ts | 3 + .../public/query/persisted_log/index.d.ts | 1 + .../query/persisted_log/persisted_log.d.ts | 28 + .../data/public/query/query_service.d.ts | 83 + .../shared/data/public/query/query_state.d.ts | 10 + .../data/public/query/query_string/index.d.ts | 2 + .../query_string/query_string_manager.d.ts | 28 + .../data/public/query/saved_query/index.d.ts | 2 + .../saved_query/saved_query_service.d.ts | 17 + .../data/public/query/saved_query/types.d.ts | 19 + .../state_sync/connect_to_query_state.d.ts | 15 + .../create_query_state_observable.d.ts | 15 + .../data/public/query/state_sync/index.d.ts | 4 + .../query/state_sync/sync_state_with_url.d.ts | 18 + .../data/public/query/state_sync/types.d.ts | 20 + .../data/public/query/timefilter/index.d.ts | 9 + .../timefilter/lib/auto_refresh_loop.d.ts | 16 + .../timefilter/lib/diff_time_picker_vals.d.ts | 4 + .../query/timefilter/lib/page_visibility.d.ts | 2 + .../timefilter/lib/validate_timerange.d.ts | 2 + .../public/query/timefilter/time_history.d.ts | 11 + .../public/query/timefilter/timefilter.d.ts | 111 ++ .../query/timefilter/timefilter_service.d.ts | 25 + .../data/public/query/timefilter/types.d.ts | 13 + .../query/timefilter/use_timefilter.d.ts | 38 + .../data/public/search/aggs/aggs_service.d.ts | 46 + .../shared/data/public/search/aggs/index.d.ts | 2 + .../shared/data/public/search/aggs/types.d.ts | 3 + .../collectors/create_usage_collector.d.ts | 4 + .../data/public/search/collectors/index.d.ts | 3 + .../data/public/search/collectors/types.d.ts | 77 + .../shared/data/public/search/constants.d.ts | 3 + .../data/public/search/expressions/eql.d.ts | 19 + .../public/search/expressions/esaggs.d.ts | 35 + .../data/public/search/expressions/esdsl.d.ts | 19 + .../data/public/search/expressions/esql.d.ts | 18 + .../data/public/search/expressions/essql.d.ts | 18 + .../data/public/search/expressions/index.d.ts | 6 + .../shared/data/public/search/index.d.ts | 9 + .../create_request_hash.d.ts | 21 + .../search/search_interceptor/index.d.ts | 2 + .../search_abort_controller.d.ts | 15 + .../search_interceptor.d.ts | 84 + .../search_response_cache.d.ts | 30 + .../search_session_incomplete_warning.d.ts | 3 + .../search_interceptor/timeout_error.d.ts | 19 + .../to_partial_response.d.ts | 8 + .../data/public/search/search_service.d.ts | 46 + .../session/background_search_notifier.d.ts | 17 + .../data/public/search/session/constants.d.ts | 2 + .../search/session/ebt_manager/constants.d.ts | 4 + .../search/session/ebt_manager/index.d.ts | 3 + .../search_session_ebt_manager.d.ts | 30 + ...rch_session_ebt_manager_registrations.d.ts | 2 + .../session/get_session_redirect_url.d.ts | 16 + .../data/public/search/session/i18n.d.ts | 5 + .../search/session/in_progress_session.d.ts | 4 + .../data/public/search/session/index.d.ts | 10 + .../session/lib/session_name_formatter.d.ts | 4 + .../search/session/search_session_state.d.ts | 167 ++ .../search/session/session_helpers.d.ts | 19 + .../search/session/session_service.d.ts | 243 +++ .../search/session/sessions_client.d.ts | 31 + .../sessions_mgmt/application/index.d.ts | 15 + .../sessions_mgmt/application/render.d.ts | 2 + .../sessions_mgmt/components/index.d.ts | 11 + .../components/inspect_flyout/index.d.ts | 1 + .../inspect_flyout/inspect_flyout.d.ts | 7 + .../sessions_mgmt/components/main.d.ts | 20 + .../sessions_mgmt/components/status.d.ts | 10 + .../table/actions/delete_button.d.ts | 5 + .../table/actions/extend_button.d.ts | 5 + .../components/table/actions/get_action.d.ts | 6 + .../components/table/actions/index.d.ts | 2 + .../table/actions/inspect_button.d.ts | 5 + .../table/actions/popover_actions.d.ts | 15 + .../table/actions/rename_button.d.ts | 5 + .../components/table/actions/types.d.ts | 8 + .../components/table/columns/actions.d.ts | 12 + .../components/table/columns/app_id.d.ts | 3 + .../components/table/columns/get_columns.d.ts | 16 + .../components/table/columns/index.d.ts | 4 + .../components/table/columns/name.d.ts | 10 + .../components/table/columns/status.d.ts | 3 + .../sessions_mgmt/components/table/index.d.ts | 2 + .../sessions_mgmt/components/table/table.d.ts | 39 + .../components/table/utils/get_actions.d.ts | 3 + .../table/utils/get_app_filter.d.ts | 3 + .../table/utils/get_status_filter.d.ts | 3 + .../table/utils/map_to_ui_session.d.ts | 8 + .../sessions_mgmt/flyout/constants.d.ts | 1 + .../session/sessions_mgmt/flyout/flyout.d.ts | 22 + .../sessions_mgmt/flyout/get_columns.d.ts | 4 + .../sessions_mgmt/flyout/get_flyout.d.ts | 25 + .../search/session/sessions_mgmt/index.d.ts | 36 + .../search/session/sessions_mgmt/lib/api.d.ts | 31 + .../sessions_mgmt/lib/date_string.d.ts | 1 + .../lib/get_expiration_status.d.ts | 5 + .../search/session/sessions_mgmt/types.d.ts | 41 + .../shared/data/public/search/types.d.ts | 100 ++ .../plugins/shared/data/public/services.d.ts | 7 + .../plugins/shared/data/public/types.d.ts | 83 + .../components/data_table.d.ts | 15 + .../components/data_table_selector.d.ts | 20 + .../components/data_view.d.ts | 33 + .../components/data_view_wrapper.d.ts | 11 + .../components/download_options.d.ts | 27 + .../utils/table_inspector_view/index.d.ts | 11 + .../utils/table_inspector_view/types.d.ts | 15 + .../plugins/shared/data/server/config.d.ts | 211 +++ .../shared/data_views/common/constants.d.ts | 62 + .../common/content_management/index.d.ts | 1 + .../content_management/v1/constants.d.ts | 7 + .../common/content_management/v1/index.d.ts | 4 + .../common/content_management/v1/types.d.ts | 20 + .../data_views/abstract_data_views.d.ts | 242 +++ .../common/data_views/data_view.d.ts | 160 ++ .../common/data_views/data_view_lazy.d.ts | 104 ++ .../data_views/data_view_lazy_util.d.ts | 2 + .../common/data_views/data_views.d.ts | 511 ++++++ .../common/data_views/flatten_hit.d.ts | 8 + .../data_views/common/data_views/index.d.ts | 6 + .../data_views/meta_units_to_formatter.d.ts | 5 + .../common/data_views/persistable_state.d.ts | 3 + .../data_views/common/data_views/utils.d.ts | 8 + .../data_view_saved_object_conflict.d.ts | 10 + .../errors/duplicate_index_pattern.d.ts | 11 + .../data_views/common/errors/index.d.ts | 3 + .../common/errors/insufficient_access.d.ts | 12 + .../data_views/common/expressions/index.d.ts | 1 + .../expressions/load_index_pattern.d.ts | 32 + .../common/fields/data_view_field.d.ts | 228 +++ .../data_views/common/fields/field_list.d.ts | 66 + .../data_views/common/fields/index.d.ts | 3 + .../data_views/common/fields/utils.d.ts | 23 + .../shared/data_views/common/index.d.ts | 16 + .../shared/data_views/common/lib/errors.d.ts | 7 + .../shared/data_views/common/lib/index.d.ts | 2 + .../shared/data_views/common/types.d.ts | 521 ++++++ .../shared/data_views/common/utils.d.ts | 10 + .../public/content_management_wrapper.d.ts | 12 + .../data_views/data_views_api_client.d.ts | 63 + .../data_views/public/data_views/index.d.ts | 2 + .../data_views/public/data_views/sha256.d.ts | 1 + .../public/data_views_service_public.d.ts | 58 + .../data_views/public/debounce_by_key.d.ts | 9 + .../data_views/public/expressions/index.d.ts | 1 + .../expressions/load_index_pattern.d.ts | 35 + .../shared/data_views/public/index.d.ts | 16 + .../shared/data_views/public/plugin.d.ts | 12 + .../public/services/get_indices.d.ts | 17 + .../data_views/public/services/has_data.d.ts | 39 + .../data_views/public/services/index.d.ts | 10 + .../shared/data_views/public/types.d.ts | 175 ++ .../public/ui_settings_wrapper.d.ts | 10 + .../common/ast/build_expression.d.ts | 68 + .../common/ast/build_function.d.ts | 116 ++ .../shared/expressions/common/ast/format.d.ts | 2 + .../common/ast/format_expression.d.ts | 7 + .../shared/expressions/common/ast/index.d.ts | 7 + .../shared/expressions/common/ast/parse.d.ts | 2 + .../common/ast/parse_expression.d.ts | 7 + .../shared/expressions/common/ast/types.d.ts | 51 + .../common/execution/container.d.ts | 32 + .../common/execution/execution.d.ts | 109 ++ .../common/execution/execution_contract.d.ts | 42 + .../expressions/common/execution/index.d.ts | 4 + .../expressions/common/execution/types.d.ts | 75 + .../common/executor/container.d.ts | 22 + .../expressions/common/executor/executor.d.ts | 83 + .../expressions/common/executor/index.d.ts | 2 + .../expression_functions/arguments.d.ts | 109 ++ .../expression_function.d.ts | 59 + .../expression_function_parameter.d.ts | 19 + .../common/expression_functions/index.d.ts | 6 + .../series_calculation_helpers.d.ts | 20 + .../expression_functions/specs/clog.d.ts | 3 + .../specs/create_table.d.ts | 8 + .../specs/cumulative_sum.d.ts | 37 + .../specs/cumulative_sum_fn.d.ts | 3 + .../specs/derivative.d.ts | 38 + .../specs/derivative_fn.d.ts | 31 + .../expression_functions/specs/font.d.ts | 17 + .../expression_functions/specs/index.d.ts | 18 + .../specs/map_column.d.ts | 10 + .../expression_functions/specs/math.d.ts | 8 + .../specs/math_column.d.ts | 11 + .../expression_functions/specs/math_fn.d.ts | 8 + .../specs/moving_average.d.ts | 36 + .../specs/moving_average_fn.d.ts | 28 + .../specs/overall_metric.d.ts | 37 + .../specs/overall_metric_fn.d.ts | 29 + .../expression_functions/specs/theme.d.ts | 9 + .../specs/ui_setting.d.ts | 35 + .../expression_functions/specs/var.d.ts | 7 + .../expression_functions/specs/var_set.d.ts | 9 + .../common/expression_functions/types.d.ts | 111 ++ .../expression_renderer.d.ts | 11 + .../expression_renderer_registry.d.ts | 10 + .../common/expression_renderers/index.d.ts | 3 + .../common/expression_renderers/types.d.ts | 79 + .../expression_types/expression_type.d.ts | 28 + .../common/expression_types/get_type.d.ts | 1 + .../common/expression_types/index.d.ts | 6 + .../expression_types/serialize_provider.d.ts | 6 + .../expression_types/specs/boolean.d.ts | 2 + .../expression_types/specs/datatable.d.ts | 128 ++ .../common/expression_types/specs/error.d.ts | 15 + .../common/expression_types/specs/filter.d.ts | 15 + .../common/expression_types/specs/image.d.ts | 9 + .../common/expression_types/specs/index.d.ts | 17 + .../common/expression_types/specs/null.d.ts | 4 + .../common/expression_types/specs/num.d.ts | 5 + .../common/expression_types/specs/number.d.ts | 4 + .../expression_types/specs/pointseries.d.ts | 35 + .../common/expression_types/specs/range.d.ts | 10 + .../common/expression_types/specs/render.d.ts | 17 + .../common/expression_types/specs/shape.d.ts | 5 + .../common/expression_types/specs/string.d.ts | 4 + .../common/expression_types/specs/style.d.ts | 5 + .../expression_types/specs/ui_setting.d.ts | 6 + .../common/expression_types/types.d.ts | 26 + .../unbox_expression_value.d.ts | 2 + .../shared/expressions/common/fonts.d.ts | 141 ++ .../shared/expressions/common/index.d.ts | 20 + .../common/service/expressions_fork.d.ts | 53 + .../common/service/expressions_services.d.ts | 292 ++++ .../expressions/common/service/index.d.ts | 1 + .../expressions/common/types/common.d.ts | 29 + .../expressions/common/types/index.d.ts | 3 + .../expressions/common/types/registry.d.ts | 5 + .../expressions/common/types/style.d.ts | 111 ++ .../create_default_inspector_adapters.d.ts | 2 + .../expressions/common/util/create_error.d.ts | 10 + .../util/expressions_inspector_adapter.d.ts | 7 + .../expressions/common/util/get_by_alias.d.ts | 13 + .../shared/expressions/common/util/index.d.ts | 6 + .../common/util/tables_adapter.d.ts | 13 + .../expressions/common/util/test_utils.d.ts | 2 + .../public/expression_functions/index.d.ts | 1 + .../expression_functions/ui_setting.d.ts | 2 + .../shared/expressions/public/index.d.ts | 13 + .../shared/expressions/public/loader.d.ts | 34 + .../shared/expressions/public/plugin.d.ts | 25 + .../react_expression_renderer/index.d.ts | 2 + .../react_expression_renderer.d.ts | 13 + .../use_debounced_value.d.ts | 1 + .../use_expression_renderer.d.ts | 24 + .../use_shallow_memo.d.ts | 1 + .../react_expression_renderer_wrapper.d.ts | 3 + .../shared/expressions/public/render.d.ts | 39 + .../public/render_error_handler.d.ts | 2 + .../public/services/expressions_services.d.ts | 5 + .../expressions/public/services/index.d.ts | 6 + .../expressions/public/types/index.d.ts | 57 + .../plugins/shared/home/common/constants.d.ts | 8 + .../home/common/instruction_variant.d.ts | 29 + .../home/public/application/application.d.ts | 2 + .../components/add_data/add_data.d.ts | 10 + .../components/add_data/index.d.ts | 1 + .../components/app_navigation_handler.d.ts | 2 + .../public/application/components/home.d.ts | 33 + .../application/components/home_app.d.ts | 7 + .../components/manage_data/index.d.ts | 1 + .../components/manage_data/manage_data.d.ts | 10 + .../components/move_data/index.d.ts | 1 + .../components/move_data/move_data.d.ts | 6 + .../components/sample_data/index.d.ts | 8 + .../setup_cloud_connect/callout_skeleton.d.ts | 2 + .../components/setup_cloud_connect/index.d.ts | 2 + .../setup_cloud_connect.d.ts | 8 + .../components/solutions_section/index.d.ts | 1 + .../solutions_section/solution_panel.d.ts | 8 + .../solutions_section/solutions_section.d.ts | 8 + .../application/components/synopsis.d.ts | 13 + .../components/tutorial/content.d.ts | 6 + .../components/tutorial/footer.d.ts | 7 + .../components/tutorial/instruction.d.ts | 8 + .../components/tutorial/instruction_set.d.ts | 18 + .../components/tutorial/introduction.d.ts | 20 + .../tutorial/replace_template_strings.d.ts | 1 + .../tutorial/status_check_states.d.ts | 5 + .../components/tutorial/tutorial.d.ts | 16 + .../components/tutorial_directory.d.ts | 13 + .../application/components/welcome.d.ts | 10 + .../shared/home/public/application/index.d.ts | 1 + .../public/application/kibana_services.d.ts | 44 + .../public/application/load_tutorials.d.ts | 3 + .../plugins/shared/home/public/index.d.ts | 7 + .../plugins/shared/home/public/plugin.d.ts | 60 + .../services/add_data/add_data_service.d.ts | 31 + .../home/public/services/add_data/index.d.ts | 2 + .../services/environment/environment.d.ts | 35 + .../public/services/environment/index.d.ts | 2 + .../feature_catalogue_registry.d.ts | 68 + .../services/feature_catalogue/index.d.ts | 2 + .../shared/home/public/services/index.d.ts | 10 + .../home/public/services/tutorials/index.d.ts | 2 + .../services/tutorials/tutorial_service.d.ts | 50 + .../home/public/services/tutorials/types.d.ts | 7 + .../home/public/services/welcome/index.d.ts | 2 + .../services/welcome/welcome_service.d.ts | 19 + .../home/server/capabilities_provider.d.ts | 10 + .../plugins/shared/home/server/config.d.ts | 5 + .../plugins/shared/home/server/index.d.ts | 8 + .../plugins/shared/home/server/plugin.d.ts | 28 + .../server/routes/fetch_es_hits_status.d.ts | 2 + .../shared/home/server/routes/index.d.ts | 2 + .../home/server/saved_objects/index.d.ts | 1 + .../saved_objects/sample_data_telemetry.d.ts | 2 + .../shared/home/server/services/index.d.ts | 5 + .../data_sets/ecommerce/field_mappings.d.ts | 202 +++ .../data_sets/ecommerce/index.d.ts | 2 + .../data_sets/ecommerce/saved_objects.d.ts | 2 + .../data_sets/flights/field_mappings.d.ts | 83 + .../sample_data/data_sets/flights/index.d.ts | 2 + .../data_sets/flights/saved_objects.d.ts | 2 + .../services/sample_data/data_sets/index.d.ts | 4 + .../data_sets/logs/field_mappings.d.ts | 155 ++ .../sample_data/data_sets/logs/index.d.ts | 2 + .../data_sets/logs/saved_objects.d.ts | 2 + .../data_sets/logs_tsdb/field_mappings.d.ts | 141 ++ .../data_sets/logs_tsdb/index.d.ts | 3 + .../data_sets/logs_tsdb/saved_objects.d.ts | 2 + .../server/services/sample_data/errors.d.ts | 4 + .../server/services/sample_data/index.d.ts | 3 + .../sample_data/lib/create_index_name.d.ts | 1 + .../sample_data/lib/find_sample_objects.d.ts | 21 + .../lib/insert_data_into_index.d.ts | 9 + .../services/sample_data/lib/load_data.d.ts | 1 + .../lib/register_with_integrations.d.ts | 3 + .../lib/sample_dataset_registry_types.d.ts | 56 + .../lib/sample_dataset_schema.d.ts | 46 + .../sample_data/lib/translate_timestamp.d.ts | 3 + .../services/sample_data/lib/utils.d.ts | 2 + .../services/sample_data/routes/index.d.ts | 3 + .../services/sample_data/routes/install.d.ts | 5 + .../services/sample_data/routes/list.d.ts | 3 + .../sample_data/routes/uninstall.d.ts | 5 + .../services/sample_data/routes/utils.d.ts | 12 + .../sample_data/sample_data_installer.d.ts | 32 + .../sample_data/sample_data_registry.d.ts | 55 + .../services/sample_data/usage/collector.d.ts | 2 + .../sample_data/usage/collector_fetch.d.ts | 11 + .../services/sample_data/usage/index.d.ts | 2 + .../services/sample_data/usage/usage.d.ts | 6 + .../home/server/services/tutorials/index.d.ts | 4 + .../tutorials/lib/tutorial_schema.d.ts | 268 +++ .../lib/tutorials_registry_types.d.ts | 16 + .../tutorials/tutorials_registry.d.ts | 22 + .../server/tutorials/activemq_logs/index.d.ts | 2 + .../tutorials/activemq_metrics/index.d.ts | 2 + .../tutorials/aerospike_metrics/index.d.ts | 2 + .../server/tutorials/apache_logs/index.d.ts | 2 + .../tutorials/apache_metrics/index.d.ts | 2 + .../server/tutorials/auditbeat/index.d.ts | 2 + .../server/tutorials/auditd_logs/index.d.ts | 2 + .../home/server/tutorials/aws_logs/index.d.ts | 2 + .../server/tutorials/aws_metrics/index.d.ts | 2 + .../server/tutorials/azure_logs/index.d.ts | 2 + .../server/tutorials/azure_metrics/index.d.ts | 2 + .../tutorials/barracuda_logs/index.d.ts | 2 + .../server/tutorials/bluecoat_logs/index.d.ts | 2 + .../home/server/tutorials/cef_logs/index.d.ts | 2 + .../server/tutorials/ceph_metrics/index.d.ts | 2 + .../tutorials/checkpoint_logs/index.d.ts | 2 + .../server/tutorials/cisco_logs/index.d.ts | 2 + .../tutorials/cockroachdb_metrics/index.d.ts | 2 + .../tutorials/consul_metrics/index.d.ts | 2 + .../server/tutorials/coredns_logs/index.d.ts | 2 + .../tutorials/coredns_metrics/index.d.ts | 2 + .../tutorials/couchbase_metrics/index.d.ts | 2 + .../tutorials/couchdb_metrics/index.d.ts | 2 + .../tutorials/crowdstrike_logs/index.d.ts | 2 + .../server/tutorials/cylance_logs/index.d.ts | 2 + .../tutorials/docker_metrics/index.d.ts | 2 + .../tutorials/dropwizard_metrics/index.d.ts | 2 + .../tutorials/elasticsearch_logs/index.d.ts | 2 + .../elasticsearch_metrics/index.d.ts | 2 + .../tutorials/envoyproxy_logs/index.d.ts | 2 + .../tutorials/envoyproxy_metrics/index.d.ts | 2 + .../server/tutorials/etcd_metrics/index.d.ts | 2 + .../home/server/tutorials/f5_logs/index.d.ts | 2 + .../server/tutorials/fortinet_logs/index.d.ts | 2 + .../home/server/tutorials/gcp_logs/index.d.ts | 2 + .../server/tutorials/gcp_metrics/index.d.ts | 2 + .../tutorials/golang_metrics/index.d.ts | 2 + .../server/tutorials/gsuite_logs/index.d.ts | 2 + .../server/tutorials/haproxy_logs/index.d.ts | 2 + .../tutorials/haproxy_metrics/index.d.ts | 2 + .../server/tutorials/ibmmq_logs/index.d.ts | 2 + .../server/tutorials/ibmmq_metrics/index.d.ts | 2 + .../server/tutorials/icinga_logs/index.d.ts | 2 + .../home/server/tutorials/iis_logs/index.d.ts | 2 + .../server/tutorials/iis_metrics/index.d.ts | 2 + .../server/tutorials/imperva_logs/index.d.ts | 2 + .../server/tutorials/infoblox_logs/index.d.ts | 2 + .../instructions/auditbeat_instructions.d.ts | 246 +++ .../instructions/cloud_instructions.d.ts | 2 + .../instructions/filebeat_instructions.d.ts | 282 +++ .../get_space_id_for_beats_tutorial.d.ts | 8 + .../instructions/heartbeat_instructions.d.ts | 273 +++ .../instructions/metricbeat_instructions.d.ts | 282 +++ .../onprem_cloud_instructions.d.ts | 8 + .../instructions/winlogbeat_instructions.d.ts | 160 ++ .../server/tutorials/iptables_logs/index.d.ts | 2 + .../server/tutorials/juniper_logs/index.d.ts | 2 + .../server/tutorials/kafka_logs/index.d.ts | 2 + .../server/tutorials/kafka_metrics/index.d.ts | 2 + .../server/tutorials/kibana_logs/index.d.ts | 2 + .../tutorials/kibana_metrics/index.d.ts | 2 + .../tutorials/kubernetes_metrics/index.d.ts | 2 + .../server/tutorials/logstash_logs/index.d.ts | 2 + .../tutorials/logstash_metrics/index.d.ts | 2 + .../tutorials/memcached_metrics/index.d.ts | 2 + .../tutorials/microsoft_logs/index.d.ts | 2 + .../server/tutorials/misp_logs/index.d.ts | 2 + .../server/tutorials/mongodb_logs/index.d.ts | 2 + .../tutorials/mongodb_metrics/index.d.ts | 2 + .../server/tutorials/mssql_logs/index.d.ts | 2 + .../server/tutorials/mssql_metrics/index.d.ts | 2 + .../server/tutorials/munin_metrics/index.d.ts | 2 + .../server/tutorials/mysql_logs/index.d.ts | 2 + .../server/tutorials/mysql_metrics/index.d.ts | 2 + .../server/tutorials/nats_logs/index.d.ts | 2 + .../server/tutorials/nats_metrics/index.d.ts | 2 + .../server/tutorials/netflow_logs/index.d.ts | 2 + .../server/tutorials/netscout_logs/index.d.ts | 2 + .../server/tutorials/nginx_logs/index.d.ts | 2 + .../server/tutorials/nginx_metrics/index.d.ts | 2 + .../server/tutorials/o365_logs/index.d.ts | 2 + .../server/tutorials/okta_logs/index.d.ts | 2 + .../tutorials/openmetrics_metrics/index.d.ts | 2 + .../tutorials/oracle_metrics/index.d.ts | 2 + .../server/tutorials/osquery_logs/index.d.ts | 2 + .../server/tutorials/panw_logs/index.d.ts | 2 + .../tutorials/php_fpm_metrics/index.d.ts | 2 + .../tutorials/postgresql_logs/index.d.ts | 2 + .../tutorials/postgresql_metrics/index.d.ts | 2 + .../tutorials/prometheus_metrics/index.d.ts | 2 + .../server/tutorials/rabbitmq_logs/index.d.ts | 2 + .../tutorials/rabbitmq_metrics/index.d.ts | 2 + .../server/tutorials/radware_logs/index.d.ts | 2 + .../server/tutorials/redis_logs/index.d.ts | 2 + .../server/tutorials/redis_metrics/index.d.ts | 2 + .../redisenterprise_metrics/index.d.ts | 2 + .../home/server/tutorials/register.d.ts | 2 + .../server/tutorials/santa_logs/index.d.ts | 2 + .../tutorials/sonicwall_logs/index.d.ts | 2 + .../server/tutorials/sophos_logs/index.d.ts | 2 + .../server/tutorials/stan_metrics/index.d.ts | 2 + .../tutorials/statsd_metrics/index.d.ts | 3 + .../server/tutorials/suricata_logs/index.d.ts | 2 + .../server/tutorials/system_logs/index.d.ts | 2 + .../tutorials/system_metrics/index.d.ts | 2 + .../server/tutorials/tomcat_logs/index.d.ts | 2 + .../server/tutorials/traefik_logs/index.d.ts | 2 + .../tutorials/traefik_metrics/index.d.ts | 3 + .../tutorials/uptime_monitors/index.d.ts | 2 + .../server/tutorials/uwsgi_metrics/index.d.ts | 2 + .../tutorials/vsphere_metrics/index.d.ts | 2 + .../tutorials/windows_event_logs/index.d.ts | 2 + .../tutorials/windows_metrics/index.d.ts | 2 + .../server/tutorials/zeek_logs/index.d.ts | 2 + .../tutorials/zookeeper_metrics/index.d.ts | 2 + .../server/tutorials/zscaler_logs/index.d.ts | 2 + .../inspector/common/adapters/index.d.ts | 2 + .../common/adapters/request/index.d.ts | 4 + .../move_request_params_to_top_level.d.ts | 2 + .../adapters/request/request_adapter.d.ts | 34 + .../adapters/request/request_responder.d.ts | 16 + .../common/adapters/request/types.d.ts | 46 + .../inspector/common/adapters/types.d.ts | 8 + .../shared/inspector/common/index.d.ts | 2 + .../adapters/has_inspector_adapters.d.ts | 5 + .../inspector/public/async_services.d.ts | 2 + .../shared/inspector/public/index.d.ts | 8 + .../shared/inspector/public/plugin.d.ts | 48 + .../shared/inspector/public/types.d.ts | 57 + .../inspector/public/ui/inspector_panel.d.ts | 39 + .../public/ui/inspector_view_chooser.d.ts | 20 + .../inspector/public/view_registry.d.ts | 36 + .../shared/inspector/public/views/index.d.ts | 1 + .../clusters_health/cluster_health.d.ts | 9 + .../clusters_health/clusters_health.d.ts | 7 + .../clusters_health/gradient.d.ts | 7 + .../clusters_view/clusters_health/index.d.ts | 2 + .../clusters_table/cluster_view.d.ts | 7 + .../clusters_table/clusters_table.d.ts | 7 + .../clusters_view/clusters_table/index.d.ts | 1 + .../clusters_table/shards_view/index.d.ts | 2 + .../open_shard_failure_flyout_button.d.ts | 7 + .../shards_view/shard_failure_details.d.ts | 20 + .../shards_view/shard_failure_flyout.d.ts | 8 + .../shards_view/shard_failure_table.d.ts | 7 + .../shards_view/shards_view.d.ts | 8 + .../details/clusters_view/clusters_view.d.ts | 16 + .../details/clusters_view/find_clusters.d.ts | 4 + .../details/clusters_view/index.d.ts | 1 + .../details/clusters_view/local_cluster.d.ts | 16 + .../requests/components/details/index.d.ts | 5 + .../components/details/req_code_viewer.d.ts | 14 + .../details/req_details_request.d.ts | 7 + .../details/req_details_request_content.d.ts | 9 + .../details/req_details_response.d.ts | 8 + .../components/details/req_details_stats.d.ts | 7 + .../requests/components/details/types.d.ts | 4 + .../disambiguate_request_names.d.ts | 2 + .../requests/components/get_next_tab.d.ts | 2 + .../requests/components/request_details.d.ts | 8 + .../requests/components/request_selector.d.ts | 14 + .../requests/components/requests_view.d.ts | 17 + .../views/requests/components/types.d.ts | 15 + .../public/views/requests/index.d.ts | 2 + .../kibana_react/public/context/context.d.ts | 12 + .../kibana_react/public/context/index.d.ts | 2 + .../kibana_react/public/context/types.d.ts | 16 + .../public/dark_mode/use_dark_mode.d.ts | 7 + .../shared/kibana_react/public/index.d.ts | 26 + .../kibana_react/public/markdown/index.d.ts | 5 + .../public/markdown/markdown.d.ts | 21 + .../public/markdown/markdownStyles.d.ts | 2 + .../public/markdown/markdown_simple.d.ts | 6 + .../overlays/create_react_overlays.d.ts | 3 + .../kibana_react/public/overlays/index.d.ts | 2 + .../kibana_react/public/overlays/types.d.ts | 6 + .../public/overview_page/index.d.ts | 2 + .../overview_page_actions/index.d.ts | 1 + .../overview_page_actions.d.ts | 13 + .../overview_page_footer/index.d.ts | 1 + .../overview_page_footer.d.ts | 12 + .../public/page_template/index.d.ts | 2 + .../action_cards/action_cards.d.ts | 8 + .../no_data_page/action_cards/index.d.ts | 1 + .../page_template/no_data_page/index.d.ts | 2 + .../no_data_card/elastic_agent_card.d.ts | 9 + .../no_data_page/no_data_card/index.d.ts | 3 + .../no_data_card/no_data_card.d.ts | 3 + .../no_data_page/no_data_page.d.ts | 47 + .../no_data_page_body/no_data_page_body.d.ts | 9 + .../page_template/solution_nav/index.d.ts | 2 + .../solution_nav/solution_nav_avatar.d.ts | 12 + .../public/react_router_navigate/index.d.ts | 1 + .../react_router_navigate.d.ts | 15 + .../shared/kibana_react/public/theme.d.ts | 11 + .../public/ui_settings/index.d.ts | 1 + .../public/ui_settings/use_ui_setting.d.ts | 50 + .../public/url_template_editor/index.d.ts | 1 + .../url_template_editor.d.ts | 20 + .../public/use_execution_context/index.d.ts | 1 + .../use_execution_context.d.ts | 7 + .../kibana_react/public/util/index.d.ts | 18 + .../public/validated_range/index.d.ts | 2 + .../validated_range/is_range_valid.d.ts | 5 + .../validated_range/validated_dual_range.d.ts | 36 + .../kibana_utils/common/abort_utils.d.ts | 36 + .../common/calculate_object_hash.d.ts | 3 + .../common/create_getter_setter.d.ts | 3 + .../shared/kibana_utils/common/defer.d.ts | 18 + ...inct_until_changed_with_initial_value.d.ts | 2 + .../kibana_utils/common/errors/errors.d.ts | 53 + .../kibana_utils/common/errors/index.d.ts | 2 + .../kibana_utils/common/errors/types.d.ts | 5 + .../kibana_utils/common/field_wildcard.d.ts | 3 + .../shared/kibana_utils/common/index.d.ts | 18 + .../shared/kibana_utils/common/now.d.ts | 5 + .../shared/kibana_utils/common/of.d.ts | 10 + .../common/persistable_state/index.d.ts | 3 + .../merge_migration_function_map.d.ts | 4 + .../persistable_state/migrate_to_latest.d.ts | 3 + .../common/persistable_state/types.d.ts | 146 ++ .../create_state_container.d.ts | 47 + .../create_state_container_react_helpers.d.ts | 38 + .../common/state_containers/index.d.ts | 10 + .../common/state_containers/types.d.ts | 148 ++ .../common/state_management/encode_state.d.ts | 1 + .../common/state_management/format.d.ts | 3 + .../common/state_management/parse.d.ts | 2 + .../set_state_to_kbn_url.d.ts | 25 + .../common/state_management/state_hash.d.ts | 2 + .../common/url/encode_uri_query.d.ts | 22 + .../shared/kibana_utils/common/url/index.d.ts | 8 + .../kibana_utils/common/url/validate_url.d.ts | 5 + .../core/create_start_service_getter.d.ts | 51 + .../kibana_utils/public/core/index.d.ts | 2 + .../public/history/get_query_params.d.ts | 3 + .../public/history/history_observable.d.ts | 23 + .../kibana_utils/public/history/index.d.ts | 4 + .../public/history/redirect_when_missing.d.ts | 36 + .../public/history/remove_query_param.d.ts | 2 + .../shared/kibana_utils/public/index.d.ts | 23 + .../shared/kibana_utils/public/plugin.d.ts | 12 + .../public/render_complete/index.d.ts | 1 + .../render_complete_dispatcher.d.ts | 23 + .../public/resize_checker/index.d.ts | 1 + .../public/resize_checker/resize_checker.d.ts | 26 + .../state_encoder/encode_decode_state.d.ts | 3 + .../state_management/state_encoder/index.d.ts | 1 + .../state_management/state_hash/index.d.ts | 1 + .../state_hash/state_hash.d.ts | 2 + .../public/state_management/url/errors.d.ts | 20 + .../state_management/url/hash_unhash_url.d.ts | 14 + .../public/state_management/url/index.d.ts | 6 + .../state_management/url/kbn_url_storage.d.ts | 115 ++ .../state_management/url/kbn_url_tracker.d.ts | 93 + .../state_management/url/url_tracker.d.ts | 11 + .../state_management/utils/diff_object.d.ts | 7 + .../kibana_utils/public/state_sync/index.d.ts | 24 + .../public/state_sync/state_sync.d.ts | 111 ++ .../create_kbn_url_state_storage.d.ts | 44 + .../create_session_storage_state_storage.d.ts | 18 + .../state_sync_state_storage/index.d.ts | 5 + .../state_sync_state_storage/types.d.ts | 29 + .../kibana_utils/public/state_sync/types.d.ts | 43 + .../hashed_item_store/hashed_item_store.d.ts | 22 + .../storage/hashed_item_store/index.d.ts | 3 + .../kibana_utils/public/storage/index.d.ts | 2 + .../kibana_utils/public/storage/storage.d.ts | 9 + .../kibana_utils/public/storage/types.d.ts | 12 + .../kibana_utils/public/theme/index.d.ts | 1 + .../public/theme/kibana_theme_provider.d.ts | 14 + .../kibana_utils/public/ui/configurable.d.ts | 36 + .../shared/kibana_utils/public/ui/index.d.ts | 1 + .../shared/management/common/contants.d.ts | 1 + .../shared/management/common/locator.d.ts | 15 + .../shared/management/public/application.d.ts | 3 + .../landing/classic_empty_prompt.d.ts | 6 + .../public/components/landing/index.d.ts | 1 + .../public/components/landing/landing.d.ts | 7 + .../landing/solution_empty_prompt.d.ts | 8 + .../components/management_app/index.d.ts | 2 + .../management_app/management_app.d.ts | 28 + .../management_app/management_context.d.ts | 8 + .../management_app/management_router.d.ts | 13 + .../management_app_wrapper/index.d.ts | 1 + .../management_app_wrapper.d.ts | 22 + .../components/management_sections.d.ts | 69 + .../management_sidebar_nav.d.ts | 11 + .../shared/management/public/index.d.ts | 7 + .../public/management_sections_service.d.ts | 13 + .../shared/management/public/plugin.d.ts | 40 + .../shared/management/public/types.d.ts | 110 ++ .../management/public/utils/breadcrumbs.d.ts | 7 + .../shared/management/public/utils/index.d.ts | 5 + .../public/utils/management_app.d.ts | 13 + .../public/utils/management_item.d.ts | 19 + .../public/utils/management_section.d.ts | 15 + .../screenshot_mode/common/constants.d.ts | 1 + .../screenshot_mode/common/context.d.ts | 20 + .../shared/screenshot_mode/common/index.d.ts | 3 + .../shared/screenshot_mode/common/mode.d.ts | 26 + .../shared/screenshot_mode/public/index.d.ts | 4 + .../shared/screenshot_mode/public/plugin.d.ts | 8 + .../shared/screenshot_mode/public/types.d.ts | 19 + .../share/common/anonymous_access/index.d.ts | 1 + .../share/common/anonymous_access/types.d.ts | 29 + .../shared/share/common/constants.d.ts | 2 + .../plugins/shared/share/common/index.d.ts | 3 + .../share/common/url_service/index.d.ts | 3 + .../common/url_service/locators/index.d.ts | 5 + .../locators/legacy_short_url_locator.d.ts | 10 + .../common/url_service/locators/locator.d.ts | 39 + .../url_service/locators/locator_client.d.ts | 46 + .../redirect/format_search_params.d.ts | 5 + .../url_service/locators/redirect/index.d.ts | 4 + .../redirect/parse_search_params.d.ts | 14 + .../locators/redirect/space_url_parser.d.ts | 1 + .../url_service/locators/redirect/types.d.ts | 27 + .../locators/short_url_assert_valid.d.ts | 1 + .../locators/short_url_redirect_locator.d.ts | 13 + .../common/url_service/locators/types.d.ts | 143 ++ .../url_service/locators/use_locator_url.d.ts | 4 + .../common/url_service/short_urls/index.d.ts | 1 + .../common/url_service/short_urls/types.d.ts | 103 ++ .../share/common/url_service/url_service.d.ts | 18 + .../draft_mode_callout.d.ts | 15 + .../common/draft_mode_callout/index.d.ts | 2 + .../public/components/context/index.d.ts | 146 ++ .../export_integrations.d.ts | 24 + .../components/export_integrations/index.d.ts | 1 + .../share/public/components/share_tabs.d.ts | 6 + .../components/tabs/embed/embed_content.d.ts | 8 + .../public/components/tabs/embed/index.d.ts | 7 + .../share/public/components/tabs/index.d.ts | 2 + .../public/components/tabs/link/index.d.ts | 8 + .../components/tabs/link/link_content.d.ts | 8 + .../tabs/link/time_type_section.d.ts | 12 + .../plugins/shared/share/public/index.d.ts | 14 + .../shared/share/public/lib/download_as.d.ts | 21 + .../share/public/lib/get_home_href.d.ts | 2 + .../share/public/lib/registrations.d.ts | 8 + .../shared/share/public/lib/time_utils.d.ts | 15 + .../plugins/shared/share/public/plugin.d.ts | 59 + .../shared/share/public/services/index.d.ts | 2 + .../public/services/share_menu_manager.d.ts | 38 + .../public/services/share_menu_registry.d.ts | 39 + .../plugins/shared/share/public/types.d.ts | 362 ++++ .../share/public/url_service/index.d.ts | 1 + .../redirect/components/empty_prompt.d.ts | 10 + .../url_service/redirect/components/page.d.ts | 14 + .../redirect/components/spinner.d.ts | 4 + .../public/url_service/redirect/index.d.ts | 1 + .../redirect/redirect_manager.d.ts | 19 + .../public/url_service/redirect/render.d.ts | 2 + .../short_urls/short_url_client.d.ts | 45 + .../short_urls/short_url_client_factory.d.ts | 10 + .../plugins/shared/share/server/config.d.ts | 13 + .../server/unused_urls_task/constants.d.ts | 5 + .../share/server/unused_urls_task/index.d.ts | 3 + .../register_delete_unused_urls_route.d.ts | 11 + .../register_unused_urls_task_routes.d.ts | 10 + .../share/server/unused_urls_task/task.d.ts | 40 + .../shared/ui_actions/common/trigger_ids.d.ts | 48 + .../ui_actions/public/actions/action.d.ts | 161 ++ .../public/actions/action_internal.d.ts | 30 + .../public/actions/create_action.d.ts | 2 + .../actions/incompatible_action_error.d.ts | 4 + .../ui_actions/public/actions/index.d.ts | 4 + .../build_eui_context_menu_panels.d.ts | 22 + .../ui_actions/public/context_menu/index.d.ts | 2 + .../context_menu/open_context_menu.d.ts | 44 + .../shared/ui_actions/public/index.d.ts | 12 + .../shared/ui_actions/public/plugin.d.ts | 16 + .../ui_actions/public/service/index.d.ts | 1 + .../service/ui_actions_execution_service.d.ts | 15 + .../public/service/ui_actions_service.d.ts | 42 + .../shared/ui_actions/public/services.d.ts | 6 + .../shared/ui_actions/public/triggers.d.ts | 4 + .../shared/ui_actions/public/types.d.ts | 47 + .../common/application_usage.d.ts | 5 + .../usage_collection/common/constants.d.ts | 4 + .../shared/usage_collection/common/index.d.ts | 1 + .../usage_collection/common/types/index.d.ts | 3 + .../common/types/stats/core_metrics.d.ts | 200 +++ .../common/types/stats/index.d.ts | 2 + .../common/types/stats/latest.d.ts | 2 + .../common/types/stats/v1.d.ts | 57 + .../common/types/ui_counters/index.d.ts | 2 + .../common/types/ui_counters/latest.d.ts | 1 + .../common/types/ui_counters/v1.d.ts | 36 + .../common/types/usage_counters/index.d.ts | 2 + .../common/types/usage_counters/latest.d.ts | 1 + .../common/types/usage_counters/v1.d.ts | 32 + .../public/components/index.d.ts | 2 + .../track_application_view/index.d.ts | 2 + .../track_application_view.d.ts | 11 + .../track_application_view_component.d.ts | 14 + .../track_application_view/types.d.ts | 17 + .../shared/usage_collection/public/index.d.ts | 6 + .../usage_collection/public/plugin.d.ts | 77 + .../public/services/application_usage.d.ts | 3 + .../public/services/create_reporter.d.ts | 11 + .../public/services/index.d.ts | 2 + .../server/collector/collector.d.ts | 14 + .../server/collector/collector_set.d.ts | 64 + .../collector/collector_stats/index.d.ts | 1 + .../collector/collector_stats/schema.d.ts | 3 + .../usage_collector_stats_collector.d.ts | 44 + .../server/collector/index.d.ts | 4 + .../server/collector/measure_duration.d.ts | 10 + .../server/collector/types.d.ts | 153 ++ .../server/collector/usage_collector.d.ts | 13 + .../usage_collection/server/config.d.ts | 17 + .../shared/usage_collection/server/index.d.ts | 7 + .../usage_collection/server/plugin.d.ts | 17 + .../usage_collection/server/report/index.d.ts | 2 + .../server/report/schema.d.ts | 34 + .../report/store_application_usage.d.ts | 7 + .../server/report/store_ui_report.d.ts | 10 + .../usage_collection/server/routes/index.d.ts | 24 + .../server/routes/stats/index.d.ts | 1 + .../server/routes/stats/stats.d.ts | 21 + .../server/routes/ui_counters.d.ts | 3 + .../usage_counters/common/kuery_utils.d.ts | 3 + .../server/usage_counters/index.d.ts | 7 + .../usage_counters/rollups/constants.d.ts | 12 + .../server/usage_counters/rollups/index.d.ts | 1 + .../rollups/register_rollups.d.ts | 9 + .../usage_counters/rollups/rollups.d.ts | 9 + .../server/usage_counters/saved_objects.d.ts | 41 + .../server/usage_counters/search/index.d.ts | 1 + .../server/usage_counters/search/search.d.ts | 3 + .../server/usage_counters/types.d.ts | 81 + .../server/usage_counters/usage_counter.d.ts | 36 + .../usage_counters_service.d.ts | 36 + .../kbn-alerting-state-types/index.d.ts | 7 + .../src/alert_instance.d.ts | 4 + .../src/lifecycle_state.d.ts | 45 + .../src/rule_task_instance.d.ts | 11 + .../src/task_state/index.d.ts | 374 ++++ .../src/task_state/lib/index.d.ts | 6 + .../src/task_state/v1/index.d.ts | 101 ++ .../src/task_state/v1/migration.d.ts | 12 + .../src/task_state/v1/schema.d.ts | 100 ++ .../src/task_state/v2/index.d.ts | 104 ++ .../src/task_state/v2/migration.d.ts | 5 + .../src/task_state/v2/schema.d.ts | 52 + .../src/task_state/v3/index.d.ts | 101 ++ .../src/task_state/v3/migration.d.ts | 5 + .../src/task_state/v3/schema.d.ts | 50 + .../index_management_shared_types/index.d.ts | 5 + .../src/constants.d.ts | 7 + .../src/home_sections.d.ts | 46 + .../src/index_templates.d.ts | 56 + .../src/services/extensions_service.d.ts | 45 + .../src/services/index.d.ts | 2 + .../src/services/public_api_service.d.ts | 31 + .../src/types.d.ts | 141 ++ .../shared/kbn-apm-types/es_fields.d.ts | 3 + .../shared/kbn-apm-types/es_schemas_raw.d.ts | 2 + .../shared/kbn-apm-types/es_schemas_ui.d.ts | 2 + .../packages/shared/kbn-apm-types/index.d.ts | 48 + .../kbn-apm-types/src/agent_explorer.d.ts | 16 + .../kbn-apm-types/src/aggregation_type.d.ts | 5 + .../shared/kbn-apm-types/src/annotations.d.ts | 9 + .../src/anomaly_detector_type.d.ts | 5 + .../shared/kbn-apm-types/src/apm_event.d.ts | 11 + .../shared/kbn-apm-types/src/apm_ml_job.d.ts | 26 + .../kbn-apm-types/src/apm_telemetry.d.ts | 254 +++ .../kbn-apm-types/src/apm_timeseries.d.ts | 64 + .../shared/kbn-apm-types/src/connections.d.ts | 56 + .../kbn-apm-types/src/container_type.d.ts | 1 + .../shared/kbn-apm-types/src/coordinate.d.ts | 5 + .../kbn-apm-types/src/correlations.d.ts | 100 ++ .../kbn-apm-types/src/custom_dashboards.d.ts | 11 + .../shared/kbn-apm-types/src/custom_link.d.ts | 25 + .../shared/kbn-apm-types/src/data_source.d.ts | 12 + .../shared/kbn-apm-types/src/diagnostics.d.ts | 13 + .../kbn-apm-types/src/document_type.d.ts | 11 + .../src/downstream_dependencies.d.ts | 17 + .../src/environment_filter_values.d.ts | 24 + .../kbn-apm-types/src/environment_rt.d.ts | 6 + .../shared/kbn-apm-types/src/errors.d.ts | 37 + .../kbn-apm-types/src/es_fields/apm.d.ts | 193 +++ .../kbn-apm-types/src/es_fields/common.d.ts | 1 + .../kbn-apm-types/src/es_fields/otel.d.ts | 12 + .../src/es_schemas/raw/apm_base_doc.d.ts | 18 + .../src/es_schemas/raw/error_raw.d.ts | 53 + .../src/es_schemas/raw/event_raw.d.ts | 17 + .../src/es_schemas/raw/fields/cloud.d.ts | 26 + .../src/es_schemas/raw/fields/container.d.ts | 6 + .../es_schemas/raw/fields/event_outcome.d.ts | 1 + .../src/es_schemas/raw/fields/faas.d.ts | 9 + .../src/es_schemas/raw/fields/host.d.ts | 9 + .../src/es_schemas/raw/fields/http.d.ts | 9 + .../src/es_schemas/raw/fields/index.d.ts | 18 + .../src/es_schemas/raw/fields/kubernetes.d.ts | 17 + .../src/es_schemas/raw/fields/observer.d.ts | 9 + .../src/es_schemas/raw/fields/otel/index.d.ts | 1 + .../raw/fields/otel/status_code.d.ts | 1 + .../src/es_schemas/raw/fields/page.d.ts | 3 + .../src/es_schemas/raw/fields/process.d.ts | 6 + .../src/es_schemas/raw/fields/server.d.ts | 4 + .../src/es_schemas/raw/fields/service.d.ts | 20 + .../src/es_schemas/raw/fields/span_links.d.ts | 12 + .../src/es_schemas/raw/fields/stackframe.d.ts | 33 + .../es_schemas/raw/fields/timestamp_us.d.ts | 3 + .../src/es_schemas/raw/fields/url.d.ts | 7 + .../src/es_schemas/raw/fields/user.d.ts | 3 + .../src/es_schemas/raw/fields/user_agent.d.ts | 13 + .../src/es_schemas/raw/index.d.ts | 6 + .../src/es_schemas/raw/metric_raw.d.ts | 100 ++ .../src/es_schemas/raw/span_raw.d.ts | 87 + .../src/es_schemas/raw/transaction_raw.d.ts | 81 + .../src/es_schemas/ui/apm_error.d.ts | 5 + .../src/es_schemas/ui/event.d.ts | 5 + .../src/es_schemas/ui/fields/agent.d.ts | 7 + .../src/es_schemas/ui/fields/index.d.ts | 1 + .../src/es_schemas/ui/index.d.ts | 5 + .../src/es_schemas/ui/metric.d.ts | 2 + .../kbn-apm-types/src/es_schemas/ui/span.d.ts | 5 + .../src/es_schemas/ui/transaction.d.ts | 11 + .../src/focused_trace_waterfall.d.ts | 6 + .../src/full_trace_waterfall.d.ts | 36 + .../shared/kbn-apm-types/src/ilm_types.d.ts | 14 + .../shared/kbn-apm-types/src/instances.d.ts | 10 + .../src/latency_aggregation_types.d.ts | 7 + .../src/latency_distribution.d.ts | 10 + .../src/latency_distribution_chart_types.d.ts | 9 + .../kbn-apm-types/src/mobile_types.d.ts | 7 + .../kbn-apm-types/src/processor_event.d.ts | 10 + .../shared/kbn-apm-types/src/rollup.d.ts | 6 + .../shared/kbn-apm-types/src/serverless.d.ts | 4 + .../kbn-apm-types/src/service_anomalies.d.ts | 10 + .../src/service_anomaly_stats.d.ts | 6 + .../src/service_anomaly_timeseries.d.ts | 18 + .../kbn-apm-types/src/service_groups.d.ts | 10 + .../src/service_health_status.d.ts | 6 + .../kbn-apm-types/src/service_inventory.d.ts | 2 + .../shared/kbn-apm-types/src/service_map.d.ts | 215 +++ .../src/service_map_diagnostic_types.d.ts | 48 + .../shared/kbn-apm-types/src/span_links.d.ts | 19 + .../src/storage_explorer_types.d.ts | 5 + .../src/time_range_metadata.d.ts | 8 + .../shared/kbn-apm-types/src/timeseries.d.ts | 41 + .../shared/kbn-apm-types/src/traces.d.ts | 80 + .../packages/shared/kbn-slo-schema/index.d.ts | 3 + .../shared/kbn-slo-schema/src/constants.d.ts | 1 + .../kbn-slo-schema/src/models/duration.d.ts | 23 + .../kbn-slo-schema/src/models/index.d.ts | 2 + .../kbn-slo-schema/src/models/pagination.d.ts | 10 + .../kbn-slo-schema/src/rest_specs/common.d.ts | 8 + .../kbn-slo-schema/src/rest_specs/index.d.ts | 4 + .../src/rest_specs/indicators.d.ts | 19 + .../src/rest_specs/routes/bulk_delete.d.ts | 28 + .../rest_specs/routes/bulk_purge_rollup.d.ts | 31 + .../composite_slo_batch_get.d.ts | 62 + .../composite_slo/composite_slo_create.d.ts | 75 + .../composite_slo/composite_slo_delete.d.ts | 7 + .../composite_slo/composite_slo_find.d.ts | 56 + .../composite_slo/composite_slo_get.d.ts | 61 + .../composite_slo_historical_summary.d.ts | 24 + .../composite_slo_summary_refresh.d.ts | 10 + .../composite_slo/composite_slo_update.d.ts | 56 + .../src/rest_specs/routes/create.d.ts | 642 +++++++ .../src/rest_specs/routes/delete.d.ts | 7 + .../rest_specs/routes/delete_instance.d.ts | 15 + .../routes/fetch_historical_summary.d.ts | 62 + .../src/rest_specs/routes/find.d.ts | 695 ++++++++ .../rest_specs/routes/find_definition.d.ts | 1339 +++++++++++++++ .../src/rest_specs/routes/find_group.d.ts | 64 + .../src/rest_specs/routes/find_instances.d.ts | 30 + .../src/rest_specs/routes/get.d.ts | 690 ++++++++ .../src/rest_specs/routes/get_burn_rates.d.ts | 25 + .../rest_specs/routes/get_grouped_stats.d.ts | 46 + .../rest_specs/routes/get_preview_data.d.ts | 653 +++++++ .../src/rest_specs/routes/get_slo_health.d.ts | 38 + .../routes/get_slo_stats_overview.d.ts | 21 + .../rest_specs/routes/get_suggestions.d.ts | 11 + .../src/rest_specs/routes/health_scan.d.ts | 80 + .../src/rest_specs/routes/index.d.ts | 34 + .../src/rest_specs/routes/manage.d.ts | 9 + .../rest_specs/routes/purge_instances.d.ts | 31 + .../src/rest_specs/routes/put_settings.d.ts | 28 + .../src/rest_specs/routes/repair.d.ts | 22 + .../src/rest_specs/routes/reset.d.ts | 649 +++++++ .../routes/search_slo_definitions.d.ts | 25 + .../src/rest_specs/routes/slo_templates.d.ts | 28 + .../src/rest_specs/routes/update.d.ts | 1278 ++++++++++++++ .../kbn-slo-schema/src/rest_specs/slo.d.ts | 674 ++++++++ .../kbn-slo-schema/src/schema/common.d.ts | 69 + .../src/schema/composite_slo.d.ts | 136 ++ .../schema/composite_slo_summary_index.d.ts | 35 + .../kbn-slo-schema/src/schema/duration.d.ts | 4 + .../kbn-slo-schema/src/schema/health.d.ts | 17 + .../kbn-slo-schema/src/schema/index.d.ts | 10 + .../kbn-slo-schema/src/schema/indicators.d.ts | 1518 +++++++++++++++++ .../kbn-slo-schema/src/schema/settings.d.ts | 19 + .../shared/kbn-slo-schema/src/schema/slo.d.ts | 1313 ++++++++++++++ .../src/schema/slo_template.d.ts | 633 +++++++ .../src/schema/time_window.d.ts | 20 + .../index.d.ts | 1 + .../src/uiam_api_key_provisioning_status.d.ts | 9 + .../response-ops/scheduling-types/index.d.ts | 1 + .../scheduling-types/schedule_types.d.ts | 55 + .../security/plugin_types_common/index.d.ts | 6 + .../src/api_keys/api_key.d.ts | 106 ++ .../src/authentication/index.d.ts | 1 + .../authorization/features_privileges.d.ts | 3 + .../src/authorization/index.d.ts | 3 + .../authorization/raw_kibana_privileges.d.ts | 11 + .../src/authorization/role.d.ts | 60 + .../src/licensing/index.d.ts | 2 + .../src/licensing/license.d.ts | 12 + .../src/licensing/license_features.d.ts | 69 + .../plugin_types_common/src/roles/index.d.ts | 13 + .../src/user_profile/index.d.ts | 1 + .../security/plugin_types_server/index.d.ts | 10 + .../src/audit/audit_service.d.ts | 29 + .../plugin_types_server/src/audit/index.d.ts | 2 + .../src/authentication/api_keys/api_keys.d.ts | 129 ++ .../src/authentication/api_keys/index.d.ts | 1 + .../authentication_service.d.ts | 10 + .../authentication/client_authentication.d.ts | 16 + .../src/authentication/index.d.ts | 4 + .../src/authorization/actions/actions.d.ts | 21 + .../src/authorization/actions/alerting.d.ts | 3 + .../src/authorization/actions/api.d.ts | 9 + .../src/authorization/actions/app.d.ts | 3 + .../src/authorization/actions/cases.d.ts | 3 + .../src/authorization/actions/index.d.ts | 8 + .../authorization/actions/saved_object.d.ts | 3 + .../src/authorization/actions/space.d.ts | 3 + .../src/authorization/actions/ui.d.ts | 4 + .../authorization/authorization_service.d.ts | 20 + .../src/authorization/check_privileges.d.ts | 123 ++ .../check_privileges_dynamically.d.ts | 4 + .../check_saved_objects_privileges.d.ts | 4 + .../src/authorization/constants.d.ts | 1 + .../src/authorization/deprecations.d.ts | 13 + .../src/authorization/es_security_config.d.ts | 5 + .../src/authorization/index.d.ts | 10 + .../src/authorization/mode.d.ts | 4 + .../src/authorization/role_schema.d.ts | 62 + .../plugin_types_server/src/plugin.d.ts | 45 + .../src/user_profile/index.d.ts | 1 + .../common/config_schema.d.ts | 33 + .../shared/apm_sources_access/public/api.d.ts | 7 + .../apm_sources_access/public/index.d.ts | 6 + .../apm_sources_access/public/plugin.d.ts | 28 + .../public/register_services.d.ts | 34 + .../apm_sources_access/server/config.d.ts | 6 + .../apm_sources_access/server/constants.d.ts | 3 + .../apm_sources_access/server/index.d.ts | 9 + .../apm_sources_access/server/plugin.d.ts | 59 + .../server/routes/index.d.ts | 29 + .../server/routes/settings.d.ts | 19 + .../server/saved_objects/apm_indices.d.ts | 26 + .../update_apm_oss_index_paths.d.ts | 13 + .../shared/cloud/common/constants.d.ts | 10 + .../shared/cloud/common/decode_cloud_id.d.ts | 8 + .../shared/cloud/common/is_cloud_enabled.d.ts | 1 + ...rse_deployment_id_from_deployment_url.d.ts | 1 + .../parse_onboarding_default_solution.d.ts | 9 + ...cloud_deployment_id_analytics_context.d.ts | 16 + .../plugins/shared/cloud/common/types.d.ts | 30 + .../plugins/shared/cloud/common/utils.d.ts | 1 + .../plugins/shared/cloud/public/index.d.ts | 5 + .../plugins/shared/cloud/public/plugin.d.ts | 52 + .../plugins/shared/cloud/public/types.d.ts | 287 ++++ .../plugins/shared/cloud/public/urls.d.ts | 25 + .../plugins/shared/cloud/public/utils.d.ts | 2 + .../shared/cloud/server/cloud_data/index.d.ts | 1 + .../server/cloud_data/persist_token.d.ts | 10 + .../collectors/cloud_usage_collector.d.ts | 28 + .../shared/cloud/server/collectors/index.d.ts | 1 + .../plugins/shared/cloud/server/config.d.ts | 44 + .../plugins/shared/cloud/server/env.d.ts | 1 + .../plugins/shared/cloud/server/index.d.ts | 5 + .../plugins/shared/cloud/server/plugin.d.ts | 206 +++ .../shared/cloud/server/routes/constants.d.ts | 1 + .../server/routes/elasticsearch_route.d.ts | 7 + .../server/routes/get_cloud_data_route.d.ts | 2 + .../shared/cloud/server/routes/index.d.ts | 9 + .../server/routes/set_cloud_data_route.d.ts | 2 + .../shared/cloud/server/routes/types.d.ts | 5 + .../cloud/server/saved_objects/index.d.ts | 4 + .../common/has_license_info_changed.d.ts | 6 + .../shared/licensing/common/license.d.ts | 40 + .../licensing/common/license_update.d.ts | 6 + .../register_analytics_context_provider.d.ts | 4 + .../licensing/public/expired_banner.d.ts | 8 + .../shared/licensing/public/index.d.ts | 4 + .../shared/licensing/public/plugin.d.ts | 56 + .../services/feature_usage_service.d.ts | 31 + .../licensing/public/services/index.d.ts | 2 + .../shared/licensing/public/types.d.ts | 41 + .../shared/licensing/server/index.d.ts | 7 + .../licensing/server/license_fetcher.d.ts | 9 + .../licensing/server/licensing_config.d.ts | 9 + .../licensing_route_handler_context.d.ts | 10 + .../server/on_pre_response_handler.d.ts | 4 + .../shared/licensing/server/plugin.d.ts | 39 + .../licensing/server/plugin_status.d.ts | 4 + .../server/routes/feature_usage.d.ts | 4 + .../shared/licensing/server/routes/index.d.ts | 5 + .../shared/licensing/server/routes/info.d.ts | 2 + .../server/routes/internal/index.d.ts | 2 + .../routes/internal/notify_feature_usage.d.ts | 2 + .../routes/internal/register_feature.d.ts | 3 + .../services/feature_usage_service.d.ts | 33 + .../licensing/server/services/index.d.ts | 2 + .../shared/licensing/server/types.d.ts | 81 + .../server/wrap_route_with_license_check.d.ts | 11 + .../services/log_sources_service/types.d.ts | 8 + .../services/log_sources_service/utils.d.ts | 2 + .../shared/logs_data_access/common/types.d.ts | 1 + .../components/logs_sources_setting.d.ts | 8 + .../public/hooks/use_log_sources.d.ts | 21 + .../shared/logs_data_access/public/index.d.ts | 7 + .../logs_data_access/public/plugin.d.ts | 15 + .../services/log_data_service/index.d.ts | 2 + .../log_data_service/log_data_service.d.ts | 6 + .../services/log_data_service/types.d.ts | 9 + .../services/log_sources_service/index.d.ts | 3 + .../public/services/register_services.d.ts | 12 + .../shared/logs_data_access/public/types.d.ts | 6 + .../shared/serverless/public/index.d.ts | 3 + .../serverless/public/navigation/index.d.ts | 1 + .../public/navigation/nav_cards.d.ts | 3 + .../shared/serverless/public/plugin.d.ts | 8 + .../shared/serverless/public/types.d.ts | 17 + .../shared/task_manager/common/constants.d.ts | 4 + .../shared/task_manager/common/index.d.ts | 1 + .../api_key_strategy/api_key_strategy.d.ts | 27 + .../create_api_key_strategy.d.ts | 4 + .../es_and_uiam_api_key_strategy.d.ts | 16 + .../api_key_strategy/es_api_key_strategy.d.ts | 12 + .../server/api_key_strategy/index.d.ts | 5 + .../server/buffered_task_store.d.ts | 19 + .../shared/task_manager/server/config.d.ts | 95 ++ .../shared/task_manager/server/constants.d.ts | 15 + .../shared/task_manager/server/index.d.ts | 21 + .../invalidate_api_keys_task.d.ts | 45 + .../invalidate_api_keys/lib/constants.d.ts | 1 + .../lib/get_api_key_ids_to_invalidate.d.ts | 27 + .../lib/get_find_filter.d.ts | 7 + .../server/invalidate_api_keys/lib/index.d.ts | 1 + .../lib/invalidate_api_keys.d.ts | 13 + .../invalidate_api_keys_and_delete_so.d.ts | 19 + .../lib/query_for_api_keys_in_use.d.ts | 10 + .../lib/run_invalidate.d.ts | 24 + .../delete_inactive_nodes_task.d.ts | 19 + .../kibana_discovery_service/index.d.ts | 1 + .../kibana_discovery_service.d.ts | 34 + .../server/lib/adhoc_task_counter.d.ts | 17 + .../server/lib/api_key_utils.d.ts | 23 + .../server/lib/assign_pod_partitions.d.ts | 14 + .../server/lib/bulk_operation_buffer.d.ts | 22 + .../server/lib/calculate_health_status.d.ts | 8 + .../server/lib/correct_deprecated_fields.d.ts | 3 + .../lib/create_managed_configuration.d.ts | 20 + .../server/lib/errors/bulk_update_error.d.ts | 14 + .../task_manager/server/lib/errors/index.d.ts | 3 + .../server/lib/errors/msearch_error.d.ts | 6 + .../errors/task_already_running_error.d.ts | 3 + .../server/lib/execution_context.d.ts | 16 + .../task_manager/server/lib/fill_pool.d.ts | 31 + .../server/lib/get_default_capacity.d.ts | 10 + .../lib/get_es_and_so_availability.d.ts | 9 + .../server/lib/get_execution_id.d.ts | 1 + .../server/lib/get_first_run_at.d.ts | 6 + .../server/lib/get_next_run_at.d.ts | 7 + .../task_manager/server/lib/get_retry_at.d.ts | 9 + .../server/lib/identify_es_error.d.ts | 29 + .../task_manager/server/lib/intervals.d.ts | 47 + .../server/lib/is_task_not_found_error.d.ts | 1 + .../server/lib/log_health_metrics.d.ts | 7 + .../task_manager/server/lib/middleware.d.ts | 20 + .../server/lib/millis_to_nanos.d.ts | 1 + .../server/lib/remove_if_exists.d.ts | 9 + .../task_manager/server/lib/result_type.d.ts | 23 + .../server/lib/retryable_bulk_update.d.ts | 15 + .../lib/runtime_statistics_aggregator.d.ts | 7 + .../server/lib/task_partitioner.d.ts | 25 + .../server/lib/wrapped_logger.d.ts | 7 + .../server/license_subscriber.d.ts | 10 + .../server/metrics/create_aggregator.d.ts | 17 + .../task_manager/server/metrics/index.d.ts | 15 + .../server/metrics/lib/counter.d.ts | 7 + .../metrics/lib/get_task_type_group.d.ts | 1 + .../server/metrics/lib/index.d.ts | 5 + .../metrics/lib/metric_counter_service.d.ts | 13 + .../server/metrics/lib/simple_histogram.d.ts | 21 + .../server/metrics/lib/unflatten_object.d.ts | 5 + .../server/metrics/metrics_stream.d.ts | 31 + .../task_claim_metrics_aggregator.d.ts | 26 + .../metrics/task_metrics_collector.d.ts | 32 + .../task_overdue_metrics_aggregator.d.ts | 28 + .../metrics/task_run_metrics_aggregator.d.ts | 53 + .../task_manager/server/metrics/types.d.ts | 7 + ...ackground_task_utilization_statistics.d.ts | 38 + .../monitoring/capacity_estimation.d.ts | 24 + .../monitoring/configuration_statistics.d.ts | 15 + .../task_manager/server/monitoring/index.d.ts | 21 + .../monitoring/monitoring_stats_stream.d.ts | 46 + .../monitoring/task_run_calculators.d.ts | 22 + .../monitoring/task_run_statistics.d.ts | 82 + .../monitoring/workload_statistics.d.ts | 202 +++ .../shared/task_manager/server/plugin.d.ts | 79 + .../polling/delay_on_claim_conflicts.d.ts | 6 + .../task_manager/server/polling/index.d.ts | 2 + .../server/polling/task_poller.d.ts | 44 + .../server/polling_lifecycle.d.ts | 74 + ...ate_task_overdue_percentiles_for_type.d.ts | 6 + .../mark_available_tasks_as_claimed.d.ts | 31 + .../queries/oldest_idle_action_task.d.ts | 7 + .../server/queries/query_clauses.d.ts | 42 + .../server/queries/task_claiming.d.ts | 77 + .../mark_removed_tasks_as_unrecognized.d.ts | 18 + .../routes/background_task_utilization.d.ts | 26 + .../task_manager/server/routes/health.d.ts | 42 + .../task_manager/server/routes/index.d.ts | 3 + .../task_manager/server/routes/metrics.d.ts | 17 + .../server/saved_objects/index.d.ts | 6 + .../server/saved_objects/mappings.d.ts | 4 + .../server/saved_objects/migrations.d.ts | 2 + .../api_key_to_invalidate_model_versions.d.ts | 2 + .../background_task_node_model_versions.d.ts | 2 + .../saved_objects/model_versions/index.d.ts | 3 + .../model_versions/task_model_versions.d.ts | 2 + .../schemas/api_key_to_invalidate.d.ts | 11 + .../schemas/background_task_node.d.ts | 6 + .../saved_objects/schemas/rrule/index.d.ts | 3 + .../saved_objects/schemas/rrule/v1.d.ts | 69 + .../saved_objects/schemas/rrule/v2.d.ts | 111 ++ .../saved_objects/schemas/rrule/v3.d.ts | 85 + .../server/saved_objects/schemas/task.d.ts | 895 ++++++++++ .../shared/task_manager/server/task.d.ts | 414 +++++ .../server/task_claimers/index.d.ts | 37 + .../task_claimers/lib/get_task_cost.d.ts | 3 + .../lib/task_selector_by_capacity.d.ts | 10 + .../server/task_claimers/strategy_mget.d.ts | 3 + .../strategy_update_by_query.d.ts | 2 + .../task_manager/server/task_events.d.ts | 70 + .../server/task_pool/cost_capacity.d.ts | 23 + .../task_manager/server/task_pool/index.d.ts | 2 + .../server/task_pool/task_pool.d.ts | 72 + .../task_manager/server/task_pool/types.d.ts | 16 + .../task_manager/server/task_pool/utils.d.ts | 2 + .../server/task_pool/worker_capacity.d.ts | 23 + .../server/task_running/errors.d.ts | 18 + .../server/task_running/index.d.ts | 2 + .../server/task_running/task_runner.d.ts | 219 +++ .../task_manager/server/task_scheduling.d.ts | 88 + .../task_manager/server/task_store.d.ts | 251 +++ .../server/task_type_dictionary.d.ts | 91 + .../task_manager/server/task_validator.d.ts | 28 + .../uiam_api_key_provisioning/constants.d.ts | 26 + .../event_based_telemetry.d.ts | 12 + .../uiam_api_key_provisioning/index.d.ts | 6 + .../lib/build_provisioning_run_telemetry.d.ts | 13 + ...ld_saved_object_bulk_updates_for_uiam.d.ts | 28 + .../lib/classify_task.d.ts | 30 + .../lib/create_provisioning_run_context.d.ts | 9 + .../create_uiam_provisioning_task_runner.d.ts | 27 + .../lib/deferred_non_running_tasks_query.d.ts | 16 + .../lib/error_utils.d.ts | 2 + ...fetch_first_batch_of_tasks_to_convert.d.ts | 19 + .../lib/get_exclude_tasks_filter.d.ts | 10 + ..._uiam_convert_response_to_key_results.d.ts | 7 + ...us_and_orphaned_keys_from_bulk_update.d.ts | 23 + ...iam_provisioning_observability_status.d.ts | 52 + ...m_provisioning_feature_flag_scheduler.d.ts | 16 + .../uiam_api_key_provisioning/task_state.d.ts | 24 + .../uiam_api_key_provisioning/types.d.ts | 95 ++ .../uiam_api_key_provisioning_task.d.ts | 35 + ...keys_provisioning_status_saved_object.d.ts | 19 + .../task_manager/server/usage/index.d.ts | 1 + .../usage/task_manager_usage_collector.d.ts | 7 + .../task_manager/server/usage/types.d.ts | 13 + 2112 files changed, 55800 insertions(+) create mode 100644 src/platform/packages/private/analytics/utils/analytics_collection_utils/index.d.ts create mode 100644 src/platform/packages/private/analytics/utils/analytics_collection_utils/src/index.d.ts create mode 100644 src/platform/packages/private/analytics/utils/analytics_collection_utils/src/is_synthetics_monitor.d.ts create mode 100644 src/platform/packages/private/kbn-cps-common/index.d.ts create mode 100644 src/platform/packages/private/kbn-cps-common/src/common/constants.d.ts create mode 100644 src/platform/packages/private/kbn-cps-common/src/common/get_space_default_npre_name.d.ts create mode 100644 src/platform/packages/private/kbn-panel-loader/index.d.ts create mode 100644 src/platform/packages/private/kbn-saved-objects-settings/index.d.ts create mode 100644 src/platform/packages/shared/content-management/favorites/favorites_common/index.d.ts create mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/index.d.ts create mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_registry.d.ts create mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.d.ts create mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_saved_object.d.ts create mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_service.d.ts create mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_usage_collection.d.ts create mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/index.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/index.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/constants.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/disabled_footer.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/index.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/install_footer.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/remove_footer.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/view_button.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/hooks/index.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/hooks/poll_sample_data_status.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/hooks/use_install.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/hooks/use_remove.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/mocks/index.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/sample_data_card.component.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/sample_data_card.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_card/src/services.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_tab/index.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_tab/src/constants.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_tab/src/demo_env_panel.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_tab/src/hooks/index.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_tab/src/hooks/use_list.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_tab/src/sample_data_cards.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_tab/src/sample_data_tab.d.ts create mode 100644 src/platform/packages/shared/home/sample_data_tab/src/services.d.ts create mode 100644 src/platform/packages/shared/kbn-apm-types-shared/index.d.ts create mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/enums/index.d.ts create mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/enums/processor_event.d.ts create mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/correlations.d.ts create mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/index.d.ts create mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/types/common.d.ts create mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/types/index.d.ts create mode 100644 src/platform/packages/shared/kbn-content-management-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-content-management-utils/src/saved_object_content_storage.d.ts create mode 100644 src/platform/packages/shared/kbn-content-management-utils/src/schema.d.ts create mode 100644 src/platform/packages/shared/kbn-content-management-utils/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-content-management-utils/src/utils.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/cps_icon.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_list_item.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_picker.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_picker_container.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_picker_content.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_picker_settings.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/strings.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/use_cps_picker_access.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/use_fetch_projects.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/use_project_picker_tour.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/components/use_route_based_cps_picker_access.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-cps-utils/types.d.ts create mode 100644 src/platform/packages/shared/kbn-css-utils/public/full_screen_bg_css.d.ts create mode 100644 src/platform/packages/shared/kbn-css-utils/public/use_memo_css.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service-server/index.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service-server/src/refresh_interval.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service-server/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service/index.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service/src/constants.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service/src/es_query/get_es_query_config.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service/src/es_query/index.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service/src/search/tabify/index.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service/src/search/tabify/tabify_docs.d.ts create mode 100644 src/platform/packages/shared/kbn-data-service/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/constants.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/utils/create_regexp_pattern_from.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/utils/get_data_view_field_or_create.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/utils/test_pattern_against_allowed_list.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-validation/index.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-validation/src/constants.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-validation/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-data-view-validation/src/validation.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/app_menu_registry.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/types.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/degraded_docs_control.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/stacktrace_control.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/types.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/error_callout.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/constants.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/apm_context_service.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/errors/errors_context_service.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/log_level_badge.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/constants.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/logs_context_service.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/apache_error_logs.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/default_logs.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/kubernetes_container_logs.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_all_logs_data_view_spec.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_resource_fields.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_fields.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_coalesed_value.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/types.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/traces_context_service.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/types.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/field_constants.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/hooks/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/hooks/use_pager.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/build_data_record.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/calc_field_counts.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/contains_index_pattern.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/convert_value_to_string.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/dismiss_flyouts.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_doc_id.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_esql_data_view.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value_with_fallback.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_flattened_fields.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_ignored_reason.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_document_overview.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_event_type_field_with_fallback.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_exception_type_field_with_fallback.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_field_with_fallback.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_level_field_with_fallback.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_message_field_with_fallbacks.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_should_show_field_handler.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_stack_trace_fields.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_trace_document_overview.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_visible_columns.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/is_esql_saved_search.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/local_storage_utils.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/nested_fields.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/prepare_data_view_for_editing.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_default_sort.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_es_query_sort.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort_for_search_source.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/index.d.ts create mode 100644 src/platform/packages/shared/kbn-discover-utils/types.d.ts create mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_guards.d.ts create mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_ingestion_path.d.ts create mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_names.d.ts create mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_sdk_name_and_language.d.ts create mode 100644 src/platform/packages/shared/kbn-encrypted-saved-objects-shared/index.d.ts create mode 100644 src/platform/packages/shared/kbn-encrypted-saved-objects-shared/src/encrypted_saved_objects_client_types.d.ts create mode 100644 src/platform/packages/shared/kbn-es-types/index.d.ts create mode 100644 src/platform/packages/shared/kbn-es-types/src/index.d.ts create mode 100644 src/platform/packages/shared/kbn-es-types/src/search.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/constants.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/index.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_limit.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_metrics_info.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_stats_by.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_where.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/utils.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/build_rename_source_field_map.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/columns.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/datasets.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/extensions.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/index.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/inference.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/lookup_indices.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/policies.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/sources.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/timeseries_indices.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/utils/cache.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/views.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/index.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/utils.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/convert_filters_to_esql.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/convert_query_to_esql.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/esql_fields_utils.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/extract_categorize_tokens.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_adhoc_dataview.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_controls.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_time_field_from_query.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_with_safe_limit.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_index_pattern_from_query.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_initial_esql_query.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_lookup_indices.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_query_summary.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/inject_where_after_source.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/query_cannot_be_sampled.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/replace_index_pattern.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/sanitaze_input.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/set_instructions_helpers.d.ts create mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/sha256.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/index.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/index.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/arg.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/ast.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/compare.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/from_expression.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/index.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/patch.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/safe_element_from_expression.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/to_expression.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/cast.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/fn.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/get_by_alias.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/get_type.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/parse.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/registry.d.ts create mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/registries.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/array_to_string_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/date_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/datemath_string_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/decode_or_throw.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/deep_exact_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/in_range_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/index_pattern_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/is_greater_or_equal/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_secs_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/json_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/literal_value_from_undefined_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/merge_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/non_empty_string_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/parseable_types/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/route_validation/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/strict_keys_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/time_key_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/to_boolean_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/to_json_schema/index.d.ts create mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/to_number_rt/index.d.ts create mode 100644 src/platform/packages/shared/kbn-management/autoops_promotion_callout/index.d.ts create mode 100644 src/platform/packages/shared/kbn-management/autoops_promotion_callout/src/callout.d.ts create mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/index.d.ts create mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/src/cards_navigation.d.ts create mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/src/consts.d.ts create mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/src/index.d.ts create mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-management/settings/setting_ids/index.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning-utils/lib/validate_version.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning/index.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_schemas.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_versioning.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/content_management_types.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/index.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/object_transform.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/types.d.ts create mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/utils.d.ts create mode 100644 src/platform/packages/shared/kbn-react-query/index.d.ts create mode 100644 src/platform/packages/shared/kbn-resizable-layout/index.d.ts create mode 100644 src/platform/packages/shared/kbn-resizable-layout/src/panels_resizable.d.ts create mode 100644 src/platform/packages/shared/kbn-resizable-layout/src/panels_static.d.ts create mode 100644 src/platform/packages/shared/kbn-resizable-layout/src/resizable_layout.d.ts create mode 100644 src/platform/packages/shared/kbn-resizable-layout/src/utils.d.ts create mode 100644 src/platform/packages/shared/kbn-resizable-layout/types.d.ts create mode 100644 src/platform/packages/shared/kbn-rison/index.d.ts create mode 100644 src/platform/packages/shared/kbn-rison/kbn_rison.d.ts create mode 100644 src/platform/packages/shared/kbn-rrule/index.d.ts create mode 100644 src/platform/packages/shared/kbn-rrule/rrule.d.ts create mode 100644 src/platform/packages/shared/kbn-rrule/sanitize.d.ts create mode 100644 src/platform/packages/shared/kbn-rrule/types.d.ts create mode 100644 src/platform/packages/shared/kbn-rrule/validate.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_constants.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_locator_params.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.d.ts create mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.d.ts create mode 100644 src/platform/packages/shared/kbn-search-errors/index.d.ts create mode 100644 src/platform/packages/shared/kbn-search-errors/src/create_es_error.d.ts create mode 100644 src/platform/packages/shared/kbn-search-errors/src/es_error.d.ts create mode 100644 src/platform/packages/shared/kbn-search-errors/src/painless_error.d.ts create mode 100644 src/platform/packages/shared/kbn-search-errors/src/render_search_error.d.ts create mode 100644 src/platform/packages/shared/kbn-search-errors/src/tsdb_error.d.ts create mode 100644 src/platform/packages/shared/kbn-search-errors/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/index.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge_popover_content.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/callout.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/empty_prompt.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/i18n_utils.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/index.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/view_details_popover.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/extract_warnings.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/handle_warnings.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/has_unsupported_downsampled_aggregation_failure.d.ts create mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-search-types/index.d.ts create mode 100644 src/platform/packages/shared/kbn-search-types/src/es_search_types.d.ts create mode 100644 src/platform/packages/shared/kbn-search-types/src/kibana_search_types.d.ts create mode 100644 src/platform/packages/shared/kbn-search-types/src/types.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository-utils/index.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository-utils/src/format_request.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository-utils/src/parse_endpoint.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository-utils/src/typings.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository/index.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/create_server_route_factory.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/decode_request_params.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/make_zod_validation_object.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/register_routes.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/strip_nullish_request_parameters.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/validate_and_decode_params.d.ts create mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/validation_objects.d.ts create mode 100644 src/platform/packages/shared/kbn-sse-utils-server/index.d.ts create mode 100644 src/platform/packages/shared/kbn-sse-utils-server/src/observable_into_event_source_stream.d.ts create mode 100644 src/platform/packages/shared/kbn-sse-utils-server/src/supertest_to_observable.d.ts create mode 100644 src/platform/packages/shared/kbn-ui-actions-browser/src/types/index.d.ts create mode 100644 src/platform/packages/shared/kbn-ui-actions-browser/src/types/presentable.d.ts create mode 100644 src/platform/packages/shared/kbn-use-tracked-promise/index.d.ts create mode 100644 src/platform/packages/shared/kbn-use-tracked-promise/use_tracked_promise.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/constants.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/index.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_override_hover_actions.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_panel.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_section.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_focus_panel.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/child_state.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/children_unsaved_changes.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/initialize_state_api.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/last_saved_child_state.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_capabilities.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_management.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/performance_trackers.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/presentation_container.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/publishes_settings.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/applies_filters.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/bwc/time_range_transforms.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch_context.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_pause_fetch.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_project_routing.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/time_range_manager.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_read_only_capabilities.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_serializable_state.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/bwc/titles_transforms.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_description.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_hide_border.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_title.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/title_manager.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/index.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_comparators.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_diff_logger.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_manager.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/types.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/utils/snake_case.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_publishing/utils/types.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_util/index.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_util/src/focus_helpers.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_util/src/loading_flyout.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_util/src/open_lazy_flyout.d.ts create mode 100644 src/platform/packages/shared/presentation/presentation_util/src/tracks_overlays.d.ts create mode 100644 src/platform/packages/shared/react/kibana_mount/index.d.ts create mode 100644 src/platform/packages/shared/react/kibana_mount/mount_point_portal.d.ts create mode 100644 src/platform/packages/shared/react/kibana_mount/to_mount_point.d.ts create mode 100644 src/platform/packages/shared/react/kibana_mount/utils.d.ts create mode 100644 src/platform/packages/shared/shared-ux/avatar/solution/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/avatar/solution/src/solution_avatar.d.ts create mode 100644 src/platform/packages/shared/shared-ux/avatar/solution/src/types.d.ts create mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/src/elastic_agent_card_illustration.d.ts create mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.component.d.ts create mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.d.ts create mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/src/services.d.ts create mode 100644 src/platform/packages/shared/shared-ux/card/no_data/types/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/code_editor.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/editor.styles.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/components/rebroadcast_mouse_down_events.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_context_menu_utils.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_copy.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fit_content.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fullscreen.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_placeholder.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/editor.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/languages/supported.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/utils/placeholder_widget.d.ts create mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/utils/remeasure_fonts.d.ts create mode 100644 src/platform/packages/shared/shared-ux/link/redirect_app/impl/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/deprecated_redirect_app_links.component.d.ts create mode 100644 src/platform/packages/shared/shared-ux/modal/tabbed/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/modal/tabbed/src/context/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/modal/tabbed/src/tabbed_modal.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/impl/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/services.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/types/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data/impl/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data/impl/src/action_card.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data/impl/src/no_data_page.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data/impl/src/services.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data/types/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/impl/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/constants.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/no_data_config_page.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/services.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/types/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/src/collapse_button.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/src/solution_nav.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.d.ts create mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.styles.d.ts create mode 100644 src/platform/packages/shared/shared-ux/prompt/not_found/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/prompt/not_found/src/not_found_prompt.d.ts create mode 100644 src/platform/packages/shared/shared-ux/table_persist/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/constants.d.ts create mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/index.d.ts create mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/storage.d.ts create mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/table_persist_hoc.d.ts create mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/types.d.ts create mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/use_table_persist.d.ts create mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/validate_persist_data.d.ts create mode 100644 src/platform/plugins/private/url_forwarding/public/forward_app/forward_app.d.ts create mode 100644 src/platform/plugins/private/url_forwarding/public/forward_app/index.d.ts create mode 100644 src/platform/plugins/private/url_forwarding/public/forward_app/navigate_to_legacy_kibana_url.d.ts create mode 100644 src/platform/plugins/private/url_forwarding/public/forward_app/normalize_path.d.ts create mode 100644 src/platform/plugins/private/url_forwarding/public/index.d.ts create mode 100644 src/platform/plugins/private/url_forwarding/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/constants.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/bulk_get.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/common.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/constants.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/create.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/delete.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/get.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/msearch.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/rpc.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/search.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/types.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/rpc/update.d.ts create mode 100644 src/platform/plugins/shared/content_management/common/schemas.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/content_client/content_client.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/content_client/content_client_context.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/content_client/content_client_mutation_hooks.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/content_client/content_client_query_hooks.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/content_client/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/content_client/query_observable.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/crud_client/crud_client.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/crud_client/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/registry/content_type.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/registry/content_type_definition.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/registry/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/registry/registry.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/rpc_client/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/rpc_client/rpc_client.d.ts create mode 100644 src/platform/plugins/shared/content_management/public/types.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/content_client/content_client.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/content_client/content_client_factory.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/content_client/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/content_client/types.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/content_type.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/core.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/crud.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/event_bus.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/event_types.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/msearch.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/registry.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/core/types.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/plugin.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/all_procedures.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/bulk_get.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/create.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/delete.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/get.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/msearch.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/search.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/update.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/routes/error_wrapper.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/routes/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/routes/routes.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/rpc_service.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/rpc/types.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/types.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/utils/index.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/utils/services_transforms_factory.d.ts create mode 100644 src/platform/plugins/shared/content_management/server/utils/utils.d.ts create mode 100644 src/platform/plugins/shared/cps/public/index.d.ts create mode 100644 src/platform/plugins/shared/cps/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/cps/public/services/async_services.d.ts create mode 100644 src/platform/plugins/shared/cps/public/services/cps_manager.d.ts create mode 100644 src/platform/plugins/shared/cps/public/services/project_fetcher.d.ts create mode 100644 src/platform/plugins/shared/cps/public/types.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/common/index.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/common/language_integrations.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/server/custom_integration_registry.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/server/external_integration/index.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/server/index.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/server/language_clients/index.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/server/plugin.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/server/routes/define_routes.d.ts create mode 100644 src/platform/plugins/shared/custom_integrations/server/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/constants.d.ts create mode 100644 src/platform/plugins/shared/data/common/datatable_utilities/datatable_utilities_service.d.ts create mode 100644 src/platform/plugins/shared/data/common/datatable_utilities/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/es_query/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/exports/constants.d.ts create mode 100644 src/platform/plugins/shared/data/common/exports/escape_value.d.ts create mode 100644 src/platform/plugins/shared/data/common/exports/export_csv.d.ts create mode 100644 src/platform/plugins/shared/data/common/exports/formula_checks.d.ts create mode 100644 src/platform/plugins/shared/data/common/exports/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/kbn_field_types/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/kbn_field_types/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/filters/persistable_state.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/is_query.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/persistable_state.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/query_state.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast_with_validation.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/timefilter/get_time.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/timefilter/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/timefilter/is_time_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/timefilter/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/query/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_config.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_configs.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_groups.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_params.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_type.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_types_registry.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/aggs_service.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/_interval_options.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_order_helper.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_other_bucket_helper.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_type.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_histogram.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/filters.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/histogram.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_prefix.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/multi_terms.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/terms.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/date_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/date_range_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/filter_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/filters.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/filters_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/histogram.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/histogram_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/cidr_mask.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/date_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/histogram_calculate_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_prefix.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/migrate_include_exclude_format.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/multi_field_key.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/range_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/range_key.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/sampler.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/sampler_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/terms.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/terms_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/time_series.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/time_series_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/avg.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/avg_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/count.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/count_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/derivative.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/derivative_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/create_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/get_response_agg_config_class.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/make_nested_label.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/nested_agg_helpers.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/ordinal_suffix.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_writer.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_writer.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/max.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/max_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/median.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/median_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_type.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/min.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/min_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_get_value.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/rate.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/rate_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/sum.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/sum_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/value_count.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/value_count_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/agg.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/base.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/field.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/json.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/optioned.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/string.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/calculate_auto_time_expression.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_interval_format_error.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_multiple.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_interval.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/get_aggs_formats.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/infer_time_zone.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/ip_address.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/parse_time_shift.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/prop_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/sampler.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/time_splits.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/aggregate_query_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/cidr.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/cidr_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/date_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/date_range_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/eql.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/eql_raw_response.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/es_raw_response.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/esaggs/esaggs_fn.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/esaggs/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/esaggs/request_handler.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/esdsl.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/esql.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/essql.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/exists_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/extended_bounds.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/extended_bounds_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/field.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/filters_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/geo_point.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/geo_point_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/ip_prefix.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/ip_prefix_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/ip_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/ip_range_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/kibana.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/kibana_context.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/kibana_context_type.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/kibana_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/kql.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/lucene.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/numerical_range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/numerical_range_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/phrase_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/query_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/query_filter_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/query_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/range.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/range_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/remove_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/select_filter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/timerange.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/timerange_to_ast.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/utils/filters_adapter.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/utils/function_wrapper.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/utils/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/expressions/utils/requests_side_effects.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/poll_search.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/create_search_source.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/extract_references.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/fetch/get_search_params.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/fetch/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/fetch/request_error.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/fetch/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/inject_references.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/inspect/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/inspect/inspector_stats.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/migrate_legacy_query.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/normalize_sort_request.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/parse_json.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/query_to_fields.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/search_source.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/search_source_service.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/search_source/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/session/ebt_utils.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/session/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/session/status.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/session/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/eql_search/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/eql_search/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/es_search/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/es_search/response_utils.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/es_search/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/ese_search/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/ese_search/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/esql_search/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/esql_search/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/sql_search/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/strategies/sql_search/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/tabify/buckets.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/tabify/get_columns.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/tabify/index.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/tabify/response_writer.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/tabify/tabify.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/tabify/types.d.ts create mode 100644 src/platform/plugins/shared/data/common/search/utils.d.ts create mode 100644 src/platform/plugins/shared/data/common/serializable_field.d.ts create mode 100644 src/platform/plugins/shared/data/common/serialize_utils.d.ts create mode 100644 src/platform/plugins/shared/data/common/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/actions/filters/create_filters_from_multi_value_click.d.ts create mode 100644 src/platform/plugins/shared/data/public/actions/filters/create_filters_from_range_select.d.ts create mode 100644 src/platform/plugins/shared/data/public/actions/filters/create_filters_from_value_click.d.ts create mode 100644 src/platform/plugins/shared/data/public/actions/filters/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/actions/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/actions/multi_value_click_action.d.ts create mode 100644 src/platform/plugins/shared/data/public/actions/select_range_action.d.ts create mode 100644 src/platform/plugins/shared/data/public/actions/value_click_action.d.ts create mode 100644 src/platform/plugins/shared/data/public/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/now_provider/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.d.ts create mode 100644 src/platform/plugins/shared/data/public/now_provider/lib/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/now_provider/now_provider.d.ts create mode 100644 src/platform/plugins/shared/data/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/filter_manager.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_filters.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_mapping_chain.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/get_display_value.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/get_index_pattern_from_filter.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/map_and_flatten_filters.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/map_filter.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_combined.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_default.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_exists.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_match_all.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrase.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_query_string.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_spatial_filter.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/sort_filters.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/lib/add_to_query_log.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/lib/get_default_query.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/lib/get_query_log.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/lib/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/persisted_log/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/persisted_log/persisted_log.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/query_service.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/query_state.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/query_string/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/query_string/query_string_manager.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/saved_query/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/saved_query/saved_query_service.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/saved_query/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/state_sync/connect_to_query_state.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/state_sync/create_query_state_observable.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/state_sync/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/state_sync/sync_state_with_url.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/state_sync/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/lib/auto_refresh_loop.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/lib/diff_time_picker_vals.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/lib/page_visibility.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/lib/validate_timerange.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/time_history.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/timefilter.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/timefilter_service.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/query/timefilter/use_timefilter.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/aggs/aggs_service.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/aggs/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/aggs/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/collectors/create_usage_collector.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/collectors/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/collectors/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/constants.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/expressions/eql.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/expressions/esaggs.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/expressions/esdsl.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/expressions/esql.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/expressions/essql.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/expressions/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/create_request_hash.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/search_abort_controller.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/search_response_cache.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/search_session_incomplete_warning.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/timeout_error.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/to_partial_response.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/search_service.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/background_search_notifier.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/constants.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/ebt_manager/constants.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/ebt_manager/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager_registrations.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/get_session_redirect_url.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/i18n.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/in_progress_session.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/lib/session_name_formatter.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/search_session_state.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/session_helpers.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/session_service.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_client.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/render.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/inspect_flyout.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/main.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/status.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/delete_button.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/extend_button.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/get_action.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/inspect_button.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/popover_actions.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/actions.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/app_id.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/get_columns.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/name.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/status.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/table.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_actions.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_app_filter.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_status_filter.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/map_to_ui_session.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/constants.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/flyout.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_columns.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_flyout.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/date_string.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/get_expiration_status.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/search/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/services.d.ts create mode 100644 src/platform/plugins/shared/data/public/types.d.ts create mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.d.ts create mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table_selector.d.ts create mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view.d.ts create mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view_wrapper.d.ts create mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/download_options.d.ts create mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/index.d.ts create mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/types.d.ts create mode 100644 src/platform/plugins/shared/data/server/config.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/constants.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/content_management/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/content_management/v1/constants.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/content_management/v1/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/content_management/v1/types.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/data_view.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/data_view_lazy.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/data_view_lazy_util.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/data_views.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/flatten_hit.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/meta_units_to_formatter.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/persistable_state.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/data_views/utils.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/errors/data_view_saved_object_conflict.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/errors/duplicate_index_pattern.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/errors/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/errors/insufficient_access.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/expressions/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/expressions/load_index_pattern.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/fields/data_view_field.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/fields/field_list.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/fields/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/fields/utils.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/lib/errors.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/lib/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/types.d.ts create mode 100644 src/platform/plugins/shared/data_views/common/utils.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/content_management_wrapper.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/data_views/data_views_api_client.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/data_views/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/data_views/sha256.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/data_views_service_public.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/debounce_by_key.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/expressions/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/expressions/load_index_pattern.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/services/get_indices.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/services/has_data.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/services/index.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/types.d.ts create mode 100644 src/platform/plugins/shared/data_views/public/ui_settings_wrapper.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/ast/build_expression.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/ast/build_function.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/ast/format.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/ast/format_expression.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/ast/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/ast/parse.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/ast/parse_expression.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/ast/types.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/execution/container.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/execution/execution.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/execution/execution_contract.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/execution/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/execution/types.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/executor/container.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/executor/executor.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/executor/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/arguments.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/expression_function.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/expression_function_parameter.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/series_calculation_helpers.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/clog.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/create_table.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum_fn.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative_fn.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/font.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/map_column.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/math.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/math_column.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/math_fn.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average_fn.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric_fn.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/theme.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/ui_setting.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/var.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/var_set.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/types.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer_registry.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_renderers/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_renderers/types.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/expression_type.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/get_type.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/serialize_provider.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/boolean.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/error.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/filter.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/image.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/null.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/num.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/number.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/pointseries.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/range.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/render.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/shape.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/string.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/style.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/ui_setting.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/types.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/expression_types/unbox_expression_value.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/fonts.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/service/expressions_fork.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/service/expressions_services.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/service/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/types/common.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/types/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/types/registry.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/types/style.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/util/create_default_inspector_adapters.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/util/create_error.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/util/expressions_inspector_adapter.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/util/get_by_alias.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/util/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/util/tables_adapter.d.ts create mode 100644 src/platform/plugins/shared/expressions/common/util/test_utils.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/expression_functions/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/expression_functions/ui_setting.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/loader.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/react_expression_renderer.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/use_debounced_value.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/use_shallow_memo.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer_wrapper.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/render.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/render_error_handler.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/services/expressions_services.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/services/index.d.ts create mode 100644 src/platform/plugins/shared/expressions/public/types/index.d.ts create mode 100644 src/platform/plugins/shared/home/common/constants.d.ts create mode 100644 src/platform/plugins/shared/home/common/instruction_variant.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/application.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/add_data/add_data.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/add_data/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/app_navigation_handler.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/home.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/home_app.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/manage_data/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/manage_data/manage_data.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/move_data/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/move_data/move_data.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/sample_data/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/callout_skeleton.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/setup_cloud_connect.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/solutions_section/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/solutions_section/solution_panel.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/solutions_section/solutions_section.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/synopsis.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/content.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/footer.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/instruction.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/instruction_set.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/introduction.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/status_check_states.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/tutorial.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial_directory.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/components/welcome.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/kibana_services.d.ts create mode 100644 src/platform/plugins/shared/home/public/application/load_tutorials.d.ts create mode 100644 src/platform/plugins/shared/home/public/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/add_data/add_data_service.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/add_data/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/environment/environment.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/environment/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/feature_catalogue/feature_catalogue_registry.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/feature_catalogue/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/tutorials/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/tutorials/tutorial_service.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/tutorials/types.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/welcome/index.d.ts create mode 100644 src/platform/plugins/shared/home/public/services/welcome/welcome_service.d.ts create mode 100644 src/platform/plugins/shared/home/server/capabilities_provider.d.ts create mode 100644 src/platform/plugins/shared/home/server/config.d.ts create mode 100644 src/platform/plugins/shared/home/server/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/plugin.d.ts create mode 100644 src/platform/plugins/shared/home/server/routes/fetch_es_hits_status.d.ts create mode 100644 src/platform/plugins/shared/home/server/routes/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/saved_objects/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/saved_objects/sample_data_telemetry.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/field_mappings.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/saved_objects.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/field_mappings.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/saved_objects.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/field_mappings.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/saved_objects.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/field_mappings.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/saved_objects.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/errors.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/create_index_name.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/find_sample_objects.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/insert_data_into_index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/load_data.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/register_with_integrations.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_schema.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/translate_timestamp.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/utils.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/install.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/list.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/uninstall.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/utils.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/sample_data_installer.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/sample_data_registry.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/usage/collector.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/usage/collector_fetch.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/usage/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/sample_data/usage/usage.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/tutorials/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/tutorials/lib/tutorials_registry_types.d.ts create mode 100644 src/platform/plugins/shared/home/server/services/tutorials/tutorials_registry.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/activemq_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/activemq_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/aerospike_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/apache_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/apache_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/auditbeat/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/auditd_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/aws_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/aws_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/azure_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/azure_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/barracuda_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/bluecoat_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/cef_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/ceph_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/checkpoint_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/cisco_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/cockroachdb_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/consul_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/coredns_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/coredns_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/couchbase_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/couchdb_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/crowdstrike_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/cylance_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/docker_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/dropwizard_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/elasticsearch_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/elasticsearch_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/envoyproxy_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/envoyproxy_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/etcd_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/f5_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/fortinet_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/gcp_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/gcp_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/golang_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/gsuite_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/haproxy_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/haproxy_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/ibmmq_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/ibmmq_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/icinga_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/iis_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/iis_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/imperva_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/infoblox_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/auditbeat_instructions.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/cloud_instructions.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/filebeat_instructions.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/get_space_id_for_beats_tutorial.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/heartbeat_instructions.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/metricbeat_instructions.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/onprem_cloud_instructions.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/winlogbeat_instructions.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/iptables_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/juniper_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/kafka_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/kafka_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/kibana_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/kibana_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/kubernetes_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/logstash_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/logstash_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/memcached_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/microsoft_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/misp_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/mongodb_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/mongodb_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/mssql_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/mssql_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/munin_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/mysql_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/mysql_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/nats_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/nats_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/netflow_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/netscout_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/nginx_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/nginx_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/o365_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/okta_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/openmetrics_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/oracle_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/osquery_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/panw_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/php_fpm_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/postgresql_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/postgresql_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/prometheus_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/rabbitmq_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/rabbitmq_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/radware_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/redis_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/redis_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/redisenterprise_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/register.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/santa_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/sonicwall_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/sophos_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/stan_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/statsd_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/suricata_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/system_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/system_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/tomcat_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/traefik_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/traefik_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/uptime_monitors/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/uwsgi_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/vsphere_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/windows_event_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/windows_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/zeek_logs/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/zookeeper_metrics/index.d.ts create mode 100644 src/platform/plugins/shared/home/server/tutorials/zscaler_logs/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/common/adapters/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/move_request_params_to_top_level.d.ts create mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/request_adapter.d.ts create mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/request_responder.d.ts create mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/types.d.ts create mode 100644 src/platform/plugins/shared/inspector/common/adapters/types.d.ts create mode 100644 src/platform/plugins/shared/inspector/common/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/adapters/has_inspector_adapters.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/async_services.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/types.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/ui/inspector_panel.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/ui/inspector_view_chooser.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/view_registry.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/cluster_health.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/clusters_health.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/gradient.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/cluster_view.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/open_shard_failure_flyout_button.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_details.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_flyout.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shards_view.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_view.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/find_clusters.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/local_cluster.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/index.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_code_viewer.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request_content.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_response.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_stats.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/types.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/disambiguate_request_names.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/get_next_tab.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/request_details.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/request_selector.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/requests_view.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/types.d.ts create mode 100644 src/platform/plugins/shared/inspector/public/views/requests/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/context/context.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/context/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/context/types.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/dark_mode/use_dark_mode.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/markdown/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/markdown/markdown.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/markdown/markdownStyles.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/markdown/markdown_simple.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/overlays/create_react_overlays.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/overlays/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/overlays/types.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/action_cards.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/no_data_card.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page_body/no_data_page_body.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/solution_nav_avatar.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/react_router_navigate/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/react_router_navigate/react_router_navigate.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/theme.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/ui_settings/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/ui_settings/use_ui_setting.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/url_template_editor/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/url_template_editor/url_template_editor.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/use_execution_context/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/use_execution_context/use_execution_context.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/util/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/validated_range/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/validated_range/is_range_valid.d.ts create mode 100644 src/platform/plugins/shared/kibana_react/public/validated_range/validated_dual_range.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/abort_utils.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/calculate_object_hash.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/create_getter_setter.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/defer.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/distinct_until_changed_with_initial_value.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/errors/errors.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/errors/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/errors/types.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/field_wildcard.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/now.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/of.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/persistable_state/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/persistable_state/merge_migration_function_map.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/persistable_state/migrate_to_latest.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/persistable_state/types.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container_react_helpers.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_containers/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_containers/types.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/encode_state.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/format.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/parse.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/set_state_to_kbn_url.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/state_hash.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/url/encode_uri_query.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/url/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/common/url/validate_url.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/core/create_start_service_getter.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/core/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/history/get_query_params.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/history/history_observable.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/history/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/history/redirect_when_missing.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/history/remove_query_param.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/render_complete/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/render_complete/render_complete_dispatcher.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/resize_checker/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/encode_decode_state.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/state_hash.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/errors.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/hash_unhash_url.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_storage.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/url_tracker.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/utils/diff_object.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/types.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/types.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/hashed_item_store.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/storage.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/types.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/theme/index.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/theme/kibana_theme_provider.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/ui/configurable.d.ts create mode 100644 src/platform/plugins/shared/kibana_utils/public/ui/index.d.ts create mode 100644 src/platform/plugins/shared/management/common/contants.d.ts create mode 100644 src/platform/plugins/shared/management/common/locator.d.ts create mode 100644 src/platform/plugins/shared/management/public/application.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/landing/classic_empty_prompt.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/landing/index.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/landing/landing.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/landing/solution_empty_prompt.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/management_app/index.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/management_app/management_app.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/management_app/management_context.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/management_app/management_router.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/management_app_wrapper/index.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/management_app_wrapper/management_app_wrapper.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/management_sections.d.ts create mode 100644 src/platform/plugins/shared/management/public/components/management_sidebar_nav/management_sidebar_nav.d.ts create mode 100644 src/platform/plugins/shared/management/public/index.d.ts create mode 100644 src/platform/plugins/shared/management/public/management_sections_service.d.ts create mode 100644 src/platform/plugins/shared/management/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/management/public/types.d.ts create mode 100644 src/platform/plugins/shared/management/public/utils/breadcrumbs.d.ts create mode 100644 src/platform/plugins/shared/management/public/utils/index.d.ts create mode 100644 src/platform/plugins/shared/management/public/utils/management_app.d.ts create mode 100644 src/platform/plugins/shared/management/public/utils/management_item.d.ts create mode 100644 src/platform/plugins/shared/management/public/utils/management_section.d.ts create mode 100644 src/platform/plugins/shared/screenshot_mode/common/constants.d.ts create mode 100644 src/platform/plugins/shared/screenshot_mode/common/context.d.ts create mode 100644 src/platform/plugins/shared/screenshot_mode/common/index.d.ts create mode 100644 src/platform/plugins/shared/screenshot_mode/common/mode.d.ts create mode 100644 src/platform/plugins/shared/screenshot_mode/public/index.d.ts create mode 100644 src/platform/plugins/shared/screenshot_mode/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/screenshot_mode/public/types.d.ts create mode 100644 src/platform/plugins/shared/share/common/anonymous_access/index.d.ts create mode 100644 src/platform/plugins/shared/share/common/anonymous_access/types.d.ts create mode 100644 src/platform/plugins/shared/share/common/constants.d.ts create mode 100644 src/platform/plugins/shared/share/common/index.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/index.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/index.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/legacy_short_url_locator.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/locator.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/locator_client.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/format_search_params.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/index.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/parse_search_params.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/space_url_parser.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/types.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/short_url_assert_valid.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/short_url_redirect_locator.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/types.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/locators/use_locator_url.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/short_urls/index.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/short_urls/types.d.ts create mode 100644 src/platform/plugins/shared/share/common/url_service/url_service.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/common/draft_mode_callout/draft_mode_callout.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/common/draft_mode_callout/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/context/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/export_integrations/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/share_tabs.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/tabs/embed/embed_content.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/tabs/embed/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/tabs/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/tabs/link/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/tabs/link/link_content.d.ts create mode 100644 src/platform/plugins/shared/share/public/components/tabs/link/time_type_section.d.ts create mode 100644 src/platform/plugins/shared/share/public/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/lib/download_as.d.ts create mode 100644 src/platform/plugins/shared/share/public/lib/get_home_href.d.ts create mode 100644 src/platform/plugins/shared/share/public/lib/registrations.d.ts create mode 100644 src/platform/plugins/shared/share/public/lib/time_utils.d.ts create mode 100644 src/platform/plugins/shared/share/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/share/public/services/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/services/share_menu_manager.d.ts create mode 100644 src/platform/plugins/shared/share/public/services/share_menu_registry.d.ts create mode 100644 src/platform/plugins/shared/share/public/types.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/components/empty_prompt.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/components/page.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/components/spinner.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/index.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/redirect_manager.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/render.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client.d.ts create mode 100644 src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client_factory.d.ts create mode 100644 src/platform/plugins/shared/share/server/config.d.ts create mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/constants.d.ts create mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/index.d.ts create mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/register_delete_unused_urls_route.d.ts create mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/register_unused_urls_task_routes.d.ts create mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/task.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/common/trigger_ids.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/actions/action.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/actions/action_internal.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/actions/create_action.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/actions/incompatible_action_error.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/actions/index.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/context_menu/build_eui_context_menu_panels.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/context_menu/index.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/context_menu/open_context_menu.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/index.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/service/index.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/service/ui_actions_service.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/services.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/triggers.d.ts create mode 100644 src/platform/plugins/shared/ui_actions/public/types.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/application_usage.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/constants.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/stats/core_metrics.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/stats/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/stats/latest.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/stats/v1.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/ui_counters/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/ui_counters/latest.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/ui_counters/v1.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/usage_counters/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/usage_counters/latest.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/common/types/usage_counters/v1.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/components/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/components/track_application_view/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view_component.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/components/track_application_view/types.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/plugin.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/services/application_usage.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/services/create_reporter.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/public/services/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector_set.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector_stats/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector_stats/schema.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector_stats/usage_collector_stats_collector.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/measure_duration.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/types.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/collector/usage_collector.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/config.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/plugin.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/report/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/report/schema.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/report/store_application_usage.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/report/store_ui_report.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/routes/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/routes/stats/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/routes/stats/stats.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/routes/ui_counters.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/common/kuery_utils.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/constants.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/register_rollups.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/rollups.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/saved_objects.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/search/index.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/search/search.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/types.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counter.d.ts create mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counters_service.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/index.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/alert_instance.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/lifecycle_state.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/rule_task_instance.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/index.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/lib/index.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/index.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/migration.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/schema.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/index.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/migration.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/schema.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/index.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/migration.d.ts create mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/schema.d.ts create mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/index.d.ts create mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/constants.d.ts create mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/home_sections.d.ts create mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/index_templates.d.ts create mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/extensions_service.d.ts create mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/index.d.ts create mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/public_api_service.d.ts create mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/es_fields.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/es_schemas_raw.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/es_schemas_ui.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/agent_explorer.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/aggregation_type.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/annotations.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/anomaly_detector_type.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/apm_event.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/apm_ml_job.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/apm_telemetry.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/apm_timeseries.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/connections.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/container_type.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/coordinate.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/correlations.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/custom_dashboards.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/custom_link.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/data_source.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/diagnostics.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/document_type.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/downstream_dependencies.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/environment_filter_values.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/environment_rt.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/errors.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/apm.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/common.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/otel.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/apm_base_doc.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/error_raw.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/event_raw.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/cloud.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/container.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/event_outcome.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/faas.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/host.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/http.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/kubernetes.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/observer.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/status_code.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/page.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/process.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/server.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/service.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/span_links.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/stackframe.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/timestamp_us.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/url.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user_agent.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/metric_raw.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/span_raw.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/transaction_raw.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/apm_error.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/event.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/agent.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/metric.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/span.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/transaction.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/focused_trace_waterfall.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/full_trace_waterfall.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/ilm_types.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/instances.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/latency_aggregation_types.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution_chart_types.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/mobile_types.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/processor_event.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/rollup.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/serverless.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_anomalies.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_stats.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_timeseries.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_groups.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_health_status.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_inventory.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_map.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_map_diagnostic_types.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/span_links.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/storage_explorer_types.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/time_range_metadata.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/timeseries.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/traces.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/constants.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_delete.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_purge_rollup.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_batch_get.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_create.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_delete.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_find.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_get.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_historical_summary.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_summary_refresh.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_update.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_instances.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_grouped_stats.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_stats_overview.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/health_scan.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/purge_instances.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/repair.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/search_slo_definitions.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/slo_templates.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo_summary_index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo_template.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/index.d.ts create mode 100644 x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/src/uiam_api_key_provisioning_status.d.ts create mode 100644 x-pack/platform/packages/shared/response-ops/scheduling-types/index.d.ts create mode 100644 x-pack/platform/packages/shared/response-ops/scheduling-types/schedule_types.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/api_keys/api_key.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authentication/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/features_privileges.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/raw_kibana_privileges.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/role.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license_features.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/roles/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/user_profile/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/audit/audit_service.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/audit/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/api_keys.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/authentication_service.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/client_authentication.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/actions.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/alerting.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/api.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/app.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/cases.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/saved_object.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/space.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/ui.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/authorization_service.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges_dynamically.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_saved_objects_privileges.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/constants.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/deprecations.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/es_security_config.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/index.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/mode.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/role_schema.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/plugin.d.ts create mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/user_profile/index.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/common/config_schema.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/public/api.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/public/index.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/public/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/public/register_services.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/config.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/constants.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/index.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/routes/index.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/routes/settings.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/apm_indices.d.ts create mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/migrations/update_apm_oss_index_paths.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/common/constants.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/common/decode_cloud_id.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/common/is_cloud_enabled.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/common/parse_deployment_id_from_deployment_url.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/common/parse_onboarding_default_solution.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/common/register_cloud_deployment_id_analytics_context.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/common/types.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/common/utils.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/public/index.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/public/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/public/types.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/public/urls.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/public/utils.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/cloud_data/index.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/collectors/index.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/config.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/env.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/index.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/constants.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/elasticsearch_route.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/index.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/set_cloud_data_route.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/types.d.ts create mode 100644 x-pack/platform/plugins/shared/cloud/server/saved_objects/index.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/common/has_license_info_changed.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/common/license.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/common/license_update.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/common/register_analytics_context_provider.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/public/expired_banner.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/public/index.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/public/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/public/services/feature_usage_service.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/public/services/index.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/public/types.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/index.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/license_fetcher.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/licensing_config.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/licensing_route_handler_context.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/on_pre_response_handler.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/plugin_status.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/feature_usage.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/index.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/info.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/internal/index.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/internal/notify_feature_usage.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/internal/register_feature.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/services/feature_usage_service.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/services/index.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/types.d.ts create mode 100644 x-pack/platform/plugins/shared/licensing/server/wrap_route_with_license_check.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/types.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/utils.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/common/types.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/components/logs_sources_setting.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/hooks/use_log_sources.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/index.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/index.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/log_data_service.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/types.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/log_sources_service/index.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/register_services.d.ts create mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/types.d.ts create mode 100644 x-pack/platform/plugins/shared/serverless/public/index.d.ts create mode 100644 x-pack/platform/plugins/shared/serverless/public/navigation/index.d.ts create mode 100644 x-pack/platform/plugins/shared/serverless/public/navigation/nav_cards.d.ts create mode 100644 x-pack/platform/plugins/shared/serverless/public/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/serverless/public/types.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/common/constants.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/common/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/api_key_strategy.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/create_api_key_strategy.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_and_uiam_api_key_strategy.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_api_key_strategy.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/buffered_task_store.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/config.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/constants.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/invalidate_api_keys_task.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/constants.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_api_key_ids_to_invalidate.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_find_filter.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys_and_delete_so.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/query_for_api_keys_in_use.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/run_invalidate.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/delete_inactive_nodes_task.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/kibana_discovery_service.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/adhoc_task_counter.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/api_key_utils.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/assign_pod_partitions.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/bulk_operation_buffer.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/calculate_health_status.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/correct_deprecated_fields.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/create_managed_configuration.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/errors/bulk_update_error.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/errors/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/errors/msearch_error.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/errors/task_already_running_error.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/execution_context.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/fill_pool.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_default_capacity.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_es_and_so_availability.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_execution_id.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_first_run_at.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_next_run_at.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_retry_at.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/identify_es_error.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/intervals.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/is_task_not_found_error.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/log_health_metrics.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/middleware.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/millis_to_nanos.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/remove_if_exists.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/result_type.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/retryable_bulk_update.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/runtime_statistics_aggregator.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/task_partitioner.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/wrapped_logger.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/license_subscriber.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/create_aggregator.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/counter.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/get_task_type_group.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/metric_counter_service.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/simple_histogram.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/unflatten_object.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/metrics_stream.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/task_claim_metrics_aggregator.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/task_metrics_collector.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/task_overdue_metrics_aggregator.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/task_run_metrics_aggregator.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/types.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/background_task_utilization_statistics.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/configuration_statistics.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/monitoring_stats_stream.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_calculators.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_statistics.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/plugin.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/polling/delay_on_claim_conflicts.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/polling/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/polling/task_poller.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/polling_lifecycle.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/mark_available_tasks_as_claimed.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/oldest_idle_action_task.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/query_clauses.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/task_claiming.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/removed_tasks/mark_removed_tasks_as_unrecognized.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/routes/background_task_utilization.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/routes/health.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/routes/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/routes/metrics.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/mappings.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/migrations.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/api_key_to_invalidate_model_versions.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/background_task_node_model_versions.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/task_model_versions.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/api_key_to_invalidate.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/background_task_node.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v1.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v2.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v3.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/task.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/get_task_cost.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/task_selector_by_capacity.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_update_by_query.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_events.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/task_pool.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/types.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/utils.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_running/errors.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_running/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_running/task_runner.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_scheduling.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_store.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_type_dictionary.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_validator.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/constants.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/event_based_telemetry.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_provisioning_run_telemetry.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_saved_object_bulk_updates_for_uiam.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/classify_task.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_provisioning_run_context.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_uiam_provisioning_task_runner.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/deferred_non_running_tasks_query.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/error_utils.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/fetch_first_batch_of_tasks_to_convert.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/get_exclude_tasks_filter.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/map_uiam_convert_response_to_key_results.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_status_and_orphaned_keys_from_bulk_update.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_uiam_provisioning_observability_status.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/uiam_provisioning_feature_flag_scheduler.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/task_state.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/types.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_key_provisioning_task.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_keys_provisioning_status_saved_object.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/usage/index.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/usage/task_manager_usage_collector.d.ts create mode 100644 x-pack/platform/plugins/shared/task_manager/server/usage/types.d.ts diff --git a/src/platform/packages/private/analytics/utils/analytics_collection_utils/index.d.ts b/src/platform/packages/private/analytics/utils/analytics_collection_utils/index.d.ts new file mode 100644 index 0000000000000..e9d59e694971e --- /dev/null +++ b/src/platform/packages/private/analytics/utils/analytics_collection_utils/index.d.ts @@ -0,0 +1 @@ +export { isSyntheticsMonitor } from './src'; diff --git a/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/index.d.ts b/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/index.d.ts new file mode 100644 index 0000000000000..2e4064a42e0d3 --- /dev/null +++ b/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/index.d.ts @@ -0,0 +1 @@ +export { isSyntheticsMonitor } from './is_synthetics_monitor'; diff --git a/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/is_synthetics_monitor.d.ts b/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/is_synthetics_monitor.d.ts new file mode 100644 index 0000000000000..32399ae29577f --- /dev/null +++ b/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/is_synthetics_monitor.d.ts @@ -0,0 +1,5 @@ +/** + * Returns whether the current navigation is performed by a Synthetics monitor + * (and hence, telemetry should not be collected). + */ +export declare function isSyntheticsMonitor(): boolean; diff --git a/src/platform/packages/private/kbn-cps-common/index.d.ts b/src/platform/packages/private/kbn-cps-common/index.d.ts new file mode 100644 index 0000000000000..863930fc2bc0c --- /dev/null +++ b/src/platform/packages/private/kbn-cps-common/index.d.ts @@ -0,0 +1,3 @@ +export { PROJECT_ROUTING } from './src/common/constants'; +export type { ProjectRoutingValue } from './src/common/constants'; +export { getSpaceDefaultNpreName } from './src/common/get_space_default_npre_name'; diff --git a/src/platform/packages/private/kbn-cps-common/src/common/constants.d.ts b/src/platform/packages/private/kbn-cps-common/src/common/constants.d.ts new file mode 100644 index 0000000000000..8474de18e398a --- /dev/null +++ b/src/platform/packages/private/kbn-cps-common/src/common/constants.d.ts @@ -0,0 +1,11 @@ +/** + * Project routing constants for Cross-project search + * These are stored as strings in saved objects to explicitly override parent values + */ +export declare const PROJECT_ROUTING: { + /** Search across all linked projects */ + readonly ALL: "_alias:*"; + /** Search only the origin project */ + readonly ORIGIN: "_alias:_origin"; +}; +export type ProjectRoutingValue = (typeof PROJECT_ROUTING)[keyof typeof PROJECT_ROUTING]; diff --git a/src/platform/packages/private/kbn-cps-common/src/common/get_space_default_npre_name.d.ts b/src/platform/packages/private/kbn-cps-common/src/common/get_space_default_npre_name.d.ts new file mode 100644 index 0000000000000..61c85740b91e6 --- /dev/null +++ b/src/platform/packages/private/kbn-cps-common/src/common/get_space_default_npre_name.d.ts @@ -0,0 +1 @@ +export declare function getSpaceDefaultNpreName(spaceId: string): string; diff --git a/src/platform/packages/private/kbn-panel-loader/index.d.ts b/src/platform/packages/private/kbn-panel-loader/index.d.ts new file mode 100644 index 0000000000000..1ffe0ab1f9003 --- /dev/null +++ b/src/platform/packages/private/kbn-panel-loader/index.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +export declare const PanelLoader: (props: { + showShadow?: boolean; + showBorder?: boolean; + dataTestSubj?: string; +}) => React.JSX.Element; diff --git a/src/platform/packages/private/kbn-saved-objects-settings/index.d.ts b/src/platform/packages/private/kbn-saved-objects-settings/index.d.ts new file mode 100644 index 0000000000000..e6ca0edde5afb --- /dev/null +++ b/src/platform/packages/private/kbn-saved-objects-settings/index.d.ts @@ -0,0 +1,2 @@ +export declare const PER_PAGE_SETTING = "savedObjects:perPage"; +export declare const LISTING_LIMIT_SETTING = "savedObjects:listingLimit"; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_common/index.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_common/index.d.ts new file mode 100644 index 0000000000000..50d9cfa1b7f94 --- /dev/null +++ b/src/platform/packages/shared/content-management/favorites/favorites_common/index.d.ts @@ -0,0 +1 @@ +export declare const FAVORITES_LIMIT = 100; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/index.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/index.d.ts new file mode 100644 index 0000000000000..29bc8c186a3d5 --- /dev/null +++ b/src/platform/packages/shared/content-management/favorites/favorites_server/index.d.ts @@ -0,0 +1 @@ +export { registerFavorites, type GetFavoritesResponse, type FavoritesSetup, type AddFavoriteResponse, type RemoveFavoriteResponse, } from './src'; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_registry.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_registry.d.ts new file mode 100644 index 0000000000000..d0274c3778a11 --- /dev/null +++ b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_registry.d.ts @@ -0,0 +1,12 @@ +import type { ObjectType } from '@kbn/config-schema'; +interface FavoriteTypeConfig { + typeMetadataSchema?: ObjectType; +} +export type FavoritesRegistrySetup = Pick; +export declare class FavoritesRegistry { + private favoriteTypes; + registerFavoriteType(type: string, config?: FavoriteTypeConfig): void; + hasType(type: string): boolean; + validateMetadata(type: string, metadata?: object): void; +} +export {}; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.d.ts new file mode 100644 index 0000000000000..a5cefa1d1981d --- /dev/null +++ b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.d.ts @@ -0,0 +1,21 @@ +import type { CoreSetup, Logger } from '@kbn/core/server'; +import type { FavoritesRegistry } from './favorites_registry'; +/** + * @public + * Response for get favorites API + */ +export interface GetFavoritesResponse { + favoriteIds: string[]; + favoriteMetadata?: Record; +} +export interface AddFavoriteResponse { + favoriteIds: string[]; +} +export interface RemoveFavoriteResponse { + favoriteIds: string[]; +} +export declare function registerFavoritesRoutes({ core, logger, favoritesRegistry, }: { + core: CoreSetup; + logger: Logger; + favoritesRegistry: FavoritesRegistry; +}): void; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_saved_object.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_saved_object.d.ts new file mode 100644 index 0000000000000..403fe867574fe --- /dev/null +++ b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_saved_object.d.ts @@ -0,0 +1,9 @@ +import type { SavedObjectsType } from '@kbn/core/server'; +export interface FavoritesSavedObjectAttributes { + userId: string; + type: string; + favoriteIds: string[]; + favoriteMetadata?: Record; +} +export declare const favoritesSavedObjectName = "favorites"; +export declare const favoritesSavedObjectType: SavedObjectsType; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_service.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_service.d.ts new file mode 100644 index 0000000000000..9adc304c6fe77 --- /dev/null +++ b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_service.d.ts @@ -0,0 +1,33 @@ +import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import type { Logger } from '@kbn/core/server'; +import type { FavoritesRegistry } from './favorites_registry'; +export interface FavoritesState { + favoriteIds: string[]; + favoriteMetadata?: Record; +} +export declare class FavoritesService { + private readonly type; + private readonly userId; + private readonly deps; + constructor(type: string, userId: string, deps: { + savedObjectClient: SavedObjectsClientContract; + logger: Logger; + favoritesRegistry: FavoritesRegistry; + }); + getFavorites(): Promise; + /** + * @throws {FavoritesLimitExceededError} + */ + addFavorite({ id, metadata, }: { + id: string; + metadata?: object; + }): Promise; + removeFavorite({ id }: { + id: string; + }): Promise; + private getFavoritesSavedObject; + private getFavoriteSavedObjectId; +} +export declare class FavoritesLimitExceededError extends Error { + constructor(); +} diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_usage_collection.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_usage_collection.d.ts new file mode 100644 index 0000000000000..5caed768e6c45 --- /dev/null +++ b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_usage_collection.d.ts @@ -0,0 +1,6 @@ +import type { CoreSetup } from '@kbn/core-lifecycle-server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +export declare function registerFavoritesUsageCollection({ core, usageCollection, }: { + core: CoreSetup; + usageCollection: UsageCollectionSetup; +}): void; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/index.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/index.d.ts new file mode 100644 index 0000000000000..8e3acbb930de6 --- /dev/null +++ b/src/platform/packages/shared/content-management/favorites/favorites_server/src/index.d.ts @@ -0,0 +1,22 @@ +import type { CoreSetup, Logger } from '@kbn/core/server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { FavoritesRegistrySetup } from './favorites_registry'; +export type { GetFavoritesResponse, AddFavoriteResponse, RemoveFavoriteResponse, } from './favorites_routes'; +/** + * @public + * Setup contract for the favorites feature. + */ +export type FavoritesSetup = FavoritesRegistrySetup; +/** + * @public + * Registers the favorites feature enabling favorites saved object type and api routes. + * + * @param logger + * @param core + * @param usageCollection + */ +export declare function registerFavorites({ logger, core, usageCollection, }: { + core: CoreSetup; + logger: Logger; + usageCollection?: UsageCollectionSetup; +}): FavoritesSetup; diff --git a/src/platform/packages/shared/home/sample_data_card/index.d.ts b/src/platform/packages/shared/home/sample_data_card/index.d.ts new file mode 100644 index 0000000000000..4a929cb7d2b9c --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/index.d.ts @@ -0,0 +1,6 @@ +export { SampleDataCard } from './src/sample_data_card'; +export type { Props as SampleDataCardProps } from './src/sample_data_card'; +export { SampleDataCardKibanaProvider, SampleDataCardProvider } from './src/services'; +export type { Services as SampleDataCardServices, KibanaDependencies as SampleDataCardKibanaDependencies, } from './src/services'; +export { getStoryArgTypes as getSampleDataCardStoryArgTypes, getStoryServices as getSampleDataCardStoryServices, getMockDataSet as getSampleDataCardMockDataSet, } from './src/mocks'; +export type { Params as SampleDataCardStorybookParams } from './src/mocks'; diff --git a/src/platform/packages/shared/home/sample_data_card/src/constants.d.ts b/src/platform/packages/shared/home/sample_data_card/src/constants.d.ts new file mode 100644 index 0000000000000..46a79012ab3c7 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/constants.d.ts @@ -0,0 +1,11 @@ +/** + * DataSetStatusType for an installed data set. + * @see src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types + */ +export declare const INSTALLED_STATUS = "installed"; +/** + * DataSetStatusType for a data set that is not installed yet. + * @see src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types + */ +export declare const UNINSTALLED_STATUS = "not_installed"; +export declare const SAMPLE_DATA_API = "/api/sample_data"; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/disabled_footer.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/disabled_footer.d.ts new file mode 100644 index 0000000000000..e171e4708adb0 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/footer/disabled_footer.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +/** + * Props for the `DisabledFooter` component. + */ +export type Props = Pick; +/** + * A footer for the `SampleDataCard` displayed when an unknown error or status prevents a person + * from installing the Sample Data Set. + */ +export declare const DisabledFooter: ({ id, name, statusMsg }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/index.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/index.d.ts new file mode 100644 index 0000000000000..80e227be3542f --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/footer/index.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; +import type { SampleDataSet, InstalledStatus } from '@kbn/home-sample-data-types'; +/** + * Props for the `Footer` component. + */ +export interface Props { + /** The Sample Data Set and its status. */ + sampleDataSet: SampleDataSet; + /** The handler to invoke when an action is performed upon the Sample Data Set. */ + onAction: (id: string, status: InstalledStatus) => void; +} +/** + * Displays the appropriate Footer component based on the status of the Sample Data Set. + */ +export declare const Footer: ({ sampleDataSet, onAction }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/install_footer.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/install_footer.d.ts new file mode 100644 index 0000000000000..21119ee66884e --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/footer/install_footer.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +import type { UseInstallParams } from '../hooks'; +/** + * Props for the `InstallFooter` component. + */ +export type Props = Pick & UseInstallParams; +/** + * A footer displayed when a Sample Data Set is not installed, allowing a person to install it. + */ +export declare const InstallFooter: (params: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/remove_footer.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/remove_footer.d.ts new file mode 100644 index 0000000000000..be97c6edae8f0 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/footer/remove_footer.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +import type { UseRemoveParams } from '../hooks'; +import type { Props as ViewButtonProps } from './view_button'; +/** + * Props for the `RemoveFooter` component. + */ +export type Props = Pick & UseRemoveParams & ViewButtonProps; +/** + * A footer displayed when a Sample Data Set is installed, allowing a person to remove it or view + * saved objects associated with it in their related solutions. + */ +export declare const RemoveFooter: (props: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/view_button.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/view_button.d.ts new file mode 100644 index 0000000000000..4b2b22d5eeffd --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/footer/view_button.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +/** + * Props for the `ViewButton` component. + */ +export type Props = Pick; +/** + * A button displayed when a Sample Data Set is installed, allowing a person to view the overview dashboard, + * and, if included, a number of actions to navigate to other solutions. + */ +export declare const ViewButton: ({ id, name, overviewDashboard, appLinks }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/hooks/index.d.ts b/src/platform/packages/shared/home/sample_data_card/src/hooks/index.d.ts new file mode 100644 index 0000000000000..1aa0927980d5b --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/hooks/index.d.ts @@ -0,0 +1,4 @@ +export { useInstall } from './use_install'; +export type { Params as UseInstallParams } from './use_install'; +export { useRemove } from './use_remove'; +export type { Params as UseRemoveParams } from './use_remove'; diff --git a/src/platform/packages/shared/home/sample_data_card/src/hooks/poll_sample_data_status.d.ts b/src/platform/packages/shared/home/sample_data_card/src/hooks/poll_sample_data_status.d.ts new file mode 100644 index 0000000000000..c9211916d01b3 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/hooks/poll_sample_data_status.d.ts @@ -0,0 +1,34 @@ +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +/** + * Options for polling sample data status after installation or removal. + */ +export interface PollOptions { + /** + * Maximum number of retry attempts (default: 10) + */ + maxAttempts?: number; + /** + * Initial delay before first check in milliseconds + */ + initialDelayMs?: number; + /** + * Minimum time between poll attempts in milliseconds + */ + minTimeout?: number; + /** + * Factor for exponential backoff (default: 1.5) + */ + factor?: number; + /** + * Callback for logging failed attempts + */ + onFailedAttempt?: (error: Error, attemptNumber: number) => void; +} +/** + * Poll the sample data list endpoint until the dataset shows as installed. + */ +export declare function pollForInstallation(id: string, fetchSampleDataSets: () => Promise, options?: PollOptions): Promise; +/** + * Poll the sample data list endpoint until the dataset shows as uninstalled. + */ +export declare function pollForRemoval(id: string, fetchSampleDataSets: () => Promise, options?: PollOptions): Promise; diff --git a/src/platform/packages/shared/home/sample_data_card/src/hooks/use_install.d.ts b/src/platform/packages/shared/home/sample_data_card/src/hooks/use_install.d.ts new file mode 100644 index 0000000000000..86378e388e621 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/hooks/use_install.d.ts @@ -0,0 +1,17 @@ +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +/** + * Parameters for the `useInstall` React hook. + */ +export type Params = Pick & { + /** Handler to invoke when the Sample Data Set is successfully installed. */ + onInstall: (id: string) => void; +}; +/** + * A React hook that allows a component to install a sample data set, handling success and + * failure in the Kibana UI. It also provides a boolean that indicates if the data set is + * in the process of being installed. + * + * After installation, this hook polls the status endpoint until the data is confirmed + * as installed + */ +export declare const useInstall: ({ id, defaultIndex, name, onInstall, }: Params) => [() => void, boolean]; diff --git a/src/platform/packages/shared/home/sample_data_card/src/hooks/use_remove.d.ts b/src/platform/packages/shared/home/sample_data_card/src/hooks/use_remove.d.ts new file mode 100644 index 0000000000000..671da707f995d --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/hooks/use_remove.d.ts @@ -0,0 +1,17 @@ +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +/** + * Parameters for the `useRemove` React hook. + */ +export type Params = Pick & { + /** Handler to invoke when the Sample Data Set is successfully removed. */ + onRemove: (id: string) => void; +}; +/** + * A React hook that allows a component to remove a sample data set, handling success and + * failure in the Kibana UI. It also provides a boolean that indicates if the data set is + * in the process of being removed. + * + * After removal, this hook polls the status endpoint until the data is confirmed + * as uninstalled + */ +export declare const useRemove: ({ id, defaultIndex, name, onRemove }: Params) => [() => void, boolean]; diff --git a/src/platform/packages/shared/home/sample_data_card/src/mocks/index.d.ts b/src/platform/packages/shared/home/sample_data_card/src/mocks/index.d.ts new file mode 100644 index 0000000000000..edc89fc6f3cf1 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/mocks/index.d.ts @@ -0,0 +1,75 @@ +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +import type { Services } from '../services'; +/** + * A set of e-commerce images for use in Storybook stories. + */ +export declare const ecommerceImages: { + previewImagePath: any; + darkPreviewImagePath: any; + iconPath: any; +}; +/** + * A mocked sample data set for use in Storybook stories. + */ +export declare const mockDataSet: SampleDataSet; +/** + * Customize the Sample Data Set mock. + */ +export declare const getMockDataSet: (params?: Partial) => { + appLinks: import("@kbn/home-sample-data-types").AppLink[]; + defaultIndex: string; + description: string; + id: string; + name: string; + overviewDashboard: string; + previewImagePath: string; + darkPreviewImagePath?: string; + iconPath?: string; + status?: import("@kbn/home-sample-data-types").InstalledStatus; + statusMsg?: string; +}; +/** + * Parameters drawn from the Storybook arguments collection that customize a component story. + */ +export type Params = Record, any>; +/** + * Returns Storybook-compatible service abstractions for the `SampleDataCard` Provider. + */ +export declare const getStoryServices: (params: Params) => Services; +/** + * Returns the Storybook arguments for `SampleDataCard`, for its stories and for + * consuming component stories. + */ +export declare const getStoryArgTypes: () => { + name: { + control: { + type: string; + }; + defaultValue: string; + }; + description: { + control: { + type: string; + }; + defaultValue: string; + }; + status: { + options: (string | undefined)[]; + control: { + type: string; + }; + defaultValue: import("@kbn/home-sample-data-types").InstalledStatus | undefined; + }; + includeAppLinks: { + control: string; + defaultValue: boolean; + }; + simulateErrors: { + control: string; + defaultValue: boolean; + }; +}; +/** + * Returns the Jest-compatible service abstractions for the `NoDataCard` Provider. + */ +export declare const getMockServices: (params?: Partial) => Services; diff --git a/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.component.d.ts b/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.component.d.ts new file mode 100644 index 0000000000000..cf546aa7964bc --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.component.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; +import type { SampleDataSet, InstalledStatus } from '@kbn/home-sample-data-types'; +export interface Props { + /** A Sample Data Set to display. */ + sampleDataSet: SampleDataSet; + /** A resolved, themed image to display in the card. */ + imagePath: string; + /** A handler to invoke when the status of a Sample Data Set is changed. */ + onStatusChange: (id: string, status: InstalledStatus) => void; +} +/** + * A pure implementation of the `SampleDataCard` component that itself + * does not depend on any Kibana services. Still requires a + * `SampleDataCardProvider` for its dependencies to render and function. + */ +export declare const SampleDataCard: ({ sampleDataSet, imagePath: image, onStatusChange: onAction, }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.d.ts b/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.d.ts new file mode 100644 index 0000000000000..f21cb8d5fa17a --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +import type { Props as ComponentProps } from './sample_data_card.component'; +/** + * Props for the `SampleDataCard` component. + */ +export interface Props extends Pick { + /** A Sample Data Set to display. */ + sampleDataSet: SampleDataSet; +} +/** + * A card representing a Sample Data Set that can be installed. Uses Kibana services to + * display and install the data set. Requires a `SampleDataCardProvider` to render and + * function. + */ +export declare const SampleDataCard: ({ sampleDataSet, onStatusChange }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/services.d.ts b/src/platform/packages/shared/home/sample_data_card/src/services.d.ts new file mode 100644 index 0000000000000..b92cc369716bc --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_card/src/services.d.ts @@ -0,0 +1,67 @@ +import type { FC, PropsWithChildren, MouseEventHandler } from 'react'; +import type { EuiGlobalToastListToast as EuiToast } from '@elastic/eui'; +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +type NavigateToUrl = (url: string) => Promise | void; +type UnmountCallback = () => void; +type MountPoint = (element: T) => UnmountCallback; +type ValidNotifyString = string | MountPoint; +type NotifyInputFields = Pick> & { + title?: ValidNotifyString; + text?: ValidNotifyString; +}; +type NotifyInput = string | NotifyInputFields; +type NotifyFn = (notification: NotifyInput) => void; +/** + * A list of services that are consumed by this component. + */ +export interface Services { + addBasePath: (path: string) => string; + fetchSampleDataSets: () => Promise; + getAppNavigationHandler: (path: string) => MouseEventHandler; + installSampleDataSet: (id: string, defaultIndex: string) => Promise; + notifyError: NotifyFn; + notifySuccess: NotifyFn; + removeSampleDataSet: (id: string, defaultIndex: string) => Promise; +} +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export declare const SampleDataCardProvider: FC>; +export interface KibanaDependencies { + coreStart: { + application: { + navigateToUrl: NavigateToUrl; + }; + http: { + basePath: { + prepend: (path: string) => string; + }; + delete: (path: string) => Promise; + get: (path: string) => Promise; + post: (path: string) => Promise; + }; + notifications: { + toasts: { + addDanger: NotifyFn; + addSuccess: NotifyFn; + }; + }; + uiSettings: { + get: (key: string, defaultOverride?: any) => any; + isDefault: (key: string) => boolean; + set: (key: string, value: any) => Promise; + }; + }; + dataViews: { + clearCache: () => void; + }; +} +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export declare const SampleDataCardKibanaProvider: FC>; +/** + * React hook for accessing pre-wired services. + */ +export declare function useServices(): Services; +export {}; diff --git a/src/platform/packages/shared/home/sample_data_tab/index.d.ts b/src/platform/packages/shared/home/sample_data_tab/index.d.ts new file mode 100644 index 0000000000000..24030c2e86071 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_tab/index.d.ts @@ -0,0 +1,2 @@ +export { SampleDataTab } from './src/sample_data_tab'; +export { SampleDataTabKibanaProvider, SampleDataTabProvider } from './src/services'; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/constants.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/constants.d.ts new file mode 100644 index 0000000000000..242c08647a4df --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_tab/src/constants.d.ts @@ -0,0 +1,19 @@ +export declare const URL_SAMPLE_DATA_API = "/api/sample_data"; +export declare const URL_DEMO_ENV = "https://ela.st/demo"; +/** + * Test Subject name for the Demo Environment button. + */ +export declare const DATA_TEST_SUBJ_DEMO_ENV_BUTTON = "goToDemoEnvButton"; +/** + * Test Subject name for the sample data accordion button. + */ +/** + * Test Subject name for the sample data accordion button. + */ +/** + * Metric name for counting number of clicks of the Demo Environment button. + */ +export declare const METRIC_CLICK_DEMO_ENV_BUTTON = "sample_data__demo_env_button"; +/** + * Metric name for counting number of clicks of the sample data accordion button. + */ diff --git a/src/platform/packages/shared/home/sample_data_tab/src/demo_env_panel.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/demo_env_panel.d.ts new file mode 100644 index 0000000000000..35d92fd1fe9b6 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_tab/src/demo_env_panel.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; +export interface Props { + demoUrl: string; +} +export declare const DemoEnvironmentPanel: ({ demoUrl }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/hooks/index.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/hooks/index.d.ts new file mode 100644 index 0000000000000..e0894854f7499 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_tab/src/hooks/index.d.ts @@ -0,0 +1 @@ +export { useList } from './use_list'; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/hooks/use_list.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/hooks/use_list.d.ts new file mode 100644 index 0000000000000..1bb8750c01757 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_tab/src/hooks/use_list.d.ts @@ -0,0 +1,7 @@ +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +/** + * A React hook that fetches a list of Sample Data Sets from Kibana, as well as failure + * indicators in the Kibana UI. It also provides a boolean that indicates if the list is + * currently being fetched, as well as a method to refresh the list on demand. + */ +export declare const useList: () => [SampleDataSet[], () => Promise, boolean]; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/sample_data_cards.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/sample_data_cards.d.ts new file mode 100644 index 0000000000000..05415f485b8f8 --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_tab/src/sample_data_cards.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import type { EuiFlexGridProps } from '@elastic/eui'; +/** + * Props for the `SampleDataCards` component. + */ +export interface Props { + /** Number of columns, defaults to 3. */ + columns?: EuiFlexGridProps['columns']; +} +/** + * Fetches and displays a collection of Sample Data Sets in a grid. + */ +export declare const SampleDataCards: ({ columns }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/sample_data_tab.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/sample_data_tab.d.ts new file mode 100644 index 0000000000000..78f6125bb094e --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_tab/src/sample_data_tab.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; +/** + * The content for the Sample Data Tab in the `home` plugin. + */ +export declare const SampleDataTab: () => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/services.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/services.d.ts new file mode 100644 index 0000000000000..3973b92e0de8f --- /dev/null +++ b/src/platform/packages/shared/home/sample_data_tab/src/services.d.ts @@ -0,0 +1,52 @@ +import type { FC, PropsWithChildren } from 'react'; +import type { EuiGlobalToastListToast as EuiToast } from '@elastic/eui'; +import type { SampleDataSet } from '@kbn/home-sample-data-types'; +import type { SampleDataCardServices, SampleDataCardKibanaDependencies } from '@kbn/home-sample-data-card'; +type UnmountCallback = () => void; +type MountPoint = (element: T) => UnmountCallback; +type ValidNotifyString = string | MountPoint; +type NotifyInputFields = Pick> & { + title?: ValidNotifyString; + text?: ValidNotifyString; +}; +type NotifyInput = string | NotifyInputFields; +type NotifyFn = (notification: NotifyInput) => void; +interface Services { + fetchSampleDataSets: () => Promise; + notifyError: NotifyFn; + logClick: (metric: string) => void; +} +/** + * A list of services that are consumed by this component. + */ +export type SampleDataTabServices = Services & SampleDataCardServices; +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export declare const SampleDataTabProvider: FC>; +interface KibanaDependencies { + coreStart: { + http: { + get: (path: string) => Promise; + }; + notifications: { + toasts: { + addDanger: NotifyFn; + }; + }; + }; + trackUiMetric: (type: string, eventNames: string | string[], count?: number) => void; +} +/** + * Services that are consumed by this component and its dependencies. + */ +export type SampleDataTabKibanaDependencies = KibanaDependencies & SampleDataCardKibanaDependencies; +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export declare const SampleDataTabKibanaProvider: FC>; +/** + * React hook for accessing pre-wired services. + */ +export declare function useServices(): Services; +export {}; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/index.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/index.d.ts new file mode 100644 index 0000000000000..eca6b09def5b7 --- /dev/null +++ b/src/platform/packages/shared/kbn-apm-types-shared/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/enums'; +export type * from './src/types'; +export type * from './src/interfaces'; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/enums/index.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/enums/index.d.ts new file mode 100644 index 0000000000000..fc934e84244fc --- /dev/null +++ b/src/platform/packages/shared/kbn-apm-types-shared/src/enums/index.d.ts @@ -0,0 +1 @@ +export * from './processor_event'; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/enums/processor_event.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/enums/processor_event.d.ts new file mode 100644 index 0000000000000..ea57681ddd04e --- /dev/null +++ b/src/platform/packages/shared/kbn-apm-types-shared/src/enums/processor_event.d.ts @@ -0,0 +1,6 @@ +export declare enum ProcessorEvent { + transaction = "transaction", + error = "error", + metric = "metric", + span = "span" +} diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/correlations.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/correlations.d.ts new file mode 100644 index 0000000000000..b36d6ce9c9bb5 --- /dev/null +++ b/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/correlations.d.ts @@ -0,0 +1,4 @@ +export interface HistogramItem { + key: number; + doc_count: number; +} diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/index.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/index.d.ts new file mode 100644 index 0000000000000..9800c79d2fd21 --- /dev/null +++ b/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/index.d.ts @@ -0,0 +1 @@ +export type * from './correlations'; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/types/common.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/types/common.d.ts new file mode 100644 index 0000000000000..fc44aea9bfd8b --- /dev/null +++ b/src/platform/packages/shared/kbn-apm-types-shared/src/types/common.d.ts @@ -0,0 +1 @@ +export type Maybe = T | null | undefined; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/types/index.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/types/index.d.ts new file mode 100644 index 0000000000000..00f66a7e09881 --- /dev/null +++ b/src/platform/packages/shared/kbn-apm-types-shared/src/types/index.d.ts @@ -0,0 +1 @@ +export type * from './common'; diff --git a/src/platform/packages/shared/kbn-content-management-utils/index.d.ts b/src/platform/packages/shared/kbn-content-management-utils/index.d.ts new file mode 100644 index 0000000000000..5b64d38d3caa4 --- /dev/null +++ b/src/platform/packages/shared/kbn-content-management-utils/index.d.ts @@ -0,0 +1,4 @@ +export type * from './src/types'; +export * from './src/schema'; +export * from './src/saved_object_content_storage'; +export * from './src/utils'; diff --git a/src/platform/packages/shared/kbn-content-management-utils/src/saved_object_content_storage.d.ts b/src/platform/packages/shared/kbn-content-management-utils/src/saved_object_content_storage.d.ts new file mode 100644 index 0000000000000..648bfa787f64b --- /dev/null +++ b/src/platform/packages/shared/kbn-content-management-utils/src/saved_object_content_storage.d.ts @@ -0,0 +1,63 @@ +import type { SearchQuery, SearchIn } from '@kbn/content-management-plugin/common'; +import type { ContentStorage, StorageContext, MSearchConfig } from '@kbn/content-management-plugin/server'; +import type { SavedObject, SavedObjectReference, SavedObjectsFindOptions, SavedObjectsCreateOptions, SavedObjectsUpdateOptions, SavedObjectsFindResult } from '@kbn/core-saved-objects-api-server'; +import type { Logger } from '@kbn/logging'; +import type { CMCrudTypes, ServicesDefinitionSet } from './types'; +export type PartialSavedObject = Omit>, 'references'> & { + references: SavedObjectReference[] | undefined; +}; +export interface SearchArgsToSOFindOptionsOptionsDefault { + fields?: string[]; + searchFields?: string[]; +} +export declare const searchArgsToSOFindOptionsDefault: (params: SearchIn) => SavedObjectsFindOptions; +export declare const createArgsToSoCreateOptionsDefault: (params: SavedObjectsCreateOptions) => SavedObjectsCreateOptions; +export declare const updateArgsToSoUpdateOptionsDefault: (params: SavedObjectsUpdateOptions) => SavedObjectsUpdateOptions; +export type CreateArgsToSoCreateOptions = (params: Types['CreateOptions']) => SavedObjectsCreateOptions; +export type SearchArgsToSOFindOptions = (params: Types['SearchIn']) => SavedObjectsFindOptions; +export type UpdateArgsToSoUpdateOptions = (params: Types['UpdateOptions']) => SavedObjectsUpdateOptions; +export interface SOContentStorageConstructorParams { + savedObjectType: string; + cmServicesDefinition: ServicesDefinitionSet; + allowedSavedObjectAttributes: Array; + createArgsToSoCreateOptions?: CreateArgsToSoCreateOptions; + updateArgsToSoUpdateOptions?: UpdateArgsToSoUpdateOptions; + searchArgsToSOFindOptions?: SearchArgsToSOFindOptions; + /** + * MSearch is a feature that allows searching across multiple content types + * (for example, could be used in a general content finder or the like) + * + * defaults to false + */ + enableMSearch?: boolean; + mSearchAdditionalSearchFields?: string[]; + logger: Logger; + throwOnResultValidationError: boolean; +} +export declare abstract class SOContentStorage implements ContentStorage> { + constructor({ savedObjectType, cmServicesDefinition, createArgsToSoCreateOptions, updateArgsToSoUpdateOptions, searchArgsToSOFindOptions, enableMSearch, allowedSavedObjectAttributes, mSearchAdditionalSearchFields, logger, throwOnResultValidationError, }: SOContentStorageConstructorParams); + protected static getSOClientFromRequest: (ctx: StorageContext) => Promise; + protected readonly throwOnResultValidationError: boolean; + protected readonly logger: Logger; + protected readonly savedObjectType: SOContentStorageConstructorParams['savedObjectType']; + protected readonly cmServicesDefinition: SOContentStorageConstructorParams['cmServicesDefinition']; + protected readonly createArgsToSoCreateOptions: CreateArgsToSoCreateOptions; + protected readonly updateArgsToSoUpdateOptions: UpdateArgsToSoUpdateOptions; + protected readonly searchArgsToSOFindOptions: SearchArgsToSOFindOptions; + protected readonly allowedSavedObjectAttributes: Array; + protected savedObjectToItem(savedObject: SavedObject): Types['Item']; + protected savedObjectToItem(savedObject: PartialSavedObject, partial: true): Types['PartialItem']; + mSearch?: { + savedObjectType: string; + toItemResult: (ctx: StorageContext, savedObject: SavedObjectsFindResult) => Types['Item']; + additionalSearchFields?: string[]; + }; + get(ctx: StorageContext, id: string): Promise; + bulkGet(): Promise; + create(ctx: StorageContext, data: Types['Attributes'], options: Types['CreateOptions']): Promise; + update(ctx: StorageContext, id: string, data: Types['Attributes'], options: Types['UpdateOptions']): Promise; + delete(ctx: StorageContext, id: string, options?: { + force: boolean; + }): Promise; + search(ctx: StorageContext, query: SearchQuery, options?: Types['SearchOptions']): Promise; +} diff --git a/src/platform/packages/shared/kbn-content-management-utils/src/schema.d.ts b/src/platform/packages/shared/kbn-content-management-utils/src/schema.d.ts new file mode 100644 index 0000000000000..ec862f952bd3f --- /dev/null +++ b/src/platform/packages/shared/kbn-content-management-utils/src/schema.d.ts @@ -0,0 +1,265 @@ +import type { ObjectType } from '@kbn/config-schema'; +export declare const apiError: ObjectType<{ + error: import("@kbn/config-schema").Type; + message: import("@kbn/config-schema").Type; + statusCode: import("@kbn/config-schema").Type; + metadata: ObjectType<{}>; +}>; +export declare const referenceSchema: ObjectType<{ + name: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + id: import("@kbn/config-schema").Type; +}>; +export declare const referencesSchema: import("@kbn/config-schema").Type[]>; +export declare const savedObjectSchema: >(attributesSchema: T) => ObjectType<{ + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; + updatedAt: import("@kbn/config-schema").Type; + createdBy: import("@kbn/config-schema").Type; + updatedBy: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + statusCode: number; + }> | undefined>; + attributes: T; + references: import("@kbn/config-schema").Type[]>; + namespaces: import("@kbn/config-schema").Type; + originId: import("@kbn/config-schema").Type; + managed: import("@kbn/config-schema").Type; +}>; +export declare const objectTypeToGetResultSchema: >(soSchema: T) => ObjectType<{ + item: T; + meta: ObjectType<{ + outcome: import("@kbn/config-schema").Type<"conflict" | "exactMatch" | "aliasMatch">; + aliasTargetId: import("@kbn/config-schema").Type; + aliasPurpose: import("@kbn/config-schema").Type<"savedObjectConversion" | "savedObjectImport" | undefined>; + }>; +}>; +export declare const createOptionsSchemas: { + id: import("@kbn/config-schema").Type; + references: import("@kbn/config-schema").Type[] | undefined>; + overwrite: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + refresh: import("@kbn/config-schema").Type; + initialNamespaces: import("@kbn/config-schema").Type; + managed: import("@kbn/config-schema").Type; +}; +export declare const schemaAndOr: import("@kbn/config-schema").Type<"AND" | "OR">; +export declare const searchOptionsSchemas: { + page: import("@kbn/config-schema").Type; + perPage: import("@kbn/config-schema").Type; + sortField: import("@kbn/config-schema").Type; + sortOrder: import("@kbn/config-schema").Type<"desc" | "asc" | undefined>; + fields: import("@kbn/config-schema").Type; + search: import("@kbn/config-schema").Type; + searchFields: import("@kbn/config-schema").Type; + rootSearchFields: import("@kbn/config-schema").Type; + hasReference: import("@kbn/config-schema").Type | Readonly<{} & { + id: string; + name: string; + type: string; + }>[] | undefined>; + hasReferenceOperator: import("@kbn/config-schema").Type<"AND" | "OR" | undefined>; + hasNoReference: import("@kbn/config-schema").Type | Readonly<{} & { + id: string; + name: string; + type: string; + }>[] | undefined>; + hasNoReferenceOperator: import("@kbn/config-schema").Type<"AND" | "OR" | undefined>; + defaultSearchOperator: import("@kbn/config-schema").Type<"AND" | "OR" | undefined>; + namespaces: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + filter: import("@kbn/config-schema").Type; + pit: import("@kbn/config-schema").Type | undefined>; +}; +export declare const updateOptionsSchema: { + references: import("@kbn/config-schema").Type[] | undefined>; + version: import("@kbn/config-schema").Type; + refresh: import("@kbn/config-schema").Type; + upsert: >(attributesSchema: T) => import("@kbn/config-schema").Type ? "attributes" : never) extends infer T_1 extends keyof { + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; + updatedAt: import("@kbn/config-schema").Type; + createdBy: import("@kbn/config-schema").Type; + updatedBy: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + statusCode: number; + }> | undefined>; + attributes: T; + references: import("@kbn/config-schema").Type[]>; + namespaces: import("@kbn/config-schema").Type; + originId: import("@kbn/config-schema").Type; + managed: import("@kbn/config-schema").Type; + } ? { [P in T_1]: { + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; + updatedAt: import("@kbn/config-schema").Type; + createdBy: import("@kbn/config-schema").Type; + updatedBy: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + statusCode: number; + }> | undefined>; + attributes: T; + references: import("@kbn/config-schema").Type[]>; + namespaces: import("@kbn/config-schema").Type; + originId: import("@kbn/config-schema").Type; + managed: import("@kbn/config-schema").Type; + }[P]; } : never)]?: import("@kbn/config-schema").TypeOf<{ + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; + updatedAt: import("@kbn/config-schema").Type; + createdBy: import("@kbn/config-schema").Type; + updatedBy: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + statusCode: number; + }> | undefined>; + attributes: T; + references: import("@kbn/config-schema").Type[]>; + namespaces: import("@kbn/config-schema").Type; + originId: import("@kbn/config-schema").Type; + managed: import("@kbn/config-schema").Type; + }[K]> | undefined; } & { [K_1 in keyof ("id" | "type" | "references" | (undefined extends import("@kbn/config-schema").TypeOf ? never : "attributes") extends infer T_2 extends keyof { + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; + updatedAt: import("@kbn/config-schema").Type; + createdBy: import("@kbn/config-schema").Type; + updatedBy: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + statusCode: number; + }> | undefined>; + attributes: T; + references: import("@kbn/config-schema").Type[]>; + namespaces: import("@kbn/config-schema").Type; + originId: import("@kbn/config-schema").Type; + managed: import("@kbn/config-schema").Type; + } ? { [P_1 in T_2]: { + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; + updatedAt: import("@kbn/config-schema").Type; + createdBy: import("@kbn/config-schema").Type; + updatedBy: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + statusCode: number; + }> | undefined>; + attributes: T; + references: import("@kbn/config-schema").Type[]>; + namespaces: import("@kbn/config-schema").Type; + originId: import("@kbn/config-schema").Type; + managed: import("@kbn/config-schema").Type; + }[P_1]; } : never)]: import("@kbn/config-schema").TypeOf<{ + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; + updatedAt: import("@kbn/config-schema").Type; + createdBy: import("@kbn/config-schema").Type; + updatedBy: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + statusCode: number; + }> | undefined>; + attributes: T; + references: import("@kbn/config-schema").Type[]>; + namespaces: import("@kbn/config-schema").Type; + originId: import("@kbn/config-schema").Type; + managed: import("@kbn/config-schema").Type; + }[K_1]>; }> | undefined>; + retryOnConflict: import("@kbn/config-schema").Type; + mergeAttributes: import("@kbn/config-schema").Type; +}; +export declare const createResultSchema: >(soSchema: T) => ObjectType<{ + item: T; +}>; +export declare const searchResultSchema: , M extends ObjectType = never>(soSchema: T, meta?: M) => ObjectType<{ + meta?: M | undefined; + hits: import("@kbn/config-schema").Type[]>; + pagination: ObjectType<{ + total: import("@kbn/config-schema").Type; + cursor: import("@kbn/config-schema").Type; + }>; +}>; diff --git a/src/platform/packages/shared/kbn-content-management-utils/src/types.d.ts b/src/platform/packages/shared/kbn-content-management-utils/src/types.d.ts new file mode 100644 index 0000000000000..bed2ccb4802b8 --- /dev/null +++ b/src/platform/packages/shared/kbn-content-management-utils/src/types.d.ts @@ -0,0 +1,316 @@ +import type { GetIn, GetResult, CreateIn, CreateResult, SearchIn, SearchResult, UpdateIn, UpdateResult, DeleteIn, DeleteResult } from '@kbn/content-management-plugin/common'; +import type { ContentManagementServicesDefinition as ServicesDefinition, Version } from '@kbn/object-versioning'; +export interface ServicesDefinitionSet { + [version: Version]: ServicesDefinition; +} +import type { SortOrder, AggregationsAggregationContainer, SortResults } from '@elastic/elasticsearch/lib/api/types'; +import type { MutatingOperationRefreshSetting, SavedObjectsPitParams, SavedObjectsFindOptionsReference } from '@kbn/core-saved-objects-api-server'; +type KueryNode = any; +export interface Reference { + type: string; + id: string; + name: string; +} +/** Saved Object create options - Pick and Omit to customize */ +export interface SavedObjectCreateOptions { + /** (not recommended) Specify an id for the document */ + id?: string; + /** Overwrite existing documents (defaults to false) */ + overwrite?: boolean; + /** + * An opaque version number which changes on each successful write operation. + * Can be used in conjunction with `overwrite` for implementing optimistic concurrency control. + **/ + version?: string; + /** Array of referenced saved objects. */ + references?: Reference[]; + /** The Elasticsearch Refresh setting for this operation */ + refresh?: boolean; + /** + * Optional initial namespaces for the object to be created in. If this is defined, it will supersede the namespace ID that is in + * {@link SavedObjectsCreateOptions}. + * + * * For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, + * including the "All spaces" identifier (`'*'`). + * * For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only + * be used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed. + * * For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used. + */ + initialNamespaces?: string[]; + /** + * Whether the object is managed by the application. + */ + managed?: boolean; +} +/** Saved Object search options - Pick and Omit to customize */ +export interface SavedObjectSearchOptions { + /** the page of results to return */ + page?: number; + /** the number of objects per page */ + perPage?: number; + /** which field to sort by */ + sortField?: string; + /** sort order, ascending or descending */ + sortOrder?: SortOrder; + /** + * An array of fields to include in the results + * @example + * SavedObjects.find({type: 'dashboard', fields: ['attributes.name', 'attributes.location']}) + */ + fields?: string[]; + /** Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String `query` argument for more information */ + search?: string; + /** The fields to perform the parsed query against. See Elasticsearch Simple Query String `fields` argument for more information */ + searchFields?: string[]; + /** + * Use the sort values from the previous page to retrieve the next page of results. + */ + searchAfter?: SortResults; + /** + * The fields to perform the parsed query against. Unlike the `searchFields` argument, these are expected to be root fields and will not + * be modified. If used in conjunction with `searchFields`, both are concatenated together. + */ + rootSearchFields?: string[]; + /** + * Search for documents having a reference to the specified objects. + * Use `hasReferenceOperator` to specify the operator to use when searching for multiple references. + */ + hasReference?: SavedObjectsFindOptionsReference | SavedObjectsFindOptionsReference[]; + /** + * The operator to use when searching by multiple references using the `hasReference` option. Defaults to `OR` + */ + hasReferenceOperator?: 'AND' | 'OR'; + /** + * Search for documents *not* having a reference to the specified objects. + * Use `hasNoReferenceOperator` to specify the operator to use when searching for multiple references. + */ + hasNoReference?: SavedObjectsFindOptionsReference | SavedObjectsFindOptionsReference[]; + /** + * The operator to use when searching by multiple references using the `hasNoReference` option. Defaults to `OR` + */ + hasNoReferenceOperator?: 'AND' | 'OR'; + /** + * The search operator to use with the provided filter. Defaults to `OR` + */ + defaultSearchOperator?: 'AND' | 'OR'; + /** filter string for the search query */ + filter?: string | KueryNode; + /** + * A record of aggregations to perform. + * The API currently only supports a limited set of metrics and bucket aggregation types. + * Additional aggregation types can be contributed to Core. + * + * @example + * Aggregating on SO attribute field + * ```ts + * const aggs = { latest_version: { max: { field: 'dashboard.attributes.version' } } }; + * return client.find({ type: 'dashboard', aggs }) + * ``` + * + * @example + * Aggregating on SO root field + * ```ts + * const aggs = { latest_update: { max: { field: 'dashboard.updated_at' } } }; + * return client.find({ type: 'dashboard', aggs }) + * ``` + * + * @alpha + */ + aggs?: Record; + /** array of namespaces to search */ + namespaces?: string[]; + /** + * Search against a specific Point In Time (PIT) that you've opened with {@link SavedObjectsClient.openPointInTimeForType}. + */ + pit?: SavedObjectsPitParams; +} +/** Saved Object update options - Pick and Omit to customize */ +export interface SavedObjectUpdateOptions { + /** Array of referenced saved objects. */ + references?: Reference[]; + version?: string; + /** The Elasticsearch Refresh setting for this operation */ + refresh?: MutatingOperationRefreshSetting; + /** If specified, will be used to perform an upsert if the object doesn't exist */ + upsert?: Attributes; + /** + * The Elasticsearch `retry_on_conflict` setting for this operation. + * Defaults to `0` when `version` is provided, `3` otherwise. + */ + retryOnConflict?: number; + /** + * By default, update will merge the provided attributes with the ones present on the document + * (performing a standard partial update). Setting this option to `false` will change the behavior, performing + * a "full" update instead, where the provided attributes will fully replace the existing ones. + * Defaults to `true`. + */ + mergeAttributes?: boolean; +} +/** Return value for Saved Object get, T is item returned */ +export type GetResultSO = GetResult; +/** + * Saved object with metadata + */ +export interface SOWithMetadata { + id: string; + type: string; + version?: string; + createdAt?: string; + updatedAt?: string; + createdBy?: string; + updatedBy?: string; + error?: { + error: string; + message: string; + statusCode: number; + metadata?: Record; + }; + managed?: boolean; + attributes: Attributes; + references: Reference[]; + namespaces?: string[]; + originId?: string; +} +export type SOWithMetadataPartial = Omit, 'attributes' | 'references'> & { + attributes: Partial; + references: Reference[] | undefined; +}; +export interface CMCrudTypes { + /** + * Saved object attributes + */ + Attributes: object; + /** + * Complete saved object + */ + Item: SOWithMetadata; + /** + * Partial saved object, used as output for update + */ + PartialItem: SOWithMetadataPartial; + /** + * Get item params + */ + GetIn: GetIn; + /** + * Get item result + */ + GetOut: GetResultSO; + /** + * Create item params + */ + CreateIn: CreateIn; + /** + * Create item result + */ + CreateOut: CreateResult; + /** + * + */ + CreateOptions: object; + /** + * Search item params + */ + SearchIn: SearchIn; + /** + * Search item result + */ + SearchOut: SearchResult; + /** + * + */ + SearchOptions: object; + /** + * Update item params + */ + UpdateIn: UpdateIn; + /** + * Update item result + */ + UpdateOut: UpdateResult; + /** + * + */ + UpdateOptions: object; + /** + * Delete item params + */ + DeleteIn: DeleteIn; + /** + * Delete item result + */ + DeleteOut: DeleteResult; +} +/** + * Types used by content management storage + * @argument ContentType - content management type. assumed to be the same as saved object type + * @argument Attributes - attributes of the saved object + */ +export interface ContentManagementCrudTypes { + Attributes: Attributes; + /** + * Complete saved object + */ + Item: SOWithMetadata; + /** + * Partial saved object, used as output for update + */ + PartialItem: SOWithMetadataPartial; + /** + * Create options + */ + CreateOptions: CreateOptions; + /** + * Update options + */ + UpdateOptions: UpdateOptions; + /** + * Search options + */ + SearchOptions: SearchOptions; + /** + * Get item params + */ + GetIn: GetIn; + /** + * Get item result + */ + GetOut: GetResultSO>; + /** + * Create item params + */ + CreateIn: CreateIn; + /** + * Create item result + */ + CreateOut: CreateResult>; + /** + * Search item params + */ + SearchIn: SearchIn; + /** + * Search item result + */ + SearchOut: SearchResult>; + /** + * Update item params + */ + UpdateIn: UpdateIn, UpdateOptions>; + /** + * Update item result + */ + UpdateOut: UpdateResult>; + /** + * Delete item params + */ + DeleteIn: DeleteIn; + /** + * Delete item result + */ + DeleteOut: DeleteResult; +} +export {}; diff --git a/src/platform/packages/shared/kbn-content-management-utils/src/utils.d.ts b/src/platform/packages/shared/kbn-content-management-utils/src/utils.d.ts new file mode 100644 index 0000000000000..1e191db54711b --- /dev/null +++ b/src/platform/packages/shared/kbn-content-management-utils/src/utils.d.ts @@ -0,0 +1,7 @@ +export declare const tagsToFindOptions: ({ included, excluded, }?: { + included?: string[]; + excluded?: string[]; +}) => { + hasReference: import("@kbn/core-saved-objects-api-server").SavedObjectsFindOptionsReference[] | undefined; + hasNoReference: import("@kbn/core-saved-objects-api-server").SavedObjectsFindOptionsReference[] | undefined; +}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/cps_icon.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/cps_icon.d.ts new file mode 100644 index 0000000000000..685b679624393 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/cps_icon.d.ts @@ -0,0 +1,2 @@ +import React from 'react'; +export declare const CPSIconDisabled: () => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_list_item.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_list_item.d.ts new file mode 100644 index 0000000000000..2e5f840b00053 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/project_list_item.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +import type { CPSProject } from '../types'; +interface ProjectListItemProps { + project: CPSProject; + index: number; + isOriginProject?: boolean; +} +export declare const ProjectListItem: ({ project, index, isOriginProject }: ProjectListItemProps) => React.JSX.Element; +export {}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_picker.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_picker.d.ts new file mode 100644 index 0000000000000..42ec02ba771e5 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/project_picker.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; +import type { ProjectRouting } from '@kbn/es-query'; +import type { UseFetchProjectsResult } from './use_fetch_projects'; +export interface ProjectPickerProps { + projectRouting?: ProjectRouting; + onProjectRoutingChange: (projectRouting: ProjectRouting) => void; + projects: UseFetchProjectsResult; + totalProjectCount: number; + isReadonly?: boolean; + settingsComponent?: React.ReactNode; +} +export declare const ProjectPicker: ({ projectRouting, onProjectRoutingChange, projects, totalProjectCount, isReadonly, settingsComponent, }: ProjectPickerProps) => React.JSX.Element | null; +export declare const ProjectPickerSkeleton: () => React.JSX.Element; +export declare const DisabledProjectPicker: ({ totalProjectCount }: { + totalProjectCount: number; +}) => React.JSX.Element | null; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_container.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_container.d.ts new file mode 100644 index 0000000000000..770293dd3a6ad --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_container.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import type { ICPSManager } from '../types'; +interface ProjectPickerContainerProps { + cpsManager: ICPSManager; +} +/** + * Container component that connects ProjectPicker to CPSManager. + * Delegates to ActiveProjectPicker or DisabledProjectPicker based on access level, + * so the fetch hook only runs when the picker is actually active. + */ +export declare const ProjectPickerContainer: React.FC; +export {}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_content.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_content.d.ts new file mode 100644 index 0000000000000..26694305b0aa1 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_content.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; +import type { ProjectRouting } from '@kbn/es-query'; +import type { UseFetchProjectsResult } from './use_fetch_projects'; +export interface ProjectPickerContentProps { + projectRouting?: ProjectRouting; + onProjectRoutingChange: (projectRouting: ProjectRouting) => void; + projects: UseFetchProjectsResult; + isReadonly?: boolean; +} +export declare const ProjectPickerContent: ({ projectRouting, onProjectRoutingChange, projects, isReadonly, }: ProjectPickerContentProps) => React.JSX.Element | null; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_settings.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_settings.d.ts new file mode 100644 index 0000000000000..2720151df3459 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_settings.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; +export interface ProjectPickerSettingsProps { + onResetToDefaults: () => void; +} +export declare const ProjectPickerSettings: ({ onResetToDefaults }: ProjectPickerSettingsProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/strings.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/strings.d.ts new file mode 100644 index 0000000000000..930bc4f99b606 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/strings.d.ts @@ -0,0 +1,15 @@ +export declare const strings: { + allButtonLabel: () => string; + getProjectPickerButtonAriaLabel: () => string; + getProjectPickerButtonLabel: (numberOfProjects: number, totalProjects: number) => string; + getProjectPickerPopoverTitle: () => string; + getManageCrossProjectSearchLabel: () => string; + getOriginProjectLabel: () => string; + getProjectPickerTourTitle: () => string; + getProjectPickerTourContent: () => string; + getProjectPickerTourCloseButton: () => string; + getProjectPickerDisabledTooltip: () => string; + getProjectPickerReadonlyCallout: () => string; + getProjectPickerReadonlyLensCallout: () => string; + getProjectPickerFetchError: () => string; +}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/use_cps_picker_access.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/use_cps_picker_access.d.ts new file mode 100644 index 0000000000000..f23ddaa70c8b5 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/use_cps_picker_access.d.ts @@ -0,0 +1,23 @@ +import type { Observable } from 'rxjs'; +import type { ICPSManager, CPSAppAccessResolver } from '../types'; +interface UseCpsPickerAccessParams { + /** The access resolver function - called to determine access for a given location */ + resolver: CPSAppAccessResolver; + /** Observable of the current app ID */ + currentAppId$: Observable; + /** The CPS manager instance (may be undefined if CPS is disabled) */ + cpsManager?: ICPSManager; +} +/** + * Registers a CPS picker access resolver for the current app. + * Automatically cleans up (sets DISABLED) on unmount. + * + * Consumers are responsible for providing their own resolver logic + * based on their routing patterns. + * + * NOTE: Call this hook only once per rendered page (at the top-level page component). + * Calling it in nested sub-routes or sub-components risks the cleanup of an inner instance + * overwriting the CPS state set by an outer one. + */ +export declare const useCpsPickerAccess: ({ resolver, currentAppId$, cpsManager, }: UseCpsPickerAccessParams) => void; +export {}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/use_fetch_projects.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/use_fetch_projects.d.ts new file mode 100644 index 0000000000000..a1b9e3d45f7a9 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/use_fetch_projects.d.ts @@ -0,0 +1,13 @@ +import type { ProjectRouting } from '@kbn/es-query'; +import type { CPSProject, ProjectsData } from '../types'; +export interface UseFetchProjectsResult { + originProject: CPSProject | null; + linkedProjects: CPSProject[]; + isLoading: boolean; + error: Error | null; +} +/** + * Hook for fetching projects data from CPSManager. + * Uses a single state object to batch all updates into one re-render per fetch cycle. + */ +export declare const useFetchProjects: (fetchProjects: (routing?: ProjectRouting) => Promise, routing?: ProjectRouting) => UseFetchProjectsResult; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/use_project_picker_tour.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/use_project_picker_tour.d.ts new file mode 100644 index 0000000000000..473e97f2e0ab4 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/use_project_picker_tour.d.ts @@ -0,0 +1,4 @@ +export declare const useProjectPickerTour: () => { + isTourOpen: boolean; + closeTour: () => void; +}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/use_route_based_cps_picker_access.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/use_route_based_cps_picker_access.d.ts new file mode 100644 index 0000000000000..8d35b1f6b76d8 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/components/use_route_based_cps_picker_access.d.ts @@ -0,0 +1,14 @@ +import type { Observable } from 'rxjs'; +import type { ICPSManager } from '../types'; +import { ProjectRoutingAccess } from '../types'; +interface ApplicationService { + currentAppId$: Observable; +} +interface CpsService { + cpsManager?: ICPSManager; +} +export declare const useRouteBasedCpsPickerAccess: (access: ProjectRoutingAccess, { application, cps }: { + application: ApplicationService; + cps?: CpsService; +}) => void; +export {}; diff --git a/src/platform/packages/shared/kbn-cps-utils/index.d.ts b/src/platform/packages/shared/kbn-cps-utils/index.d.ts new file mode 100644 index 0000000000000..0536b2bed664b --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/index.d.ts @@ -0,0 +1,13 @@ +export type { ProjectPickerProps } from './components/project_picker'; +export type { ProjectPickerContentProps } from './components/project_picker_content'; +export type { UseFetchProjectsResult } from './components/use_fetch_projects'; +export type { CPSProject, ProjectTagsResponse, ICPSManager, ProjectsData, CPSAppAccessResolver, } from './types'; +export type { ProjectRoutingValue } from '@kbn/cps-common'; +export { ProjectPicker } from './components/project_picker'; +export { ProjectPickerContent } from './components/project_picker_content'; +export { ProjectPickerContainer } from './components/project_picker_container'; +export { useFetchProjects } from './components/use_fetch_projects'; +export { useCpsPickerAccess } from './components/use_cps_picker_access'; +export { useRouteBasedCpsPickerAccess } from './components/use_route_based_cps_picker_access'; +export { PROJECT_ROUTING } from '@kbn/cps-common'; +export { ProjectRoutingAccess } from './types'; diff --git a/src/platform/packages/shared/kbn-cps-utils/types.d.ts b/src/platform/packages/shared/kbn-cps-utils/types.d.ts new file mode 100644 index 0000000000000..ef1d17b12b798 --- /dev/null +++ b/src/platform/packages/shared/kbn-cps-utils/types.d.ts @@ -0,0 +1,52 @@ +import type { ProjectRouting } from '@kbn/es-query'; +import type { Observable } from 'rxjs'; +/** + * Access levels for project routing picker + */ +export declare enum ProjectRoutingAccess { + /** Cannot interact with picker - picker is disabled */ + DISABLED = "disabled", + /** Can view but not edit - shows read-only message */ + READONLY = "readonly", + /** Full functionality - can change project scope */ + EDITABLE = "editable" +} +/** + * Function that determines the project picker access level for a given location. + * Apps register one of these via `registerAppAccess` to control picker behavior + * based on runtime conditions (feature flags, config values, route patterns, etc.). + */ +export type CPSAppAccessResolver = (location: string) => ProjectRoutingAccess; +export interface CPSProject { + _id: string; + _alias: string; + _type: string; + _organisation: string; + _csp?: string; + _region?: string; + [key: string]: string | undefined; +} +export interface ProjectTagsResponse { + origin: Record; + linked_projects: Record; +} +export interface ProjectsData { + origin: CPSProject | null; + linkedProjects: CPSProject[]; +} +export interface ICPSManager { + whenReady(): Promise; + fetchProjects(projectRouting?: ProjectRouting): Promise; + getTotalProjectCount(): number; + getProjectRouting$(): Observable; + setProjectRouting(projectRouting: ProjectRouting | undefined): void; + /** + * Returns an explicit override value when provided, regardless of picker access mode. + * Otherwise resolves routing based on current picker access and CPS state. + */ + getProjectRouting(overrideValue?: ProjectRouting): ProjectRouting | undefined; + getDefaultProjectRouting(): ProjectRouting; + updateDefaultProjectRouting(projectRouting?: ProjectRouting): void; + getProjectPickerAccess$(): Observable; + registerAppAccess(appId: string, resolver: CPSAppAccessResolver): void; +} diff --git a/src/platform/packages/shared/kbn-css-utils/public/full_screen_bg_css.d.ts b/src/platform/packages/shared/kbn-css-utils/public/full_screen_bg_css.d.ts new file mode 100644 index 0000000000000..4790d825ac821 --- /dev/null +++ b/src/platform/packages/shared/kbn-css-utils/public/full_screen_bg_css.d.ts @@ -0,0 +1,3 @@ +import type { UseEuiTheme } from '@elastic/eui'; +export declare const kbnFullScreenBgCss: ({ euiTheme, colorMode }: UseEuiTheme) => import("@emotion/react").SerializedStyles; +export declare const useKbnFullScreenBgCss: () => import("@emotion/react").SerializedStyles; diff --git a/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.d.ts b/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.d.ts new file mode 100644 index 0000000000000..294e7e9e53cf5 --- /dev/null +++ b/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.d.ts @@ -0,0 +1,23 @@ +import type { CSSInterpolation } from '@emotion/serialize'; +import type { UseEuiTheme } from '@elastic/eui'; +export type EmotionStyles = Record CSSInterpolation)>; +/** + * Custom hook to reduce boilerplate when working with Emotion styles that may depend on + * the EUI theme. + * + * Accepts a map of styles where each entry is either a static Emotion style (via `css`) + * or a function that returns styles based on the current `euiTheme`. + * + * It returns a memoized version of the style map with all values resolved to static + * Emotion styles, allowing components to use a clean and unified object for styling. + * + * This helps simplify component code by centralizing theme-aware style logic. + * + * Example usage: + * const componentStyles = { + * container: css({ overflow: hidden }), + * leftPane: ({ euiTheme }) => css({ paddingTop: euiTheme.size.m }), + * } + * const styles = useMemoCss(componentStyles); + */ +export declare const useMemoCss: (styleMap: T) => { [K in keyof T]: CSSInterpolation; }; diff --git a/src/platform/packages/shared/kbn-data-service-server/index.d.ts b/src/platform/packages/shared/kbn-data-service-server/index.d.ts new file mode 100644 index 0000000000000..c3c5a02dffbb6 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service-server/index.d.ts @@ -0,0 +1,2 @@ +export { refreshIntervalSchema } from './src/refresh_interval'; +export type { RefreshInterval } from './src/types'; diff --git a/src/platform/packages/shared/kbn-data-service-server/src/refresh_interval.d.ts b/src/platform/packages/shared/kbn-data-service-server/src/refresh_interval.d.ts new file mode 100644 index 0000000000000..132c74ae8471a --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service-server/src/refresh_interval.d.ts @@ -0,0 +1,4 @@ +export declare const refreshIntervalSchema: import("@kbn/config-schema").ObjectType<{ + pause: import("@kbn/config-schema").Type; + value: import("@kbn/config-schema").Type; +}>; diff --git a/src/platform/packages/shared/kbn-data-service-server/src/types.d.ts b/src/platform/packages/shared/kbn-data-service-server/src/types.d.ts new file mode 100644 index 0000000000000..d66a9736f67c5 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service-server/src/types.d.ts @@ -0,0 +1,3 @@ +import type { TypeOf } from '@kbn/config-schema'; +import type { refreshIntervalSchema } from './refresh_interval'; +export type RefreshInterval = TypeOf; diff --git a/src/platform/packages/shared/kbn-data-service/index.d.ts b/src/platform/packages/shared/kbn-data-service/index.d.ts new file mode 100644 index 0000000000000..1557ba50e5657 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service/index.d.ts @@ -0,0 +1,4 @@ +export type { GetConfigFn } from './src/types'; +export { UI_SETTINGS } from './src/constants'; +export { getEsQueryConfig } from './src/es_query'; +export { tabifyDocs, flattenHit, getFlattenedFieldsComparator, type FlattenedFieldsComparator, } from './src/search/tabify'; diff --git a/src/platform/packages/shared/kbn-data-service/src/constants.d.ts b/src/platform/packages/shared/kbn-data-service/src/constants.d.ts new file mode 100644 index 0000000000000..55728832f9d56 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service/src/constants.d.ts @@ -0,0 +1,26 @@ +export declare const UI_SETTINGS: { + readonly META_FIELDS: "metaFields"; + readonly DOC_HIGHLIGHT: "doc_table:highlight"; + readonly QUERY_STRING_OPTIONS: "query:queryString:options"; + readonly QUERY_ALLOW_LEADING_WILDCARDS: "query:allowLeadingWildcards"; + readonly SEARCH_QUERY_LANGUAGE: "search:queryLanguage"; + readonly SORT_OPTIONS: "sort:options"; + readonly COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: "courier:ignoreFilterIfFieldNotInIndex"; + readonly COURIER_SET_REQUEST_PREFERENCE: "courier:setRequestPreference"; + readonly COURIER_CUSTOM_REQUEST_PREFERENCE: "courier:customRequestPreference"; + readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: "courier:maxConcurrentShardRequests"; + readonly SEARCH_INCLUDE_FROZEN: "search:includeFrozen"; + readonly SEARCH_TIMEOUT: "search:timeout"; + readonly HISTOGRAM_BAR_TARGET: "histogram:barTarget"; + readonly HISTOGRAM_MAX_BARS: "histogram:maxBars"; + readonly HISTORY_LIMIT: "history:limit"; + readonly TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: "timepicker:refreshIntervalDefaults"; + readonly TIMEPICKER_QUICK_RANGES: "timepicker:quickRanges"; + readonly TIMEPICKER_TIME_DEFAULTS: "timepicker:timeDefaults"; + readonly FILTERS_PINNED_BY_DEFAULT: "filters:pinnedByDefault"; + readonly FILTERS_EDITOR_SUGGEST_VALUES: "filterEditor:suggestValues"; + readonly AUTOCOMPLETE_USE_TIMERANGE: "autocomplete:useTimeRange"; + readonly AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: "autocomplete:valueSuggestionMethod"; + readonly DATE_FORMAT: "dateFormat"; + readonly DATEFORMAT_TZ: "dateFormat:tz"; +}; diff --git a/src/platform/packages/shared/kbn-data-service/src/es_query/get_es_query_config.d.ts b/src/platform/packages/shared/kbn-data-service/src/es_query/get_es_query_config.d.ts new file mode 100644 index 0000000000000..42c0412656ed0 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service/src/es_query/get_es_query_config.d.ts @@ -0,0 +1,7 @@ +import type { EsQueryConfig } from '@kbn/es-query'; +import type { GetConfigFn } from '../types'; +interface KibanaConfig { + get: GetConfigFn; +} +export declare function getEsQueryConfig(config: KibanaConfig): EsQueryConfig; +export {}; diff --git a/src/platform/packages/shared/kbn-data-service/src/es_query/index.d.ts b/src/platform/packages/shared/kbn-data-service/src/es_query/index.d.ts new file mode 100644 index 0000000000000..3396c858bf007 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service/src/es_query/index.d.ts @@ -0,0 +1 @@ +export { getEsQueryConfig } from './get_es_query_config'; diff --git a/src/platform/packages/shared/kbn-data-service/src/search/tabify/index.d.ts b/src/platform/packages/shared/kbn-data-service/src/search/tabify/index.d.ts new file mode 100644 index 0000000000000..cfb81aa99db7a --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service/src/search/tabify/index.d.ts @@ -0,0 +1 @@ +export { tabifyDocs, flattenHit, getFlattenedFieldsComparator, type FlattenedFieldsComparator, } from './tabify_docs'; diff --git a/src/platform/packages/shared/kbn-data-service/src/search/tabify/tabify_docs.d.ts b/src/platform/packages/shared/kbn-data-service/src/search/tabify/tabify_docs.d.ts new file mode 100644 index 0000000000000..cefb6cc8ba445 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service/src/search/tabify/tabify_docs.d.ts @@ -0,0 +1,35 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { Datatable } from '@kbn/expressions-plugin/common'; +import type { DataView } from '@kbn/data-views-plugin/common'; +interface TabifyDocsOptions { + shallow?: boolean; + /** + * If set to `false` the _source of the document, if requested, won't be + * merged into the flattened document. + */ + source?: boolean; + /** + * If set to `true` values that have been ignored in ES (ignored_field_values) + * will be merged into the flattened document. This will only have an effect if + * the `hit` has been retrieved using the `fields` option. + */ + includeIgnoredValues?: boolean; +} +type Hit = Partial> & { + ignored_field_values?: Record; +}; +/** + * Flattens an individual hit (from an ES response) into an object. This will + * create flattened field names, like `user.name`. + * + * @param hit The hit from an ES reponse's hits.hits[] + * @param indexPattern The index pattern for the requested index if available. + * @param params Parameters how to flatten the hit + */ +export declare function flattenHit(hit: Hit, indexPattern?: DataView, params?: TabifyDocsOptions & { + flattenedFieldsComparator?: FlattenedFieldsComparator; +}): Record; +export declare const getFlattenedFieldsComparator: (indexPattern?: DataView) => (a: string | symbol, b: string | symbol) => 0 | 1 | -1; +export type FlattenedFieldsComparator = ReturnType; +export declare const tabifyDocs: (esResponse: estypes.SearchResponse, index?: DataView, params?: TabifyDocsOptions) => Datatable; +export {}; diff --git a/src/platform/packages/shared/kbn-data-service/src/types.d.ts b/src/platform/packages/shared/kbn-data-service/src/types.d.ts new file mode 100644 index 0000000000000..b247bf07b1b91 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-service/src/types.d.ts @@ -0,0 +1,11 @@ +/** + * If a service is being shared on both the client and the server, and + * the client code requires synchronous access to uiSettings, both client + * and server should wrap the core uiSettings services in a function + * matching this signature. + * + * This matches the signature of the public `core.uiSettings.get`, and + * should only be used in scenarios where async access to uiSettings is + * not possible. + */ +export type GetConfigFn = (key: string, defaultOverride?: T) => T; diff --git a/src/platform/packages/shared/kbn-data-view-utils/index.d.ts b/src/platform/packages/shared/kbn-data-view-utils/index.d.ts new file mode 100644 index 0000000000000..4569ce7bb874f --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-utils/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/constants'; +export { convertDatatableColumnToDataViewFieldSpec } from './src/utils/convert_to_data_view_field_spec'; +export { getDataViewFieldOrCreateFromColumnMeta } from './src/utils/get_data_view_field_or_create'; +export { createRegExpPatternFrom } from './src/utils/create_regexp_pattern_from'; +export { testPatternAgainstAllowedList } from './src/utils/test_pattern_against_allowed_list'; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/constants.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/constants.d.ts new file mode 100644 index 0000000000000..47d9a98e56d1f --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-utils/src/constants.d.ts @@ -0,0 +1,4 @@ +/** + * ESQL type constant + */ +export declare const ESQL_TYPE = "esql"; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.d.ts new file mode 100644 index 0000000000000..b3e513c7b7160 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.d.ts @@ -0,0 +1,6 @@ +import type { DatatableColumn } from '@kbn/expressions-plugin/common'; +import type { FieldSpec } from '@kbn/data-views-plugin/common'; +/** + * Convert a datatable column to a DataViewFieldSpec + */ +export declare function convertDatatableColumnToDataViewFieldSpec(column: DatatableColumn): FieldSpec; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/utils/create_regexp_pattern_from.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/utils/create_regexp_pattern_from.d.ts new file mode 100644 index 0000000000000..981217efd8a38 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-utils/src/utils/create_regexp_pattern_from.d.ts @@ -0,0 +1,3 @@ +type Selector = 'data' | 'failures' | '*'; +export declare const createRegExpPatternFrom: (basePatterns: string | string[], selector: Selector) => RegExp; +export {}; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/utils/get_data_view_field_or_create.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/utils/get_data_view_field_or_create.d.ts new file mode 100644 index 0000000000000..623fdb0be6234 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-utils/src/utils/get_data_view_field_or_create.d.ts @@ -0,0 +1,7 @@ +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; +export declare const getDataViewFieldOrCreateFromColumnMeta: ({ dataView, fieldName, columnMeta, }: { + dataView: DataView; + fieldName: string; + columnMeta?: DatatableColumnMeta; +}) => import("@kbn/data-views-plugin/public").DataViewField | undefined; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/utils/test_pattern_against_allowed_list.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/utils/test_pattern_against_allowed_list.d.ts new file mode 100644 index 0000000000000..3b07e275d9e75 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-utils/src/utils/test_pattern_against_allowed_list.d.ts @@ -0,0 +1 @@ +export declare const testPatternAgainstAllowedList: (allowedList: Array) => (value: string) => boolean; diff --git a/src/platform/packages/shared/kbn-data-view-validation/index.d.ts b/src/platform/packages/shared/kbn-data-view-validation/index.d.ts new file mode 100644 index 0000000000000..ff59335c40674 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-validation/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/constants'; +export * from './src/validation'; +export type * from './src/types'; diff --git a/src/platform/packages/shared/kbn-data-view-validation/src/constants.d.ts b/src/platform/packages/shared/kbn-data-view-validation/src/constants.d.ts new file mode 100644 index 0000000000000..c973ce2c6bbbb --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-validation/src/constants.d.ts @@ -0,0 +1,16 @@ +/** + * Error code for when an index pattern contains illegal characters + */ +export declare const ILLEGAL_CHARACTERS_KEY: "ILLEGAL_CHARACTERS"; +/** + * Error code for when an index pattern contains spaces + */ +export declare const CONTAINS_SPACES_KEY: "CONTAINS_SPACES"; +/** + * Characters disallowed in index patterns that are visible. + */ +export declare const ILLEGAL_CHARACTERS_VISIBLE: string[]; +/** + * All characters disallowed in index patterns. + */ +export declare const ILLEGAL_CHARACTERS: string[]; diff --git a/src/platform/packages/shared/kbn-data-view-validation/src/types.d.ts b/src/platform/packages/shared/kbn-data-view-validation/src/types.d.ts new file mode 100644 index 0000000000000..85f2d6b41acbb --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-validation/src/types.d.ts @@ -0,0 +1,5 @@ +import type { ILLEGAL_CHARACTERS_KEY, CONTAINS_SPACES_KEY } from './constants'; +export interface ValidationErrors { + [ILLEGAL_CHARACTERS_KEY]?: string[]; + [CONTAINS_SPACES_KEY]?: boolean; +} diff --git a/src/platform/packages/shared/kbn-data-view-validation/src/validation.d.ts b/src/platform/packages/shared/kbn-data-view-validation/src/validation.d.ts new file mode 100644 index 0000000000000..c125d31f93f86 --- /dev/null +++ b/src/platform/packages/shared/kbn-data-view-validation/src/validation.d.ts @@ -0,0 +1,8 @@ +import type { ValidationErrors } from './types'; +/** + * Validate index pattern strings + * @public + * @param indexPattern string to validate + * @returns errors object + */ +export declare function validateDataView(indexPattern: string): ValidationErrors; diff --git a/src/platform/packages/shared/kbn-discover-utils/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/index.d.ts new file mode 100644 index 0000000000000..946cc4fb77e21 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/index.d.ts @@ -0,0 +1,6 @@ +export { CONTEXT_DEFAULT_SIZE_SETTING, CONTEXT_STEP_SETTING, CONTEXT_TIE_BREAKER_FIELDS_SETTING, DEFAULT_ALLOWED_LOGS_BASE_PATTERNS, DEFAULT_COLUMNS_SETTING, DOC_HIDE_TIME_COLUMN_SETTING, FIELDS_LIMIT_SETTING, HIDE_ANNOUNCEMENTS, IS_ESQL_DEFAULT_FEATURE_FLAG_KEY, MAX_DOC_FIELDS_DISPLAYED, MODIFY_COLUMNS_ON_SWITCH, ROW_HEIGHT_OPTION, SAMPLE_ROWS_PER_PAGE_SETTING, SAMPLE_SIZE_SETTING, SEARCH_EMBEDDABLE_TYPE, SEARCH_ON_PAGE_LOAD_SETTING, SHOW_FIELD_STATISTICS, SHOW_MULTIFIELDS, SORT_DEFAULT_ORDER_SETTING, DataGridDensity, IgnoredReason, buildDataTableRecord, buildDataTableRecordList, convertValueToString, createLogsContextService, createApmContextService, createDegradedDocsControl, createStacktraceControl, fieldConstants, formatFieldValueReact, formatFieldValueText, formatFieldStringValueWithHighlights, formatHitReact, getDocId, getLogDocumentOverview, getFlattenedTraceDocumentOverview, getIgnoredReason, getMessageFieldWithFallbacks, getChartHidden, getTableHidden, getTopPanelHeight, getBreakdownField, getAvailableResourceFields, getAvailableTraceFields, getLogLevelFieldWithFallback, getLogEventTypeFieldWithFallback, getLogExceptionTypeFieldWithFallback, getShouldShowFieldHandler, isEsqlSavedSearch, isNestedFieldParent, usePager, calcFieldCounts, getLogLevelColor, getLogLevelCoalescedValue, getLogLevelCoalescedValueLabel, LogLevelCoalescedValue, getFieldValue, getVisibleColumns, canPrependTimeFieldColumn, DiscoverFlyouts, AppMenuRegistry, dismissAllFlyoutsExceptFor, dismissFlyouts, ErrorCallout, prepareDataViewForEditing, getEsqlDataView, setChartHidden, setTableHidden, setTopPanelHeight, setBreakdownField, LogLevelBadge, getDefaultSort, getSort, getSortArray, getSortForSearchSource, getEsQuerySort, getTieBreakerFieldName, severityOrder, CHART_HIDDEN_KEY, TABLE_HIDDEN_KEY, HISTOGRAM_HEIGHT_KEY, HISTOGRAM_BREAKDOWN_FIELD_KEY, } from './src'; +export type { LogsContextService, ApmContextService, SortOrder, SortInput, SortPair, ErrorCalloutProps, DiscoverSessionFinderAttributes, } from './src'; +export * from './src/types'; +export * from './src/data_types/logs/constants'; +export { ALL_RECOMMENDED_FIELDS_FOR_ESQL, APACHE_ERROR_LOGS_PROFILE, DEFAULT_LOGS_PROFILE, KUBERNETES_CONTAINER_LOGS_PROFILE, } from './src/data_types/logs'; +export type { ApacheErrorLogsProfile, DefaultLogsProfile, KubernetesContainerLogsProfile, } from './src/data_types/logs'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/app_menu_registry.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/app_menu_registry.d.ts new file mode 100644 index 0000000000000..4091907962013 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/app_menu_registry.d.ts @@ -0,0 +1,47 @@ +import type { DiscoverAppMenuConfig, DiscoverAppMenuItemType, DiscoverAppMenuPopoverItem, DiscoverAppMenuPrimaryActionItem } from '../../types'; +/** + * Registry for managing AppMenuConfig items with Discover-specific types. + * All run actions automatically receive DiscoverAppMenuRunActionParams with guaranteed onFinishAction. + */ +export declare class AppMenuRegistry { + static CUSTOM_ITEMS_LIMIT: number; + private items; + private primaryActionItem?; + /** + * Register a custom menu item. + * @param item The menu item to register + */ + registerCustomItem(item: DiscoverAppMenuItemType): void; + /** + * Register a custom popover item under a parent menu item. + * @param parentId The ID of the parent menu item + * @param popoverItem The popover item to register + */ + registerCustomPopoverItem(parentId: string, popoverItem: DiscoverAppMenuPopoverItem): void; + /** + * Register a menu item. + * @param item The menu item to register + */ + registerItem(item: DiscoverAppMenuItemType): void; + /** + * Register multiple menu items at once. + * @param items Array of menu items to register + */ + registerItems(items: DiscoverAppMenuItemType[]): void; + /** + * Set the primary action item for the app menu. + * @param item The primary action item + */ + setPrimaryActionItem(item: DiscoverAppMenuPrimaryActionItem): void; + /** + * Register a popover item for a specific parent menu item. + * @param parentId The ID of the parent menu item + * @param popoverItem The popover item to register + */ + registerPopoverItem(parentId: string, popoverItem: DiscoverAppMenuPopoverItem): void; + /** + * Get the complete AppMenuConfig. + * Items with registered popover items will have their items property populated. + */ + getAppMenuConfig(): DiscoverAppMenuConfig; +} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/types.d.ts new file mode 100644 index 0000000000000..c4995abab51a4 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/types.d.ts @@ -0,0 +1,60 @@ +import type { AppMenuItemType, AppMenuPopoverItem, AppMenuPrimaryActionItem, AppMenuRunActionParams } from '@kbn/core-chrome-app-menu-components'; +import type { ReactElement, ReactNode } from 'react'; +export declare enum AppMenuActionId { + new = "new", + open = "open", + share = "share", + export = "export", + alerts = "alerts", + inspect = "inspect", + switchLanguageMode = "switchLanguageMode", + createRule = "createRule", + backgroundsearch = "backgroundSearch", + manageRulesAndConnectors = "manageRulesAndConnectors" +} +/** + * Discover-specific context that's always available in app menu run actions + */ +export interface DiscoverAppMenuContext extends Record { + onFinishAction: () => void; +} +/** + * Typed params for Discover app menu actions with guaranteed context + */ +export interface DiscoverAppMenuRunActionParams extends AppMenuRunActionParams { + context: DiscoverAppMenuContext; +} +/** + * Discover-specific run action that always receives DiscoverAppMenuRunActionParams + */ +export type DiscoverAppMenuRunAction = (params: DiscoverAppMenuRunActionParams) => ReactElement | void | null | ReactNode | Promise; +/** + * Discover-specific popover item with typed run action and nested items + */ +export type DiscoverAppMenuPopoverItem = Omit & { + run?: DiscoverAppMenuRunAction; + /** + * Sub-items for nested submenus (e.g., "Create legacy rules" submenu) + */ + items?: DiscoverAppMenuPopoverItem[]; +}; +/** + * Discover-specific menu item type with typed run action and items + */ +export type DiscoverAppMenuItemType = Omit & { + run?: DiscoverAppMenuRunAction; + items?: DiscoverAppMenuPopoverItem[]; +}; +/** + * Discover-specific primary action item with typed run action + */ +export type DiscoverAppMenuPrimaryActionItem = Omit & { + run?: DiscoverAppMenuRunAction; +}; +/** + * Discover-specific app menu config with typed menu items + */ +export interface DiscoverAppMenuConfig { + items?: DiscoverAppMenuItemType[]; + primaryActionItem?: DiscoverAppMenuPrimaryActionItem; +} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/degraded_docs_control.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/degraded_docs_control.d.ts new file mode 100644 index 0000000000000..985d1160dcf72 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/degraded_docs_control.d.ts @@ -0,0 +1,11 @@ +import type { RowControlColumn, RowControlProps } from './types'; +interface DegradedDocsControlProps extends Partial { + enabled?: boolean; + addIgnoredMetadataToQuery?: () => void; +} +/** + * Degraded docs control factory function. + * @param props Optional props for the generated Control component, useful to override onClick, etc + */ +export declare const createDegradedDocsControl: (props?: DegradedDocsControlProps) => RowControlColumn; +export {}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/index.d.ts new file mode 100644 index 0000000000000..b72870621d729 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/index.d.ts @@ -0,0 +1,2 @@ +export { createDegradedDocsControl } from './degraded_docs_control'; +export { createStacktraceControl } from './stacktrace_control'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/stacktrace_control.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/stacktrace_control.d.ts new file mode 100644 index 0000000000000..a46428c05f863 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/stacktrace_control.d.ts @@ -0,0 +1,6 @@ +import type { RowControlColumn, RowControlProps } from './types'; +/** + * Stacktrace control factory function. + * @param props Optional props for the generated Control component, useful to override onClick, etc + */ +export declare const createStacktraceControl: (props?: Partial) => RowControlColumn; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/types.d.ts new file mode 100644 index 0000000000000..cd1c71231f705 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/types.d.ts @@ -0,0 +1,31 @@ +import type { EuiButtonIconProps, IconType } from '@elastic/eui'; +import type { Interpolation, Theme } from '@emotion/react'; +import type { FC, ReactElement } from 'react'; +import type React from 'react'; +import type { DataTableRecord } from '../../types'; +export interface RowControlRowProps { + rowIndex: number; + record: DataTableRecord; +} +export interface RowControlProps { + color?: EuiButtonIconProps['color']; + css?: Interpolation; + 'data-test-subj'?: string; + disabled?: boolean; + iconType: IconType; + label: string; + onClick: ((props: RowControlRowProps) => void) | undefined; + tooltipContent?: React.ReactNode; +} +export type RowControlComponent = FC; +export interface RowControlColumn { + id: string; + /** + * Optional predicate called per-row before the inline/menu split. + * Returning `false` removes this action from the row entirely. + * If omitted, the action is always included. + */ + isAvailable?: (props: RowControlRowProps) => boolean; + render: (Control: RowControlComponent, props: RowControlRowProps) => ReactElement; + width?: number; +} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/error_callout.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/error_callout.d.ts new file mode 100644 index 0000000000000..842da88451e9c --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/error_callout.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; +export interface ErrorCalloutProps { + title: string; + error: Error; + isEsqlMode?: boolean; + /** When set, renders the "View details" action (non-ES|QL mode only). */ + showErrorDialog?: (args: { + title: string; + error: Error; + }) => void; + /** Doc link for the ES|QL reference button. Used when `isEsqlMode` is true. */ + esqlReferenceHref?: string; +} +export declare const ErrorCallout: ({ title, error, isEsqlMode, showErrorDialog, esqlReferenceHref, }: ErrorCalloutProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/index.d.ts new file mode 100644 index 0000000000000..9652b2d918916 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/index.d.ts @@ -0,0 +1,2 @@ +export { ErrorCallout } from './error_callout'; +export type { ErrorCalloutProps } from './error_callout'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/constants.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/constants.d.ts new file mode 100644 index 0000000000000..f6bd949336ad5 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/constants.d.ts @@ -0,0 +1,23 @@ +export declare const CONTEXT_DEFAULT_SIZE_SETTING = "context:defaultSize"; +export declare const CONTEXT_STEP_SETTING = "context:step"; +export declare const CONTEXT_TIE_BREAKER_FIELDS_SETTING = "context:tieBreakerFields"; +export declare const DEFAULT_COLUMNS_SETTING = "defaultColumns"; +export declare const DOC_HIDE_TIME_COLUMN_SETTING = "doc_table:hideTimeColumn"; +export declare const FIELDS_LIMIT_SETTING = "fields:popularLimit"; +export declare const HIDE_ANNOUNCEMENTS = "hideAnnouncements"; +export declare const IS_ESQL_DEFAULT_FEATURE_FLAG_KEY = "discover.isEsqlDefault"; +export declare const MAX_DOC_FIELDS_DISPLAYED = "discover:maxDocFieldsDisplayed"; +export declare const MODIFY_COLUMNS_ON_SWITCH = "discover:modifyColumnsOnSwitch"; +export declare const ROW_HEIGHT_OPTION = "discover:rowHeightOption"; +export declare const SAMPLE_ROWS_PER_PAGE_SETTING = "discover:sampleRowsPerPage"; +export declare const SAMPLE_SIZE_SETTING = "discover:sampleSize"; +export declare const SEARCH_EMBEDDABLE_TYPE = "discover_session"; +export declare const SEARCH_ON_PAGE_LOAD_SETTING = "discover:searchOnPageLoad"; +export declare const SHOW_FIELD_STATISTICS = "discover:showFieldStatistics"; +export declare const SHOW_MULTIFIELDS = "discover:showMultiFields"; +export declare const SORT_DEFAULT_ORDER_SETTING = "discover:sort:defaultOrder"; +export declare enum DataGridDensity { + COMPACT = "compact", + EXPANDED = "expanded", + NORMAL = "normal" +} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/apm_context_service.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/apm_context_service.d.ts new file mode 100644 index 0000000000000..72c333359354c --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/apm_context_service.d.ts @@ -0,0 +1,10 @@ +import type { ApmSourceAccessPluginStart } from '@kbn/apm-sources-access-plugin/public'; +import { type TracesContextService } from '../traces'; +import { type ErrorsContextService } from './errors/errors_context_service'; +export interface ApmContextService { + tracesService: TracesContextService; + errorsService: ErrorsContextService; +} +export declare const createApmContextService: ({ apmSourcesAccess, }: { + apmSourcesAccess?: ApmSourceAccessPluginStart; +}) => Promise; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/errors/errors_context_service.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/errors/errors_context_service.d.ts new file mode 100644 index 0000000000000..175f9ddc802d5 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/errors/errors_context_service.d.ts @@ -0,0 +1,10 @@ +import type { APMIndices } from '@kbn/apm-sources-access-plugin/public'; +export interface ErrorsContextService { + getErrorsIndexPattern(): string | undefined; +} +export declare const createErrorsContextService: ({ indices, }: { + indices: APMIndices | null; +}) => ErrorsContextService; +export declare const getErrorsContextService: (error?: string) => { + getErrorsIndexPattern: () => string | undefined; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/index.d.ts new file mode 100644 index 0000000000000..263ab49e157d7 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/index.d.ts @@ -0,0 +1,2 @@ +export * from './errors/errors_context_service'; +export * from './apm_context_service'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/index.d.ts new file mode 100644 index 0000000000000..0a775318d133a --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/index.d.ts @@ -0,0 +1,4 @@ +export * from './logs'; +export * from './traces'; +export * from './apm'; +export type * from './observability'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/index.d.ts new file mode 100644 index 0000000000000..965b7c85e5c9f --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/index.d.ts @@ -0,0 +1 @@ +export * from './log_level_badge'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/log_level_badge.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/log_level_badge.d.ts new file mode 100644 index 0000000000000..82328a74c4b5c --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/log_level_badge.d.ts @@ -0,0 +1,7 @@ +import type { ReactElement } from 'react'; +import React from 'react'; +import type { EuiBadgeProps } from '@elastic/eui'; +export declare const LogLevelBadge: ({ logLevel, fallback, "data-test-subj": dataTestSubj, ...badgeProps }: Omit & { + logLevel: {}; + fallback?: ReactElement; +}) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/constants.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/constants.d.ts new file mode 100644 index 0000000000000..03ad155b34c40 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/constants.d.ts @@ -0,0 +1,27 @@ +import type { SmartFieldGridColumnOptions } from './types'; +export * from '../../field_constants'; +export declare const LOGS_EXPLORER_PROFILE_ID = "logs-explorer"; +export declare const CONTENT_FIELD = "content"; +export declare const RESOURCE_FIELD = "resource"; +export declare const DATA_GRID_COLUMN_WIDTH_SMALL = 240; +export declare const DATA_GRID_COLUMN_WIDTH_MEDIUM = 320; +export declare const ACTIONS_COLUMN_WIDTH = 80; +export declare const RESOURCE_FIELD_CONFIGURATION: SmartFieldGridColumnOptions; +export declare const CONTENT_FIELD_CONFIGURATION: SmartFieldGridColumnOptions; +export declare const SMART_FALLBACK_FIELDS: { + content: SmartFieldGridColumnOptions; + resource: SmartFieldGridColumnOptions; +}; +export declare const DEFAULT_COLUMNS: SmartFieldGridColumnOptions[]; +export declare const DEFAULT_ROWS_PER_PAGE = 100; +export declare const FILTER_OUT_FIELDS_PREFIXES_FOR_CONTENT: string[]; +export declare const FILTER_OUT_EXACT_FIELDS_FOR_CONTENT: string[]; +export declare const DEFAULT_ALLOWED_DATA_VIEWS: string[]; +export declare const DEFAULT_ALLOWED_LOGS_DATA_VIEWS: string[]; +export declare const LOG_LEVEL_FIELDS: string[]; +export declare const SERVICE_NAME_FIELDS: string[]; +export declare const AGENT_NAME_FIELD = "agent.name"; +export declare const LOG_LEVEL_REGEX: RegExp; +export declare const RESOURCE_FIELDS: readonly ["service.name", "container.name", "host.name", "orchestrator.resource.id", "orchestrator.cluster.name", "orchestrator.cluster.id", "container.id", "agent.name", "resource.attributes.telemetry.sdk.language"]; +export declare const TRACE_FIELDS: readonly ["service.name", "event.outcome", "transaction.name", "transaction.duration.us", "span.name", "span.duration.us", "agent.name"]; +export declare const DURATION_FIELDS: readonly string[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/index.d.ts new file mode 100644 index 0000000000000..d49dfd8647c6a --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/index.d.ts @@ -0,0 +1,8 @@ +export type * from './types'; +export * from './utils'; +export * from './logs_context_service'; +export * from './components'; +export { DEFAULT_LOGS_PROFILE, type DefaultLogsProfile } from './recommended_fields/default_logs'; +export { APACHE_ERROR_LOGS_PROFILE, type ApacheErrorLogsProfile, } from './recommended_fields/apache_error_logs'; +export { KUBERNETES_CONTAINER_LOGS_PROFILE, type KubernetesContainerLogsProfile, } from './recommended_fields/kubernetes_container_logs'; +export { ALL_RECOMMENDED_FIELDS_FOR_ESQL } from './recommended_fields'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/logs_context_service.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/logs_context_service.d.ts new file mode 100644 index 0000000000000..f30772577b9d9 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/logs_context_service.d.ts @@ -0,0 +1,15 @@ +import type { LogsDataAccessPluginStart } from '@kbn/logs-data-access-plugin/public'; +export interface LogsContextService { + getAllLogsIndexPattern(): string | undefined; + isLogsIndexPattern(indexPattern: unknown): boolean; +} +export interface LogsContextServiceDeps { + logsDataAccess?: LogsDataAccessPluginStart; +} +export declare const DEFAULT_ALLOWED_LOGS_BASE_PATTERNS: string[]; +export declare const DEFAULT_ALLOWED_LOGS_BASE_PATTERNS_REGEXP: RegExp; +export declare const createLogsContextService: ({ logsDataAccess, }: LogsContextServiceDeps) => Promise; +export declare const getLogsContextService: ({ allLogsIndexPattern, allowedDataSources, }: { + allLogsIndexPattern: string | undefined; + allowedDataSources: Array; +}) => LogsContextService; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/apache_error_logs.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/apache_error_logs.d.ts new file mode 100644 index 0000000000000..33ee74017b491 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/apache_error_logs.d.ts @@ -0,0 +1,8 @@ +/** + * Configuration for Apache Error Logs profile recommended fields + */ +export declare const APACHE_ERROR_LOGS_PROFILE: { + readonly pattern: "logs-apache.error"; + readonly recommendedFields: readonly ["client.ip", "destination.ip", "http.request.method", "http.response.bytes", "http.response.status_code", "log.level", "message", "referrer", "source.ip", "url.path", "user.agent"]; +}; +export type ApacheErrorLogsProfile = typeof APACHE_ERROR_LOGS_PROFILE; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/default_logs.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/default_logs.d.ts new file mode 100644 index 0000000000000..a921196d0c9a0 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/default_logs.d.ts @@ -0,0 +1,11 @@ +/** + * Configuration for Default Logs profile recommended fields. + * This is used as a fallback when no specific log sub-profile matches. + * The wildcard pattern 'logs-*' ensures these fields are available for + * any logs index that doesn't have more specific profile. + */ +export declare const DEFAULT_LOGS_PROFILE: { + readonly pattern: "logs-*"; + readonly recommendedFields: readonly ["event.dataset", "host.name", "log.level", "message", "service.name"]; +}; +export type DefaultLogsProfile = typeof DEFAULT_LOGS_PROFILE; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/index.d.ts new file mode 100644 index 0000000000000..ab99c68838a06 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/index.d.ts @@ -0,0 +1,5 @@ +import type { RecommendedField } from '@kbn/esql-types'; +/** + * Merged list of all recommended fields for ES|QL autocomplete. + */ +export declare const ALL_RECOMMENDED_FIELDS_FOR_ESQL: RecommendedField[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/kubernetes_container_logs.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/kubernetes_container_logs.d.ts new file mode 100644 index 0000000000000..797245ebcf741 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/kubernetes_container_logs.d.ts @@ -0,0 +1,8 @@ +/** + * Configuration for Kubernetes Container Logs profile recommended fields + */ +export declare const KUBERNETES_CONTAINER_LOGS_PROFILE: { + readonly pattern: "logs-kubernetes.container_logs"; + readonly recommendedFields: readonly ["container.image.name", "kubernetes.container.name", "kubernetes.namespace", "kubernetes.node.name", "kubernetes.pod.name", "log.level", "message", "orchestrator.resource.name"]; +}; +export type KubernetesContainerLogsProfile = typeof KUBERNETES_CONTAINER_LOGS_PROFILE; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.d.ts new file mode 100644 index 0000000000000..54c9f5c3f135c --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.d.ts @@ -0,0 +1,99 @@ +import type { DataTableRecord } from '../../types'; +export interface LogDocument extends DataTableRecord { + flattened: { + '@timestamp': string; + 'log.level'?: [string]; + message?: [string]; + 'error.message'?: string; + 'event.original'?: string; + 'host.name'?: string; + 'service.name'?: string; + 'trace.id'?: string; + 'agent.name'?: string; + 'orchestrator.cluster.name'?: string; + 'orchestrator.cluster.id'?: string; + 'orchestrator.resource.id'?: string; + 'orchestrator.namespace'?: string; + 'container.name'?: string; + 'container.id'?: string; + 'cloud.provider'?: string; + 'cloud.region'?: string; + 'cloud.availability_zone'?: string; + 'cloud.project.id'?: string; + 'cloud.instance.id'?: string; + 'log.file.path'?: string; + 'data_stream.namespace': string; + 'data_stream.dataset': string; + 'error.stack_trace'?: string; + 'error.exception.stacktrace.abs_path'?: string; + 'error.log.stacktrace.abs_path'?: string; + }; +} +export interface LogFlyoutDoc { + '@timestamp': string; + 'log.level'?: string; + message?: string; + 'error.message'?: string; + 'event.original'?: string; + 'host.name'?: string; + 'service.name'?: string; + 'trace.id'?: string; + 'agent.name'?: string; + 'orchestrator.cluster.name'?: string; + 'orchestrator.cluster.id'?: string; + 'orchestrator.resource.id'?: string; + 'orchestrator.namespace'?: string; + 'container.name'?: string; + 'cloud.provider'?: string; + 'cloud.region'?: string; + 'cloud.availability_zone'?: string; + 'cloud.project.id'?: string; + 'cloud.instance.id'?: string; + 'log.file.path'?: string; + 'data_stream.namespace': string; + 'data_stream.dataset': string; +} +export interface ResourceFields { + 'service.name'?: string; + 'kubernetes.container.name'?: string; + 'k8s.container.name'?: string; + 'container.name'?: string; + 'kubernetes.node.name'?: string; + 'k8s.node.name'?: string; + 'host.name'?: string; + 'orchestrator.cluster.name'?: string; + 'k8s.cluster.name'?: string; + 'kubernetes.namespace'?: string; + 'k8s.namespace.name'?: string; + 'kubernetes.pod.name'?: string; + 'k8s.pod.name'?: string; + 'kubernetes.deployment.name'?: string; + 'k8s.deployment.name'?: string; + 'kubernetes.replicaset.name'?: string; + 'k8s.replicaset.name'?: string; + 'kubernetes.statefulset.name'?: string; + 'k8s.statefulset.name'?: string; + 'kubernetes.daemonset.name'?: string; + 'k8s.daemonset.name'?: string; + 'kubernetes.job.name'?: string; + 'k8s.job.name'?: string; + 'kubernetes.cronjob.name'?: string; + 'k8s.cronjob.name'?: string; + 'agent.name'?: string; + 'orchestrator.cluster.id'?: string; + 'orchestrator.resource.id'?: string; + 'orchestrator.namespace'?: string; + 'container.id'?: string; + 'cloud.instance.id'?: string; +} +export interface StackTraceFields { + 'error.stack_trace'?: string; + 'error.exception.stacktrace.abs_path'?: string; + 'error.log.stacktrace.abs_path'?: string; +} +export interface SmartFieldGridColumnOptions { + type: 'smart-field'; + smartField: 'content' | 'resource'; + fallbackFields: string[]; + width?: number; +} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_all_logs_data_view_spec.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_all_logs_data_view_spec.d.ts new file mode 100644 index 0000000000000..c24ee9972b42e --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_all_logs_data_view_spec.d.ts @@ -0,0 +1,9 @@ +export declare const ALL_LOGS_DATA_VIEW_ID = "discover-observability-solution-all-logs"; +export declare const getAllLogsDataViewSpec: ({ allLogsIndexPattern, }: { + allLogsIndexPattern: string; +}) => { + id: string; + name: string; + title: string; + timeFieldName: string; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_resource_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_resource_fields.d.ts new file mode 100644 index 0000000000000..b6be44f7aabea --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_resource_fields.d.ts @@ -0,0 +1 @@ +export declare const getAvailableResourceFields: (resourceDoc: Record) => string[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_fields.d.ts new file mode 100644 index 0000000000000..d1d5e496e55a1 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_fields.d.ts @@ -0,0 +1,2 @@ +import type { TraceFields } from '../../..'; +export declare const getAvailableTraceFields: (traceDoc: TraceFields) => ("event.outcome" | "transaction.name" | "transaction.duration.us" | "span.name" | "span.duration.us" | "service.name")[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_coalesed_value.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_coalesed_value.d.ts new file mode 100644 index 0000000000000..84d98a3bdcde5 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_coalesed_value.d.ts @@ -0,0 +1,16 @@ +export declare enum LogLevelCoalescedValue { + trace = "trace", + debug = "debug", + info = "info", + notice = "notice", + warning = "warning", + error = "error", + critical = "critical", + alert = "alert", + emergency = "emergency", + fatal = "fatal" +} +export declare const severityOrder: LogLevelCoalescedValue[]; +export declare const logLevelSynonyms: Record; +export declare const getLogLevelCoalescedValue: (logLevel: string | string[] | unknown) => LogLevelCoalescedValue | undefined; +export declare const getLogLevelCoalescedValueLabel: (coalescedValue: LogLevelCoalescedValue) => string; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.d.ts new file mode 100644 index 0000000000000..78d4e906a06e4 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.d.ts @@ -0,0 +1,3 @@ +import type { EuiThemeComputed } from '@elastic/eui'; +import { LogLevelCoalescedValue } from './get_log_level_coalesed_value'; +export declare const getLogLevelColor: (logLevelCoalescedValue: LogLevelCoalescedValue, euiTheme: EuiThemeComputed) => string | undefined; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/index.d.ts new file mode 100644 index 0000000000000..a4ca393e0a91c --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/index.d.ts @@ -0,0 +1,5 @@ +export * from './get_log_level_color'; +export * from './get_log_level_coalesed_value'; +export * from './get_available_resource_fields'; +export * from './get_all_logs_data_view_spec'; +export * from './get_available_trace_fields'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/index.d.ts new file mode 100644 index 0000000000000..a2dddad7107a4 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/index.d.ts @@ -0,0 +1 @@ +export type * from './types'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/types.d.ts new file mode 100644 index 0000000000000..dc15001c8d2b6 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/types.d.ts @@ -0,0 +1,7 @@ +export interface ObservabilityIndexes { + logs?: string; + apm: { + errors?: string; + traces?: string; + }; +} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/index.d.ts new file mode 100644 index 0000000000000..7d8ff9eb2f4a1 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/index.d.ts @@ -0,0 +1,2 @@ +export type * from './types'; +export * from './traces_context_service'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/traces_context_service.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/traces_context_service.d.ts new file mode 100644 index 0000000000000..bc2a1eb2d3596 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/traces_context_service.d.ts @@ -0,0 +1,22 @@ +import type { APMIndices, ApmSourceAccessPluginStart } from '@kbn/apm-sources-access-plugin/public'; +export interface TracesContextService { + getAllTracesIndexPattern(): string | undefined; + isTracesIndexPattern(indexPattern: unknown): boolean; + containsTracesIndexPattern(indexPattern: unknown): boolean; +} +export interface TracesContextServiceDeps { + apmSourcesAccess?: ApmSourceAccessPluginStart; +} +export declare const DEFAULT_ALLOWED_TRACES_BASE_PATTERNS: string[]; +export declare const DEFAULT_ALLOWED_TRACES_BASE_PATTERNS_REGEXP: RegExp; +export declare const createTracesContextService: ({ indices, }: { + indices: APMIndices | null; +}) => TracesContextService; +export declare const getTracesContextService: ({ tracesIndexPattern, allowedDataSources, }: { + tracesIndexPattern?: string; + allowedDataSources: Array; +}) => { + getAllTracesIndexPattern: () => string | undefined; + isTracesIndexPattern: (value: string) => boolean; + containsTracesIndexPattern: (indexPattern: unknown) => boolean; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/types.d.ts new file mode 100644 index 0000000000000..417ed181d8717 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/types.d.ts @@ -0,0 +1,45 @@ +import type { DataTableRecord } from '../../types'; +export interface TraceFields { + 'service.name'?: string; + 'event.outcome'?: string; + 'transaction.name'?: string; + 'transaction.duration.us'?: string; + 'span.name'?: string; + 'span.duration.us'?: string; + 'agent.name'?: string; +} +export interface TraceDocument extends DataTableRecord { + flattened: { + '@timestamp': string; + 'log.level'?: [string]; + message?: [string]; + 'error.message'?: string; + 'event.original'?: string; + 'host.name'?: string; + 'service.name'?: string; + 'trace.id': string; + 'agent.name'?: string; + 'orchestrator.cluster.name'?: string; + 'orchestrator.cluster.id'?: string; + 'orchestrator.resource.id'?: string; + 'orchestrator.namespace'?: string; + 'container.name'?: string; + 'container.id'?: string; + 'cloud.provider'?: string; + 'cloud.region'?: string; + 'cloud.availability_zone'?: string; + 'cloud.project.id'?: string; + 'cloud.instance.id'?: string; + 'log.file.path'?: string; + 'data_stream.namespace': string; + 'data_stream.dataset': string; + 'error.stack_trace'?: string; + 'error.exception.stacktrace.abs_path'?: string; + 'error.log.stacktrace.abs_path'?: string; + 'event.outcome'?: string; + 'transaction.name'?: string; + 'transaction.duration.us'?: string; + 'span.name'?: string; + 'span.duration.us'?: string; + }; +} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/field_constants.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/field_constants.d.ts new file mode 100644 index 0000000000000..7f0aa4f882bef --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/field_constants.d.ts @@ -0,0 +1,69 @@ +export declare const TIMESTAMP_FIELD = "@timestamp"; +export declare const HOST_NAME_FIELD = "host.name"; +export declare const LOG_LEVEL_FIELD = "log.level"; +export declare const ERROR_LOG_LEVEL_FIELD = "error.log.level"; +export declare const MESSAGE_FIELD = "message"; +export declare const OTEL_MESSAGE_FIELD = "body.text"; +export declare const EXCEPTION_MESSAGE_FIELD = "exception.message"; +export declare const ERROR_MESSAGE_FIELD = "error.message"; +export declare const EVENT_ORIGINAL_FIELD = "event.original"; +export declare const EVENT_OUTCOME_FIELD = "event.outcome"; +export declare const INDEX_FIELD = "_index"; +export declare const EVENT_CATEGORY_FIELD = "event.category"; +export declare const TRACE_ID_FIELD = "trace.id"; +export declare const PARENT_ID_FIELD = "parent.id"; +export declare const TRANSACTION_ID_FIELD = "transaction.id"; +export declare const TRANSACTION_TYPE_FIELD = "transaction.type"; +export declare const TRANSACTION_NAME_FIELD = "transaction.name"; +export declare const TRANSACTION_DURATION_FIELD = "transaction.duration.us"; +export declare const SPAN_NAME_FIELD = "span.name"; +export declare const SPAN_ID_FIELD = "span.id"; +export declare const SPAN_ACTION_FIELD = "span.action"; +export declare const SPAN_DURATION_FIELD = "span.duration.us"; +export declare const SPAN_TYPE_FIELD = "span.type"; +export declare const SPAN_SUBTYPE_FIELD = "span.subtype"; +export declare const SPAN_DESTINATION_SERVICE_RESOURCE_FIELD = "span.destination.service.resource"; +export declare const PROCESSOR_EVENT_FIELD = "processor.event"; +export declare const OTEL_SPAN_KIND = "kind"; +export declare const OTEL_DURATION = "duration"; +export declare const OTEL_STATUS_CODE = "status.code"; +export declare const OTEL_RESOURCE_ATTRIBUTES_TELEMETRY_SDK_LANGUAGE = "resource.attributes.telemetry.sdk.language"; +export declare const OTEL_ATTRIBUTES_EXCEPTION_MESSAGE = "attributes.exception.message"; +export declare const OTEL_ATTRIBUTES_EXCEPTION_STACKTRACE = "attributes.exception.stacktrace"; +export declare const OTEL_EVENT_NAME_FIELD = "event_name"; +export declare const LOG_FILE_PATH_FIELD = "log.file.path"; +export declare const DATASTREAM_NAMESPACE_FIELD = "data_stream.namespace"; +export declare const DATASTREAM_DATASET_FIELD = "data_stream.dataset"; +export declare const DATASTREAM_TYPE_FIELD = "data_stream.type"; +export declare const OTEL_LINKS_TRACE_ID = "links.trace_id"; +export declare const OTEL_LINKS_SPAN_ID = "links.span_id"; +export declare const SPAN_LINKS_TRACE_ID = "span.links.trace.id"; +export declare const SPAN_LINKS_SPAN_ID = "span.links.span.id"; +export declare const AGENT_NAME_FIELD = "agent.name"; +export declare const CLOUD_PROVIDER_FIELD = "cloud.provider"; +export declare const CLOUD_REGION_FIELD = "cloud.region"; +export declare const CLOUD_AVAILABILITY_ZONE_FIELD = "cloud.availability_zone"; +export declare const CLOUD_PROJECT_ID_FIELD = "cloud.project.id"; +export declare const CLOUD_INSTANCE_ID_FIELD = "cloud.instance.id"; +export declare const SERVICE_NAME_FIELD = "service.name"; +export declare const SERVICE_ENVIRONMENT_FIELD = "service.environment"; +export declare const ORCHESTRATOR_CLUSTER_NAME_FIELD = "orchestrator.cluster.name"; +export declare const ORCHESTRATOR_CLUSTER_ID_FIELD = "orchestrator.cluster.id"; +export declare const ORCHESTRATOR_RESOURCE_ID_FIELD = "orchestrator.resource.id"; +export declare const ORCHESTRATOR_NAMESPACE_FIELD = "orchestrator.namespace"; +export declare const CONTAINER_NAME_FIELD = "container.name"; +export declare const CONTAINER_ID_FIELD = "container.id"; +export declare const USER_AGENT_NAME_FIELD = "user_agent.name"; +export declare const USER_AGENT_VERSION_FIELD = "user_agent.version"; +export declare const HTTP_RESPONSE_STATUS_CODE_FIELD = "http.response.status_code"; +export declare const IGNORED_FIELD = "_ignored"; +export declare const IGNORED_FIELD_VALUES_FIELD = "ignored_field_values"; +export declare const DEGRADED_DOCS_FIELDS: readonly ["_ignored", "ignored_field_values"]; +export declare const ERROR_CULPRIT_FIELD = "error.culprit"; +export declare const ERROR_GROUPING_NAME_FIELD = "error.grouping_name"; +export declare const ERROR_EXCEPTION_MESSAGE = "error.exception.message"; +export declare const ERROR_EXCEPTION_TYPE_FIELD = "error.exception.type"; +export declare const OTEL_EXCEPTION_TYPE_FIELD = "exception.type"; +export declare const ERROR_STACK_TRACE = "error.stack_trace"; +export declare const ERROR_EXCEPTION_STACKTRACE_ABS_PATH = "error.exception.stacktrace.abs_path"; +export declare const ERROR_LOG_STACKTRACE_ABS_PATH = "error.log.stacktrace.abs_path"; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/hooks/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/hooks/index.d.ts new file mode 100644 index 0000000000000..22de6a6a13c54 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/hooks/index.d.ts @@ -0,0 +1 @@ +export * from './use_pager'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/hooks/use_pager.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/hooks/use_pager.d.ts new file mode 100644 index 0000000000000..efbb5cce0788b --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/hooks/use_pager.d.ts @@ -0,0 +1,13 @@ +export declare const usePager: ({ initialPageSize, initialPageIndex, totalItems, }: { + totalItems: number; + initialPageSize: number; + initialPageIndex?: number; +}) => { + curPageIndex: number; + pageSize: number; + changePageIndex: (pageIndex: number) => void; + changePageSize: (newPageSize: number) => void; + totalPages: number; + startIndex: number; + hasNextPage: boolean; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/index.d.ts new file mode 100644 index 0000000000000..0d67d84022424 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/index.d.ts @@ -0,0 +1,10 @@ +export * from './constants'; +export * as fieldConstants from './field_constants'; +export * from './hooks'; +export * from './utils'; +export * from './data_types'; +export * from './components/custom_control_columns'; +export { ErrorCallout } from './components/error_callout'; +export type { ErrorCalloutProps } from './components/error_callout'; +export { AppMenuRegistry } from './components/app_menu/app_menu_registry'; +export type { DiscoverAppMenuItemType, DiscoverAppMenuPopoverItem, DiscoverAppMenuPrimaryActionItem, DiscoverAppMenuRunAction, DiscoverAppMenuRunActionParams, DiscoverAppMenuContext, DiscoverAppMenuConfig, } from './components/app_menu/types'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/types.d.ts new file mode 100644 index 0000000000000..4bc8faa70682f --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/types.d.ts @@ -0,0 +1,151 @@ +import type { SearchHit } from '@elastic/elasticsearch/lib/api/types'; +import type { EsqlColumnsWithHighlights } from '@kbn/esql-utils'; +import type { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; +export type { IgnoredReason, ShouldShowFieldInTableHandler } from './utils'; +export type { RowControlColumn, RowControlComponent, RowControlProps, RowControlRowProps, } from './components/custom_control_columns/types'; +export type * from './components/app_menu/types'; +export { AppMenuActionId } from './components/app_menu/types'; +type DiscoverSearchHit = SearchHit>; +export interface EsHitRecord extends Omit { + _index?: DiscoverSearchHit['_index']; + _id?: DiscoverSearchHit['_id']; + _source?: DiscoverSearchHit['_source']; + /** + * As oposed to DSL, ES|QL highlights are inlined in the hit value. + * This record holds which columns have highlights and what tag was used for it. + */ + inline_highlights?: EsqlColumnsWithHighlights; +} +/** + * This is the record/row of data provided to our Data Table + */ +export interface DataTableRecord { + /** + * A unique id generated by index, id and routing of a record + */ + id: string; + /** + * The document returned by Elasticsearch for search queries + */ + raw: EsHitRecord; + /** + * A flattened version of the ES doc or data provided by SQL, aggregations ... + */ + flattened: Record; + /** + * Determines that the given doc is the anchor doc when rendering view surrounding docs + */ + isAnchor?: boolean; +} +/** + * Custom column types per column name + */ +export type DataTableColumnsMeta = Record; +import type { ReactNode } from 'react'; +type FormattedHitPair = readonly [ + fieldDisplayName: string, + formattedValue: ReactNode, + fieldName: string | null +]; +/** + * Pairs array for each field in the hit where values are ReactNodes + */ +export type FormattedHit = FormattedHitPair[]; +export interface LogDocumentOverview extends LogResourceFields, LogStackTraceFields, LogCloudFields, LogOtelStackTraceFields, Partial, Partial { + '@timestamp': string; + 'log.level'?: string; + message?: string; + 'body.text'?: string; + 'error.message'?: string; + 'event.original'?: string; + 'trace.id'?: string; + 'transaction.id'?: string; + 'span.id'?: string; + 'log.file.path'?: string; + 'data_stream.namespace': string; + 'data_stream.dataset': string; + 'exception.message'?: string; +} +export interface ApmErrorLogFields { + 'processor.event': string; + 'error.log.level'?: string; + 'error.exception.type'?: string; + 'error.exception.message'?: string; + 'error.culprit'?: string; + 'error.grouping_name'?: string; +} +export interface OtelExceptionLogFields { + event_name: string; + 'exception.type'?: string; +} +export interface LogResourceFields { + 'host.name'?: string; + 'service.name'?: string; + 'agent.name'?: string; + 'orchestrator.cluster.name'?: string; + 'orchestrator.cluster.id'?: string; + 'orchestrator.resource.id'?: string; + 'orchestrator.namespace'?: string; + 'container.name'?: string; + 'container.id'?: string; +} +export interface LogStackTraceFields { + 'error.stack_trace'?: string; + 'error.exception.stacktrace'?: string; + 'error.log.stacktrace'?: string; +} +export interface LogOtelStackTraceFields { + 'attributes.exception.stacktrace'?: string; + 'attributes.exception.type'?: string; + 'attributes.exception.message'?: string; +} +export interface LogCloudFields { + 'cloud.provider'?: string; + 'cloud.region'?: string; + 'cloud.availability_zone'?: string; + 'cloud.project.id'?: string; + 'cloud.instance.id'?: string; +} +export interface TraceDocumentOverview extends TraceFields, Partial, Partial, Partial, Partial { + duration?: number; + kind?: string; + 'resource.attributes.telemetry.sdk.language'?: string; + 'links.trace_id'?: string; + 'links.span_id'?: string; +} +export interface TraceFields { + '@timestamp': number; + 'trace.id': string; + 'processor.event'?: 'span' | 'transaction'; + 'parent.id'?: string; + 'http.response.status_code'?: number; +} +export interface ServiceFields { + 'service.name': string; + 'service.environment': string; + 'agent.name': string; +} +export interface TransactionFields { + 'transaction.id': string; + 'transaction.type': string; + 'transaction.name': string; + 'transaction.duration.us'?: number; +} +export interface SpanFields { + 'span.id': string; + 'span.name': string; + 'span.action': string; + 'span.duration.us': number; + 'span.type': string; + 'span.subtype': string; + 'span.destination.service.resource': string; + 'span.links.span.id'?: string; + 'span.links.trace.id'?: string; +} +export interface UserAgentFields { + 'user_agent.name': string; + 'user_agent.version': string; +} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/build_data_record.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/build_data_record.d.ts new file mode 100644 index 0000000000000..0f49017349292 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/build_data_record.d.ts @@ -0,0 +1,22 @@ +import type { DataView } from '@kbn/data-views-plugin/common'; +import { type FlattenedFieldsComparator } from '@kbn/data-service'; +import type { DataTableRecord, EsHitRecord } from '../types'; +/** + * Build a record for data grid + * @param doc the document returned from Elasticsearch + * @param dataView this current data view + * @param isAnchor determines if the given doc is the anchor doc when viewing surrounding documents + */ +export declare function buildDataTableRecord(doc: EsHitRecord, dataView?: DataView, isAnchor?: boolean, options?: { + flattenedFieldsComparator?: FlattenedFieldsComparator; +}): DataTableRecord; +/** + * Helper to build multiple DataTableRecords at once, saved a bit of testing code lines + * @param records Array of documents returned from Elasticsearch + * @param dataView this current data view + */ +export declare function buildDataTableRecordList({ records, dataView, processRecord, }: { + records: EsHitRecord[]; + dataView?: DataView; + processRecord?: (record: DataTableRecord) => T; +}): DataTableRecord[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/calc_field_counts.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/calc_field_counts.d.ts new file mode 100644 index 0000000000000..c609ab4cddcb2 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/calc_field_counts.d.ts @@ -0,0 +1,6 @@ +import type { DataTableRecord } from '../types'; +/** + * This function is calculating stats of the available fields, for usage in sidebar and sharing + * Note that this values aren't displayed, but used for internal calculations + */ +export declare function calcFieldCounts(rows?: DataTableRecord[]): Record; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/contains_index_pattern.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/contains_index_pattern.d.ts new file mode 100644 index 0000000000000..14ab7cd0d9336 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/contains_index_pattern.d.ts @@ -0,0 +1 @@ +export declare const containsIndexPattern: (allowedDataSources: Array) => (indexPattern: unknown) => boolean; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/convert_value_to_string.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/convert_value_to_string.d.ts new file mode 100644 index 0000000000000..183d50d55bcc0 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/convert_value_to_string.d.ts @@ -0,0 +1,19 @@ +import type { DataView, DataViewField } from '@kbn/data-views-plugin/public'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { DataTableRecord } from '../../types'; +interface ConvertedResult { + formattedString: string; + withFormula: boolean; +} +export declare const convertValueToString: ({ dataView, dataViewField, flattenedValue, dataTableRecord, fieldFormats, options, }: { + dataView: DataView; + dataViewField?: DataViewField; + flattenedValue: unknown; + dataTableRecord: DataTableRecord; + fieldFormats: FieldFormatsStart; + options?: { + compatibleWithCSV?: boolean; + compatibleWithMarkdown?: boolean; + }; +}) => ConvertedResult; +export {}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/dismiss_flyouts.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/dismiss_flyouts.d.ts new file mode 100644 index 0000000000000..5cf2378da6571 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/dismiss_flyouts.d.ts @@ -0,0 +1,11 @@ +export declare enum DiscoverFlyouts { + lensEdit = "lensEdit", + docViewer = "docViewer", + esqlDocs = "esqlDocs", + metricInsights = "metricInsights", + esqlControls = "esqlControls", + lensAlertRule = "lensAlertRule", + inspectorPanel = "inspectorPanel" +} +export declare const dismissFlyouts: (selectedFlyouts?: DiscoverFlyouts[], excludedFlyout?: DiscoverFlyouts) => void; +export declare const dismissAllFlyoutsExceptFor: (excludedFlyout: DiscoverFlyouts) => void; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.d.ts new file mode 100644 index 0000000000000..55ddc2c0be05b --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.d.ts @@ -0,0 +1,13 @@ +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { DataTableRecord, ShouldShowFieldInTableHandler, FormattedHit, DataTableColumnsMeta } from '../types'; +/** + * Returns a formatted document in form of key/value pairs where the value is a ReactNode + * @param hit + * @param dataView + * @param shouldShowFieldHandler + * @param maxEntries + * @param fieldFormats + * @param columnsMeta + */ +export declare function formatHitReact(hit: DataTableRecord, dataView: DataView, shouldShowFieldHandler: ShouldShowFieldInTableHandler, maxEntries: number, fieldFormats: FieldFormatsStart, columnsMeta: DataTableColumnsMeta | undefined): FormattedHit; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.d.ts new file mode 100644 index 0000000000000..0396441213bd3 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.d.ts @@ -0,0 +1,63 @@ +import type { ReactNode } from 'react'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { DataView, DataViewField } from '@kbn/data-views-plugin/public'; +import type { ReactContextTypeOptions, TextContextTypeOptions } from '@kbn/field-formats-plugin/common/types'; +import type { EsHitRecord } from '../types'; +/** Base parameters for field value formatting functions */ +interface FormatFieldValueBaseParams { + value: unknown; + fieldFormats: FieldFormatsStart; + dataView?: DataView; + field?: DataViewField; +} +export interface FormatFieldValueReactParams extends FormatFieldValueBaseParams { + hit: EsHitRecord; + options?: ReactContextTypeOptions; +} +export interface FormatFieldValueTextParams extends FormatFieldValueBaseParams { + options?: TextContextTypeOptions; +} +/** + * React equivalent of formatFieldValueText. Returns a ReactNode rendered via convertToReact, + * which is safe to render directly without dangerouslySetInnerHTML. + * + * @returns A ReactNode that can be rendered directly + */ +export declare const formatFieldValueReact: ({ value, hit, fieldFormats, dataView, field, options, }: FormatFieldValueReactParams) => ReactNode; +/** + * Text equivalent of formatFieldValueReact. Returns a plain text string without HTML tags. + * Use this when you need string values for further processing (e.g., in LogDocumentOverview). + * + * Note: Unlike formatFieldValueReact, this does not accept `hit` because text formatters + * do not apply highlighting (highlighting requires HTML/React markup). + * + * @returns A plain text string + */ +export declare const formatFieldValueText: ({ value, fieldFormats, dataView, field, options, }: FormatFieldValueTextParams) => string; +export interface FormatFieldStringWithHighlightsParams { + value: unknown; + hit: EsHitRecord; + fieldFormats: FieldFormatsStart; + /** Optional data view to look up the field. If provided with fieldName, will attempt to get the DataViewField */ + dataView?: DataView; + /** The field name for highlight lookup. If dataView is provided, will attempt to get DataViewField from it */ + fieldName?: string; + options?: ReactContextTypeOptions; +} +/** + * Formats a value using the default string formatter with React output and search highlighting. + * + * This is a convenience function for formatting values when you only have a field name (not a DataViewField). + * It attempts to look up the field in the data view, falling back to a minimal field object with just the name. + * This fallback ensures search highlighting still works even for fields not in the data view (e.g., OTel body.text). + * + * @param value - The value to format + * @param hit - The ES hit record containing highlight information + * @param fieldFormats - Field formats service + * @param dataView - Optional data view to look up the field + * @param fieldName - The field name for highlight lookup + * @param options - Additional options for the formatter + * @returns A ReactNode that can be rendered directly + */ +export declare const formatFieldStringValueWithHighlights: ({ value, hit, fieldFormats, dataView, fieldName, options, }: FormatFieldStringWithHighlightsParams) => ReactNode; +export {}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_doc_id.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_doc_id.d.ts new file mode 100644 index 0000000000000..069caf7918ef1 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_doc_id.d.ts @@ -0,0 +1,8 @@ +import type { EsHitRecord } from '../types'; +/** + * Returning a generated id of a given ES document, since `_id` can be the same + * when using different indices and shard routing + */ +export declare const getDocId: (doc: EsHitRecord & { + _routing?: string; +}) => string; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_esql_data_view.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_esql_data_view.d.ts new file mode 100644 index 0000000000000..2b1c19c06cf21 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_esql_data_view.d.ts @@ -0,0 +1,8 @@ +import type { AggregateQuery } from '@kbn/es-query'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { HttpStart } from '@kbn/core-http-browser'; +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; +export declare function getEsqlDataView(query: AggregateQuery, currentDataView: DataView | undefined, services: { + dataViews: DataViewsPublicPluginStart; + http: HttpStart; +}): Promise; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value.d.ts new file mode 100644 index 0000000000000..a3a3bc342d9c4 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value.d.ts @@ -0,0 +1,2 @@ +import type { DataTableRecord } from '../types'; +export declare const getFieldValue: (record: TRecord, field: TField & keyof TRecord["flattened"]) => TRecord["flattened"][TField]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value_with_fallback.d.ts new file mode 100644 index 0000000000000..17ccdc52aed1d --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value_with_fallback.d.ts @@ -0,0 +1,24 @@ +/** + * Gets a field value from a document, checking both ECS and OpenTelemetry field names. + * First checks the primary ECS field, then falls back to OTel equivalent fields if defined. + * + * @param document - The document object (flattened) + * @param ecsFieldName - The ECS field name to look up + * @returns Object with the actual field name found and its value, or undefined field if not found + */ +export declare function getFieldValueWithFallback(document: Record, ecsFieldName: string): { + field: string | undefined; + value: unknown; +}; +/** + * Gets multiple field values with OTel fallbacks, returning the first non-undefined value. + * Useful for checking a ranked list of fields (e.g., message → error.message → event.original). + * + * @param document - The document object (flattened) + * @param ecsFieldNames - Array of ECS field names to check in order + * @returns Object with the actual field name and value that was found, or undefined field if none found + */ +export declare function getFirstAvailableFieldValue(document: Record, ecsFieldNames: readonly string[]): { + field: string | undefined; + value?: unknown; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_flattened_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_flattened_fields.d.ts new file mode 100644 index 0000000000000..67188f9595c2a --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_flattened_fields.d.ts @@ -0,0 +1,2 @@ +import type { DataTableRecord } from '../types'; +export declare function getFlattenedFields(doc: DataTableRecord, fields: Array): T; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_ignored_reason.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_ignored_reason.d.ts new file mode 100644 index 0000000000000..ed4e837f93707 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_ignored_reason.d.ts @@ -0,0 +1,17 @@ +import type { SearchHit } from '@elastic/elasticsearch/lib/api/types'; +import type { DataViewField } from '@kbn/data-views-plugin/public'; +export declare enum IgnoredReason { + IGNORE_ABOVE = "ignore_above", + MALFORMED = "malformed", + UNKNOWN = "unknown" +} +/** + * Returns the reason why a specific field was ignored in the response. + * Will return undefined if the field had no ignored values in it. + * This implementation will make some assumptions based on specific types + * of ignored values can only happen with specific field types in Elasticsearch. + * + * @param field Either the data view field or the string name of it. + * @param ignoredFields The hit._ignored value of the hit to validate. + */ +export declare function getIgnoredReason(field: DataViewField | string, ignoredFields: SearchHit['_ignored']): IgnoredReason | undefined; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_document_overview.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_document_overview.d.ts new file mode 100644 index 0000000000000..8c355521572d8 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_document_overview.d.ts @@ -0,0 +1,7 @@ +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { DataTableRecord, LogDocumentOverview } from '../..'; +export declare function getLogDocumentOverview(doc: DataTableRecord, { dataView, fieldFormats }: { + dataView: DataView; + fieldFormats: FieldFormatsStart; +}): LogDocumentOverview; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_event_type_field_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_event_type_field_with_fallback.d.ts new file mode 100644 index 0000000000000..8ef9e1028d232 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_event_type_field_with_fallback.d.ts @@ -0,0 +1,12 @@ +import type { LogDocumentOverview } from '../types'; +export declare const getLogEventTypeFieldWithFallback: (doc: LogDocumentOverview) => { + field: string; + value: string; + formattedValue: string | undefined; + originalValue: unknown; +} | { + field: undefined; + value?: undefined; + formattedValue?: undefined; + originalValue?: undefined; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_exception_type_field_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_exception_type_field_with_fallback.d.ts new file mode 100644 index 0000000000000..7a158cc7457b7 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_exception_type_field_with_fallback.d.ts @@ -0,0 +1,12 @@ +import type { LogDocumentOverview } from '../types'; +export declare const getLogExceptionTypeFieldWithFallback: (doc: Record | LogDocumentOverview) => { + field: string; + value: string; + formattedValue: string | undefined; + originalValue: unknown; +} | { + field: undefined; + value?: undefined; + formattedValue?: undefined; + originalValue?: undefined; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_field_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_field_with_fallback.d.ts new file mode 100644 index 0000000000000..b19140a1fb722 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_field_with_fallback.d.ts @@ -0,0 +1,15 @@ +import type { LogDocumentOverview } from '../types'; +export declare const getLogFieldWithFallback: (doc: Record | LogDocumentOverview, rankingOrder: readonly T[], options?: { + includeFormattedValue?: boolean; + includeOriginalValue?: boolean; +}) => { + field: string; + value: string; + formattedValue: string | undefined; + originalValue: unknown; +} | { + field: undefined; + value?: undefined; + formattedValue?: undefined; + originalValue?: undefined; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_level_field_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_level_field_with_fallback.d.ts new file mode 100644 index 0000000000000..04220997c619a --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_level_field_with_fallback.d.ts @@ -0,0 +1,12 @@ +import type { LogDocumentOverview } from '../types'; +export declare const getLogLevelFieldWithFallback: (doc: LogDocumentOverview) => { + field: string; + value: string; + formattedValue: string | undefined; + originalValue: unknown; +} | { + field: undefined; + value?: undefined; + formattedValue?: undefined; + originalValue?: undefined; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_message_field_with_fallbacks.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_message_field_with_fallbacks.d.ts new file mode 100644 index 0000000000000..d67b71d34ae8a --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_message_field_with_fallbacks.d.ts @@ -0,0 +1,14 @@ +import type { LogDocumentOverview } from '../types'; +export declare const getMessageFieldWithFallbacks: (doc: Record | LogDocumentOverview, { includeFormattedValue }?: { + includeFormattedValue?: boolean; +}) => { + field: string; + value: string; + formattedValue: string | undefined; + originalValue: unknown; +} | { + field: undefined; + value?: undefined; + formattedValue?: undefined; + originalValue?: undefined; +}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_should_show_field_handler.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_should_show_field_handler.d.ts new file mode 100644 index 0000000000000..9d3abce09d6bd --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_should_show_field_handler.d.ts @@ -0,0 +1,11 @@ +import type { DataView } from '@kbn/data-views-plugin/public'; +export type ShouldShowFieldInTableHandler = (fieldName: string) => boolean; +/** + * Returns a function for checking whether we should display a field in the Documents column of the data table + * If showMultiFields is set to false, it filters out multifields that have a parent, to prevent entries for multifields + * like this: field, field.keyword, field.whatever + * @param fields + * @param dataView + * @param showMultiFields + */ +export declare const getShouldShowFieldHandler: (fields: string[], dataView: DataView, showMultiFields: boolean) => ShouldShowFieldInTableHandler; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_stack_trace_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_stack_trace_fields.d.ts new file mode 100644 index 0000000000000..227fcda39b4d3 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_stack_trace_fields.d.ts @@ -0,0 +1,2 @@ +import type { LogDocument, StackTraceFields } from '..'; +export declare const getStacktraceFields: (doc: LogDocument) => StackTraceFields; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_trace_document_overview.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_trace_document_overview.d.ts new file mode 100644 index 0000000000000..92d572fe57be0 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_trace_document_overview.d.ts @@ -0,0 +1,2 @@ +import type { DataTableRecord, TraceDocumentOverview } from '../types'; +export declare function getFlattenedTraceDocumentOverview(doc: DataTableRecord): TraceDocumentOverview; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_visible_columns.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_visible_columns.d.ts new file mode 100644 index 0000000000000..b27bb9e4fd331 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_visible_columns.d.ts @@ -0,0 +1,5 @@ +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { DataTableColumnsMeta } from '../types'; +export declare function canPrependTimeFieldColumn(columns: string[] | undefined, timeFieldName: string | undefined, columnsMeta: DataTableColumnsMeta | undefined, showTimeCol: boolean, // based on Advanced Settings `doc_table:hideTimeColumn` +isESQLMode: boolean): boolean; +export declare function getVisibleColumns(columns: string[], dataView: DataView, shouldPrependTimeFieldColumn: boolean): string[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/index.d.ts new file mode 100644 index 0000000000000..5341d04d2f418 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/index.d.ts @@ -0,0 +1,26 @@ +export * from './build_data_record'; +export * from './calc_field_counts'; +export * from './contains_index_pattern'; +export * from './format_hit'; +export * from './format_value'; +export * from './get_doc_id'; +export * from './get_field_value_with_fallback'; +export * from './get_ignored_reason'; +export * from './get_log_document_overview'; +export * from './get_trace_document_overview'; +export * from './get_message_field_with_fallbacks'; +export * from './get_log_exception_type_field_with_fallback'; +export * from './get_log_level_field_with_fallback'; +export * from './get_log_event_type_field_with_fallback'; +export * from './get_should_show_field_handler'; +export * from './get_stack_trace_fields'; +export * from './is_esql_saved_search'; +export * from './nested_fields'; +export * from './get_field_value'; +export * from './get_visible_columns'; +export * from './convert_value_to_string'; +export * from './local_storage_utils'; +export * from './sorting'; +export { DiscoverFlyouts, dismissAllFlyoutsExceptFor, dismissFlyouts } from './dismiss_flyouts'; +export { prepareDataViewForEditing } from './prepare_data_view_for_editing'; +export { getEsqlDataView } from './get_esql_data_view'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/is_esql_saved_search.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/is_esql_saved_search.d.ts new file mode 100644 index 0000000000000..8c37febb6a232 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/is_esql_saved_search.d.ts @@ -0,0 +1,19 @@ +/** + * @deprecated This should only be used in combination with {@link isEsqlSavedSearch} + */ +export interface DiscoverSessionFinderAttributes { + tabs?: Array<{ + attributes: { + isTextBasedQuery?: boolean; + }; + }>; +} +/** + * @deprecated This is only used in specific legacy conditions: + * - Within a `showSavedObject` callback passed to `SavedObjectFinder` + * - When the Discover session is being used as a legacy saved search + * - When the app does not support ES|QL saved searches (e.g. agg-based vis) + */ +export declare const isEsqlSavedSearch: (savedObject: { + attributes: DiscoverSessionFinderAttributes; +}) => boolean; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/local_storage_utils.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/local_storage_utils.d.ts new file mode 100644 index 0000000000000..6caaf83216cad --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/local_storage_utils.d.ts @@ -0,0 +1,38 @@ +import type { Storage } from '@kbn/kibana-utils-plugin/public'; +import type { ResizableLayoutProps } from '@kbn/resizable-layout'; +export declare const CHART_HIDDEN_KEY = "chartHidden"; +export declare const TABLE_HIDDEN_KEY = "tableHidden"; +export declare const HISTOGRAM_HEIGHT_KEY = "histogramHeight"; +export declare const HISTOGRAM_BREAKDOWN_FIELD_KEY = "histogramBreakdownField"; +/** + * Get the chart hidden state from local storage + */ +export declare const getChartHidden: (storage: Storage, localStorageKeyPrefix: string) => boolean | undefined; +/** + * Get the table hidden state from local storage + */ +export declare const getTableHidden: (storage: Storage, localStorageKeyPrefix: string) => boolean | undefined; +/** + * Get the top panel height from local storage + */ +export declare const getTopPanelHeight: (storage: Storage, localStorageKeyPrefix: string) => ResizableLayoutProps["fixedPanelSize"] | undefined; +/** + * Get the breakdown field from local storage + */ +export declare const getBreakdownField: (storage: Storage, localStorageKeyPrefix: string) => string | undefined; +/** + * Set the chart hidden state in local storage + */ +export declare const setChartHidden: (storage: Storage, localStorageKeyPrefix: string, chartHidden: boolean | undefined) => false | void; +/** + * Set the table hidden state in local storage + */ +export declare const setTableHidden: (storage: Storage, localStorageKeyPrefix: string, tableHidden: boolean | undefined) => false | void; +/** + * Set the top panel height in local storage + */ +export declare const setTopPanelHeight: (storage: Storage, localStorageKeyPrefix: string, topPanelHeight: ResizableLayoutProps["fixedPanelSize"]) => false | void; +/** + * Set the breakdown field in local storage + */ +export declare const setBreakdownField: (storage: Storage, localStorageKeyPrefix: string, breakdownField: string | undefined) => false | void; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/nested_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/nested_fields.d.ts new file mode 100644 index 0000000000000..fb4d94d0ae80b --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/nested_fields.d.ts @@ -0,0 +1,38 @@ +import type { DataView } from '@kbn/data-views-plugin/public'; +/** + * This function checks if the given field in a given data view is a nested field's parent. + * Discover doesn't flatten arrays of objects, so for documents with an `object` or `nested` field that + * contains an array, Discover will only detect the top level root field. We want to detect when those + * root fields are `nested` so that we can display the proper icon and label. However, those root + * `nested` fields are not a part of the data view. Their children are though, and contain nested path + * info. So to detect nested fields we look through the data view for nested children + * whose path begins with the current field. There are edge cases where + * this could incorrectly identify a plain `object` field as `nested`. Say we had the following document + * where `foo` is a plain object field and `bar` is a nested field. + * { + * "foo": [ + * { + * "bar": [ + * { + * "baz": "qux" + * } + * ] + * }, + * { + * "bar": [ + * { + * "baz": "qux" + * } + * ] + * } + * ] + * } + * The following code will search for `foo`, find it at the beginning of the path to the nested child field + * `foo.bar.baz` and incorrectly mark `foo` as nested. Any time we're searching for the name of a plain object + * field that happens to match a segment of a nested path, we'll get a false positive. + * We're aware of this issue and we'll have to live with + * it in the short term. The long term fix will be to add info about the `nested` and `object` root fields + * to the data view, but that has its own complications which you can read more about in the following + * issue: https://github.com/elastic/kibana/issues/54957 + */ +export declare function isNestedFieldParent(fieldName: string, dataView: DataView): boolean; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/prepare_data_view_for_editing.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/prepare_data_view_for_editing.d.ts new file mode 100644 index 0000000000000..3e8dafb172361 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/prepare_data_view_for_editing.d.ts @@ -0,0 +1,3 @@ +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { DataViewsServicePublic } from '@kbn/data-views-plugin/public/types'; +export declare function prepareDataViewForEditing(dataView: DataView, dataViewsService: DataViewsServicePublic): Promise; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_default_sort.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_default_sort.d.ts new file mode 100644 index 0000000000000..4c641656d6b60 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_default_sort.d.ts @@ -0,0 +1,7 @@ +import type { DataView } from '@kbn/data-views-plugin/public'; +import { type SortOrder } from './get_sort'; +/** + * use in case the user didn't manually sort. + * the default sort is returned depending on the data view or non for ES|QL queries + */ +export declare function getDefaultSort(dataView: DataView | Pick | undefined, defaultSortOrder: string | undefined, hidingTimeColumn: boolean | undefined, isEsqlMode: boolean): SortOrder[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_es_query_sort.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_es_query_sort.d.ts new file mode 100644 index 0000000000000..3296fa4014ab4 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_es_query_sort.d.ts @@ -0,0 +1,46 @@ +import type { EsQuerySortValue, SortDirection } from '@kbn/data-plugin/public'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; +/** + * Returns `EsQuerySort` which is used to sort records in the ES query + * https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html + * @param sortDir + * @param timeFieldName + * @param tieBreakerFieldName + * @param isTimeNanosBased + */ +export declare function getEsQuerySort({ sortDir, timeFieldName, tieBreakerFieldName, isTimeNanosBased, }: { + sortDir: SortDirection; + timeFieldName: string; + tieBreakerFieldName: string; + isTimeNanosBased: boolean; +}): [EsQuerySortValue, EsQuerySortValue]; +/** + * Prepares "sort" structure for a time field for next ES request + * @param sortDir + * @param timeFieldName + * @param isTimeNanosBased + */ +export declare function getESQuerySortForTimeField({ sortDir, timeFieldName, isTimeNanosBased, }: { + sortDir: SortDirection; + timeFieldName: string; + isTimeNanosBased: boolean; +}): EsQuerySortValue; +/** + * Prepares "sort" structure for a tie breaker for next ES request + * @param sortDir + * @param tieBreakerFieldName + */ +export declare function getESQuerySortForTieBreaker({ sortDir, tieBreakerFieldName, }: { + sortDir: SortDirection; + tieBreakerFieldName: string; +}): EsQuerySortValue; +/** + * The default tie breaker for Discover + */ +export declare const DEFAULT_TIE_BREAKER_NAME = "_doc"; +/** + * Returns a field from the intersection of the set of sortable fields in the + * given data view and a given set of candidate field names. + */ +export declare function getTieBreakerFieldName(dataView: DataView, uiSettings: Pick): any; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort.d.ts new file mode 100644 index 0000000000000..b7b5090975e40 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort.d.ts @@ -0,0 +1,21 @@ +import type { DataView } from '@kbn/data-views-plugin/common'; +export type SortOrder = [string, string]; +export type SortPairObj = Record; +export type SortPair = SortOrder | SortPairObj; +export type SortInput = SortPair | SortPair[]; +export declare function isSortable(fieldName: string, dataView: DataView, isEsqlMode: boolean): boolean; +export declare function isLegacySort(sort: SortPair[] | SortPair): sort is SortPair; +/** + * Take a sorting array and make it into an object + * @param {array} sort two dimensional array [[fieldToSort, directionToSort]] + * or an array of objects [{fieldToSort: directionToSort}] + * @param {object} dataView used for determining default sort + * @param {boolean} isEsqlMode + * @returns Array<{object}> an array of sort objects + */ +export declare function getSort(sort: SortPair[] | SortPair, dataView: DataView, isEsqlMode: boolean): SortPairObj[]; +/** + * compared to getSort it doesn't return an array of objects, it returns an array of arrays + * [[fieldToSort: directionToSort]] + */ +export declare function getSortArray(sort: SortInput, dataView: DataView, isEsqlMode: boolean): SortOrder[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort_for_search_source.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort_for_search_source.d.ts new file mode 100644 index 0000000000000..12faae79995f1 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort_for_search_source.d.ts @@ -0,0 +1,16 @@ +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { EsQuerySortValue } from '@kbn/data-plugin/common'; +import { type SortOrder } from './get_sort'; +/** + * Prepares sort for search source, that's sending the request to ES + * - Adds default sort if necessary + * - Handles the special case when there's sorting by date_nanos typed fields + * the addon of the numeric_type guarantees the right sort order + * when there are indices with date and indices with date_nanos field + */ +export declare function getSortForSearchSource({ sort, dataView, defaultSortDir, includeTieBreaker, }: { + sort: SortOrder[] | undefined; + dataView: DataView | undefined; + defaultSortDir: string; + includeTieBreaker?: boolean; +}): EsQuerySortValue[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/index.d.ts new file mode 100644 index 0000000000000..929091241661f --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/index.d.ts @@ -0,0 +1,5 @@ +export { getDefaultSort } from './get_default_sort'; +export { getSort, getSortArray } from './get_sort'; +export type { SortOrder, SortInput, SortPair } from './get_sort'; +export { getSortForSearchSource } from './get_sort_for_search_source'; +export { getEsQuerySort, getTieBreakerFieldName } from './get_es_query_sort'; diff --git a/src/platform/packages/shared/kbn-discover-utils/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/types.d.ts new file mode 100644 index 0000000000000..04ee56438cd10 --- /dev/null +++ b/src/platform/packages/shared/kbn-discover-utils/types.d.ts @@ -0,0 +1 @@ +export type { DataTableRecord, DataTableColumnsMeta, EsHitRecord, IgnoredReason, ShouldShowFieldInTableHandler, FormattedHit, } from './src/types'; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/index.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/index.d.ts new file mode 100644 index 0000000000000..edadc0e66d382 --- /dev/null +++ b/src/platform/packages/shared/kbn-elastic-agent-utils/index.d.ts @@ -0,0 +1,5 @@ +export { getAgentName, isOpenTelemetryAgentName, isEDOTAgentName, isOTELAgentName, hasOpenTelemetryPrefix, isJavaAgentName, isRumAgentName, isMobileAgentName, isRumOrMobileAgentName, isIosAgentName, isAndroidAgentName, isJRubyAgentName, isServerlessAgentName, isAWSLambdaAgentName, isAzureFunctionsAgentName, } from './src/agent_guards'; +export { ELASTIC_AGENT_NAMES, OPEN_TELEMETRY_AGENT_NAMES, EDOT_AGENT_NAMES, OTEL_AGENT_NAMES, JAVA_AGENT_NAMES, RUM_AGENT_NAMES, SERVERLESS_TYPE, AGENT_NAMES, } from './src/agent_names'; +export { getIngestionPath } from './src/agent_ingestion_path'; +export { getSdkNameAndLanguage } from './src/agent_sdk_name_and_language'; +export type { ElasticAgentName, OpenTelemetryAgentName, JavaAgentName, RumAgentName, ServerlessType, AgentName, } from './src/agent_names'; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_guards.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_guards.d.ts new file mode 100644 index 0000000000000..bce94652a12eb --- /dev/null +++ b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_guards.d.ts @@ -0,0 +1,17 @@ +import type { ElasticAgentName, JavaAgentName, OpenTelemetryAgentName, RumAgentName, ServerlessType } from './agent_names'; +export declare function getAgentName(agentName: string | null, telemetryAgentName: string | null, telemetrySdkName: string | null): string | null; +export declare function hasOpenTelemetryPrefix(agentName?: string, language?: string): boolean; +export declare function isOpenTelemetryAgentName(agentName: string): agentName is OpenTelemetryAgentName; +export declare const isElasticAgentName: (agentName: string) => agentName is ElasticAgentName; +export declare function isEDOTAgentName(agentName: string): agentName is OpenTelemetryAgentName; +export declare function isOTELAgentName(agentName: string): agentName is OpenTelemetryAgentName; +export declare function isJavaAgentName(agentName?: string): agentName is JavaAgentName; +export declare function isRumAgentName(agentName?: string): agentName is RumAgentName; +export declare function isMobileAgentName(agentName?: string): boolean; +export declare function isRumOrMobileAgentName(agentName?: string): boolean; +export declare function isIosAgentName(agentName?: string): boolean; +export declare function isAndroidAgentName(agentName?: string): boolean; +export declare function isJRubyAgentName(agentName?: string, runtimeName?: string): boolean; +export declare function isServerlessAgentName(serverlessType?: string): serverlessType is ServerlessType; +export declare function isAWSLambdaAgentName(serverlessType?: string): serverlessType is ServerlessType; +export declare function isAzureFunctionsAgentName(serverlessType?: string): serverlessType is ServerlessType; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_ingestion_path.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_ingestion_path.d.ts new file mode 100644 index 0000000000000..84901d68bbaff --- /dev/null +++ b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_ingestion_path.d.ts @@ -0,0 +1 @@ +export declare const getIngestionPath: (hasOpenTelemetryFields: boolean) => "otel_native" | "classic_apm"; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_names.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_names.d.ts new file mode 100644 index 0000000000000..9f639e7e852a0 --- /dev/null +++ b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_names.d.ts @@ -0,0 +1,23 @@ +/** + * We cannot mark these arrays as const and derive their type + * because we need to be able to assign them as mutable entities for ES queries. + */ +export type ElasticAgentName = 'dotnet' | 'go' | 'iOS/swift' | 'java' | 'js-base' | 'nodejs' | 'php' | 'python' | 'ruby' | 'rum-js' | 'android/java'; +export declare const ELASTIC_AGENT_NAMES: ElasticAgentName[]; +export type OpenTelemetryAgentName = 'opentelemetry' | 'otlp' | `opentelemetry/${string}` | `otlp/${string}`; +export declare const OPEN_TELEMETRY_BASE_AGENT_NAMES: OpenTelemetryAgentName[]; +export declare const OPEN_TELEMETRY_AGENT_NAMES: OpenTelemetryAgentName[]; +export declare const EDOT_AGENT_NAMES: OpenTelemetryAgentName[]; +export declare const OTEL_AGENT_NAMES: OpenTelemetryAgentName[]; +export type JavaAgentName = 'java' | 'opentelemetry/java' | 'otlp/java'; +export declare const JAVA_AGENT_NAMES: JavaAgentName[]; +export type RumAgentName = 'js-base' | 'rum-js' | 'opentelemetry/webjs' | 'otlp/webjs'; +export declare const RUM_AGENT_NAMES: RumAgentName[]; +export type AndroidAgentName = 'android/java' | 'opentelemetry/android' | 'otlp/android'; +export declare const ANDROID_AGENT_NAMES: AndroidAgentName[]; +export type IOSAgentName = 'ios/swift' | 'opentelemetry/swift' | 'otlp/swift'; +export declare const IOS_AGENT_NAMES: IOSAgentName[]; +export type ServerlessType = 'aws.lambda' | 'azure.functions'; +export declare const SERVERLESS_TYPE: ServerlessType[]; +export type AgentName = ElasticAgentName | OpenTelemetryAgentName | JavaAgentName | RumAgentName | AndroidAgentName | IOSAgentName; +export declare const AGENT_NAMES: AgentName[]; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_sdk_name_and_language.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_sdk_name_and_language.d.ts new file mode 100644 index 0000000000000..4bec38245cfa3 --- /dev/null +++ b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_sdk_name_and_language.d.ts @@ -0,0 +1,6 @@ +interface SdkNameAndLanguage { + sdkName?: 'apm' | 'edot' | 'otel_other'; + language?: string; +} +export declare const getSdkNameAndLanguage: (agentName: string) => SdkNameAndLanguage; +export {}; diff --git a/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/index.d.ts b/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/index.d.ts new file mode 100644 index 0000000000000..71a1537421a47 --- /dev/null +++ b/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/index.d.ts @@ -0,0 +1 @@ +export type * from './src/encrypted_saved_objects_client_types'; diff --git a/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/src/encrypted_saved_objects_client_types.d.ts b/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/src/encrypted_saved_objects_client_types.d.ts new file mode 100644 index 0000000000000..ba20d53ad4c13 --- /dev/null +++ b/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/src/encrypted_saved_objects_client_types.d.ts @@ -0,0 +1,28 @@ +import type { ISavedObjectsPointInTimeFinder, SavedObject, SavedObjectsBaseOptions, SavedObjectsCreatePointInTimeFinderDependencies, SavedObjectsCreatePointInTimeFinderOptions } from '@kbn/core/server'; +export interface EncryptedSavedObjectsClient { + getDecryptedAsInternalUser: (type: string, id: string, options?: SavedObjectsBaseOptions) => Promise>; + /** + * API method, that can be used to help page through large sets of saved objects and returns decrypted properties in result SO. + * Its interface matches interface of the corresponding Saved Objects API `createPointInTimeFinder` method: + * + * @example + * ```ts + * const finder = await this.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser({ + * filter, + * type: 'my-saved-object-type', + * perPage: 1000, + * }); + * for await (const response of finder.find()) { + * // process response + * } + * ``` + * + * @param findOptions matches interface of corresponding argument of Saved Objects API `createPointInTimeFinder` {@link SavedObjectsCreatePointInTimeFinderOptions} + * @param dependencies matches interface of corresponding argument of Saved Objects API `createPointInTimeFinder` {@link SavedObjectsCreatePointInTimeFinderDependencies} + * + */ + createPointInTimeFinderDecryptedAsInternalUser(findOptions: SavedObjectsCreatePointInTimeFinderOptions, dependencies?: SavedObjectsCreatePointInTimeFinderDependencies): Promise>; +} +export interface EncryptedSavedObjectsClientOptions { + includedHiddenTypes?: string[]; +} diff --git a/src/platform/packages/shared/kbn-es-types/index.d.ts b/src/platform/packages/shared/kbn-es-types/index.d.ts new file mode 100644 index 0000000000000..1f97bdcabb945 --- /dev/null +++ b/src/platform/packages/shared/kbn-es-types/index.d.ts @@ -0,0 +1 @@ +export type { AggregationOptionsByType, ESSearchOptions, SearchHit, ESSearchResponse, ESSearchRequest, ESSourceOptions, InferSearchResponseOf, AggregationResultOf, AggregationResultOfMap, ESFilter, MaybeReadonlyArray, ESQLColumn, ESQLRow, ESQLSearchResponse, ESQLSearchParams, SearchField, } from './src'; diff --git a/src/platform/packages/shared/kbn-es-types/src/index.d.ts b/src/platform/packages/shared/kbn-es-types/src/index.d.ts new file mode 100644 index 0000000000000..845d0822ece35 --- /dev/null +++ b/src/platform/packages/shared/kbn-es-types/src/index.d.ts @@ -0,0 +1,17 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { InferSearchResponseOf, AggregateOf as AggregationResultOf, AggregateOfMap as AggregationResultOfMap, SearchHit, ESQLColumn, ESQLRow, ESQLSearchResponse, ESQLSearchParams, ChangePointType } from './search'; +export type ESFilter = estypes.QueryDslQueryContainer; +export type ESSearchRequest = estypes.SearchRequest; +export type AggregationOptionsByType = Required; +export type MaybeReadonlyArray = T[] | readonly T[]; +export type ESSourceOptions = boolean | string | string[]; +export interface ESSearchOptions { + restTotalHitsAsInt: boolean; +} +export type ESSearchResponse = InferSearchResponseOf; +export type SearchField = estypes.QueryDslFieldAndFormat | estypes.Field; +export type { InferSearchResponseOf, AggregationResultOf, AggregationResultOfMap, SearchHit, ESQLColumn, ESQLRow, ESQLSearchResponse, ESQLSearchParams, ChangePointType, }; diff --git a/src/platform/packages/shared/kbn-es-types/src/search.d.ts b/src/platform/packages/shared/kbn-es-types/src/search.d.ts new file mode 100644 index 0000000000000..696a6e5adc3de --- /dev/null +++ b/src/platform/packages/shared/kbn-es-types/src/search.d.ts @@ -0,0 +1,575 @@ +import type { ValuesType, UnionToIntersection } from 'utility-types'; +import type { estypes } from '@elastic/elasticsearch'; +interface AggregationsAggregationContainer extends Record { + aggs?: any; + aggregations?: any; +} +type InvalidAggregationRequest = unknown; +type ValidAggregationKeysOf> = T extends T ? keyof T : never; +type KeyOfSource = { + [key in keyof T]: (T[key] extends Record ? null : never) | string | number; +}; +type KeysOfSources = UnionToIntersection>>>; +type CompositeKeysOf = TAggregationContainer extends { + composite: { + sources: [...infer TSource]; + }; +} ? KeysOfSources : unknown; +type Source = estypes.SearchSourceFilter | boolean | estypes.Fields; +type TopMetricKeysOf = TAggregationContainer extends { + top_metrics: { + metrics: { + field: infer TField; + }; + }; +} ? Extract : TAggregationContainer extends { + top_metrics: { + metrics: Array<{ + field: infer TField; + }>; + }; +} ? Extract : string; +type ValueTypeOfField = T extends Record ? ValuesType : T extends Array ? ValueTypeOfField : T extends { + field: estypes.Field; +} ? T['field'] : T extends string | number ? T : never; +type MaybeArray = T | T[]; +type Fields = Required['fields']; +type DocValueFields = MaybeArray; +export type ChangePointType = 'indeterminable' | 'dip' | 'distribution_change' | 'non_stationary' | 'spike' | 'stationary' | 'step_change' | 'trend_change'; +export type SearchHit = Omit & (TSource extends false ? {} : { + _source: TSource; +}) & (TFields extends Fields ? { + fields: Partial, unknown[]>>; +} : { + fields?: Record; +}) & (TDocValueFields extends DocValueFields ? { + fields: Partial, unknown[]>>; +} : {}); +type HitsOf = Array>; +type AggregationMap = Partial>; +type TopLevelAggregationRequest = Pick; +type MaybeKeyed = TAggregationContainer extends Record ? Record : { + buckets: TBucket[]; +}; +export type AggregateOf = ValuesType & { + adjacency_matrix: { + buckets: Array<{ + key: string; + doc_count: number; + } & SubAggregateOf>; + }; + auto_date_histogram: { + interval: string; + buckets: Array<{ + key: number; + key_as_string: string; + doc_count: number; + } & SubAggregateOf>; + }; + avg: { + value: number | null; + value_as_string?: string; + }; + avg_bucket: { + value: number | null; + }; + boxplot: { + min: number | null; + max: number | null; + q1: number | null; + q2: number | null; + q3: number | null; + }; + bucket_correlation: { + value: number | null; + }; + bucket_count_ks_test: { + less: number; + greater: number; + two_sided: number; + }; + bucket_script: { + value: unknown; + }; + categorize_text: { + buckets: Array<{ + doc_count: number; + key: string; + regex: string; + max_matching_length: number; + } & SubAggregateOf>; + }; + cardinality: { + value: number; + }; + change_point: { + bucket?: { + key: string; + }; + type: Record; + }; + children: { + doc_count: number; + } & SubAggregateOf; + composite: { + after_key: CompositeKeysOf; + buckets: Array<{ + doc_count: number; + key: CompositeKeysOf; + } & SubAggregateOf>; + }; + cumulative_cardinality: { + value: number; + }; + cumulative_sum: { + value: number; + }; + date_histogram: MaybeKeyed>; + date_range: MaybeKeyed & Partial<{ + to: string | number; + to_as_string: string; + }> & { + doc_count: number; + key: string; + }>; + derivative: { + value: number | null; + } | undefined; + extended_stats: { + count: number; + min: number | null; + max: number | null; + avg: number | null; + sum: number; + sum_of_squares: number | null; + variance: number | null; + variance_population: number | null; + variance_sampling: number | null; + std_deviation: number | null; + std_deviation_population: number | null; + std_deviation_sampling: number | null; + std_deviation_bounds: { + upper: number | null; + lower: number | null; + upper_population: number | null; + lower_population: number | null; + upper_sampling: number | null; + lower_sampling: number | null; + }; + } & ({ + min_as_string: string; + max_as_string: string; + avg_as_string: string; + sum_of_squares_as_string: string; + variance_population_as_string: string; + variance_sampling_as_string: string; + std_deviation_as_string: string; + std_deviation_population_as_string: string; + std_deviation_sampling_as_string: string; + std_deviation_bounds_as_string: { + upper: string; + lower: string; + upper_population: string; + lower_population: string; + upper_sampling: string; + lower_sampling: string; + }; + } | {}); + extended_stats_bucket: { + count: number; + min: number | null; + max: number | null; + avg: number | null; + sum: number | null; + sum_of_squares: number | null; + variance: number | null; + variance_population: number | null; + variance_sampling: number | null; + std_deviation: number | null; + std_deviation_population: number | null; + std_deviation_sampling: number | null; + std_deviation_bounds: { + upper: number | null; + lower: number | null; + upper_population: number | null; + lower_population: number | null; + upper_sampling: number | null; + lower_sampling: number | null; + }; + }; + filter: { + doc_count: number; + } & SubAggregateOf; + filters: { + buckets: TAggregationContainer extends { + filters: { + filters: any[]; + }; + } ? Array<{ + doc_count: number; + } & SubAggregateOf> : TAggregationContainer extends { + filters: { + filters: Record; + }; + } ? { + [key in keyof TAggregationContainer['filters']['filters']]: { + doc_count: number; + } & SubAggregateOf; + } & (TAggregationContainer extends { + filters: { + other_bucket_key: infer TOtherBucketKey; + }; + } ? Record> : unknown) & (TAggregationContainer extends { + filters: { + other_bucket: true; + }; + } ? { + _other: { + doc_count: number; + } & SubAggregateOf; + } : unknown) : unknown; + }; + geo_bounds: { + top_left: { + lat: number | null; + lon: number | null; + }; + bottom_right: { + lat: number | null; + lon: number | null; + }; + }; + geo_centroid: { + count: number; + location: { + lat: number; + lon: number; + }; + }; + geo_distance: MaybeKeyed>; + geo_hash: { + buckets: Array<{ + doc_count: number; + key: string; + } & SubAggregateOf>; + }; + geotile_grid: { + buckets: Array<{ + doc_count: number; + key: string; + } & SubAggregateOf>; + }; + global: { + doc_count: number; + } & SubAggregateOf; + histogram: MaybeKeyed>; + ip_range: MaybeKeyed; + }; + } ? TRangeType extends { + key: infer TKeys; + } ? TKeys : string : string>; + inference: { + value: number; + prediction_probability: number; + prediction_score: number; + }; + max: { + value: number | null; + value_as_string?: string; + }; + max_bucket: { + value: number | null; + }; + min: { + value: number | null; + value_as_string?: string; + }; + min_bucket: { + value: number | null; + }; + median_absolute_deviation: { + value: number | null; + }; + moving_avg: { + value: number | null; + } | undefined; + moving_fn: { + value: number | null; + }; + moving_percentiles: TAggregationContainer extends Record ? Array<{ + key: number; + value: number | null; + }> : Record | undefined; + missing: { + doc_count: number; + } & SubAggregateOf; + multi_terms: { + doc_count_error_upper_bound: number; + sum_other_doc_count: number; + buckets: Array<{ + doc_count: number; + key: string[]; + key_as_string: string; + } & SubAggregateOf>; + }; + nested: { + doc_count: number; + } & SubAggregateOf; + normalize: { + value: number | null; + value_as_string?: string; + }; + parent: { + doc_count: number; + } & SubAggregateOf; + percentiles: { + values: TAggregationContainer extends Record ? Array<{ + key: number; + value: number | null; + }> : Record; + }; + percentile_ranks: { + values: TAggregationContainer extends Record ? Array<{ + key: number; + value: number | null; + }> : Record; + }; + percentiles_bucket: { + values: TAggregationContainer extends Record ? Array<{ + key: number; + value: number | null; + }> : Record; + }; + range: MaybeKeyed; + }; + } ? TRangeType extends { + key: infer TKeys; + } ? TKeys : string : string>; + rare_terms: Array<{ + key: string | number; + doc_count: number; + } & SubAggregateOf>; + rate: { + value: number | null; + }; + reverse_nested: { + doc_count: number; + } & SubAggregateOf; + random_sampler: { + seed: number; + probability: number; + doc_count: number; + } & SubAggregateOf; + sampler: { + doc_count: number; + } & SubAggregateOf; + scripted_metric: { + value: unknown; + }; + serial_diff: { + value: number | null; + value_as_string?: string; + }; + significant_terms: { + doc_count: number; + bg_count: number; + buckets: Array<{ + key: string | number; + score: number; + doc_count: number; + bg_count: number; + } & SubAggregateOf>; + }; + significant_text: { + doc_count: number; + buckets: Array<{ + key: string; + doc_count: number; + score: number; + bg_count: number; + }>; + }; + stats: { + count: number; + min: number | null; + max: number | null; + avg: number | null; + sum: number; + } & ({ + min_as_string: string; + max_as_string: string; + avg_as_string: string; + sum_as_string: string; + } | {}); + stats_bucket: { + count: number; + min: number | null; + max: number | null; + avg: number | null; + sum: number; + }; + string_stats: { + count: number; + min_length: number | null; + max_length: number | null; + avg_length: number | null; + entropy: number | null; + distribution: Record; + }; + sum: { + value: number | null; + value_as_string?: string; + }; + sum_bucket: { + value: number | null; + }; + terms: { + doc_count_error_upper_bound: number; + sum_other_doc_count: number; + buckets: Array<{ + doc_count: number; + key: string | number; + key_as_string?: string; + } & SubAggregateOf>; + }; + top_hits: { + hits: { + total: { + value: number; + relation: 'eq' | 'gte'; + }; + max_score: number | null; + hits: TAggregationContainer extends { + top_hits: estypes.AggregationsTopHitsAggregation; + } ? HitsOf : estypes.SearchHitsMetadata; + }; + }; + top_metrics: { + top: Array<{ + sort: number[] | string[]; + metrics: Record, string | number | null>; + }>; + }; + weighted_avg: { + value: number | null; + }; + value_count: { + value: number; + }; +}, Exclude, 'aggs' | 'aggregations'> & string>>; +export type AggregateOfMap = { + [TAggregationName in keyof TAggregationMap]: Required[TAggregationName] extends AggregationsAggregationContainer ? AggregateOf[TAggregationName], TDocument> : never; +}; +type SubAggregateOf = TAggregationRequest extends { + aggs?: AggregationMap; +} ? AggregateOfMap : TAggregationRequest extends { + aggregations?: AggregationMap; +} ? AggregateOfMap : {}; +type SearchResponseOf = SubAggregateOf; +type WrapAggregationResponse = keyof UnionToIntersection extends never ? { + aggregations?: unknown; +} : { + aggregations?: T; +}; +export type InferSearchResponseOf = Omit, 'aggregations' | 'hits'> & (TSearchRequest extends TopLevelAggregationRequest ? WrapAggregationResponse> : { + aggregations?: InvalidAggregationRequest; +}) & { + hits: Omit['hits'], 'total' | 'hits'> & (TOptions['restTotalHitsAsInt'] extends true ? { + total: number; + } : { + total: { + value: number; + relation: 'eq' | 'gte'; + }; + }) & { + hits: HitsOf; + }; +}; +export interface ESQLColumn { + name: string; + type: string; + original_types?: string[]; +} +export type ESQLRow = unknown[]; +export interface ESQLSearchResponse { + columns: ESQLColumn[]; + all_columns?: ESQLColumn[]; + values: ESQLRow[]; + took?: number; + documents_found?: number; + _clusters?: estypes.ClusterStatistics; +} +export interface ESQLSearchParams { + time_zone?: string; + query: string; + filter?: unknown; + project_routing?: string; + locale?: string; + include_execution_metadata?: boolean; + dropNullColumns?: boolean; + params?: estypes.ScalarValue[] | Array | undefined>>; +} +export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/constants.d.ts b/src/platform/packages/shared/kbn-esql-utils/constants.d.ts new file mode 100644 index 0000000000000..f15720d89694a --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/constants.d.ts @@ -0,0 +1,5 @@ +export declare const ENABLE_ESQL = "enableESQL"; +/** + * Denotes placeholder value for property on a record that is not set. + */ +export declare const GROUP_NOT_SET_VALUE = "(null)"; diff --git a/src/platform/packages/shared/kbn-esql-utils/index.d.ts b/src/platform/packages/shared/kbn-esql-utils/index.d.ts new file mode 100644 index 0000000000000..417fe3990daeb --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/index.d.ts @@ -0,0 +1,2 @@ +export { getESQLAdHocDataview, getESQLTimeFieldFromQuery, getIndexPatternFromESQLQuery, getSourceCommandFromESQLQuery, hasTransformationalCommand, getLimitFromESQLQuery, removeDropCommandsFromESQLQuery, getIndexForESQLQuery, getInitialESQLQuery, getESQLWithSafeLimit, appendToESQLQuery, appendWhereClauseToESQLQuery, appendStatsByToQuery, appendLimitToQuery, buildMetricsInfoQuery, getESQLQueryColumns, getESQLQueryColumnsRaw, getESQLResults, formatESQLColumns, getTimeFieldFromESQLQuery, getStartEndParams, hasStartEndParams, getNamedParams, prettifyQuery, retrieveMetadataColumns, getQueryColumnsFromESQLQuery, isESQLColumnSortable, isESQLColumnGroupable, isESQLFieldGroupable, sanitazeESQLInput, queryCannotBeSampled, mapVariableToColumn, getValuesFromQueryField, getESQLQueryVariables, fixESQLQueryWithVariables, replaceESQLQueryIndexPattern, getCategorizeColumns, getSparklineColumns, extractCategorizeTokens, getArgsFromRenameFunction, getCategorizeField, getKqlSearchQueries, getRemoteClustersFromESQLQuery, getLookupIndicesFromQuery, convertTimeseriesCommandToFrom, getESQLStatsQueryMeta, constructCascadeQuery, appendFilteringWhereClauseForCascadeLayout, getStatsGroupFieldType, getFieldParamDefinition, getESQLSources, getEsqlColumns, getEsqlPolicies, getJoinIndices, getTimeseriesIndices, getViews, getDatasets, getInferenceEndpoints, getEditorExtensions, getProjectRoutingFromEsqlQuery, hasOnlySourceCommand, hasTimeseriesInfoCommand, isComputedColumn, getQuerySummary, getColumnsWithHighlights, buildRenameSourceFieldMap, getEsqlControls, getAllEsqlControls, convertFiltersToESQLExpression, convertQueryToESQLExpression, injectWhereClauseAfterSourceCommand, type ESQLStatsQueryMeta, type EsqlColumnsWithHighlights, type ESQLHighlightTags, } from './src'; +export { ENABLE_ESQL, GROUP_NOT_SET_VALUE } from './constants'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/index.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/index.d.ts new file mode 100644 index 0000000000000..077ee7e09606a --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/index.d.ts @@ -0,0 +1,29 @@ +export { getESQLAdHocDataview, getIndexForESQLQuery } from './utils/get_esql_adhoc_dataview'; +export { getESQLTimeFieldFromQuery } from './utils/get_esql_time_field_from_query'; +export { getInitialESQLQuery } from './utils/get_initial_esql_query'; +export { getESQLWithSafeLimit } from './utils/get_esql_with_safe_limit'; +export { getLimitFromESQLQuery, removeDropCommandsFromESQLQuery, hasTransformationalCommand, getTimeFieldFromESQLQuery, prettifyQuery, retrieveMetadataColumns, getQueryColumnsFromESQLQuery, mapVariableToColumn, getValuesFromQueryField, getESQLQueryVariables, fixESQLQueryWithVariables, getCategorizeColumns, getSparklineColumns, getArgsFromRenameFunction, getCategorizeField, getKqlSearchQueries, getRemoteClustersFromESQLQuery, convertTimeseriesCommandToFrom, hasOnlySourceCommand, hasTimeseriesInfoCommand, } from './utils/query_parsing_helpers'; +export { getIndexPatternFromESQLQuery, getSourceCommandFromESQLQuery, } from './utils/get_index_pattern_from_query'; +export { queryCannotBeSampled } from './utils/query_cannot_be_sampled'; +export { appendToESQLQuery } from './utils/append_to_query/utils'; +export { appendStatsByToQuery } from './utils/append_to_query/append_stats_by'; +export { appendWhereClauseToESQLQuery } from './utils/append_to_query/append_where'; +export { appendLimitToQuery } from './utils/append_to_query/append_limit'; +export { buildMetricsInfoQuery } from './utils/append_to_query/append_metrics_info'; +export { getESQLQueryColumns, getESQLQueryColumnsRaw, getESQLResults, formatESQLColumns, getStartEndParams, hasStartEndParams, getNamedParams, } from './utils/run_query'; +export { isESQLColumnSortable, isESQLColumnGroupable, isESQLFieldGroupable, } from './utils/esql_fields_utils'; +export { sanitazeESQLInput } from './utils/sanitaze_input'; +export { replaceESQLQueryIndexPattern } from './utils/replace_index_pattern'; +export { extractCategorizeTokens } from './utils/extract_categorize_tokens'; +export { getLookupIndicesFromQuery } from './utils/get_lookup_indices'; +export { type ESQLStatsQueryMeta, getESQLStatsQueryMeta, constructCascadeQuery, appendFilteringWhereClauseForCascadeLayout, } from './utils/cascaded_documents_helpers'; +export { getStatsGroupFieldType, getFieldParamDefinition, } from './utils/cascaded_documents_helpers/utils'; +export { getProjectRoutingFromEsqlQuery } from './utils/set_instructions_helpers'; +export { isComputedColumn, getQuerySummary } from './utils/get_query_summary'; +export { getColumnsWithHighlights, type EsqlColumnsWithHighlights, type ESQLHighlightTags, } from './utils/get_columns_with_highlights'; +export { buildRenameSourceFieldMap } from './utils/build_rename_source_field_map'; +export { getAllEsqlControls, getEsqlControls } from './utils/get_esql_controls'; +export { convertFiltersToESQLExpression } from './utils/convert_filters_to_esql'; +export { convertQueryToESQLExpression } from './utils/convert_query_to_esql'; +export { injectWhereClauseAfterSourceCommand } from './utils/inject_where_after_source'; +export * from './utils/callbacks'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_limit.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_limit.d.ts new file mode 100644 index 0000000000000..44bafeffba26a --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_limit.d.ts @@ -0,0 +1 @@ +export declare const appendLimitToQuery: (queryString: string, limit: number) => string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_metrics_info.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_metrics_info.d.ts new file mode 100644 index 0000000000000..8394658fa4a69 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_metrics_info.d.ts @@ -0,0 +1,7 @@ +/** + * Appends "| METRICS_INFO" to an ES|QL query if it has no transformational commands. + * SORT is removed from the query. LIMIT, if present, is appended after METRICS_INFO. + * @param esql the ES|QL query. + * @returns the query with "| METRICS_INFO" added, or an empty string if not allowed. + */ +export declare function buildMetricsInfoQuery(esql?: string, dimensions?: string[]): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_stats_by.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_stats_by.d.ts new file mode 100644 index 0000000000000..cb73635a5f8ac --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_stats_by.d.ts @@ -0,0 +1 @@ +export declare const appendStatsByToQuery: (queryString: string, column: string) => string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_where.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_where.d.ts new file mode 100644 index 0000000000000..2b447099be6b4 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_where.d.ts @@ -0,0 +1,12 @@ +import { type SupportedOperation } from './utils'; +/** + * Appends a WHERE clause to an existing ES|QL query string. + * @param baseESQLQuery the base ES|QL query to append the WHERE clause to. + * @param field the field to filter on. + * @param value the value to filter by. + * @param operation the operation to perform ('+', '-', 'is_not_null', 'is_null'). + * @param kibanaFieldType the type of the field being filtered (optional). + * @param esMappingType the ES mapping type of the field (optional, used to determine whether to use MV_CONTAINS). + * @returns the modified ES|QL query string with the appended WHERE clause, or undefined if no changes were made. + */ +export declare function appendWhereClauseToESQLQuery(baseESQLQuery: string, field: string, value: unknown, operation: SupportedOperation, kibanaFieldType?: string, esMappingType?: string): string | undefined; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/utils.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/utils.d.ts new file mode 100644 index 0000000000000..2a0fc80732016 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/utils.d.ts @@ -0,0 +1,39 @@ +import type { BinaryExpressionComparisonOperator, ESQLFunction } from '@elastic/esql/types'; +export type SupportedOperation = '+' | '-' | 'is_not_null' | 'is_null'; +export type SupportedOperators = Extract { + operator: SupportedOperators; + expressionType: "postfix-unary" | "binary"; +}; +/** + * Get the list of supported operators dynamically by mapping all possible operation inputs + */ +export declare function getSupportedOperators(): SupportedOperators[]; +/** + * Escapes a string value for use in ES|QL queries by escaping special characters + */ +export declare function escapeStringValue(val: string): string; +/** + * Append in a new line the appended text to take care of the case where the user adds a comment at the end of the query. + * In these cases a base query such as "from index // comment" will result in errors or wrong data if we don't append in a new line + */ +export declare function appendToESQLQuery(baseESQLQuery: string, appendedText: string): string; +/** + * Extracts field name and value from a MATCH function AST node + */ +export declare function extractMatchFunctionDetails(matchFunction: ESQLFunction): { + columnName: string; + literalValue: string; +} | null; +/** + * Extracts field name and values from an MV_CONTAINS function AST node, + * supporting both casted and uncast scalar or list values + */ +export declare function extractMvContainsFunctionDetails(mvContainsFunction: ESQLFunction): { + columnName: string; + literalValues: Array; +} | null; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/build_rename_source_field_map.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/build_rename_source_field_map.d.ts new file mode 100644 index 0000000000000..c3b139bd68772 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/build_rename_source_field_map.d.ts @@ -0,0 +1,7 @@ +/** + * Pre-computes the rename source field resolution for every rename target in a single parse pass. + * Use this when resolving multiple columns for the same query (e.g. a full column list from an + * ES response). Only columns that actually resolve to a different source field are present in the + * returned map; callers should fall back to the column name for absent entries. + */ +export declare function buildRenameSourceFieldMap(query: string): Map; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/columns.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/columns.d.ts new file mode 100644 index 0000000000000..9fdac4c5dd5b4 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/columns.d.ts @@ -0,0 +1,19 @@ +import type { TimeRange } from '@kbn/es-query'; +import type { ISearchGeneric } from '@kbn/search-types'; +import type { ESQLControlVariable, ESQLFieldWithMetadata } from '@kbn/esql-types'; +/** + * Gets the columns of an ESQL query, formatted as ESQLFieldWithMetadata + * @param esqlQuery The ESQL query to execute + * @param search The search service to use + * @param variables Optional ESQL control variables to substitute in the query + * @param signal Optional AbortSignal to cancel the request + * @param timeRange Optional time range for the query + * @returns A promise that resolves to an array of ESQLFieldWithMetadata + */ +export declare const getEsqlColumns: ({ esqlQuery, search, variables, signal, timeRange, }: { + search: ISearchGeneric; + esqlQuery?: string; + variables?: ESQLControlVariable[]; + signal?: AbortSignal; + timeRange?: TimeRange; +}) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/datasets.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/datasets.d.ts new file mode 100644 index 0000000000000..d10e2b4b2b247 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/datasets.d.ts @@ -0,0 +1,9 @@ +import type { EsqlDatasetsResult } from '@kbn/esql-types'; +/** + * Fetches all ES|QL datasets from the cluster (GET _query/dataset). + * @param http The HTTP service to use for the request. + * @returns A promise that resolves to the datasets list. + */ +export declare const getDatasets: (this: void | { + forceRefresh?: boolean; +} | undefined, http: import("@kbn/core/public").HttpSetup) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/extensions.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/extensions.d.ts new file mode 100644 index 0000000000000..fdd077ba2839f --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/extensions.d.ts @@ -0,0 +1,27 @@ +import type { RecommendedField, RecommendedQuery, ESQLRegistrySolutionId } from '@kbn/esql-types'; +import type { HttpStart } from '@kbn/core/public'; +interface EditorExtensions { + recommendedQueries: RecommendedQuery[]; + recommendedFields: RecommendedField[]; +} +/** + * Single-pass analysis of the query string: parses the AST once and returns + * whether the source is complete, the index pattern, and the command name. + * Returns undefined when the source is incomplete or missing. + */ +export declare const analyzeSourceQuery: (queryString: string) => { + indexPattern: string; + commandName: string; +} | undefined; +/** + * Fetches editor extensions from the registry based on the provided query string and active solution ID. + * @param queryString The query string to search for extensions. + * @param activeSolutionId The active solution ID to filter extensions. + * @param http The HTTP service to use for the request. + * @returns A promise that resolves to the editor extensions. + * Results are cached by index pattern so they are computed once per source and reused + * across all consumers. While the user is still typing the source name the function + * returns an empty result immediately without making any HTTP requests. + */ +export declare const getEditorExtensions: (http: HttpStart, queryString: string, activeSolutionId: ESQLRegistrySolutionId) => Promise; +export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/index.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/index.d.ts new file mode 100644 index 0000000000000..871ae33dd5a39 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/index.d.ts @@ -0,0 +1,9 @@ +export { getESQLSources } from './sources'; +export { getEsqlColumns } from './columns'; +export { getEsqlPolicies } from './policies'; +export { getJoinIndices } from './lookup_indices'; +export { getTimeseriesIndices } from './timeseries_indices'; +export { getViews } from './views'; +export { getDatasets } from './datasets'; +export { getInferenceEndpoints } from './inference'; +export { getEditorExtensions } from './extensions'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/inference.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/inference.d.ts new file mode 100644 index 0000000000000..88f32dfd9d00e --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/inference.d.ts @@ -0,0 +1,10 @@ +import type { InferenceEndpointsAutocompleteResult } from '@kbn/esql-types'; +/** + * Fetches inference endpoints based on the provided task type. + * @param http The HTTP service to use for the request. + * @param taskType The type of inference task to get endpoints for. + * @returns A promise that resolves to an InferenceEndpointsAutocompleteResult object. + */ +export declare const getInferenceEndpoints: (this: void | { + forceRefresh?: boolean; +} | undefined, http: import("@kbn/core/public").HttpSetup, taskType: string) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/lookup_indices.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/lookup_indices.d.ts new file mode 100644 index 0000000000000..5c106b5e495da --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/lookup_indices.d.ts @@ -0,0 +1,12 @@ +import type { HttpStart } from '@kbn/core/public'; +import type { IndicesAutocompleteResult } from '@kbn/esql-types'; +/** + * Fetches join indices based on the provided ESQL query. + * @param query The ESQL query string to extract remote clusters from. + * @param http The HTTP service to use for the request. + * @param cacheOptions Optional cache options to control cache behavior. + * @returns A promise that resolves to an IndicesAutocompleteResult object. + */ +export declare const getJoinIndices: (query: string, http: HttpStart, cacheOptions?: { + forceRefresh?: boolean; +}) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/policies.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/policies.d.ts new file mode 100644 index 0000000000000..79b2216b72c64 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/policies.d.ts @@ -0,0 +1,10 @@ +import type { HttpStart } from '@kbn/core/public'; +import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; +type EsqlPolicy = Omit; +/** + * Fetches the list of enrich policies from the server, formatted as EsqlPolicy objects. + * @param http The HTTP service to use for the request. + * @returns A promise that resolves to an array of EsqlPolicy objects. + */ +export declare const getEsqlPolicies: (http: HttpStart) => Promise; +export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/sources.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/sources.d.ts new file mode 100644 index 0000000000000..1289ab6f087b0 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/sources.d.ts @@ -0,0 +1,26 @@ +import type { CoreStart } from '@kbn/core/public'; +import { type ESQLSourceResult } from '@kbn/esql-types'; +import type { ILicense } from '@kbn/licensing-types'; +/** + * Fetches the list of indices, aliases, and data streams from the Elasticsearch cluster. + * @param core The core start contract to make HTTP requests. + * @param areRemoteIndicesAvailable A boolean indicating if remote indices should be included. + * @param signal Optional AbortSignal to cancel the request. + * @param projectRouting Optional CPS project routing value forwarded to the server so that index + * resolution reflects the project picker selection or an explicit `SET project_routing` + * pre-statement. `SET project_routing` takes precedence over the picker value. + * @returns A promise that resolves to an array of ESQLSourceResult objects. + */ +export declare const getIndicesList: (core: Pick, areRemoteIndicesAvailable: boolean, signal?: AbortSignal, projectRouting?: string) => Promise; +/** Fetches ESQL sources including indices, aliases, data streams, and integrations. + * @param core The core start contract to make HTTP requests and access application capabilities. + * @param getLicense An optional function to retrieve the current license information. + * @param enrichSources Optional function to enrich or transform the list of sources before + * returning them (e.g. to add stream descriptions, links, or custom types). + * @param signal Optional AbortSignal to cancel the request. + * @param projectRouting Optional CPS project routing value forwarded to the server so that index + * resolution reflects the project picker selection or an explicit `SET project_routing` + * pre-statement. `SET project_routing` takes precedence over the picker value. + * @returns A promise that resolves to an array of ESQLSourceResult objects. + */ +export declare const getESQLSources: (core: Pick, getLicense: (() => Promise) | undefined, enrichSources?: (sources: ESQLSourceResult[]) => Promise, signal?: AbortSignal, projectRouting?: string) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/timeseries_indices.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/timeseries_indices.d.ts new file mode 100644 index 0000000000000..80c54fce0e04e --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/timeseries_indices.d.ts @@ -0,0 +1,4 @@ +import type { IndicesAutocompleteResult } from '@kbn/esql-types'; +export declare const getTimeseriesIndices: (this: void | { + forceRefresh?: boolean; +} | undefined, http: import("@kbn/core/public").HttpSetup) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/utils/cache.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/utils/cache.d.ts new file mode 100644 index 0000000000000..ce087137f228e --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/utils/cache.d.ts @@ -0,0 +1,32 @@ +/** + * Given a non-parametrized async function, returns a function which caches the + * result of that function. When a cached value is available, it returns + * immediately that value and refreshes the cache in the background. When the + * cached value is too old, it is discarded and the function is called again. + * + * @param fn Function to call to get the value. + * @param maxCacheDuration For how long to keep a value in the cache, + * in milliseconds. Defaults to 5 minutes. + * @param refreshAfter Minimum time between cache refreshes, in milliseconds. + * Defaults to 15 seconds. + * @param now Function which returns the current time in milliseconds, defaults to `Date.now`. + * @returns A function which returns the cached value. + */ +export declare const cacheNonParametrizedAsyncFunction: (fn: () => Promise, maxCacheDuration?: number, refreshAfter?: number, now?: () => number) => ({ forceRefresh }?: { + forceRefresh?: boolean; +}) => Promise; +/** + * Caches the result of an async function based on its arguments. + * + * @param fn Function to call to get the value. + * @param getKey Function to generate a unique cache key from the arguments. + * @param maxCacheDuration For how long to keep a value in the cache, + * in milliseconds. Defaults to 5 minutes. + * @param refreshAfter Minimum time between cache refreshes, in milliseconds. + * Defaults to 15 seconds. + * @param now Function which returns the current time in milliseconds, defaults to `Date.now`. + * @returns A function which returns the cached value. + */ +export declare const cacheParametrizedAsyncFunction: (fn: (...args: Args) => Promise, getKey?: (...args: Args) => string, maxCacheDuration?: number, refreshAfter?: number, now?: () => number) => (this: { + forceRefresh?: boolean; +} | undefined | void, ...args: Args) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/views.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/views.d.ts new file mode 100644 index 0000000000000..fbb0a2fc2e994 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/views.d.ts @@ -0,0 +1,9 @@ +import type { EsqlViewsResult } from '@kbn/esql-types'; +/** + * Fetches all ES|QL views from the cluster (GET _query/view). + * @param http The HTTP service to use for the request. + * @returns A promise that resolves to the views list. + */ +export declare const getViews: (this: void | { + forceRefresh?: boolean; +} | undefined, http: import("@kbn/core/public").HttpSetup) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/index.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/index.d.ts new file mode 100644 index 0000000000000..de2404aed84d6 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/index.d.ts @@ -0,0 +1,58 @@ +import { type AggregateQuery } from '@kbn/es-query'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { ESQLControlVariable } from '@kbn/esql-types'; +import { type SupportedFieldTypes, type FieldValue } from './utils'; +type NodeType = 'group' | 'leaf'; +export interface AppliedStatsFunction { + identifier: string; + aggregation: string; +} +export interface ESQLStatsQueryMeta { + groupByFields: Array<{ + field: string; + type: string; + }>; + appliedFunctions: AppliedStatsFunction[]; +} +/** + * This method is used to get the metadata on STATS command to drive the cascade experience from an ESQL query, + * if a valid STATS command is found information about the group by fields and applied functions is returned. + * This method will exclude queries contain commands that are not valid for the cascade experience, + */ +export declare const getESQLStatsQueryMeta: (queryString: string) => ESQLStatsQueryMeta; +export interface CascadeQueryArgs { + /** + * data view for the query + */ + dataView: DataView; + /** + * anchor query for generating the next valid query + */ + query: AggregateQuery; + /** + * ESQL variables for the query + */ + esqlVariables: ESQLControlVariable[] | undefined; + /** + * Node type (group or leaf) for which we are constructing the cascade query + */ + nodeType: NodeType; + /** + * Node path for the current node in the cascade experience we'd like to generate a query for + */ + nodePath: string[]; + /** + * Mapping of node paths to their corresponding values, used to populate the query with literal values + */ + nodePathMap: Record; +} +/** + * Constructs a cascade query from the provided query, based on the node type, node path and node path map. + */ +export declare const constructCascadeQuery: ({ query, dataView, esqlVariables, nodeType, nodePath, nodePathMap, }: CascadeQueryArgs) => AggregateQuery | undefined; +/** + * Handles the computation and appending of a filtering where clause, + * for ES|QL query containing a stats command in the cascade layout experience + */ +export declare const appendFilteringWhereClauseForCascadeLayout: (query: string, esqlVariables: ESQLControlVariable[] | undefined, dataView: DataView, fieldName: string, value: T extends SupportedFieldTypes ? FieldValue : unknown, operation: "+" | "-" | "is_not_null" | "is_null", fieldType?: T extends SupportedFieldTypes ? T : string) => string; +export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/utils.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/utils.d.ts new file mode 100644 index 0000000000000..346ad3a1a3b49 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/utils.d.ts @@ -0,0 +1,58 @@ +import { type DataView } from '@kbn/data-views-plugin/public'; +import { Builder } from '@elastic/esql'; +import type { EsqlQuery } from '@elastic/esql'; +import type { ESQLFunction, ESQLCommand } from '@elastic/esql/types'; +import type { FieldSummary } from '@kbn/esql-language/src/commands/registry/types'; +import type { ESQLControlVariable } from '@kbn/esql-types'; +import { type Terminal } from '../esql_fields_utils'; +export declare const SUPPORTED_STATS_COMMAND_OPTION_FUNCTIONS: "categorize"[]; +export type SupportedStatsFunction = (typeof SUPPORTED_STATS_COMMAND_OPTION_FUNCTIONS)[number]; +export declare const isSupportedStatsFunction: (fnName: string) => fnName is SupportedStatsFunction; +export type SupportedFieldTypes = Exclude; +export type FieldValue = Parameters<(typeof Builder.expression.literal)[T]>[0] | unknown; +export interface StatsCommandSummary { + command: ESQLCommand; + aggregates: Record; + grouping: Record; +} +export declare const isCategorizeFunctionWithFunctionArgument: (functionDefinition: ESQLFunction) => boolean; +export declare const removeBackticks: (str: string) => string; +/** + * constrains the field value type to be one of the supported field value types, else we process as a string literal when building the expression + */ +export declare const isSupportedFieldType: (fieldType: unknown) => fieldType is SupportedFieldTypes; +/** + * if value is a text or keyword field and it's not "aggregatable", we opt to use match phrase for the where command + */ +export declare const requiresMatchPhrase: (fieldName: string, dataViewFields: DataView["fields"]) => boolean | undefined; +/** + * Returns the stats command to operate on, we operate on the last stats command in the query + */ +export declare function getStatsCommandToOperateOn(esqlQuery: EsqlQuery): ({ + command: ESQLCommand; + grouping: Record; + aggregates: Record; +} & { + index: number; +}) | null; +/** + * Returns the data source command from the esql query, supports both the FROM and TS commands + */ +export declare function getESQLQueryDataSourceCommand(esqlQuery: EsqlQuery): ESQLCommand<'from' | 'ts'> | undefined; +/** + * Returns runtime fields that are created within the query by the STATS command in the query + */ +export declare function getStatsCommandRuntimeFields(esqlQuery: EsqlQuery): Set[]; +/** + * Returns the summary of the stats command at the given command index in the esql query + */ +export declare function getStatsCommandAtIndexSummary(esqlQuery: EsqlQuery, commandIndex: number): { + command: ESQLCommand; + grouping: Record; + aggregates: Record; +} | null; +/** + * Returns the param definition for the given field name + */ +export declare function getFieldParamDefinition(fieldName: string, fieldTerminals: Array, esqlVariables: ESQLControlVariable[] | undefined): string | number | (string | number)[] | undefined; +export declare function getStatsGroupFieldType(groupByFields: T): R; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_filters_to_esql.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_filters_to_esql.d.ts new file mode 100644 index 0000000000000..85076f2442e3a --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_filters_to_esql.d.ts @@ -0,0 +1,13 @@ +import { type Filter } from '@kbn/es-query'; +export interface FilterTranslationResult { + /** Combined WHERE expression fragment (all translatable filters ANDed), empty string if none */ + esqlExpression: string; + /** Filters that could not be translated to ES|QL */ + untranslatableFilters: Filter[]; +} +/** + * Converts an array of Elasticsearch Query DSL filters to an ES|QL WHERE clause expression. + * Disabled filters are skipped. Negated filters are wrapped with NOT. + * Untranslatable filter types (custom, spatial, scripted) are returned separately. + */ +export declare const convertFiltersToESQLExpression: (filters: Filter[]) => FilterTranslationResult; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_query_to_esql.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_query_to_esql.d.ts new file mode 100644 index 0000000000000..6a754915aee9f --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_query_to_esql.d.ts @@ -0,0 +1,9 @@ +import { type Query } from '@kbn/es-query'; +/** + * Converts a KQL or Lucene query into an ES|QL expression that can be used inside a WHERE + * clause. KQL maps to the `KQL(...)` function and Lucene maps to `QSTR(...)`. + * + * Returns an empty string when the query is missing, has no body, or uses an unsupported + * language. + */ +export declare const convertQueryToESQLExpression: (query?: Query) => string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/esql_fields_utils.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/esql_fields_utils.d.ts new file mode 100644 index 0000000000000..7bfe8f239dabd --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/esql_fields_utils.d.ts @@ -0,0 +1,43 @@ +import type { FieldSpec } from '@kbn/data-views-plugin/common'; +import type { ESQLColumn, ESQLList, ESQLLiteral, ESQLProperNode } from '@elastic/esql/types'; +import type { DatatableColumn } from '@kbn/expressions-plugin/common'; +/** + * Check if a column is sortable. + * + * @param column The DatatableColumn of the field. + * @returns True if the column is sortable, false otherwise. + */ +export declare const isESQLColumnSortable: (column: DatatableColumn) => boolean; +/** + * Check if a column is groupable (| STATS ... BY ). + * + * @param column The DatatableColumn of the field. + * @returns True if the column is groupable, false otherwise. + */ +export declare const isESQLColumnGroupable: (column: DatatableColumn) => boolean; +export declare const isESQLFieldGroupable: (field: FieldSpec) => boolean; +/** + * Returns the expression that defines the value of the field. + * + * If the field is defined using an assignement expression, it returns the right side of the assignment. + * i.e. in `STATS foo = bar + 1`, it returns `bar + 1`. + * + * If the field is not defined using an assignment, it returns the field argument itself. + * i.e. in `STATS count()`, it returns `count()`. + */ +export declare const getFieldDefinitionFromArg: (fieldArgument: ESQLProperNode) => ESQLProperNode; +export type Terminal = ESQLColumn | ESQLLiteral | ESQLList; +/** + * Retrieves a list of terminal nodes that were found in the field definition. + */ +export declare const getFieldTerminals: (fieldArgument: ESQLProperNode) => Terminal[]; +/** + * Retrieves a formatted list of field names which were used for the new field + * construction. For example, in the below example, `x` and `y` are the + * existing "used" fields: + * + * ``` + * STATS foo = agg(x) BY y, bar = x + * ``` + */ +export declare const getUsedFields: (fieldArgument: ESQLProperNode) => Set; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/extract_categorize_tokens.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/extract_categorize_tokens.d.ts new file mode 100644 index 0000000000000..e97b67d235fee --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/extract_categorize_tokens.d.ts @@ -0,0 +1,8 @@ +/** + * Extracts "tokens" from a regex string (produced by the categorize function) by stripping leading/trailing '.*?' + * and splitting the remainder by '.+?'. + * + * @param {string} regexString The regular expression string. + * @returns {string[]} An array of extracted "keywords". + */ +export declare function extractCategorizeTokens(regexString: string): string[]; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.d.ts new file mode 100644 index 0000000000000..b13486a8d70bb --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.d.ts @@ -0,0 +1,36 @@ +export declare const DEFAULT_HIGHLIGHT_PRE_TAG = ""; +export declare const DEFAULT_HIGHLIGHT_POST_TAG = ""; +/** + * ES|QL functions that can produce highlight markup in output columns when + * called with `{ "highlight": true }`. + */ +export declare const FUNCTIONS_WITH_HIGHLIGHT_SUPPORT: string[]; +export interface ESQLHighlightTags { + preTag: string; + postTag: string; +} +export type EsqlColumnsWithHighlights = Record; +/** + * Returns columns built using a highlighting algorithm, + * including the opening and closing markup tags configured for each column. + * + * Example: + * ``` + * FROM books + * | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": true }) + * | EVAL titles = TOP_SNIPPETS(title, "Tolkien", { "highlight": true, "pre_tag": "", "post_tag": "" }) + * ``` + * Will return the following map: + * ``` + * { + * snippets: { + * preTag: '', + * postTag: '', + * }, + * titles: { + * preTag: '', + * postTag: '', + * }, + * } + */ +export declare function getColumnsWithHighlights(query: string): EsqlColumnsWithHighlights; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_adhoc_dataview.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_adhoc_dataview.d.ts new file mode 100644 index 0000000000000..9dfcf541339f6 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_adhoc_dataview.d.ts @@ -0,0 +1,51 @@ +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; +import type { HttpStart } from '@kbn/core/public'; +/** + * Creates an ad-hoc DataView for ES|QL queries. + * + * Some applications need to have a DataView to work properly with ES|QL queries. + * This helper creates an ad-hoc DataView with an ID constructed from the index pattern. + * Since there are no runtime fields, field formatters, or default time fields, + * the same ad-hoc DataView can be constructed/reused, which solves caching issues + * described in https://github.com/elastic/kibana/issues/168131. + * + * The function automatically detects the time field by making an HTTP request to determine + * if '@timestamp' exists across all indices in the query. If all indices contain the field, + * it sets '@timestamp' as the time field; otherwise, no time field is set. + * + * @param dataViewsService - The DataViews service instance used to create the DataView + * @param query - The ES|QL query string to extract the index pattern from + * @param options - Optional configuration for DataView creation + * @param options.allowNoIndex - Whether to allow creating a DataView for non-existent indices + * @param options.skipFetchFields - Whether to skip fetching fields for performance reasons + * @param options.createNewInstanceEvenIfCachedOneAvailable - Forces creation of a new instance by clearing the cached DataView instance and cached time field lookup for the query + * @param options.id - Explicit DataView ID. When provided, this ID is used as-is instead of generating one via SHA-256. Useful when the caller already knows the ID (e.g. from a persisted ad-hoc DataView spec) and wants the DataViewService cache to be populated under that exact key. + * @param options.idPrefix - Custom prefix for the DataView ID (defaults to 'esql'). Use a different prefix to avoid cache collisions between consumers. + * @param http - Optional HTTP service for fetching time field information. If not provided, no time field detection is performed + * + * @returns Promise that resolves to the created DataView with the detected time field (if any) + * + */ +export declare function getESQLAdHocDataview({ dataViewsService, query, options, http, }: { + dataViewsService: DataViewsPublicPluginStart; + query: string; + options?: { + allowNoIndex?: boolean; + createNewInstanceEvenIfCachedOneAvailable?: boolean; + skipFetchFields?: boolean; + id?: string; + idPrefix?: string; + }; + http?: HttpStart; +}): Promise; +/** + * Gets an initial index for a default ES|QL query by querying both local and remote (CCS) indices. + * Could be used during onboarding when data views to get a better index are not yet available. + * Can be used in combination with {@link getESQLAdHocDataview} to create a dataview for the index. + * + * Prefers a local `logs*` pattern if any local index starts with "logs", + * otherwise returns the first available non-hidden index (local or remote). + */ +export declare function getIndexForESQLQuery(deps: { + http: HttpStart; +}): Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_controls.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_controls.d.ts new file mode 100644 index 0000000000000..2a0b4ea36fef2 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_controls.d.ts @@ -0,0 +1,15 @@ +import type { AggregateQuery, Query } from '@kbn/es-query'; +import type { OptionsListESQLControlState } from '@kbn/controls-schemas'; +import { type PresentationContainer } from '@kbn/presentation-publishing'; +import { ESQL_CONTROL } from '@kbn/controls-constants'; +type EsqlControlState = OptionsListESQLControlState & { + type: typeof ESQL_CONTROL; +}; +interface EsqlControlsState { + [uuid: string]: EsqlControlState; +} +export declare function getAllEsqlControls(presentationContainer: PresentationContainer): EsqlControlsState; +export declare function getEsqlControls(presentationContainer: PresentationContainer, query: AggregateQuery | Query | undefined): { + [k: string]: EsqlControlState; +} | undefined; +export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_time_field_from_query.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_time_field_from_query.d.ts new file mode 100644 index 0000000000000..cbc572834462b --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_time_field_from_query.d.ts @@ -0,0 +1,13 @@ +import type { HttpStart } from '@kbn/core/public'; +/** + * Resolves the default time field for an ES|QL query by calling the timefield API. + * + * When `http` is omitted, returns `undefined` (unless a prior successful request + * for the same query left a value in the in-memory cache). + * + * Concurrent requests for the same query share one HTTP request via an LRU-backed promise cache. + */ +export declare function getESQLTimeFieldFromQuery({ query, http, }: { + query: string; + http?: HttpStart; +}): Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_with_safe_limit.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_with_safe_limit.d.ts new file mode 100644 index 0000000000000..6d4f3d8000b46 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_with_safe_limit.d.ts @@ -0,0 +1 @@ +export declare function getESQLWithSafeLimit(esql: string, limit: number): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_index_pattern_from_query.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_index_pattern_from_query.d.ts new file mode 100644 index 0000000000000..2d72495b68c9d --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_index_pattern_from_query.d.ts @@ -0,0 +1,13 @@ +/** + * Retrieves the index pattern from an ES|QL query using AST parsing. + * Handles both main queries and subqueries within FROM/TS commands. + * + * @param esql - The ES|QL query string to parse + * @returns Comma-separated string of unique index names, or empty string if no sources found + */ +export declare function getIndexPatternFromESQLQuery(esql?: string): string; +/** + * @param esql - The ES|QL query string to parse + * @returns The source command name, or an empty string if not found + */ +export declare function getSourceCommandFromESQLQuery(esql?: string): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_initial_esql_query.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_initial_esql_query.d.ts new file mode 100644 index 0000000000000..3cef2be5488e0 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_initial_esql_query.d.ts @@ -0,0 +1,12 @@ +import type { DataView } from '@kbn/data-views-plugin/public'; +import { type Filter, type Query } from '@kbn/es-query'; +/** + * Builds an ES|QL query for the provided dataView + * If there is @timestamp field in the index, we don't add the WHERE clause + * If there is no @timestamp and there is a dataView timeFieldName, we add the WHERE clause with the timeFieldName + * If the index pattern contains TSDB fields, we add the TS command, otherwise we add the FROM command + * @param dataView + * @param query + * @param filters - DSL filters to convert to ES|QL WHERE clauses + */ +export declare function getInitialESQLQuery(dataView: DataView, query?: Query, filters?: Filter[]): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_lookup_indices.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_lookup_indices.d.ts new file mode 100644 index 0000000000000..823be0aee7a60 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_lookup_indices.d.ts @@ -0,0 +1,7 @@ +/** + * Extracts and returns a list of unique lookup indices from the provided ESQL query by parsing the query and traversing its AST. + * + * @param {string} esqlQuery - The ESQL query string to parse and analyze for lookup indices. + * @return {string[]} An array of unique lookup index names found in the query. + */ +export declare function getLookupIndicesFromQuery(esqlQuery: string): string[]; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_query_summary.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_query_summary.d.ts new file mode 100644 index 0000000000000..6177c9425a1b0 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_query_summary.d.ts @@ -0,0 +1,26 @@ +import type { ESQLAstCommand } from '@elastic/esql/types'; +import { type ESQLCommandSummary } from '@kbn/esql-language'; +/** + * Analyzes the provided ES|QL query and returns a summary of new columns, + * renamed columns, and metadata columns introduced by the commands in the query. + * @param query The ES|QL query string to analyze. + * @returns An object containing sets of new columns, renamed column pairs, metadata columns, aggregates, and grouping. + */ +export declare function getQuerySummary(query: string): ESQLCommandSummary; +/** + * Returns an array of summaries, one for each command of the specified type. + * If there are multiple commands of the same type, each will have its own summary in the array. + */ +export declare function getQuerySummaryPerCommandType(query: string, commandType: string): ESQLCommandSummary[]; +/** + * Analyzes a specific command within an ES|QL query and returns a summary of it. + */ +export declare function getSummaryPerCommand(query: string, command: ESQLAstCommand): ESQLCommandSummary; +/** + * Checks if a given field name is a computed column (generated by the ES|QL query), + * excluding original index fields. + * @param fieldName The name of the field to check. + * @param summary The ES|QL query summary. + * @returns True if the field is computed by the query (not from index), false otherwise. + */ +export declare function isComputedColumn(fieldName: string, summary: ESQLCommandSummary): boolean; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/inject_where_after_source.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/inject_where_after_source.d.ts new file mode 100644 index 0000000000000..836b10a975c3f --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/inject_where_after_source.d.ts @@ -0,0 +1,15 @@ +/** + * Injects a WHERE clause immediately after the source command (FROM/TS/etc.) of an ES|QL query. + * + * Filters reference source-level fields, so a WHERE has to run before any transformational + * command (STATS, KEEP, DROP, RENAME) that may rename or remove those fields. Appending the + * WHERE to the end of the pipeline would break valid filters; injecting it right after the + * source keeps them at the earliest safe position. + * + * Returns the original query unchanged when the expression is empty or no source command + * can be found in the query. + * + * @param esql - The base ES|QL query + * @param whereExpression - The WHERE expression body (without the leading `WHERE`) + */ +export declare function injectWhereClauseAfterSourceCommand(esql: string, whereExpression: string): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_cannot_be_sampled.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_cannot_be_sampled.d.ts new file mode 100644 index 0000000000000..7e802115ae979 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_cannot_be_sampled.d.ts @@ -0,0 +1,18 @@ +import type { AggregateQuery, Query } from '@kbn/es-query'; +/** + * Check if the query contains any of the function names being passed in + * @param query + * @param functions list of function names to check for + * @returns + */ +export declare const queryContainsFunction: (query: AggregateQuery | Query | { + [key: string]: any; +} | undefined | null, functions: string[]) => boolean; +/** + * Check if the query contains any function that cannot be used after LIMIT clause + * @param query + * @returns + */ +export declare const queryCannotBeSampled: (query: AggregateQuery | Query | { + [key: string]: any; +} | undefined | null) => boolean; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.d.ts new file mode 100644 index 0000000000000..168bc2ac5d4f1 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.d.ts @@ -0,0 +1,104 @@ +import type { ESQLFunction, ESQLColumn, ESQLAstQueryExpression } from '@elastic/esql/types'; +import { type ESQLControlVariable } from '@kbn/esql-types'; +import type { DatatableColumn } from '@kbn/expressions-plugin/common'; +import type { monaco } from '@kbn/monaco'; +export declare function getRemoteClustersFromESQLQuery(esql?: string): string[] | undefined; +/** + * Determines if an ES|QL query contains transformational commands. + * + * For ES|QL, we consider the following as transformational commands: + * - `stats`: Performs aggregations and transformations + * - `keep`: Filters and selects specific fields + * - `fork` commands where ALL branches contain only transformational commands + * + * @param esql - The ES|QL query string to analyze + * @returns true if the query contains transformational commands or fork commands with all transformational branches + * + * @example + * hasTransformationalCommand('from index | stats count() by field') // true + * hasTransformationalCommand('from index | keep field1, field2') // true + * hasTransformationalCommand('from index | fork (stats count()) (keep field)') // true + * hasTransformationalCommand('from index | fork (where x > 0) (eval y = x * 2)') // false + * hasTransformationalCommand('from index | where field > 0') // false + */ +export declare function hasTransformationalCommand(esql?: string): boolean; +export declare function getLimitFromESQLQuery(esql: string): number; +export declare function removeDropCommandsFromESQLQuery(esql?: string): string; +/** + * Converts timeseries (TS) commands to FROM commands in an ES|QL query + * @param esql - The ES|QL query string + * @returns The modified query with TS commands converted to FROM commands + */ +export declare function convertTimeseriesCommandToFrom(esql?: string): string; +/** + * When the ?_tstart and ?_tend params are used, we want to retrieve the timefield from the query. + * @param esql:string + * @returns string + */ +export declare const getTimeFieldFromESQLQuery: (esql: string) => string | undefined; +export declare const getKqlSearchQueries: (esql: string) => string[]; +/** + * Prettifies an ES|QL query with configurable line wrapping. + * @param src - The raw ES|QL query string + * @param lineWidth - Optional line width in characters; when provided, output is wrapped to fit. Otherwise uses the library default (80). + */ +export declare const prettifyQuery: (src: string, lineWidth?: number) => string; +export declare const retrieveMetadataColumns: (esql: string) => string[]; +export declare const getQueryColumnsFromESQLQuery: (esql: string) => string[]; +export declare const getESQLQueryVariables: (esql: string) => string[]; +/** + * This function is used to map the variables to the columns in the datatable + * @param esql:string + * @param variables:ESQLControlVariable[] + * @param columns:DatatableColumn[] + * @returns DatatableColumn[] + */ +export declare const mapVariableToColumn: (esql: string, variables: ESQLControlVariable[], columns: DatatableColumn[]) => DatatableColumn[]; +export declare const getQueryUpToCursor: (queryString: string, cursorPosition?: monaco.Position) => string; +/** + * Finds the column closest to the given cursor position within an array of columns. + * + * @param columns An array of ES|QL columns. + * @param cursorPosition The current cursor position. + * @returns The column object closest to the cursor, or null if the columns array is empty. + */ +export declare function findClosestColumn(columns: ESQLColumn[], cursorPosition?: monaco.Position): ESQLColumn | undefined; +export declare const getValuesFromQueryField: (queryString: string, cursorPosition?: monaco.Position) => string | undefined; +export declare const fixESQLQueryWithVariables: (queryString: string, esqlVariables?: ESQLControlVariable[]) => string; +export declare const getCategorizeColumns: (esql: string) => string[]; +export declare const getSparklineColumns: (esql: string) => string[]; +/** + * Extracts the original and renamed columns from a rename function. + * RENAME original AS renamed Vs RENAME renamed = original + * @param renameFunction + */ +export declare const getArgsFromRenameFunction: (renameFunction: ESQLFunction) => { + original: ESQLColumn; + renamed: ESQLColumn; +}; +/** + * Extracts the fields used in the CATEGORIZE function from an ESQL query. + * @param esql: string - The ESQL query string + */ +export declare const getCategorizeField: (esql: string) => string[]; +export declare const hasLimitBeforeAggregate: (esql: string) => boolean; +export declare const missingSortBeforeLimit: (esql: string) => boolean; +/** + * Checks if the ESQL query contains only source commands (e.g., FROM, TS). + * If the query contains PROMQL command, we will exclude it from this check. + * @param esql: string - The ESQL query string + * @returns true if the query contains only source commands, false otherwise + */ +export declare const hasOnlySourceCommand: (query: string) => boolean; +/** + * Determines if an ES|QL query contains the METRICS_INFO or TS_INFO commands. + * + * @param esql - The ES|QL query string to analyze + * @returns true if the query contains the METRICS_INFO or TS_INFO commands, false otherwise + */ +export declare const hasTimeseriesInfoCommand: (esql?: string) => boolean; +/** + * Given an array of column names, it returns a new array with corrected column names + * if any of the columns is renamed in the query. + */ +export declare const replaceColumnNamesIfRenamed: (root: ESQLAstQueryExpression, columnNames: string[]) => string[]; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/replace_index_pattern.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/replace_index_pattern.d.ts new file mode 100644 index 0000000000000..c400f21d472db --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/replace_index_pattern.d.ts @@ -0,0 +1 @@ +export declare function replaceESQLQueryIndexPattern(esql: string, replacements: Record): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.d.ts new file mode 100644 index 0000000000000..778e1d50b44d9 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.d.ts @@ -0,0 +1,48 @@ +import type { DatatableColumn } from '@kbn/expressions-plugin/common'; +import type { KibanaExecutionContext } from '@kbn/core/public'; +import type { ISearchGeneric } from '@kbn/search-types'; +import type { TimeRange } from '@kbn/es-query'; +import type { ESQLColumn, ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types'; +import { type ESQLControlVariable } from '@kbn/esql-types'; +export declare const hasStartEndParams: (query: string) => boolean; +export declare const getStartEndParams: (query: string, time?: TimeRange) => ({ + _tstart: string; + _tend?: undefined; +} | { + _tend: string; + _tstart?: undefined; +})[]; +export declare const getNamedParams: (query: string, timeRange?: TimeRange, variables?: ESQLControlVariable[]) => Record | undefined>[]; +export declare function formatESQLColumns(columns: ESQLColumn[]): DatatableColumn[]; +export declare function getESQLQueryColumnsRaw({ esqlQuery, search, signal, filter, dropNullColumns, timeRange, variables, }: { + esqlQuery: string; + search: ISearchGeneric; + signal?: AbortSignal; + dropNullColumns?: boolean; + filter?: unknown; + timeRange?: TimeRange; + variables?: ESQLControlVariable[]; +}): Promise; +export declare function getESQLQueryColumns({ esqlQuery, search, signal, filter, dropNullColumns, timeRange, variables, }: { + esqlQuery: string; + search: ISearchGeneric; + signal?: AbortSignal; + filter?: unknown; + dropNullColumns?: boolean; + timeRange?: TimeRange; + variables?: ESQLControlVariable[]; +}): Promise; +export declare function getESQLResults({ esqlQuery, search, signal, filter, dropNullColumns, timeRange, variables, timezone, executionContext, }: { + esqlQuery: string; + search: ISearchGeneric; + signal?: AbortSignal; + filter?: unknown; + dropNullColumns?: boolean; + timeRange?: TimeRange; + variables?: ESQLControlVariable[]; + timezone?: string; + executionContext?: KibanaExecutionContext; +}): Promise<{ + response: ESQLSearchResponse; + params: ESQLSearchParams; +}>; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/sanitaze_input.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/sanitaze_input.d.ts new file mode 100644 index 0000000000000..3514b9e138e3d --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/sanitaze_input.d.ts @@ -0,0 +1 @@ +export declare function sanitazeESQLInput(input: string): string | undefined; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/set_instructions_helpers.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/set_instructions_helpers.d.ts new file mode 100644 index 0000000000000..5a2b8f72086c2 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/set_instructions_helpers.d.ts @@ -0,0 +1,14 @@ +/** + * Extracts the project routing value from an ES|QL query string. + * + * @param queryString - The ES|QL query string to parse + * @returns The project routing value if found, undefined otherwise + * + * @example + * getProjectRoutingFromEsqlQuery('SET project_routing = "_alias:*"; FROM my_index') + * // Returns: '_alias:*' + * + * getProjectRoutingFromEsqlQuery('FROM my_index') + * // Returns: undefined + */ +export declare function getProjectRoutingFromEsqlQuery(queryString: string): string | undefined; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/sha256.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/sha256.d.ts new file mode 100644 index 0000000000000..d52b21c712424 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/sha256.d.ts @@ -0,0 +1 @@ +export declare const sha256: (str: string) => Promise; diff --git a/src/platform/packages/shared/kbn-interpreter/index.d.ts b/src/platform/packages/shared/kbn-interpreter/index.d.ts new file mode 100644 index 0000000000000..587a861935990 --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/index.d.ts @@ -0,0 +1 @@ +export * from './src/common'; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/index.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/index.d.ts new file mode 100644 index 0000000000000..f02cc7037c38e --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/index.d.ts @@ -0,0 +1,9 @@ +export type { Ast, AstArgument, AstFunction, AstNode, AstWithMeta, AstArgumentWithMeta, AstFunctionWithMeta, } from './lib/ast'; +export { fromExpression, isAst, isAstWithMeta, toExpression, safeElementFromExpression, } from './lib/ast'; +export { Fn } from './lib/fn'; +export { getType } from './lib/get_type'; +export { castProvider } from './lib/cast'; +export { parse } from './lib/parse'; +export { getByAlias } from './lib/get_by_alias'; +export { Registry } from './lib/registry'; +export { addRegistries, register, registryFactory } from './registries'; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/arg.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/arg.d.ts new file mode 100644 index 0000000000000..738afcf3adc1f --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/arg.d.ts @@ -0,0 +1,14 @@ +export function Arg(config: any): void; +export class Arg { + constructor(config: any); + name: any; + required: any; + help: any; + types: any; + default: any; + aliases: any; + multi: any; + resolve: any; + options: any; + accepts: (type: any) => boolean; +} diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/ast.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/ast.d.ts new file mode 100644 index 0000000000000..eae7e05c7c84c --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/ast.d.ts @@ -0,0 +1,31 @@ +export type AstNode = Ast | AstFunction | AstArgument; +export type Ast = { + type: 'expression'; + chain: AstFunction[]; +}; +export type AstFunction = { + type: 'function'; + function: string; + arguments: Record; +}; +export type AstArgument = string | boolean | number | Ast; +interface WithMeta { + start: number; + end: number; + text: string; + node: T; +} +type Replace = Pick> & R; +type WrapAstArgumentWithMeta = T extends Ast ? AstWithMeta : WithMeta; +export type AstArgumentWithMeta = WrapAstArgumentWithMeta; +export type AstFunctionWithMeta = WithMeta>; +export type AstWithMeta = WithMeta>; +export declare function isAstWithMeta(value: any): value is AstWithMeta; +export declare function isAst(value: any): value is Ast; +export {}; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/compare.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/compare.d.ts new file mode 100644 index 0000000000000..11faba06d4def --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/compare.d.ts @@ -0,0 +1,9 @@ +import type { Ast, AstArgument, AstArgumentWithMeta } from './ast'; +export interface ValueChange { + type: 'value'; + source: AstArgumentWithMeta; + target: AstArgument; +} +export type Change = ValueChange; +export declare function isValueChange(value: any): value is ValueChange; +export declare function compare(expression: string, ast: Ast): Change[]; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/from_expression.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/from_expression.d.ts new file mode 100644 index 0000000000000..09f2fb91635fd --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/from_expression.d.ts @@ -0,0 +1,2 @@ +import type { Ast } from './ast'; +export declare function fromExpression(expression: string, type?: string): Ast; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/index.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/index.d.ts new file mode 100644 index 0000000000000..3c55fe2285f22 --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/index.d.ts @@ -0,0 +1,4 @@ +export * from './ast'; +export * from './from_expression'; +export * from './safe_element_from_expression'; +export * from './to_expression'; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/patch.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/patch.d.ts new file mode 100644 index 0000000000000..4379a05aaeee8 --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/patch.d.ts @@ -0,0 +1,2 @@ +import type { Ast } from './ast'; +export declare function patch(expression: string, ast: Ast): string; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/safe_element_from_expression.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/safe_element_from_expression.d.ts new file mode 100644 index 0000000000000..37cb76c1f7aa4 --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/safe_element_from_expression.d.ts @@ -0,0 +1 @@ +export declare function safeElementFromExpression(expression: string): import("./ast").Ast; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/to_expression.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/to_expression.d.ts new file mode 100644 index 0000000000000..4f442a77752b1 --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/to_expression.d.ts @@ -0,0 +1,14 @@ +import type { AstNode } from './ast'; +interface Options { + /** + * Node type. + */ + type?: 'argument' | 'expression' | 'function'; + /** + * Original expression to apply the new AST to. + * At the moment, only arguments values changes are supported. + */ + source?: string; +} +export declare function toExpression(ast: AstNode, options?: string | Options): string; +export {}; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/cast.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/cast.d.ts new file mode 100644 index 0000000000000..2430d0c19f1fd --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/cast.d.ts @@ -0,0 +1 @@ +export function castProvider(types: any): (node: any, toTypeNames: any) => any; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/fn.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/fn.d.ts new file mode 100644 index 0000000000000..a4836a63543bc --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/fn.d.ts @@ -0,0 +1,15 @@ +export function Fn(config: any): void; +export class Fn { + constructor(config: any); + name: any; + type: any; + aliases: any; + fn: (...args: any[]) => Promise; + help: any; + args: { + [x: string]: Arg; + }; + context: any; + accepts: (type: any) => boolean; +} +import { Arg } from './arg'; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_by_alias.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_by_alias.d.ts new file mode 100644 index 0000000000000..70d555315ad49 --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_by_alias.d.ts @@ -0,0 +1,6 @@ +/** + * This is used for looking up function/argument definitions. It looks through + * the given object/array for a case-insensitive match, which could be either the + * `name` itself, or something under the `aliases` property. + */ +export function getByAlias(specs: any, name: any): any; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_type.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_type.d.ts new file mode 100644 index 0000000000000..2a5e3f7b4d736 --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_type.d.ts @@ -0,0 +1 @@ +export declare function getType(node: any): string; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/parse.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/parse.d.ts new file mode 100644 index 0000000000000..2537be0cb446c --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/parse.d.ts @@ -0,0 +1,14 @@ +import type { Ast, AstWithMeta } from './ast'; +import { parse } from './grammar.peggy'; +interface Options { + startRule?: string; +} +interface OptionsWithMeta extends Options { + addMeta: true; +} +export interface Parse { + (input: string, options?: Options): Ast; + (input: string, options: OptionsWithMeta): AstWithMeta; +} +declare const typedParse: typeof parse; +export { typedParse as parse }; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/registry.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/registry.d.ts new file mode 100644 index 0000000000000..a969e4c4b702c --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/lib/registry.d.ts @@ -0,0 +1,14 @@ +export declare class Registry { + private readonly _prop; + private _indexed; + constructor(prop?: string); + wrapper(obj: ItemSpec): Item; + register(fn: () => ItemSpec): void; + toJS(): { + [key: string]: any; + }; + toArray(): Item[]; + get(name: string): Item; + getProp(): string; + reset(): void; +} diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/registries.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/registries.d.ts new file mode 100644 index 0000000000000..7de6b1581bb46 --- /dev/null +++ b/src/platform/packages/shared/kbn-interpreter/src/common/registries.d.ts @@ -0,0 +1,25 @@ +/** + * Add a new set of registries to an existing set of registries. + * + * @param {*} registries - The existing set of registries + * @param {*} newRegistries - The new set of registries + */ +export function addRegistries(registries: any, newRegistries: any): any; +/** + * Register a set of interpreter specs (functions, types, renderers, etc) + * + * @param {*} registries - The set of registries + * @param {*} specs - The specs to be regsitered (e.g. { types: [], browserFunctions: [] }) + */ +export function register(registries: any, specs: any): any; +/** + * A convenience function for exposing registries and register in a plugin-friendly way + * as a global in the browser, and as server.plugins.interpreter.register | registries + * on the server. + * + * @param {*} registries - The registries to wrap. + */ +export function registryFactory(registries: any): { + registries(): any; + register(specs: any): any; +}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/index.d.ts new file mode 100644 index 0000000000000..df8a766ffe400 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/index.d.ts @@ -0,0 +1,22 @@ +export type { IndexPattern } from './src/index_pattern_rt'; +export type { NonEmptyString, NonEmptyStringBrand } from './src/non_empty_string_rt'; +export { arrayToStringRt } from './src/array_to_string_rt'; +export { deepExactRt } from './src/deep_exact_rt'; +export { indexPatternRt } from './src/index_pattern_rt'; +export { jsonRt } from './src/json_rt'; +export { mergeRt } from './src/merge_rt'; +export { strictKeysRt } from './src/strict_keys_rt'; +export { isoToEpochRt } from './src/iso_to_epoch_rt'; +export { isoToEpochSecsRt } from './src/iso_to_epoch_secs_rt'; +export { toNumberRt } from './src/to_number_rt'; +export { toBooleanRt } from './src/to_boolean_rt'; +export { toJsonSchema } from './src/to_json_schema'; +export { nonEmptyStringRt } from './src/non_empty_string_rt'; +export { createLiteralValueFromUndefinedRT } from './src/literal_value_from_undefined_rt'; +export { createRouteValidationFunction } from './src/route_validation'; +export { inRangeRt, type InRangeBrand, type InRange, inRangeFromStringRt } from './src/in_range_rt'; +export { dateRt } from './src/date_rt'; +export { isGreaterOrEqualRt, type IsGreaterOrEqualBrand, type IsGreaterOrEqual, } from './src/is_greater_or_equal'; +export { datemathStringRt } from './src/datemath_string_rt'; +export { createPlainError, decodeOrThrow, formatErrors, throwErrors } from './src/decode_or_throw'; +export { DateFromStringOrNumber, minimalTimeKeyRT, type MinimalTimeKey, type TimeKey, type UniqueTimeKey, } from './src/time_key_rt'; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/array_to_string_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/array_to_string_rt/index.d.ts new file mode 100644 index 0000000000000..6526c77708130 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/array_to_string_rt/index.d.ts @@ -0,0 +1,2 @@ +import * as rt from 'io-ts'; +export declare const arrayToStringRt: rt.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/date_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/date_rt/index.d.ts new file mode 100644 index 0000000000000..d6479f9d2e643 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/date_rt/index.d.ts @@ -0,0 +1,6 @@ +import * as rt from 'io-ts'; +export interface DateBrand { + readonly Date: unique symbol; +} +export type Date = rt.Branded; +export declare const dateRt: rt.BrandC; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/datemath_string_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/datemath_string_rt/index.d.ts new file mode 100644 index 0000000000000..c1ec9a3c840b5 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/datemath_string_rt/index.d.ts @@ -0,0 +1,2 @@ +import * as rt from 'io-ts'; +export declare const datemathStringRt: rt.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/decode_or_throw.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/decode_or_throw.d.ts new file mode 100644 index 0000000000000..62e6d5996647b --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/decode_or_throw.d.ts @@ -0,0 +1,7 @@ +import type { Errors, Type, ValidationError } from 'io-ts'; +type ErrorFactory = (message: string) => Error; +export declare const formatErrors: (errors: ValidationError[]) => string; +export declare const createPlainError: (message: string) => Error; +export declare const throwErrors: (createError: ErrorFactory) => (errors: Errors) => never; +export declare const decodeOrThrow: (runtimeType: Type, createError?: ErrorFactory) => (inputValue: InputValue) => DecodedValue; +export {}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/deep_exact_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/deep_exact_rt/index.d.ts new file mode 100644 index 0000000000000..5fcda7be32f66 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/deep_exact_rt/index.d.ts @@ -0,0 +1,3 @@ +import * as t from 'io-ts'; +import type { ParseableType } from '../parseable_types'; +export declare function deepExactRt | ParseableType>(type: T): T; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/in_range_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/in_range_rt/index.d.ts new file mode 100644 index 0000000000000..9c382d6fc70a4 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/in_range_rt/index.d.ts @@ -0,0 +1,7 @@ +import * as rt from 'io-ts'; +export interface InRangeBrand { + readonly InRange: unique symbol; +} +export type InRange = rt.Branded; +export declare const inRangeRt: (start: number, end: number) => rt.Type; +export declare const inRangeFromStringRt: (start: number, end: number) => rt.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/index_pattern_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/index_pattern_rt/index.d.ts new file mode 100644 index 0000000000000..2438d5e586f7a --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/index_pattern_rt/index.d.ts @@ -0,0 +1,10 @@ +import * as rt from 'io-ts'; +export declare const isEmptyString: (value: string) => value is ""; +export declare const containsSpaces: (value: string) => boolean; +export declare const containsEmptyEntries: (value: string) => boolean; +export declare const validateIndexPattern: (indexPattern: string) => boolean; +export interface IndexPatternBrand { + readonly IndexPattern: unique symbol; +} +export type IndexPattern = rt.Branded; +export declare const indexPatternRt: rt.BrandC; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/is_greater_or_equal/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/is_greater_or_equal/index.d.ts new file mode 100644 index 0000000000000..4ba3cb4bbecce --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/is_greater_or_equal/index.d.ts @@ -0,0 +1,6 @@ +import * as rt from 'io-ts'; +export interface IsGreaterOrEqualBrand { + readonly IsGreaterOrEqual: unique symbol; +} +export type IsGreaterOrEqual = rt.Branded; +export declare const isGreaterOrEqualRt: (value: number) => rt.BrandC; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_rt/index.d.ts new file mode 100644 index 0000000000000..9202ecd3a60f1 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_rt/index.d.ts @@ -0,0 +1,2 @@ +import * as t from 'io-ts'; +export declare const isoToEpochRt: t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_secs_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_secs_rt/index.d.ts new file mode 100644 index 0000000000000..f1d33091647a6 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_secs_rt/index.d.ts @@ -0,0 +1,2 @@ +import * as t from 'io-ts'; +export declare const isoToEpochSecsRt: t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/json_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/json_rt/index.d.ts new file mode 100644 index 0000000000000..b50d01c655205 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/json_rt/index.d.ts @@ -0,0 +1,2 @@ +import * as t from 'io-ts'; +export declare const jsonRt: t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/literal_value_from_undefined_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/literal_value_from_undefined_rt/index.d.ts new file mode 100644 index 0000000000000..aaf783143393e --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/literal_value_from_undefined_rt/index.d.ts @@ -0,0 +1,2 @@ +import * as rt from 'io-ts'; +export declare const createLiteralValueFromUndefinedRT: (literalValue: LiteralValue) => rt.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/merge_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/merge_rt/index.d.ts new file mode 100644 index 0000000000000..3016d129c4af3 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/merge_rt/index.d.ts @@ -0,0 +1,13 @@ +import * as t from 'io-ts'; +type PlainObject = Record; +type DeepMerge = U extends PlainObject ? T extends PlainObject ? Omit & { + [key in keyof U]: T extends { + [k in key]: any; + } ? DeepMerge : U[key]; +} : U : U; +export type MergeType = t.Type, t.TypeOf>, DeepMerge, t.OutputOf>> & { + _tag: 'MergeType'; + types: [T1, T2]; +}; +export declare function mergeRt(a: T1, b: T2): MergeType; +export {}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/non_empty_string_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/non_empty_string_rt/index.d.ts new file mode 100644 index 0000000000000..c750474986976 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/non_empty_string_rt/index.d.ts @@ -0,0 +1,6 @@ +import * as t from 'io-ts'; +export interface NonEmptyStringBrand { + readonly NonEmptyString: unique symbol; +} +export type NonEmptyString = t.Branded; +export declare const nonEmptyStringRt: t.BrandC; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/parseable_types/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/parseable_types/index.d.ts new file mode 100644 index 0000000000000..f068a45672c1c --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/parseable_types/index.d.ts @@ -0,0 +1,4 @@ +import type * as t from 'io-ts'; +import type { MergeType } from '../merge_rt'; +export type ParseableType = t.StringType | t.NumberType | t.BooleanType | t.ArrayType | t.RecordC | t.DictionaryType | t.InterfaceType | t.PartialType | t.UnionType | t.IntersectionType | MergeType; +export declare const isParsableType: (type: t.Type | ParseableType) => type is ParseableType; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/route_validation/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/route_validation/index.d.ts new file mode 100644 index 0000000000000..2d8b4b1304223 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/route_validation/index.d.ts @@ -0,0 +1,4 @@ +import type { RouteValidationFunction } from '@kbn/core/server'; +import type { Type, ValidationError } from 'io-ts'; +export declare const createRouteValidationFunction: (runtimeType: Type) => RouteValidationFunction; +export declare const formatErrors: (errors: ValidationError[]) => string; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/strict_keys_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/strict_keys_rt/index.d.ts new file mode 100644 index 0000000000000..e294778637d95 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/strict_keys_rt/index.d.ts @@ -0,0 +1,2 @@ +import * as t from 'io-ts'; +export declare function strictKeysRt(type: T): t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/time_key_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/time_key_rt/index.d.ts new file mode 100644 index 0000000000000..6be73182698fa --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/time_key_rt/index.d.ts @@ -0,0 +1,19 @@ +import * as rt from 'io-ts'; +export declare const DateFromStringOrNumber: rt.Type; +export declare const minimalTimeKeyRT: rt.TypeC<{ + time: rt.Type; + tiebreaker: rt.NumberC; +}>; +export type MinimalTimeKey = rt.TypeOf; +declare const timeKeyRT: rt.IntersectionC<[rt.TypeC<{ + time: rt.Type; + tiebreaker: rt.NumberC; +}>, rt.PartialC<{ + gid: rt.StringC; + fromAutoReload: rt.BooleanC; +}>]>; +export type TimeKey = rt.TypeOf; +export interface UniqueTimeKey extends TimeKey { + gid: string; +} +export {}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/to_boolean_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/to_boolean_rt/index.d.ts new file mode 100644 index 0000000000000..0a1ba67dff50d --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/to_boolean_rt/index.d.ts @@ -0,0 +1,3 @@ +import * as t from 'io-ts'; +export declare function isPrimitive(value: unknown): value is string | number | boolean | null | undefined; +export declare const toBooleanRt: t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/to_json_schema/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/to_json_schema/index.d.ts new file mode 100644 index 0000000000000..ee29e0a4c65af --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/to_json_schema/index.d.ts @@ -0,0 +1,27 @@ +import type * as t from 'io-ts'; +import type { ParseableType } from '../parseable_types'; +interface JSONSchemaObject { + type: 'object'; + required?: string[]; + properties?: Record; + additionalProperties?: boolean | JSONSchema; +} +interface JSONSchemaOneOf { + oneOf: JSONSchema[]; +} +interface JSONSchemaAllOf { + allOf: JSONSchema[]; +} +interface JSONSchemaAnyOf { + anyOf: JSONSchema[]; +} +interface JSONSchemaArray { + type: 'array'; + items?: JSONSchema; +} +interface BaseJSONSchema { + type: string; +} +type JSONSchema = JSONSchemaObject | JSONSchemaArray | BaseJSONSchema | JSONSchemaOneOf | JSONSchemaAllOf | JSONSchemaAnyOf; +export declare const toJsonSchema: (type: t.Type | ParseableType) => JSONSchema; +export {}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/to_number_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/to_number_rt/index.d.ts new file mode 100644 index 0000000000000..47911d9742aa6 --- /dev/null +++ b/src/platform/packages/shared/kbn-io-ts-utils/src/to_number_rt/index.d.ts @@ -0,0 +1,2 @@ +import * as t from 'io-ts'; +export declare const toNumberRt: t.Type; diff --git a/src/platform/packages/shared/kbn-management/autoops_promotion_callout/index.d.ts b/src/platform/packages/shared/kbn-management/autoops_promotion_callout/index.d.ts new file mode 100644 index 0000000000000..fed53fe0593c5 --- /dev/null +++ b/src/platform/packages/shared/kbn-management/autoops_promotion_callout/index.d.ts @@ -0,0 +1,2 @@ +export type { AutoOpsPromotionCalloutProps } from './src/callout'; +export { AutoOpsPromotionCallout } from './src/callout'; diff --git a/src/platform/packages/shared/kbn-management/autoops_promotion_callout/src/callout.d.ts b/src/platform/packages/shared/kbn-management/autoops_promotion_callout/src/callout.d.ts new file mode 100644 index 0000000000000..03cfbe19a12ee --- /dev/null +++ b/src/platform/packages/shared/kbn-management/autoops_promotion_callout/src/callout.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; +import type { EuiCallOutProps } from '@elastic/eui'; +export interface AutoOpsPromotionCalloutProps { + cloudConnectUrl?: string; + onConnectClick?: (e: React.MouseEvent) => void; + hasCloudConnectPermission?: boolean; + overrideCalloutProps?: Partial>; +} +export declare const AUTOOPS_CALLOUT_DISMISSED_KEY = "kibana.autoOpsPromotionCallout.dismissed"; +export declare const AutoOpsPromotionCallout: ({ cloudConnectUrl, onConnectClick, hasCloudConnectPermission, overrideCalloutProps, }: AutoOpsPromotionCalloutProps) => React.JSX.Element | null; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/index.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/index.d.ts new file mode 100644 index 0000000000000..baf306d147678 --- /dev/null +++ b/src/platform/packages/shared/kbn-management/cards_navigation/index.d.ts @@ -0,0 +1,3 @@ +export type { AppId, CardsNavigationComponentProps } from './src'; +export { appCategories, type CardNavExtensionDefinition } from './src/types'; +export { appIds, CardsNavigation } from './src'; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/src/cards_navigation.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/src/cards_navigation.d.ts new file mode 100644 index 0000000000000..fde2b040f180d --- /dev/null +++ b/src/platform/packages/shared/kbn-management/cards_navigation/src/cards_navigation.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +import type { CardsNavigationComponentProps, AppId, AppDefinition } from './types'; +type AggregatedCardNavDefinitions = NonNullable | Record; +export declare const getAppIdsByCategory: (category: string, appDefinitions: AggregatedCardNavDefinitions) => ("settings" | "spaces" | "dataViews" | "transform" | "objects" | "tags" | "ingest_pipelines" | "pipelines" | "index_management" | "jobsListLink" | "filesManagement" | "reporting" | "triggersActionsConnectors" | "triggersActions" | "maintenanceWindows" | "roles" | "api_keys" | "data_quality" | "data_usage" | "content_connectors")[]; +export declare const CardsNavigation: ({ sections, appBasePath, onCardClick, hideLinksTo, extendedCardNavigationDefinitions, }: CardsNavigationComponentProps) => React.JSX.Element; +export {}; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/src/consts.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/src/consts.d.ts new file mode 100644 index 0000000000000..5efefa5d157e6 --- /dev/null +++ b/src/platform/packages/shared/kbn-management/cards_navigation/src/consts.d.ts @@ -0,0 +1,3 @@ +import type { AppId, AppDefinition } from './types'; +export { AppIds, appCategories } from './types'; +export declare const appDefinitions: Record; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/src/index.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/src/index.d.ts new file mode 100644 index 0000000000000..bcbe914752a84 --- /dev/null +++ b/src/platform/packages/shared/kbn-management/cards_navigation/src/index.d.ts @@ -0,0 +1,3 @@ +export type { CardsNavigationComponentProps, AppId } from './types'; +export { AppIds as appIds } from './consts'; +export { CardsNavigation } from './cards_navigation'; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/src/types.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/src/types.d.ts new file mode 100644 index 0000000000000..9f941d8d8310f --- /dev/null +++ b/src/platform/packages/shared/kbn-management/cards_navigation/src/types.d.ts @@ -0,0 +1,82 @@ +import type { EuiIconProps } from '@elastic/eui'; +/** + * app ids shared by all solutions + */ +export declare enum AppIds { + INGEST_PIPELINES = "ingest_pipelines", + PIPELINES = "pipelines", + INDEX_MANAGEMENT = "index_management", + TRANSFORM = "transform", + ML = "jobsListLink", + SAVED_OBJECTS = "objects", + TAGS = "tags", + FILES_MANAGEMENT = "filesManagement", + DATA_VIEWS = "dataViews", + REPORTING = "reporting", + CONNECTORS = "triggersActionsConnectors", + RULES = "triggersActions", + MAINTENANCE_WINDOWS = "maintenanceWindows", + SERVERLESS_SETTINGS = "settings", + ROLES = "roles", + API_KEYS = "api_keys", + DATA_QUALITY = "data_quality", + SPACES = "spaces", + DATA_USAGE = "data_usage", + CONTENT_CONNECTORS = "content_connectors" +} +export type AppId = `${AppIds}`; +export declare const appCategories: { + readonly DATA: "data"; + readonly ACCESS: "access"; + readonly ALERTS: "alerts"; + readonly CONTENT: "content"; + readonly OTHER: "other"; +}; +export interface Application { + id: string; + title: string; + basePath: string; + enabled: boolean; +} +export interface AppRegistrySections { + id?: string; + title?: string; + apps: Application[]; +} +export interface CardsNavigationComponentProps { + sections: AppRegistrySections[]; + appBasePath: string; + onCardClick?: (e: React.MouseEvent) => void; + hideLinksTo?: AppId[]; + extendedCardNavigationDefinitions?: Record; +} +export interface ManagementAppProps { + id: string; + title: string; + href: string; +} +export interface AppDefinition { + category: (typeof appCategories)[keyof typeof appCategories]; + description: string; + icon: EuiIconProps['type']; +} +export type CardNavExtensionDefinition = AppDefinition & ({ + /** + * Optional prop that indicates if the card nav definition being declared, + * skips validation to ascertain it's key is a valid id for a management app. + */ + skipValidation?: false; +} | { + skipValidation: true; + /** + * Specify the url that the card nav being defined should route to, + * and is only expected when the value of {@link skipValidation} prop is passed true. + */ + href: string; + /** + * Defines the title of the card nav being defined, + * and is only expected when the {@link skipValidation} prop value is true. + */ + title: string; +}); +export type AppProps = ManagementAppProps & (AppDefinition | CardNavExtensionDefinition); diff --git a/src/platform/packages/shared/kbn-management/settings/setting_ids/index.d.ts b/src/platform/packages/shared/kbn-management/settings/setting_ids/index.d.ts new file mode 100644 index 0000000000000..5ba84806ec428 --- /dev/null +++ b/src/platform/packages/shared/kbn-management/settings/setting_ids/index.d.ts @@ -0,0 +1,159 @@ +export declare const DISABLE_REQUEST_BATCHING_ID = "bfetch:disable"; +export declare const ELASTIC_CONSOLE_ENABLED_SETTING_ID = "elasticRamen:enabled"; +export declare const DISABLE_BATCH_COMPRESSION_ID = "bfetch:disableCompression"; +export declare const CSV_QUOTE_VALUES_ID = "csv:quoteValues"; +export declare const CSV_SEPARATOR_ID = "csv:separator"; +export declare const DATE_FORMAT_ID = "dateFormat"; +export declare const DATE_FORMAT_DOW_ID = "dateFormat:dow"; +export declare const DATE_FORMAT_SCALED_ID = "dateFormat:scaled"; +export declare const DATE_FORMAT_TZ_ID = "dateFormat:tz"; +export declare const DATE_FORMAT_NANOS_ID = "dateNanosFormat"; +export declare const DEFAULT_INDEX_ID = "defaultIndex"; +export declare const DEFAULT_ROUTE_ID = "defaultRoute"; +export declare const FIELDS_POPULAR_LIMIT_ID = "fields:popularLimit"; +export declare const FILE_UPLOAD_MAX_SIZE_ID = "fileUpload:maxFileSize"; +export declare const FILTER_EDITOR_SUGGEST_VALUES_ID = "filterEditor:suggestValues"; +export declare const FILTERS_PINNED_BY_DEFAULT_ID = "filters:pinnedByDefault"; +export declare const FORMAT_BYTES_DEFAULT_PATTERN_ID = "format:bytes:defaultPattern"; +export declare const FORMAT_CURRENCY_DEFAULT_PATTERN_ID = "format:currency:defaultPattern"; +export declare const FORMAT_DEFAULT_TYPE_MAP_ID = "format:defaultTypeMap"; +export declare const FORMAT_NUMBER_DEFAULT_LOCALE_ID = "format:number:defaultLocale"; +export declare const FORMAT_NUMBER_DEFAULT_PATTERN_ID = "format:number:defaultPattern"; +export declare const FORMAT_PERCENT_DEFAULT_PATTERN_ID = "format:percent:defaultPattern"; +export declare const HIDE_ANNOUNCEMENTS_ID = "hideAnnouncements"; +export declare const HISTOGRAM_BAR_TARGET_ID = "histogram:barTarget"; +export declare const HISTOGRAM_MAX_BARS_ID = "histogram:maxBars"; +export declare const HISTORY_LIMIT_ID = "history:limit"; +export declare const META_FIELDS_ID = "metaFields"; +export declare const METRICS_ALLOW_STRING_INDICES_ID = "metrics:allowStringIndices"; +export declare const METRICS_MAX_BUCKETS_ID = "metrics:max_buckets"; +export declare const QUERY_ALLOW_LEADING_WILDCARDS_ID = "query:allowLeadingWildcards"; +export declare const QUERY_STRING_OPTIONS_ID = "query:queryString:options"; +export declare const SAVED_OBJECTS_LISTING_LIMIT_ID = "savedObjects:listingLimit"; +export declare const SAVED_OBJECTS_PER_PAGE_ID = "savedObjects:perPage"; +export declare const SEARCH_QUERY_LANGUAGE_ID = "search:queryLanguage"; +export declare const SHORT_DOTS_ENABLE_ID = "shortDots:enable"; +export declare const SORT_OPTIONS_ID = "sort:options"; +export declare const STATE_STORE_IN_SESSION_STORAGE_ID = "state:storeInSessionStorage"; +export declare const THEME_DARK_MODE_ID = "theme:darkMode"; +export declare const THEME_NAME_ID = "theme:name"; +export declare const TIMEPICKER_QUICK_RANGES_ID = "timepicker:quickRanges"; +export declare const TIMEPICKER_REFRESH_INTERVAL_DEFAULTS_ID = "timepicker:refreshIntervalDefaults"; +export declare const TIMEPICKER_TIME_DEFAULTS_ID = "timepicker:timeDefaults"; +export declare const LABS_CANVAS_BY_VALUE_EMBEDDABLE_ID = "labs:canvas:byValueEmbeddable"; +export declare const LABS_CANVAS_ENABLE_UI_ID = "labs:canvas:enable_ui"; +export declare const LABS_DASHBOARD_DEFER_BELOW_FOLD_ID = "labs:dashboard:deferBelowFold"; +export declare const LABS_DASHBOARDS_ENABLE_UI_ID = "labs:dashboard:enable_ui"; +export declare const ACCESSIBILITY_DISABLE_ANIMATIONS_ID = "accessibility:disableAnimations"; +export declare const AGENT_BUILDER_NAV_ENABLED_SETTING_ID = "agentBuilder:navEnabled"; +export declare const AGENT_BUILDER_EXPERIMENTAL_FEATURES_SETTING_ID = "agentBuilder:experimentalFeatures"; +export declare const AGENT_BUILDER_PRE_PROMPT_WORKFLOW_IDS = "agentBuilder:prePromptWorkflowIds"; +export declare const AGENT_BUILDER_UIAM_OAUTH_CLIENT_MANAGEMENT_SETTING_ID = "agentBuilder:uiamOAuthClientManagement"; +export declare const AUTOCOMPLETE_USE_TIME_RANGE_ID = "autocomplete:useTimeRange"; +export declare const AUTOCOMPLETE_VALUE_SUGGESTION_METHOD_ID = "autocomplete:valueSuggestionMethod"; +export declare const BANNERS_PLACEMENT_ID = "banners:placement"; +export declare const BANNERS_TEXT_CONTENT_ID = "banners:textContent"; +export declare const BANNERS_TEXT_COLOR_ID = "banners:textColor"; +export declare const BANNERS_LINK_COLOR_ID = "banners:linkColor"; +export declare const BANNERS_BACKGROUND_COLOR_ID = "banners:backgroundColor"; +export declare const CONTEXT_DEFAULT_SIZE_ID = "context:defaultSize"; +export declare const CONTEXT_STEP_ID = "context:step"; +export declare const CONTEXT_TIE_BREAKER_FIELDS_ID = "context:tieBreakerFields"; +export declare const DEFAULT_COLUMNS_ID = "defaultColumns"; +export declare const ENABLE_ESQL_ID = "enableESQL"; +export declare const DISCOVER_MAX_DOC_FIELDS_DISPLAYED_ID = "discover:maxDocFieldsDisplayed"; +export declare const DISCOVER_MODIFY_COLUMNS_ON_SWITCH_ID = "discover:modifyColumnsOnSwitch"; +export declare const DISCOVER_ROW_HEIGHT_OPTION_ID = "discover:rowHeightOption"; +export declare const DISCOVER_SAMPLE_ROWS_PER_PAGE_ID = "discover:sampleRowsPerPage"; +export declare const DISCOVER_SAMPLE_SIZE_ID = "discover:sampleSize"; +export declare const DISCOVER_SEARCH_ON_PAGE_LOAD_ID = "discover:searchOnPageLoad"; +export declare const DISCOVER_SHOW_FIELD_STATISTICS_ID = "discover:showFieldStatistics"; +export declare const DISCOVER_SHOW_MULTI_FIELDS_ID = "discover:showMultiFields"; +export declare const DISCOVER_SORT_DEFAULT_ORDER_ID = "discover:sort:defaultOrder"; +export declare const DOC_TABLE_HIDE_TIME_COLUMNS_ID = "doc_table:hideTimeColumn"; +export declare const DOC_TABLE_HIGHLIGHT_ID = "doc_table:highlight"; +export declare const ML_ANOMALY_DETECTION_RESULTS_ENABLE_TIME_DEFAULTS_ID = "ml:anomalyDetection:results:enableTimeDefaults"; +export declare const ML_ANOMALY_DETECTION_RESULTS_TIME_DEFAULTS_ID = "ml:anomalyDetection:results:timeDefaults"; +export declare const NOTIFICATIONS_BANNER_ID = "notifications:banner"; +export declare const NOTIFICATIONS_LIFETIME_BANNER_ID = "notifications:lifetime:banner"; +export declare const NOTIFICATIONS_LIFETIME_ERROR_ID = "notifications:lifetime:error"; +export declare const NOTIFICATIONS_LIFETIME_INFO_ID = "notifications:lifetime:info"; +export declare const NOTIFICATIONS_LIFETIME_WARNING_ID = "notifications:lifetime:warning"; +export declare const OBSERVABILITY_APM_AWS_LAMBDA_PRICE_FACTOR_ID = "observability:apmAWSLambdaPriceFactor"; +export declare const OBSERVABILITY_APM_AWS_LAMBDA_REQUEST_COST_PER_MILLION_ID = "observability:apmAWSLambdaRequestCostPerMillion"; +export declare const OBSERVABILITY_APM_DEFAULT_SERVICE_ENVIRONMENT_ID = "observability:apmDefaultServiceEnvironment"; +export declare const OBSERVABILITY_APM_PROGRESSIVE_LOADING_ID = "observability:apmProgressiveLoading"; +export declare const OBSERVABILITY_APM_SERVICE_GROUP_MAX_NUMBER_OF_SERVICE_ID = "observability:apmServiceGroupMaxNumberOfServices"; +export declare const OBSERVABILITY_ENABLE_COMPARISON_BY_DEFAULT_ID = "observability:enableComparisonByDefault"; +export declare const OBSERVABILITY_ENABLE_INFRASTRUCTURE_ASSET_CUSTOM_DASHBOARDS_ID = "observability:enableInfrastructureAssetCustomDashboards"; +export declare const OBSERVABILITY_ENABLE_INSPECT_ES_QUERIES_ID = "observability:enableInspectEsQueries"; +export declare const OBSERVABILITY_MAX_SUGGESTIONS_ID = "observability:maxSuggestions"; +export declare const OBSERVABILITY_APM_ENABLE_TABLE_SEARCH_BAR = "observability:apmEnableTableSearchBar"; +export declare const OBSERVABILITY_APM_ENABLE_SERVICE_INVENTORY_TABLE_SEARCH_BAR = "observability:apmEnableServiceInventoryTableSearchBar"; +export declare const OBSERVABILITY_LOGS_SHARED_NEW_LOGS_OVERVIEW_ID = "observability:newLogsOverview"; +export declare const OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID = "observability:logSources"; +export declare const OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING = "observability:aiAssistantSimulatedFunctionCalling"; +export declare const OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN = "observability:aiAssistantSearchConnectorIndexPattern"; +export declare const GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR = "genAiSettings:defaultAIConnector"; +export declare const GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR_DEFAULT_ONLY = "genAiSettings:defaultAIConnectorOnly"; +export declare const GEN_AI_SETTINGS_TOKEN_USAGE_TRACKING = "genAiSettings:tokenUsageTracking"; +export declare const AI_ASSISTANT_PREFERRED_AI_ASSISTANT_TYPE = "aiAssistant:preferredAIAssistantType"; +export declare const AI_CHAT_EXPERIENCE_TYPE = "aiAssistant:preferredChatExperience"; +export declare const AI_ANONYMIZATION_SETTINGS = "ai:anonymizationSettings"; +export declare const OBSERVABILITY_SEARCH_EXCLUDED_DATA_TIERS = "observability:searchExcludedDataTiers"; +export declare const OBSERVABILITY_STREAMS_ENABLE_SIGNIFICANT_EVENTS = "observability:streamsEnableSignificantEvents"; +export declare const OBSERVABILITY_STREAMS_ENABLE_SIGNIFICANT_EVENTS_DISCOVERY = "observability:streamsEnableSignificantEventsDiscovery"; +export declare const OBSERVABILITY_STREAMS_ENABLE_GROUP_STREAMS = "observability:streamsEnableGroupStreams"; +export declare const OBSERVABILITY_STREAMS_ENABLE_QUERY_STREAMS = "observability:streamsEnableQueryStreams"; +export declare const OBSERVABILITY_STREAMS_ENABLE_CONTENT_PACKS = "observability:streamsEnableContentPacks"; +export declare const OBSERVABILITY_STREAMS_ENABLE_WIRED_STREAM_VIEWS = "observability:streamsEnableWiredStreamViews"; +export declare const OBSERVABILITY_STREAMS_ENABLE_DRAFT_STREAMS = "observability:streamsEnableDraftStreams"; +export declare const OBSERVABILITY_STREAMS_CONTINUOUS_KI_EXTRACTION_ENABLED = "observability:streamsContinuousKiExtractionEnabled"; +export declare const OBSERVABILITY_STREAMS_CONTINUOUS_KI_EXTRACTION_INTERVAL_HOURS = "observability:streamsContinuousKiExtractionIntervalHours"; +export declare const OBSERVABILITY_STREAMS_CONTINUOUS_KI_EXTRACTION_EXCLUDED_STREAM_PATTERNS = "observability:streamsContinuousKiExtractionExcludedStreamPatterns"; +export declare const OBSERVABILITY_STREAMS_SIG_EVENTS_INDEX_PATTERNS = "observability:streamsSigEventsIndexPatterns"; +export declare const OBSERVABILITY_STREAMS_SIG_EVENTS_TUNING_CONFIG = "observability:streamsSigEventsTuningConfig"; +export declare const OBSERVABILITY_STREAMS_ENABLE_MEMORY = "observability:streamsEnableMemory"; +export declare const OBSERVABILITY_STREAMS_ENABLE_SIGNIFICANT_EVENTS_ALERTING_V2 = "observability:streamsEnableSignificantEventsAlertingV2"; +export declare const OBSERVABILITY_ENABLE_DIAGNOSTIC_MODE = "observability:enableDiagnosticMode"; +export declare const XPACK_REPORTING_CUSTOM_PDF_LOGO_ID = "xpackReporting:customPdfLogo"; +export declare const ROLLUPS_ENABLE_INDEX_PATTERNS_ID = "rollups.enableIndexPatterns"; +export declare const COURIER_CUSTOM_REQUEST_PREFERENCE_ID = "courier:customRequestPreference"; +export declare const COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_ID = "courier:ignoreFilterIfFieldNotInIndex"; +export declare const COURIER_MAX_CONCURRENT_SHARD_REQUEST_ID = "courier:maxConcurrentShardRequests"; +export declare const COURIER_SET_REQUEST_PREFERENCE_ID = "courier:setRequestPreference"; +export declare const SEARCH_INCLUDE_FROZEN_ID = "search:includeFrozen"; +export declare const SEARCH_TIMEOUT_ID = "search:timeout"; +export declare const QUERY_ACTIVITY_MIN_RUNNING_TIME_ID = "query_activity:minRunningTime"; +export declare const SECURITY_SOLUTION_REFRESH_INTERVAL_DEFAULTS_ID = "securitySolution:refreshIntervalDefaults"; +export declare const SECURITY_SOLUTION_TIME_DEFAULTS_ID = "securitySolution:timeDefaults"; +export declare const SECURITY_SOLUTION_DEFAULT_INDEX_ID = "securitySolution:defaultIndex"; +export declare const SECURITY_SOLUTION_DEFAULT_THREAT_INDEX_ID = "securitySolution:defaultThreatIndex"; +export declare const SECURITY_SOLUTION_DEFAULT_ANOMALY_SCORE_ID = "securitySolution:defaultAnomalyScore"; +export declare const SECURITY_SOLUTION_ENABLE_GROUPED_NAV_ID = "securitySolution:enableGroupedNav"; +export declare const SECURITY_SOLUTION_RULES_TABLE_REFRESH_ID = "securitySolution:rulesTableRefresh"; +export declare const SECURITY_SOLUTION_ENABLE_NEWS_FEED_ID = "securitySolution:enableNewsFeed"; +export declare const SECURITY_SOLUTION_NEWS_FEED_URL_ID = "securitySolution:newsFeedUrl"; +export declare const SECURITY_SOLUTION_IP_REPUTATION_LINKS_ID = "securitySolution:ipReputationLinks"; +export declare const SECURITY_SOLUTION_SHOW_RELATED_INTEGRATIONS_ID = "securitySolution:showRelatedIntegrations"; +export declare const SECURITY_SOLUTION_SUPPRESSION_BEHAVIOR_ON_ALERT_CLOSURE_SETTING: "securitySolution:suppressionBehaviorOnAlertClosure"; +export declare const SECURITY_SOLUTION_DEFAULT_ALERT_TAGS_KEY: "securitySolution:alertTags"; +export declare const SECURITY_SOLUTION_EXCLUDED_GAP_REASONS_KEY: "securitySolution:excludedGapReasons"; +export declare const SECURITY_SOLUTION_INCLUDED_DATA_STREAM_NAMESPACES_FOR_RULE_EXECUTION: "securitySolution:includedDataStreamNamespacesForRuleExecution"; +/** This Kibana Advanced Setting allows users to enable/disable the Asset Criticality feature */ +export declare const SECURITY_SOLUTION_ENABLE_ASSET_CRITICALITY_SETTING: "securitySolution:enableAssetCriticality"; +export declare const SECURITY_SOLUTION_ENABLE_ASSET_INVENTORY_SETTING: "securitySolution:enableAssetInventory"; +export declare const SECURITY_SOLUTION_ENABLE_CLOUD_CONNECTOR_SETTING: "securitySolution:enableCloudConnector"; +export declare const SECURITY_SOLUTION_DEFAULT_VALUE_REPORT_MINUTES: "securitySolution:defaultValueReportMinutes"; +export declare const SECURITY_SOLUTION_DEFAULT_VALUE_REPORT_RATE: "securitySolution:defaultValueReportRate"; +export declare const SECURITY_SOLUTION_DEFAULT_VALUE_REPORT_TITLE: "securitySolution:defaultValueReportTitle"; +export declare const CASES_MAX_OPEN_CASES_PER_RULE_RUN_ID: "cases:maxOpenCasesPerRuleRun"; +export declare const TIMELION_ES_DEFAULT_INDEX_ID = "timelion:es.default_index"; +export declare const TIMELION_ES_TIME_FIELD_ID = "timelion:es.timefield"; +export declare const TIMELION_MAX_BUCKETS_ID = "timelion:max_buckets"; +export declare const TIMELION_MIN_INTERVAL_ID = "timelion:min_interval"; +export declare const TIMELION_TARGET_BUCKETS_ID = "timelion:target_buckets"; +export declare const VISUALIZATION_HEATMAP_MAX_BUCKETS_ID = "visualization:heatmap:maxBuckets"; +export declare const VISUALIZATION_LEGACY_GAUGE_CHARTS_LIBRARY_ID = "visualization:visualize:legacyGaugeChartsLibrary"; +export declare const VISUALIZATION_LEGACY_HEATMAP_CHARTS_LIBRARY_ID = "visualization:visualize:legacyHeatmapChartsLibrary"; +export declare const VISUALIZATION_ENABLE_LABS_ID = "visualize:enableLabs"; diff --git a/src/platform/packages/shared/kbn-object-versioning-utils/index.d.ts b/src/platform/packages/shared/kbn-object-versioning-utils/index.d.ts new file mode 100644 index 0000000000000..5ccfe387ce8e4 --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning-utils/index.d.ts @@ -0,0 +1 @@ +export { validateVersion } from './lib/validate_version'; diff --git a/src/platform/packages/shared/kbn-object-versioning-utils/lib/validate_version.d.ts b/src/platform/packages/shared/kbn-object-versioning-utils/lib/validate_version.d.ts new file mode 100644 index 0000000000000..1b25eb819a9de --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning-utils/lib/validate_version.d.ts @@ -0,0 +1,9 @@ +type Version = number; +export declare const validateVersion: (version: unknown) => { + result: true; + value: Version; +} | { + result: false; + value: null; +}; +export {}; diff --git a/src/platform/packages/shared/kbn-object-versioning/index.d.ts b/src/platform/packages/shared/kbn-object-versioning/index.d.ts new file mode 100644 index 0000000000000..49cfdf0e57a03 --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning/index.d.ts @@ -0,0 +1,2 @@ +export { initTransform, getContentManagementServicesTransforms, compileServiceDefinitions, } from './lib'; +export type { Version, VersionableObject, ObjectMigrationDefinition, ObjectTransform, ObjectTransforms, TransformReturn, ContentManagementServiceDefinitionVersioned, ContentManagementServiceTransforms, ContentManagementServicesDefinition, ContentManagementGetTransformsFn, } from './lib'; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_schemas.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_schemas.d.ts new file mode 100644 index 0000000000000..0925d32649b18 --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_schemas.d.ts @@ -0,0 +1,36 @@ +import type { Type } from '@kbn/config-schema'; +export declare const serviceDefinitionSchema: import("@kbn/config-schema").ObjectType<{ + get: Type | undefined>; + bulkGet: Type | undefined>; + create: Type | undefined>; + update: Type | undefined>; + delete: Type | undefined>; + search: Type | undefined>; + mSearch: Type | undefined; + } & {}> | undefined; + } & {}> | undefined>; +}>; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_versioning.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_versioning.d.ts new file mode 100644 index 0000000000000..1cda14664e592 --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_versioning.d.ts @@ -0,0 +1,47 @@ +import type { ObjectMigrationDefinition, Version } from './types'; +import type { ServiceDefinitionVersioned, ServiceTransforms } from './content_management_types'; +/** + * Convert a versionned service definition to a flattened service definition + * where _each object_ is versioned (at the leaf). + * + * @example + * + * ```ts + * From this + * { + * // Service definition version 1 + * 1: { + * get: { + * in: { + * options: { up: () => {} } + * } + * }, + * ... + * }, + * // Service definition version 2 + * 2: { + * get: { + * in: { + * options: { up: () => {} } + * } + * }, + * } + * } + * + * To this + * + * { + * 'get.in.options': { // Flattend path + * 1: { up: () => {} }, // 1 + * 2: { up: () => {} } // 2 + * } + * } + * ``` + */ +export declare const compile: (definitions: ServiceDefinitionVersioned) => { + [path: string]: ObjectMigrationDefinition; +}; +export declare const getTransforms: (definitions: ServiceDefinitionVersioned, requestVersion: Version, _compiled?: { + [path: string]: ObjectMigrationDefinition; +}) => ServiceTransforms; +export type GetTransformsFn = typeof getTransforms; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_types.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_types.d.ts new file mode 100644 index 0000000000000..d160195160524 --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_types.d.ts @@ -0,0 +1,118 @@ +import type { ObjectTransforms, Version, VersionableObject } from './types'; +export interface ServicesDefinition { + get?: { + in?: { + options?: VersionableObject; + }; + out?: { + result?: VersionableObject; + }; + }; + bulkGet?: { + in?: { + options?: VersionableObject; + }; + out?: { + result?: VersionableObject; + }; + }; + create?: { + in?: { + data?: VersionableObject; + options?: VersionableObject; + }; + out?: { + result?: VersionableObject; + }; + }; + update?: { + in?: { + data?: VersionableObject; + options?: VersionableObject; + }; + out?: { + result?: VersionableObject; + }; + }; + delete?: { + in?: { + options?: VersionableObject; + }; + out?: { + result?: VersionableObject; + }; + }; + search?: { + in?: { + options?: VersionableObject; + }; + out?: { + result?: VersionableObject; + }; + }; + mSearch?: { + out?: { + result?: VersionableObject; + }; + }; +} +export interface ServiceTransforms { + get: { + in: { + options: ObjectTransforms; + }; + out: { + result: ObjectTransforms; + }; + }; + bulkGet: { + in: { + options: ObjectTransforms; + }; + out: { + result: ObjectTransforms; + }; + }; + create: { + in: { + data: ObjectTransforms; + options: ObjectTransforms; + }; + out: { + result: ObjectTransforms; + }; + }; + update: { + in: { + data: ObjectTransforms; + options: ObjectTransforms; + }; + out: { + result: ObjectTransforms; + }; + }; + delete: { + in: { + options: ObjectTransforms; + }; + out: { + result: ObjectTransforms; + }; + }; + search: { + in: { + options: ObjectTransforms; + }; + out: { + result: ObjectTransforms; + }; + }; + mSearch: { + out: { + result: ObjectTransforms; + }; + }; +} +export interface ServiceDefinitionVersioned { + [version: Version]: ServicesDefinition; +} diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/index.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/index.d.ts new file mode 100644 index 0000000000000..76d6510a4026f --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning/lib/index.d.ts @@ -0,0 +1,5 @@ +export { initTransform } from './object_transform'; +export { getTransforms as getContentManagementServicesTransforms, compile as compileServiceDefinitions, } from './content_management_services_versioning'; +export type { GetTransformsFn as ContentManagementGetTransformsFn } from './content_management_services_versioning'; +export type { Version, VersionableObject, ObjectMigrationDefinition, ObjectTransform, ObjectTransforms, TransformReturn, } from './types'; +export type { ServiceTransforms as ContentManagementServiceTransforms, ServicesDefinition as ContentManagementServicesDefinition, ServiceDefinitionVersioned as ContentManagementServiceDefinitionVersioned, } from './content_management_types'; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/object_transform.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/object_transform.d.ts new file mode 100644 index 0000000000000..2d3f2bcd7a648 --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning/lib/object_transform.d.ts @@ -0,0 +1,42 @@ +import type { ObjectMigrationDefinition, Version } from './types'; +/** + * Initiate a transform for a specific request version. After we initiate the transforms + * for a specific version we can then pass different `ObjectMigrationDefinition` to the provided + * handler to start up/down transforming different object based on this request version. + * + * @example + * + * ```ts + * const transforms = initTransform(2); // start from version "2" + * const fooTransforms = transforms(fooMigrationDefinition); + * const barTransforms = transforms(barMigrationDefinition); + * + * // Up transform the objects to the latest, starting from version "2" + * const { value: fooOnLatest } = foo.up(); + * const { value: barOnLatest } = bar.up(); + * ``` + * + * @param requestVersion The starting version before up/down transforming + * @returns A handler to pass an object migration definition + */ +export declare const initTransform: (requestVersion: Version) => (migrationDefinition: ObjectMigrationDefinition) => { + up: (obj: I, to?: number | "latest", { validate }?: { + validate?: boolean; + }) => { + error: Error; + value: null; + } | { + value: O; + error: null; + }; + down: (obj: I, from?: number | "latest", { validate }?: { + validate?: boolean; + }) => { + error: Error; + value: null; + } | { + value: any; + error: null; + }; + validate: (value: unknown, version?: number) => Error | null; +}; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/types.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/types.d.ts new file mode 100644 index 0000000000000..8e6326c97c9e2 --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning/lib/types.d.ts @@ -0,0 +1,34 @@ +import type { z } from '@kbn/zod'; +import type { Type } from '@kbn/config-schema'; +export type Version = number; +export type ObjectTransform = (input: I) => O; +export interface VersionableObject { + /** + * Schema used to validate a versioned object before up/down transforms. + * Supports `@kbn/config-schema` or `@kbn/zod` schemas. + */ + schema?: Type | z.ZodTypeAny; + down?: ObjectTransform; + up?: ObjectTransform; +} +export interface ObjectMigrationDefinition { + [version: Version]: VersionableObject; +} +export type TransformReturn = { + value: T; + error: null; +} | { + value: null; + error: Error; +}; +export interface ObjectTransforms { + up: (obj: I, version?: Version | 'latest', options?: { + /** Validate the object _before_ up transform */ + validate?: boolean; + }) => TransformReturn; + down: (obj: I, version?: Version | 'latest', options?: { + /** Validate the object _before_ down transform */ + validate?: boolean; + }) => TransformReturn; + validate: (obj: any, version?: Version) => Error | null; +} diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/utils.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/utils.d.ts new file mode 100644 index 0000000000000..0596226a56a04 --- /dev/null +++ b/src/platform/packages/shared/kbn-object-versioning/lib/utils.d.ts @@ -0,0 +1,11 @@ +import { type ZodType } from '@kbn/zod'; +import type { Type } from '@kbn/config-schema'; +/** + * Validate an object based on a schema. + * + * @param obj The object to validate + * @param objSchema The schema to validate the object against + * @returns null, or Error + */ +export declare const validateObj: (obj: unknown, objSchema?: Type | ZodType) => Error | null; +export { validateVersion } from '@kbn/object-versioning-utils'; diff --git a/src/platform/packages/shared/kbn-react-query/index.d.ts b/src/platform/packages/shared/kbn-react-query/index.d.ts new file mode 100644 index 0000000000000..84999e91cb2b2 --- /dev/null +++ b/src/platform/packages/shared/kbn-react-query/index.d.ts @@ -0,0 +1,10 @@ +import type { QueryClientConfig } from '@tanstack/react-query'; +import { QueryClient as TanstackQueryClient } from '@tanstack/query-core'; +declare class QueryClient extends TanstackQueryClient { + constructor(config?: QueryClientConfig); +} +export { TanstackQueryClient, QueryClient, }; +export type { CancelOptions, ContextOptions, DefaultedInfiniteQueryObserverOptions, DefaultedQueryObserverOptions, DefaultOptions, DefinedQueryObserverResult, DefinedUseBaseQueryResult, DefinedUseQueryResult, DehydratedState, DehydrateOptions, FetchInfiniteQueryOptions, FetchNextPageOptions, FetchPreviousPageOptions, FetchQueryOptions, FetchStatus, GetNextPageParamFunction, GetPreviousPageParamFunction, HydrateOptions, HydrateProps, InfiniteData, InfiniteQueryObserverBaseResult, InfiniteQueryObserverLoadingErrorResult, InfiniteQueryObserverLoadingResult, InfiniteQueryObserverOptions, InfiniteQueryObserverRefetchErrorResult, InfiniteQueryObserverResult, InfiniteQueryObserverSuccessResult, InitialDataFunction, InvalidateOptions, InvalidateQueryFilters, Logger, MutateFunction, MutateOptions, Mutation, // class, but exported as type-only +MutationFilters, MutationFunction, MutationKey, MutationMeta, MutationObserverBaseResult, MutationObserverErrorResult, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverOptions, MutationObserverResult, MutationObserverSuccessResult, MutationOptions, MutationStatus, NetworkMode, NotifyEvent, NotifyEventType, PlaceholderDataFunction, QueriesOptions, QueriesResults, Query, // class, but exported as type-only +QueryClientConfig, QueryClientProviderProps, QueryErrorResetBoundaryProps, QueryFilters, QueryFunction, QueryFunctionContext, QueryKey, QueryKeyHashFunction, QueryMeta, QueryObserverBaseResult, QueryObserverLoadingErrorResult, QueryObserverLoadingResult, QueryObserverOptions, QueryObserverRefetchErrorResult, QueryObserverResult, QueryObserverSuccessResult, QueryOptions, QueryState, QueryStatus, RefetchOptions, RefetchPageFilters, RefetchQueryFilters, ResetOptions, ResetQueryFilters, ResultOptions, SetDataOptions, ShouldDehydrateMutationFunction, ShouldDehydrateQueryFunction, Updater, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseErrorBoundary, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, WithRequired, } from '@tanstack/react-query'; +export { CancelledError, defaultContext, defaultShouldDehydrateMutation, defaultShouldDehydrateQuery, dehydrate, focusManager, hashQueryKey, hydrate, Hydrate, isCancelledError, isError, isServer, InfiniteQueryObserver, IsRestoringProvider, matchQuery, MutationCache, MutationObserver, notifyManager, onlineManager, parseFilterArgs, parseMutationArgs, parseMutationFilterArgs, parseQueryArgs, QueriesObserver, QueryCache, QueryClientProvider, QueryErrorResetBoundary, QueryObserver, replaceEqualDeep, useHydrate, useInfiniteQuery, useIsFetching, useIsMutating, useIsRestoring, useMutation, useQueries, useQuery, useQueryClient, useQueryErrorResetBoundary, } from '@tanstack/react-query'; diff --git a/src/platform/packages/shared/kbn-resizable-layout/index.d.ts b/src/platform/packages/shared/kbn-resizable-layout/index.d.ts new file mode 100644 index 0000000000000..49d4a325f3e52 --- /dev/null +++ b/src/platform/packages/shared/kbn-resizable-layout/index.d.ts @@ -0,0 +1,3 @@ +export { ResizableLayoutMode, ResizableLayoutDirection, ResizableLayoutOrder } from './types'; +export type { ResizableLayoutProps } from './src/resizable_layout'; +export { ResizableLayout } from './src/resizable_layout'; diff --git a/src/platform/packages/shared/kbn-resizable-layout/src/panels_resizable.d.ts b/src/platform/packages/shared/kbn-resizable-layout/src/panels_resizable.d.ts new file mode 100644 index 0000000000000..57de436ff347b --- /dev/null +++ b/src/platform/packages/shared/kbn-resizable-layout/src/panels_resizable.d.ts @@ -0,0 +1,16 @@ +import type { ReactNode } from 'react'; +import React from 'react'; +import { ResizableLayoutOrder, type ResizableLayoutDirection } from '../types'; +export declare const PanelsResizable: ({ className, direction, fixedPanelSize, minFixedPanelSize, minFlexPanelSize, fixedPanel, flexPanel, fixedPanelOrder, resizeButtonClassName, ["data-test-subj"]: dataTestSubj, onFixedPanelSizeChange, }: { + className?: string; + direction: ResizableLayoutDirection; + fixedPanelSize: number | "max-content"; + minFixedPanelSize: number; + minFlexPanelSize: number; + fixedPanel: ReactNode; + flexPanel: ReactNode; + fixedPanelOrder?: ResizableLayoutOrder; + resizeButtonClassName?: string; + ["data-test-subj"]?: string; + onFixedPanelSizeChange?: (fixedPanelSize: number) => void; +}) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-resizable-layout/src/panels_static.d.ts b/src/platform/packages/shared/kbn-resizable-layout/src/panels_static.d.ts new file mode 100644 index 0000000000000..bb9229a31f6fb --- /dev/null +++ b/src/platform/packages/shared/kbn-resizable-layout/src/panels_static.d.ts @@ -0,0 +1,10 @@ +import type { ReactNode } from 'react'; +import React from 'react'; +import { ResizableLayoutDirection } from '../types'; +export declare const PanelsStatic: ({ className, direction, hideFixedPanel, fixedPanel, flexPanel, }: { + className?: string; + direction: ResizableLayoutDirection; + hideFixedPanel?: boolean; + fixedPanel: ReactNode; + flexPanel: ReactNode; +}) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-resizable-layout/src/resizable_layout.d.ts b/src/platform/packages/shared/kbn-resizable-layout/src/resizable_layout.d.ts new file mode 100644 index 0000000000000..f1acf0b4f627e --- /dev/null +++ b/src/platform/packages/shared/kbn-resizable-layout/src/resizable_layout.d.ts @@ -0,0 +1,55 @@ +import type { ReactNode } from 'react'; +import React from 'react'; +import type { ResizableLayoutDirection, ResizableLayoutOrder } from '../types'; +import { ResizableLayoutMode } from '../types'; +export interface ResizableLayoutProps { + /** + * Class name for the layout container + */ + className?: string; + /** + * The current layout mode + */ + mode: ResizableLayoutMode; + /** + * The current layout direction + */ + direction: ResizableLayoutDirection; + /** + * Current size of the fixed panel in pixels + */ + fixedPanelSize: number | 'max-content'; + /** + * Minimum size of the fixed panel in pixels + */ + minFixedPanelSize: number; + /** + * Minimum size of the flex panel in pixels + */ + minFlexPanelSize: number; + /** + * The fixed panel + */ + fixedPanel: ReactNode; + /** + * The flex panel + */ + flexPanel: ReactNode; + /** + * The side to render the fixed panel. + */ + fixedPanelOrder?: ResizableLayoutOrder; + /** + * Class name for the resize button + */ + resizeButtonClassName?: string; + /** + * Test subject for the layout container + */ + ['data-test-subj']?: string; + /** + * Callback when the fixed panel size changes, receives the new size in pixels + */ + onFixedPanelSizeChange?: (fixedPanelSize: number) => void; +} +export declare const ResizableLayout: ({ className, mode, direction, fixedPanelSize, minFixedPanelSize, minFlexPanelSize, fixedPanel, flexPanel, fixedPanelOrder, resizeButtonClassName, ["data-test-subj"]: dataTestSubj, onFixedPanelSizeChange, }: ResizableLayoutProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-resizable-layout/src/utils.d.ts b/src/platform/packages/shared/kbn-resizable-layout/src/utils.d.ts new file mode 100644 index 0000000000000..081814580292c --- /dev/null +++ b/src/platform/packages/shared/kbn-resizable-layout/src/utils.d.ts @@ -0,0 +1,4 @@ +import { ResizableLayoutDirection } from '../types'; +export declare const percentToPixels: (containerSize: number, percentage: number) => number; +export declare const pixelsToPercent: (containerSize: number, pixels: number) => number; +export declare const getContainerSize: (direction: ResizableLayoutDirection, width: number, height: number) => number; diff --git a/src/platform/packages/shared/kbn-resizable-layout/types.d.ts b/src/platform/packages/shared/kbn-resizable-layout/types.d.ts new file mode 100644 index 0000000000000..0b47f5703c9d2 --- /dev/null +++ b/src/platform/packages/shared/kbn-resizable-layout/types.d.ts @@ -0,0 +1,34 @@ +export declare enum ResizableLayoutMode { + /** + * Single panel mode -- hides the fixed panel + */ + Single = "single", + /** + * Static mode -- prevents resizing + */ + Static = "static", + /** + * Resizable mode -- allows resizing + */ + Resizable = "resizable" +} +export declare enum ResizableLayoutDirection { + /** + * Horizontal layout -- panels are side by side + */ + Horizontal = "horizontal", + /** + * Vertical layout -- panels are stacked + */ + Vertical = "vertical" +} +export declare enum ResizableLayoutOrder { + /** + * Start order (left or top) + */ + Start = "start", + /** + * End order (right or bottom) + */ + End = "end" +} diff --git a/src/platform/packages/shared/kbn-rison/index.d.ts b/src/platform/packages/shared/kbn-rison/index.d.ts new file mode 100644 index 0000000000000..54e55aa764f3f --- /dev/null +++ b/src/platform/packages/shared/kbn-rison/index.d.ts @@ -0,0 +1,10 @@ +export * from './kbn_rison'; +import { encode, encodeUnknown, decode, encodeArray, decodeArray } from './kbn_rison'; +declare const _default: { + encode: typeof encode; + encodeUnknown: typeof encodeUnknown; + decode: typeof decode; + encodeArray: typeof encodeArray; + decodeArray: typeof decodeArray; +}; +export default _default; diff --git a/src/platform/packages/shared/kbn-rison/kbn_rison.d.ts b/src/platform/packages/shared/kbn-rison/kbn_rison.d.ts new file mode 100644 index 0000000000000..8636c275c1141 --- /dev/null +++ b/src/platform/packages/shared/kbn-rison/kbn_rison.d.ts @@ -0,0 +1,61 @@ +/** + * Any value that can be represented in RISON — a superset of JSON primitives + * that also supports nested objects and arrays. + */ +export type RisonValue = boolean | string | number | RisonValue[] | { + [key: string]: RisonValue; +} | null; +/** + * RISON-encode a JavaScript value, returning `undefined` when the value cannot + * be represented in RISON (e.g. functions, symbols, or circular references). + * Use {@link encode} when the input is expected to always be encodable. + * + * @param obj - The value to encode. Typed as `any` because this function is + * intentionally used to probe whether an arbitrary runtime value is + * RISON-encodable before committing to encoding it. + * @returns The RISON-encoded string, or `undefined` if the value is not encodable. + */ +export declare function encodeUnknown(obj: any): string | undefined; +/** + * RISON-encode a JavaScript value, throwing if the value cannot be encoded. + * For values of unknown encodability, prefer {@link encodeUnknown}. + * + * @param obj - The JavaScript value to encode. Typed as `any` because RISON + * encoding is used to serialize arbitrary application state (e.g. URL + * parameters) whose shape is not known at compile time. + * @returns The RISON-encoded string. + */ +export declare function encode(obj: any): string; +/** + * Parse a RISON string into a JavaScript structure. + * + * @param rison - The RISON-encoded string to decode. + * @returns The decoded JavaScript value as a {@link RisonValue}. + */ +export declare function decode(rison: string): RisonValue; +/** + * Parse a RISON string into a JavaScript structure, returning `null` instead + * of throwing when the input is invalid. + * + * @param rison - The RISON-encoded string to decode. + * @returns The decoded {@link RisonValue}, or `null` if the string is not valid RISON. + */ +export declare function safeDecode(rison: string): RisonValue; +/** + * RISON-encode a JavaScript array using A-RISON format (without surrounding + * parentheses), suitable for use in URL array parameters. + * + * @param array - The array to encode. Typed as `any[]` because the array + * elements may be arbitrary application state values. + * @returns The A-RISON-encoded string. + */ +export declare function encodeArray(array: any[]): any; +/** + * Parse an A-RISON string (a RISON array without surrounding parentheses) + * into a JavaScript array. This prepends array markup before passing to the + * standard RISON decoder. + * + * @param rison - The A-RISON-encoded string to decode. + * @returns The decoded array of {@link RisonValue} elements. + */ +export declare function decodeArray(rison: string): RisonValue[]; diff --git a/src/platform/packages/shared/kbn-rrule/index.d.ts b/src/platform/packages/shared/kbn-rrule/index.d.ts new file mode 100644 index 0000000000000..5890af22264de --- /dev/null +++ b/src/platform/packages/shared/kbn-rrule/index.d.ts @@ -0,0 +1,3 @@ +export { RRule } from './rrule'; +export type { Options, WeekdayStr } from './types'; +export { Frequency, Weekday } from './types'; diff --git a/src/platform/packages/shared/kbn-rrule/rrule.d.ts b/src/platform/packages/shared/kbn-rrule/rrule.d.ts new file mode 100644 index 0000000000000..a683c25f47684 --- /dev/null +++ b/src/platform/packages/shared/kbn-rrule/rrule.d.ts @@ -0,0 +1,21 @@ +import moment from 'moment-timezone'; +import type { ConstructorOptions } from './types'; +import { Frequency, type IterOptions } from './types'; +type AllResult = Date[] & { + hasMore?: boolean; +}; +export declare class RRule { + private options; + constructor(options: ConstructorOptions); + private dateset; + between(start: Date, end: Date): Date[]; + before(dt: Date): Date; + after(dt: Date): Date | null; + all(limit?: number): AllResult; + static isValid(options: ConstructorOptions): boolean; +} +export declare const getNextRecurrences: ({ refDT, wkst, byyearday, bymonth, bymonthday, byweekday, byhour, byminute, bysecond, bysetpos, freq, interval, }: IterOptions & { + freq?: Frequency; + interval?: number; +}) => moment.Moment[]; +export {}; diff --git a/src/platform/packages/shared/kbn-rrule/sanitize.d.ts b/src/platform/packages/shared/kbn-rrule/sanitize.d.ts new file mode 100644 index 0000000000000..c561444ff0f40 --- /dev/null +++ b/src/platform/packages/shared/kbn-rrule/sanitize.d.ts @@ -0,0 +1,18 @@ +import type { Options } from './types'; +export declare function sanitizeOptions(opts: Options): { + wkst?: (import("./types").Weekday | number | null) | undefined; + byyearday?: number[] | null | undefined; + bymonth?: number[] | null | undefined; + bysetpos?: number[] | null | undefined; + bymonthday?: number[] | null | undefined; + byweekday?: import("./types").Weekday[] | null | undefined; + byhour?: number[] | null | undefined; + byminute?: number[] | null | undefined; + bysecond?: number[] | null | undefined; + dtstart: Date; + freq?: import("./types").Frequency; + interval?: number; + until?: Date | null; + count?: number; + tzid: string; +}; diff --git a/src/platform/packages/shared/kbn-rrule/types.d.ts b/src/platform/packages/shared/kbn-rrule/types.d.ts new file mode 100644 index 0000000000000..311115f367ade --- /dev/null +++ b/src/platform/packages/shared/kbn-rrule/types.d.ts @@ -0,0 +1,44 @@ +import type { Moment } from 'moment'; +export declare enum Frequency { + YEARLY = 0, + MONTHLY = 1, + WEEKLY = 2, + DAILY = 3, + HOURLY = 4, + MINUTELY = 5, + SECONDLY = 6 +} +export declare enum Weekday { + MO = 1, + TU = 2, + WE = 3, + TH = 4, + FR = 5, + SA = 6, + SU = 7 +} +export type WeekdayStr = 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU'; +export interface IterOptions { + refDT: Moment; + wkst?: Weekday | number | null; + byyearday?: number[] | null; + bymonth?: number[] | null; + bysetpos?: number[] | null; + bymonthday?: number[] | null; + byweekday?: Weekday[] | null; + byhour?: number[] | null; + byminute?: number[] | null; + bysecond?: number[] | null; +} +export type Options = Omit & { + dtstart: Date; + freq?: Frequency; + interval?: number; + until?: Date | null; + count?: number; + tzid: string; +}; +export type ConstructorOptions = Omit & { + byweekday?: Array | null; + wkst?: Weekday | WeekdayStr | number | null; +}; diff --git a/src/platform/packages/shared/kbn-rrule/validate.d.ts b/src/platform/packages/shared/kbn-rrule/validate.d.ts new file mode 100644 index 0000000000000..740db0f1bdc90 --- /dev/null +++ b/src/platform/packages/shared/kbn-rrule/validate.d.ts @@ -0,0 +1,2 @@ +import type { ConstructorOptions } from './types'; +export declare function validateOptions(opts: ConstructorOptions): void; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/index.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/index.d.ts new file mode 100644 index 0000000000000..123b4bf113172 --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/index.d.ts @@ -0,0 +1,11 @@ +export * from './src/default_alerts_as_data'; +export * from './src/legacy_alerts_as_data'; +export * from './src/technical_field_names'; +export * from './src/alerts_as_data_rbac'; +export * from './src/alerts_as_data_severity'; +export * from './src/alerts_as_data_status'; +export * from './src/alerts_as_data_cases'; +export * from './src/rule_locator_params'; +export * from './src/routes/stack_rule_paths'; +export * from './src/rule_types'; +export * from './src/rule_constants'; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.d.ts new file mode 100644 index 0000000000000..c88467cb64c2e --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.d.ts @@ -0,0 +1 @@ +export declare const MAX_CASES_PER_ALERT = 10; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.d.ts new file mode 100644 index 0000000000000..78fb9d59cb1f3 --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.d.ts @@ -0,0 +1,55 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { EsQueryConfig } from '@kbn/es-query'; +export declare const ATTACK_DISCOVERY_SCHEDULES_ALERT_TYPE_ID: "attack-discovery"; +/** + * registering a new instance of the rule data client + * in a new plugin will require updating the below data structure + * to include the index name where the alerts as data will be written to. + */ +export declare const AlertConsumers: { + readonly APM: "apm"; + readonly LOGS: "logs"; + readonly INFRASTRUCTURE: "infrastructure"; + readonly OBSERVABILITY: "observability"; + readonly STREAMS: "streams"; + readonly SLO: "slo"; + readonly SIEM: "siem"; + readonly UPTIME: "uptime"; + readonly ML: "ml"; + readonly STACK_ALERTS: "stackAlerts"; + readonly EXAMPLE: "AlertingExample"; + readonly MONITORING: "monitoring"; + readonly ALERTS: "alerts"; + readonly DISCOVER: "discover"; +}; +export type AlertConsumers = (typeof AlertConsumers)[keyof typeof AlertConsumers]; +export declare const DEPRECATED_ALERTING_CONSUMERS: "observability"[]; +export type STATUS_VALUES = 'open' | 'acknowledged' | 'closed' | 'in-progress'; +export type ValidFeatureId = AlertConsumers; +export declare const validFeatureIds: string[]; +export declare const isValidFeatureId: (a: unknown) => a is ValidFeatureId; +/** + * Prevent javascript from returning Number.MAX_SAFE_INTEGER when Elasticsearch expects + * Java's Long.MAX_VALUE. This happens when sorting fields by date which are + * unmapped in the provided index + * + * Ref: https://github.com/elastic/elasticsearch/issues/28806#issuecomment-369303620 + * + * return stringified Long.MAX_VALUE if we receive Number.MAX_SAFE_INTEGER + * @param sortIds estypes.SortResults | undefined + * @returns SortResults + */ +export declare const getSafeSortIds: (sortIds: estypes.SortResults | null | undefined) => Array | undefined; +interface GetEsQueryConfigParamType { + allowLeadingWildcards?: EsQueryConfig['allowLeadingWildcards']; + queryStringOptions?: EsQueryConfig['queryStringOptions']; + ignoreFilterIfFieldNotInIndex?: EsQueryConfig['ignoreFilterIfFieldNotInIndex']; + dateFormatTZ?: EsQueryConfig['dateFormatTZ']; +} +export declare const getEsQueryConfig: (params?: GetEsQueryConfigParamType) => EsQueryConfig; +/** + * TODO: Remove when checks for specific rule type ids is not needed + *in the codebase. + */ +export declare const isSiemRuleType: (ruleTypeId: string) => boolean; +export {}; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.d.ts new file mode 100644 index 0000000000000..34fd1edd04460 --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.d.ts @@ -0,0 +1,14 @@ +export declare const ALERT_SEVERITY_INFO = "info"; +export declare const ALERT_SEVERITY_LOW = "low"; +export declare const ALERT_SEVERITY_MEDIUM = "medium"; +export declare const ALERT_SEVERITY_HIGH = "high"; +export declare const ALERT_SEVERITY_CRITICAL = "critical"; +export declare const ALERT_SEVERITY_WARNING = "warning"; +export declare const ALERT_SEVERITY_MINOR = "minor"; +export declare const ALERT_SEVERITY_MAJOR = "major"; +export type AlertSeverity = typeof ALERT_SEVERITY_INFO | typeof ALERT_SEVERITY_LOW | typeof ALERT_SEVERITY_MEDIUM | typeof ALERT_SEVERITY_HIGH | typeof ALERT_SEVERITY_CRITICAL | typeof ALERT_SEVERITY_WARNING | typeof ALERT_SEVERITY_MINOR | typeof ALERT_SEVERITY_MAJOR; +/** + * Ordered list of severity values from highest to lowest, intended for UX + * surfaces and for runtime validation in API schemas. + */ +export declare const ALERT_SEVERITY_VALUES: readonly ["critical", "major", "high", "medium", "minor", "low", "warning", "info"]; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.d.ts new file mode 100644 index 0000000000000..11f38edb9c5bb --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.d.ts @@ -0,0 +1,6 @@ +export declare const ALERT_STATUS_ACTIVE = "active"; +export declare const ALERT_STATUS_RECOVERED = "recovered"; +export declare const ALERT_STATUS_UNTRACKED = "untracked"; +export declare const ALERT_STATUS_DELAYED = "delayed"; +export type AlertStatus = typeof ALERT_STATUS_ACTIVE | typeof ALERT_STATUS_RECOVERED | typeof ALERT_STATUS_UNTRACKED | typeof ALERT_STATUS_DELAYED; +export type PublicAlertStatus = typeof ALERT_STATUS_ACTIVE | typeof ALERT_STATUS_RECOVERED | typeof ALERT_STATUS_UNTRACKED; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.d.ts new file mode 100644 index 0000000000000..d3b7eb0c9b249 --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.d.ts @@ -0,0 +1,115 @@ +import type { ValuesType } from 'utility-types'; +declare const TIMESTAMP: "@timestamp"; +declare const KIBANA_NAMESPACE: "kibana"; +declare const ALERT_NAMESPACE: "kibana.alert"; +declare const ALERT_RULE_NAMESPACE: "kibana.alert.rule"; +declare const ALERT_STATE_NAMESPACE: "kibana.alert.state"; +declare const SPACE_IDS: "kibana.space_ids"; +declare const CPS_SCOPE_EXPRESSION: "kibana.cps_scope.expression"; +declare const CPS_SCOPE_LINKED_PROJECTS: "kibana.cps_scope.linked_projects"; +declare const VERSION: "kibana.version"; +declare const ALERT_ACTION_GROUP: "kibana.alert.action_group"; +declare const ALERT_PREVIOUS_ACTION_GROUP: "kibana.alert.previous_action_group"; +declare const ALERT_SEVERITY_IMPROVING: "kibana.alert.severity_improving"; +declare const ALERT_CASE_IDS: "kibana.alert.case_ids"; +declare const ALERT_DURATION: "kibana.alert.duration.us"; +declare const ALERT_END: "kibana.alert.end"; +declare const ALERT_FLAPPING: "kibana.alert.flapping"; +declare const ALERT_FLAPPING_HISTORY: "kibana.alert.flapping_history"; +declare const ALERT_MAINTENANCE_WINDOW_IDS: "kibana.alert.maintenance_window_ids"; +declare const ALERT_MAINTENANCE_WINDOW_NAMES: "kibana.alert.maintenance_window_names"; +declare const ALERT_CONSECUTIVE_MATCHES: "kibana.alert.consecutive_matches"; +declare const ALERT_PENDING_RECOVERED_COUNT: "kibana.alert.pending_recovered_count"; +declare const ALERT_INSTANCE_ID: "kibana.alert.instance.id"; +declare const ALERT_LAST_DETECTED: "kibana.alert.last_detected"; +declare const ALERT_INTENDED_TIMESTAMP: "kibana.alert.intended_timestamp"; +declare const ALERT_REASON: "kibana.alert.reason"; +declare const ALERT_START: "kibana.alert.start"; +declare const ALERT_UPDATED_AT: "kibana.alert.updated_at"; +declare const ALERT_UPDATED_BY_USER_ID: "kibana.alert.updated_by.user.id"; +declare const ALERT_UPDATED_BY_USER_NAME: "kibana.alert.updated_by.user.name"; +declare const ALERT_SEVERITY: "kibana.alert.severity"; +declare const ALERT_STATUS: "kibana.alert.status"; +declare const ALERT_TIME_RANGE: "kibana.alert.time_range"; +declare const ALERT_UUID: "kibana.alert.uuid"; +declare const ALERT_WORKFLOW_STATUS: "kibana.alert.workflow_status"; +declare const ALERT_WORKFLOW_TAGS: "kibana.alert.workflow_tags"; +declare const ALERT_WORKFLOW_ASSIGNEE_IDS: "kibana.alert.workflow_assignee_ids"; +declare const ALERT_RULE_CATEGORY: "kibana.alert.rule.category"; +declare const ALERT_RULE_CONSUMER: "kibana.alert.rule.consumer"; +declare const ALERT_RULE_EXECUTION_TIMESTAMP: "kibana.alert.rule.execution.timestamp"; +declare const ALERT_RULE_EXECUTION_UUID: "kibana.alert.rule.execution.uuid"; +declare const ALERT_RULE_NAME: "kibana.alert.rule.name"; +declare const ALERT_RULE_PARAMETERS: "kibana.alert.rule.parameters"; +declare const ALERT_RULE_PRODUCER: "kibana.alert.rule.producer"; +declare const ALERT_RULE_REVISION: "kibana.alert.rule.revision"; +declare const ALERT_RULE_TAGS: "kibana.alert.rule.tags"; +declare const ALERT_RULE_TYPE_ID: "kibana.alert.rule.rule_type_id"; +declare const ALERT_URL: "kibana.alert.url"; +declare const ALERT_RULE_UUID: "kibana.alert.rule.uuid"; +declare const ALERT_RULE_EXECUTION_TYPE: "kibana.alert.rule.execution.type"; +declare const ALERT_SCHEDULED_ACTION_GROUP: "kibana.alert.scheduled_action.group"; +declare const ALERT_SCHEDULED_ACTION_DATE: "kibana.alert.scheduled_action.date"; +declare const ALERT_SCHEDULED_ACTION_THROTTLING: "kibana.alert.scheduled_action.throttling"; +declare const ALERT_INDEX_PATTERN: "kibana.alert.index_pattern"; +declare const ALERT_MUTED: "kibana.alert.muted"; +declare const namespaces: { + KIBANA_NAMESPACE: "kibana"; + ALERT_NAMESPACE: "kibana.alert"; + ALERT_RULE_NAMESPACE: "kibana.alert.rule"; + ALERT_STATE_NAMESPACE: "kibana.alert.state"; +}; +export declare const fields: { + ALERT_ACTION_GROUP: "kibana.alert.action_group"; + ALERT_CASE_IDS: "kibana.alert.case_ids"; + ALERT_DURATION: "kibana.alert.duration.us"; + ALERT_END: "kibana.alert.end"; + ALERT_FLAPPING: "kibana.alert.flapping"; + ALERT_FLAPPING_HISTORY: "kibana.alert.flapping_history"; + ALERT_MAINTENANCE_WINDOW_IDS: "kibana.alert.maintenance_window_ids"; + ALERT_MAINTENANCE_WINDOW_NAMES: "kibana.alert.maintenance_window_names"; + ALERT_PENDING_RECOVERED_COUNT: "kibana.alert.pending_recovered_count"; + ALERT_CONSECUTIVE_MATCHES: "kibana.alert.consecutive_matches"; + ALERT_INSTANCE_ID: "kibana.alert.instance.id"; + ALERT_INDEX_PATTERN: "kibana.alert.index_pattern"; + ALERT_LAST_DETECTED: "kibana.alert.last_detected"; + ALERT_PREVIOUS_ACTION_GROUP: "kibana.alert.previous_action_group"; + ALERT_REASON: "kibana.alert.reason"; + ALERT_RULE_CATEGORY: "kibana.alert.rule.category"; + ALERT_RULE_CONSUMER: "kibana.alert.rule.consumer"; + ALERT_RULE_EXECUTION_TIMESTAMP: "kibana.alert.rule.execution.timestamp"; + ALERT_RULE_EXECUTION_TYPE: "kibana.alert.rule.execution.type"; + ALERT_INTENDED_TIMESTAMP: "kibana.alert.intended_timestamp"; + ALERT_RULE_EXECUTION_UUID: "kibana.alert.rule.execution.uuid"; + ALERT_RULE_NAME: "kibana.alert.rule.name"; + ALERT_RULE_PARAMETERS: "kibana.alert.rule.parameters"; + ALERT_RULE_PRODUCER: "kibana.alert.rule.producer"; + ALERT_RULE_REVISION: "kibana.alert.rule.revision"; + ALERT_RULE_TAGS: "kibana.alert.rule.tags"; + ALERT_RULE_TYPE_ID: "kibana.alert.rule.rule_type_id"; + ALERT_RULE_UUID: "kibana.alert.rule.uuid"; + ALERT_SEVERITY: "kibana.alert.severity"; + ALERT_SEVERITY_IMPROVING: "kibana.alert.severity_improving"; + ALERT_START: "kibana.alert.start"; + ALERT_UPDATED_AT: "kibana.alert.updated_at"; + ALERT_UPDATED_BY_USER_ID: "kibana.alert.updated_by.user.id"; + ALERT_UPDATED_BY_USER_NAME: "kibana.alert.updated_by.user.name"; + ALERT_STATUS: "kibana.alert.status"; + ALERT_TIME_RANGE: "kibana.alert.time_range"; + ALERT_URL: "kibana.alert.url"; + ALERT_UUID: "kibana.alert.uuid"; + ALERT_WORKFLOW_ASSIGNEE_IDS: "kibana.alert.workflow_assignee_ids"; + ALERT_WORKFLOW_STATUS: "kibana.alert.workflow_status"; + ALERT_WORKFLOW_TAGS: "kibana.alert.workflow_tags"; + ALERT_SCHEDULED_ACTION_GROUP: "kibana.alert.scheduled_action.group"; + ALERT_SCHEDULED_ACTION_DATE: "kibana.alert.scheduled_action.date"; + ALERT_SCHEDULED_ACTION_THROTTLING: "kibana.alert.scheduled_action.throttling"; + SPACE_IDS: "kibana.space_ids"; + CPS_SCOPE_EXPRESSION: "kibana.cps_scope.expression"; + CPS_SCOPE_LINKED_PROJECTS: "kibana.cps_scope.linked_projects"; + TIMESTAMP: "@timestamp"; + VERSION: "kibana.version"; + ALERT_MUTED: "kibana.alert.muted"; +}; +export { ALERT_NAMESPACE, ALERT_RULE_NAMESPACE, KIBANA_NAMESPACE, ALERT_STATE_NAMESPACE, ALERT_ACTION_GROUP, ALERT_CASE_IDS, ALERT_DURATION, ALERT_END, ALERT_FLAPPING, ALERT_FLAPPING_HISTORY, ALERT_MAINTENANCE_WINDOW_IDS, ALERT_MAINTENANCE_WINDOW_NAMES, ALERT_CONSECUTIVE_MATCHES, ALERT_PENDING_RECOVERED_COUNT, ALERT_INSTANCE_ID, ALERT_INDEX_PATTERN, ALERT_LAST_DETECTED, ALERT_PREVIOUS_ACTION_GROUP, ALERT_REASON, ALERT_RULE_CATEGORY, ALERT_RULE_CONSUMER, ALERT_RULE_EXECUTION_TIMESTAMP, ALERT_RULE_EXECUTION_TYPE, ALERT_INTENDED_TIMESTAMP, ALERT_RULE_EXECUTION_UUID, ALERT_RULE_NAME, ALERT_RULE_PARAMETERS, ALERT_RULE_PRODUCER, ALERT_RULE_REVISION, ALERT_RULE_TAGS, ALERT_RULE_TYPE_ID, ALERT_RULE_UUID, ALERT_SEVERITY, ALERT_SEVERITY_IMPROVING, ALERT_START, ALERT_UPDATED_AT, ALERT_UPDATED_BY_USER_ID, ALERT_UPDATED_BY_USER_NAME, ALERT_STATUS, ALERT_TIME_RANGE, ALERT_URL, ALERT_UUID, ALERT_WORKFLOW_ASSIGNEE_IDS, ALERT_WORKFLOW_STATUS, ALERT_WORKFLOW_TAGS, ALERT_SCHEDULED_ACTION_GROUP, ALERT_SCHEDULED_ACTION_DATE, ALERT_SCHEDULED_ACTION_THROTTLING, SPACE_IDS, CPS_SCOPE_EXPRESSION, CPS_SCOPE_LINKED_PROJECTS, TIMESTAMP, VERSION, ALERT_MUTED, }; +export type DefaultAlertFieldName = ValuesType; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.d.ts new file mode 100644 index 0000000000000..b7cbd7e4fe8ad --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.d.ts @@ -0,0 +1,34 @@ +declare const ECS_VERSION: "ecs.version"; +declare const EVENT_ACTION: "event.action"; +declare const EVENT_KIND: "event.kind"; +declare const EVENT_ORIGINAL: "event.original"; +declare const TAGS: "tags"; +declare const ALERT_RISK_SCORE: "kibana.alert.risk_score"; +declare const ALERT_RULE_AUTHOR: "kibana.alert.rule.author"; +declare const ALERT_RULE_CREATED_AT: "kibana.alert.rule.created_at"; +declare const ALERT_RULE_CREATED_BY: "kibana.alert.rule.created_by"; +declare const ALERT_RULE_DESCRIPTION: "kibana.alert.rule.description"; +declare const ALERT_RULE_ENABLED: "kibana.alert.rule.enabled"; +declare const ALERT_RULE_FROM: "kibana.alert.rule.from"; +declare const ALERT_RULE_INTERVAL: "kibana.alert.rule.interval"; +declare const ALERT_RULE_LICENSE: "kibana.alert.rule.license"; +declare const ALERT_RULE_NOTE: "kibana.alert.rule.note"; +declare const ALERT_RULE_REFERENCES: "kibana.alert.rule.references"; +declare const ALERT_RULE_RULE_ID: "kibana.alert.rule.rule_id"; +declare const ALERT_RULE_RULE_NAME_OVERRIDE: "kibana.alert.rule.rule_name_override"; +declare const ALERT_RULE_TO: "kibana.alert.rule.to"; +declare const ALERT_RULE_TYPE: "kibana.alert.rule.type"; +declare const ALERT_RULE_UPDATED_AT: "kibana.alert.rule.updated_at"; +declare const ALERT_RULE_UPDATED_BY: "kibana.alert.rule.updated_by"; +declare const ALERT_RULE_VERSION: "kibana.alert.rule.version"; +declare const ALERT_SUPPRESSION_TERMS: "kibana.alert.suppression.terms"; +declare const ALERT_SUPPRESSION_FIELD: "kibana.alert.suppression.terms.field"; +declare const ALERT_SUPPRESSION_VALUE: "kibana.alert.suppression.terms.value"; +declare const ALERT_SUPPRESSION_START: "kibana.alert.suppression.start"; +declare const ALERT_SUPPRESSION_END: "kibana.alert.suppression.end"; +declare const ALERT_SUPPRESSION_DOCS_COUNT: "kibana.alert.suppression.docs_count"; +declare const ALERT_SYSTEM_STATUS: "kibana.alert.system_status"; +declare const ALERT_WORKFLOW_REASON: "kibana.alert.workflow_reason"; +declare const ALERT_WORKFLOW_USER: "kibana.alert.workflow_user"; +declare const ALERT_WORKFLOW_STATUS_UPDATED_AT: "kibana.alert.workflow_status_updated_at"; +export { ALERT_RISK_SCORE, ALERT_RULE_AUTHOR, ALERT_RULE_CREATED_AT, ALERT_RULE_CREATED_BY, ALERT_RULE_DESCRIPTION, ALERT_RULE_ENABLED, ALERT_RULE_FROM, ALERT_RULE_INTERVAL, ALERT_RULE_LICENSE, ALERT_RULE_NOTE, ALERT_RULE_REFERENCES, ALERT_RULE_RULE_ID, ALERT_RULE_RULE_NAME_OVERRIDE, ALERT_RULE_TO, ALERT_RULE_TYPE, ALERT_RULE_UPDATED_AT, ALERT_RULE_UPDATED_BY, ALERT_RULE_VERSION, ALERT_SUPPRESSION_DOCS_COUNT, ALERT_SUPPRESSION_END, ALERT_SUPPRESSION_FIELD, ALERT_SUPPRESSION_START, ALERT_SUPPRESSION_TERMS, ALERT_SUPPRESSION_VALUE, ALERT_SYSTEM_STATUS, ALERT_WORKFLOW_REASON, ALERT_WORKFLOW_USER, ALERT_WORKFLOW_STATUS_UPDATED_AT, ECS_VERSION, EVENT_ACTION, EVENT_KIND, EVENT_ORIGINAL, TAGS, }; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.d.ts new file mode 100644 index 0000000000000..a800cb21d4e84 --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.d.ts @@ -0,0 +1,13 @@ +export declare const ruleDetailsRoute: "/rule/:ruleId"; +export declare const createRuleRoute: "/create/:ruleTypeId"; +export declare const createRuleFromTemplateRoute: "/create/template/:templateId"; +export declare const editRuleRoute: "/edit/:id"; +export declare const rulesAppDetailsRoute: "/rule/:ruleId"; +export declare const ruleLogsRoute: "/logs"; +export declare const triggersActionsRoute: "/app/management/insightsAndAlerting/triggersActions"; +export declare const rulesAppRoute: "/app/rules"; +export declare const getRuleDetailsRoute: (ruleId: string) => string; +export declare const getRulesAppDetailsRoute: (ruleId: string) => string; +export declare const getCreateRuleRoute: (ruleTypeId: string) => string; +export declare const getCreateRuleFromTemplateRoute: (templateId: string) => string; +export declare const getEditRuleRoute: (ruleId: string) => string; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_constants.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_constants.d.ts new file mode 100644 index 0000000000000..6a8d81ba8891a --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_constants.d.ts @@ -0,0 +1 @@ +export declare const ALERT_KEY_JOINER = ","; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_locator_params.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_locator_params.d.ts new file mode 100644 index 0000000000000..1c210dfcffde9 --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_locator_params.d.ts @@ -0,0 +1,22 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +export declare const ruleDetailsLocatorID = "RULE_DETAILS_LOCATOR"; +export declare const rulesLocatorID = "RULES_LOCATOR"; +export type RuleDetailsTabId = 'alerts' | 'history'; +export type RuleStatus = 'enabled' | 'disabled' | 'snoozed'; +export declare const RULE_DETAILS_ALERTS_TAB: RuleDetailsTabId; +export declare const RULE_DETAILS_HISTORY_TAB: RuleDetailsTabId; +export interface RuleDetailsLocatorParams extends SerializableRecord { + ruleId: string; + tabId?: RuleDetailsTabId; + rangeFrom?: string; + rangeTo?: string; + kuery?: string; + controlConfigs?: SerializableRecord[]; +} +export interface RulesLocatorParams extends SerializableRecord { + lastResponse?: string[]; + params?: Record; + search?: string; + status?: RuleStatus[]; + type?: string[]; +} diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.d.ts new file mode 100644 index 0000000000000..96ebef70ece89 --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.d.ts @@ -0,0 +1,5 @@ +import type { AlertConsumers } from '../alerts_as_data_rbac'; +import type { STACK_ALERTS_FEATURE_ID } from './stack_rules'; +export * from './stack_rules'; +export * from './o11y_rules'; +export type RuleCreationValidConsumer = typeof AlertConsumers.LOGS | typeof AlertConsumers.INFRASTRUCTURE | typeof AlertConsumers.OBSERVABILITY | typeof STACK_ALERTS_FEATURE_ID | 'alerts'; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.d.ts new file mode 100644 index 0000000000000..89bc1e8a6276a --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.d.ts @@ -0,0 +1,54 @@ +export declare const OBSERVABILITY_THRESHOLD_RULE_TYPE_ID = "observability.rules.custom_threshold"; +/** + * APM rule types + */ +export declare enum ApmRuleType { + ErrorCount = "apm.error_rate",// ErrorRate was renamed to ErrorCount but the key is kept as `error_rate` for backwards-compat. + TransactionErrorRate = "apm.transaction_error_rate", + TransactionDuration = "apm.transaction_duration", + Anomaly = "apm.anomaly" +} +export declare const APM_RULE_TYPE_IDS: ApmRuleType[]; +/** + * Synthetics ryle types + */ +export declare const SYNTHETICS_STATUS_RULE = "xpack.synthetics.alerts.monitorStatus"; +export declare const SYNTHETICS_TLS_RULE = "xpack.synthetics.alerts.tls"; +export declare const SYNTHETICS_ALERT_RULE_TYPES: { + MONITOR_STATUS: string; + TLS: string; +}; +export declare const SYNTHETICS_RULE_TYPE_IDS: string[]; +/** + * SLO rule types + */ +export declare const SLO_BURN_RATE_RULE_TYPE_ID = "slo.rules.burnRate"; +export declare const SLO_RULE_TYPE_IDS: string[]; +/** + * ESQL rule types + */ +export declare const STREAMS_ESQL_RULE_TYPE_ID = "streams.rules.esql"; +export declare const STREAMS_RULE_TYPE_IDS: string[]; +/** + * Metrics rule types + */ +export declare const METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID = "metrics.alert.inventory.threshold"; +export declare const METRIC_THRESHOLD_ALERT_TYPE_ID = "metrics.alert.threshold"; +/** + * Logs rule types + */ +export declare const LOG_THRESHOLD_ALERT_TYPE_ID = "logs.alert.document.count"; +export declare const LOG_RULE_TYPE_IDS: string[]; +/** + * Uptime rule types + */ +export declare const UPTIME_RULE_TYPE_IDS: string[]; +/** + * Infra rule types + */ +export declare enum InfraRuleType { + MetricThreshold = "metrics.alert.threshold", + InventoryThreshold = "metrics.alert.inventory.threshold" +} +export declare const INFRA_RULE_TYPE_IDS: InfraRuleType[]; +export declare const OBSERVABILITY_RULE_TYPE_IDS: string[]; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.d.ts new file mode 100644 index 0000000000000..7f0a50c16da94 --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.d.ts @@ -0,0 +1,10 @@ +export declare const STACK_ALERTS_FEATURE_ID = "stackAlerts"; +export declare const ES_QUERY_ID = ".es-query"; +export declare const ML_ANOMALY_DETECTION_RULE_TYPE_ID = "xpack.ml.anomaly_detection_alert"; +export declare const DEGRADED_DOCS_RULE_TYPE_ID = "datasetQuality.degradedDocs"; +/** + * These rule types are not the only stack rules. There are more. + * The variable holds all stack rule types that support multiple + * consumers aka the "Role visibility" UX dropdown. + */ +export declare const STACK_RULE_TYPE_IDS_SUPPORTED_BY_OBSERVABILITY: string[]; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.d.ts new file mode 100644 index 0000000000000..97fe820dd379c --- /dev/null +++ b/src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.d.ts @@ -0,0 +1,116 @@ +import type { ValuesType } from 'utility-types'; +declare const EVENT_MODULE: "event.module"; +declare const ALERT_BUILDING_BLOCK_TYPE: "kibana.alert.building_block_type"; +declare const ALERT_EVALUATION_THRESHOLD: "kibana.alert.evaluation.threshold"; +declare const ALERT_EVALUATION_TIME_RANGE: "kibana.alert.evaluation.time_range"; +declare const ALERT_EVALUATION_VALUE: "kibana.alert.evaluation.value"; +declare const ALERT_CONTEXT: "kibana.alert.context"; +declare const ALERT_EVALUATION_VALUES: "kibana.alert.evaluation.values"; +declare const ALERT_GROUPING: "kibana.alert.grouping"; +declare const ALERT_GROUP: "kibana.alert.group"; +declare const ALERT_GROUP_FIELD: "kibana.alert.group.field"; +declare const ALERT_GROUP_VALUE: "kibana.alert.group.value"; +declare const ALERT_RULE_EXCEPTIONS_LIST: "kibana.alert.rule.exceptions_list"; +declare const ALERT_RULE_NAMESPACE_FIELD: "kibana.alert.rule.namespace"; +declare const ALERT_THREAT_FRAMEWORK: "kibana.alert.rule.threat.framework"; +declare const ALERT_THREAT_TACTIC_ID: "kibana.alert.rule.threat.tactic.id"; +declare const ALERT_THREAT_TACTIC_NAME: "kibana.alert.rule.threat.tactic.name"; +declare const ALERT_THREAT_TACTIC_REFERENCE: "kibana.alert.rule.threat.tactic.reference"; +declare const ALERT_THREAT_TECHNIQUE_ID: "kibana.alert.rule.threat.technique.id"; +declare const ALERT_THREAT_TECHNIQUE_NAME: "kibana.alert.rule.threat.technique.name"; +declare const ALERT_THREAT_TECHNIQUE_REFERENCE: "kibana.alert.rule.threat.technique.reference"; +declare const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID: "kibana.alert.rule.threat.technique.subtechnique.id"; +declare const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME: "kibana.alert.rule.threat.technique.subtechnique.name"; +declare const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE: "kibana.alert.rule.threat.technique.subtechnique.reference"; +declare const namespaces: { + KIBANA_NAMESPACE: "kibana"; + ALERT_NAMESPACE: "kibana.alert"; + ALERT_RULE_NAMESPACE: "kibana.alert.rule"; +}; +declare const fields: { + ECS_VERSION: "ecs.version"; + EVENT_KIND: "event.kind"; + EVENT_ACTION: "event.action"; + EVENT_MODULE: "event.module"; + TAGS: "tags"; + TIMESTAMP: "@timestamp"; + ALERT_ACTION_GROUP: "kibana.alert.action_group"; + ALERT_BUILDING_BLOCK_TYPE: "kibana.alert.building_block_type"; + ALERT_DURATION: "kibana.alert.duration.us"; + ALERT_END: "kibana.alert.end"; + ALERT_EVALUATION_THRESHOLD: "kibana.alert.evaluation.threshold"; + ALERT_EVALUATION_TIME_RANGE: "kibana.alert.evaluation.time_range"; + ALERT_EVALUATION_VALUE: "kibana.alert.evaluation.value"; + ALERT_EVALUATION_VALUES: "kibana.alert.evaluation.values"; + ALERT_GROUPING: "kibana.alert.grouping"; + ALERT_GROUP: "kibana.alert.group"; + ALERT_GROUP_FIELD: "kibana.alert.group.field"; + ALERT_GROUP_VALUE: "kibana.alert.group.value"; + ALERT_FLAPPING: "kibana.alert.flapping"; + ALERT_MAINTENANCE_WINDOW_IDS: "kibana.alert.maintenance_window_ids"; + ALERT_MAINTENANCE_WINDOW_NAMES: "kibana.alert.maintenance_window_names"; + ALERT_INSTANCE_ID: "kibana.alert.instance.id"; + ALERT_RULE_CONSUMER: "kibana.alert.rule.consumer"; + ALERT_RULE_PRODUCER: "kibana.alert.rule.producer"; + ALERT_REASON: "kibana.alert.reason"; + ALERT_CONTEXT: "kibana.alert.context"; + ALERT_RISK_SCORE: "kibana.alert.risk_score"; + ALERT_CASE_IDS: "kibana.alert.case_ids"; + ALERT_RULE_AUTHOR: "kibana.alert.rule.author"; + ALERT_RULE_CREATED_AT: "kibana.alert.rule.created_at"; + ALERT_RULE_CREATED_BY: "kibana.alert.rule.created_by"; + ALERT_RULE_DESCRIPTION: "kibana.alert.rule.description"; + ALERT_RULE_ENABLED: "kibana.alert.rule.enabled"; + ALERT_RULE_EXCEPTIONS_LIST: "kibana.alert.rule.exceptions_list"; + ALERT_RULE_EXECUTION_UUID: "kibana.alert.rule.execution.uuid"; + ALERT_RULE_FROM: "kibana.alert.rule.from"; + ALERT_RULE_INTERVAL: "kibana.alert.rule.interval"; + ALERT_RULE_LICENSE: "kibana.alert.rule.license"; + ALERT_RULE_NAME: "kibana.alert.rule.name"; + ALERT_RULE_NAMESPACE_FIELD: "kibana.alert.rule.namespace"; + ALERT_RULE_NOTE: "kibana.alert.rule.note"; + ALERT_RULE_PARAMETERS: "kibana.alert.rule.parameters"; + ALERT_RULE_REFERENCES: "kibana.alert.rule.references"; + ALERT_RULE_RULE_ID: "kibana.alert.rule.rule_id"; + ALERT_RULE_RULE_NAME_OVERRIDE: "kibana.alert.rule.rule_name_override"; + ALERT_RULE_TAGS: "kibana.alert.rule.tags"; + ALERT_RULE_TO: "kibana.alert.rule.to"; + ALERT_RULE_TYPE: "kibana.alert.rule.type"; + ALERT_RULE_TYPE_ID: "kibana.alert.rule.rule_type_id"; + ALERT_RULE_UPDATED_AT: "kibana.alert.rule.updated_at"; + ALERT_RULE_UPDATED_BY: "kibana.alert.rule.updated_by"; + ALERT_RULE_VERSION: "kibana.alert.rule.version"; + ALERT_START: "kibana.alert.start"; + ALERT_TIME_RANGE: "kibana.alert.time_range"; + ALERT_SEVERITY: "kibana.alert.severity"; + ALERT_STATUS: "kibana.alert.status"; + ALERT_SYSTEM_STATUS: "kibana.alert.system_status"; + ALERT_UUID: "kibana.alert.uuid"; + ALERT_WORKFLOW_ASSIGNEE_IDS: "kibana.alert.workflow_assignee_ids"; + ALERT_WORKFLOW_REASON: "kibana.alert.workflow_reason"; + ALERT_WORKFLOW_STATUS: "kibana.alert.workflow_status"; + ALERT_WORKFLOW_TAGS: "kibana.alert.workflow_tags"; + ALERT_WORKFLOW_USER: "kibana.alert.workflow_user"; + ALERT_RULE_UUID: "kibana.alert.rule.uuid"; + ALERT_RULE_CATEGORY: "kibana.alert.rule.category"; + ALERT_THREAT_FRAMEWORK: "kibana.alert.rule.threat.framework"; + ALERT_THREAT_TACTIC_ID: "kibana.alert.rule.threat.tactic.id"; + ALERT_THREAT_TACTIC_NAME: "kibana.alert.rule.threat.tactic.name"; + ALERT_THREAT_TACTIC_REFERENCE: "kibana.alert.rule.threat.tactic.reference"; + ALERT_THREAT_TECHNIQUE_ID: "kibana.alert.rule.threat.technique.id"; + ALERT_THREAT_TECHNIQUE_NAME: "kibana.alert.rule.threat.technique.name"; + ALERT_THREAT_TECHNIQUE_REFERENCE: "kibana.alert.rule.threat.technique.reference"; + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID: "kibana.alert.rule.threat.technique.subtechnique.id"; + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME: "kibana.alert.rule.threat.technique.subtechnique.name"; + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE: "kibana.alert.rule.threat.technique.subtechnique.reference"; + ALERT_SUPPRESSION_TERMS: "kibana.alert.suppression.terms"; + ALERT_SUPPRESSION_FIELD: "kibana.alert.suppression.terms.field"; + ALERT_SUPPRESSION_VALUE: "kibana.alert.suppression.terms.value"; + ALERT_SUPPRESSION_START: "kibana.alert.suppression.start"; + ALERT_SUPPRESSION_END: "kibana.alert.suppression.end"; + ALERT_SUPPRESSION_DOCS_COUNT: "kibana.alert.suppression.docs_count"; + SPACE_IDS: "kibana.space_ids"; + VERSION: "kibana.version"; +}; +export { ALERT_BUILDING_BLOCK_TYPE, ALERT_EVALUATION_THRESHOLD, ALERT_EVALUATION_TIME_RANGE, ALERT_EVALUATION_VALUE, ALERT_CONTEXT, ALERT_EVALUATION_VALUES, ALERT_GROUPING, ALERT_GROUP, ALERT_GROUP_FIELD, ALERT_GROUP_VALUE, ALERT_RULE_EXCEPTIONS_LIST, ALERT_RULE_NAMESPACE_FIELD, ALERT_THREAT_FRAMEWORK, ALERT_THREAT_TACTIC_ID, ALERT_THREAT_TACTIC_NAME, ALERT_THREAT_TACTIC_REFERENCE, ALERT_THREAT_TECHNIQUE_ID, ALERT_THREAT_TECHNIQUE_NAME, ALERT_THREAT_TECHNIQUE_REFERENCE, ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, EVENT_MODULE, }; +export type TechnicalRuleDataFieldName = ValuesType; diff --git a/src/platform/packages/shared/kbn-search-errors/index.d.ts b/src/platform/packages/shared/kbn-search-errors/index.d.ts new file mode 100644 index 0000000000000..49c926d051c9b --- /dev/null +++ b/src/platform/packages/shared/kbn-search-errors/index.d.ts @@ -0,0 +1,4 @@ +export { createEsError } from './src/create_es_error'; +export { isEsError, EsError } from './src/es_error'; +export { renderSearchError } from './src/render_search_error'; +export type { IEsError } from './src/types'; diff --git a/src/platform/packages/shared/kbn-search-errors/src/create_es_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/create_es_error.d.ts new file mode 100644 index 0000000000000..639665b24b1a9 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-errors/src/create_es_error.d.ts @@ -0,0 +1,9 @@ +import type { ApplicationStart, CoreStart } from '@kbn/core/public'; +import type { AbstractDataView } from '@kbn/data-views-plugin/common'; +import type { IEsError } from './types'; +import { EsError } from './es_error'; +export interface Services { + application: ApplicationStart; + docLinks: CoreStart['docLinks']; +} +export declare function createEsError(err: IEsError, openInInspector: () => void, services: Services, dataView?: AbstractDataView): EsError; diff --git a/src/platform/packages/shared/kbn-search-errors/src/es_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/es_error.d.ts new file mode 100644 index 0000000000000..8c2de303b3f86 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-errors/src/es_error.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; +import type { IEsError } from './types'; +/** + * Checks if a given errors originated from Elasticsearch. + * Those params are assigned to the attributes property of an error. + * + * @param e + */ +export declare function isEsError(e: any): e is IEsError; +export declare class EsError extends Error { + readonly attributes: IEsError['attributes']; + private readonly openInInspector; + constructor(err: IEsError, message: string, openInInspector: () => void); + getErrorMessage(): React.JSX.Element; + getActions(): React.JSX.Element[]; +} diff --git a/src/platform/packages/shared/kbn-search-errors/src/painless_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/painless_error.d.ts new file mode 100644 index 0000000000000..2a73d708e97a2 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-errors/src/painless_error.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +import type { ApplicationStart } from '@kbn/core/public'; +import type { AbstractDataView } from '@kbn/data-views-plugin/common'; +import type { IEsError } from './types'; +import { EsError } from './es_error'; +export declare class PainlessError extends EsError { + private readonly applicationStart; + private readonly painlessCause; + private readonly dataView?; + constructor(err: IEsError, openInInspector: () => void, painlessCause: estypes.ErrorCause, applicationStart: ApplicationStart, dataView?: AbstractDataView); + getErrorMessage(): React.JSX.Element; + getActions(): React.JSX.Element[]; +} diff --git a/src/platform/packages/shared/kbn-search-errors/src/render_search_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/render_search_error.d.ts new file mode 100644 index 0000000000000..90949b630412a --- /dev/null +++ b/src/platform/packages/shared/kbn-search-errors/src/render_search_error.d.ts @@ -0,0 +1,6 @@ +import type { ReactNode } from 'react'; +export declare function renderSearchError(error: Error): { + title: string; + body: ReactNode; + actions?: ReactNode[]; +} | undefined; diff --git a/src/platform/packages/shared/kbn-search-errors/src/tsdb_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/tsdb_error.d.ts new file mode 100644 index 0000000000000..13d7a4c7a0c57 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-errors/src/tsdb_error.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +import type { CoreStart } from '@kbn/core/public'; +import type { IEsError } from './types'; +import { EsError } from './es_error'; +export declare class TsdbError extends EsError { + private readonly docLinks; + constructor(err: IEsError, openInInspector: () => void, tsdbCause: estypes.ErrorCause, docLinks: CoreStart['docLinks']); + getErrorMessage(): React.JSX.Element; +} diff --git a/src/platform/packages/shared/kbn-search-errors/src/types.d.ts b/src/platform/packages/shared/kbn-search-errors/src/types.d.ts new file mode 100644 index 0000000000000..aa1ace89bdd9f --- /dev/null +++ b/src/platform/packages/shared/kbn-search-errors/src/types.d.ts @@ -0,0 +1,3 @@ +import type { IEsErrorAttributes } from '@kbn/search-types'; +import type { KibanaServerError } from '@kbn/kibana-utils-plugin/common'; +export type IEsError = KibanaServerError; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/index.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/index.d.ts new file mode 100644 index 0000000000000..cb7f9a4eb82fe --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/index.d.ts @@ -0,0 +1,5 @@ +export type { SearchResponseWarning, WarningHandlerCallback } from './src/types'; +export { getWarningsDescription, getWarningsTitle, SearchResponseWarningsBadge, SearchResponseWarningsBadgePopoverContent, SearchResponseWarningsCallout, SearchResponseWarningsEmptyPrompt, ViewDetailsPopover, } from './src/components/search_response_warnings'; +export { extractWarnings } from './src/extract_warnings'; +export { handleWarnings } from './src/handle_warnings'; +export { hasUnsupportedDownsampledAggregationFailure } from './src/has_unsupported_downsampled_aggregation_failure'; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge.d.ts new file mode 100644 index 0000000000000..c452bfd4c384e --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { SearchResponseWarning } from '../../types'; +interface Props { + warnings: SearchResponseWarning[]; +} +export declare const SearchResponseWarningsBadge: (props: Props) => React.JSX.Element | null; +export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge_popover_content.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge_popover_content.d.ts new file mode 100644 index 0000000000000..54184863ea321 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge_popover_content.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import type { SearchResponseWarning } from '../../types'; +interface Props { + onViewDetailsClick?: () => void; + warnings: SearchResponseWarning[]; +} +export declare const SearchResponseWarningsBadgePopoverContent: (props: Props) => React.JSX.Element; +export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/callout.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/callout.d.ts new file mode 100644 index 0000000000000..2c74fee869b13 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/callout.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { SearchResponseWarning } from '../../types'; +interface Props { + warnings: SearchResponseWarning[]; +} +export declare const SearchResponseWarningsCallout: (props: Props) => React.JSX.Element | null; +export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/empty_prompt.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/empty_prompt.d.ts new file mode 100644 index 0000000000000..25cb0dabdc40e --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/empty_prompt.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { SearchResponseWarning } from '../../types'; +interface Props { + warnings: SearchResponseWarning[]; +} +export declare const SearchResponseWarningsEmptyPrompt: (props: Props) => React.JSX.Element; +export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/i18n_utils.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/i18n_utils.d.ts new file mode 100644 index 0000000000000..e14c77fe354b2 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/i18n_utils.d.ts @@ -0,0 +1,5 @@ +import type { SearchResponseWarning } from '../../types'; +export declare const viewDetailsLabel: string; +export declare function getNonSuccessfulClusters(warnings: SearchResponseWarning[]): Set; +export declare function getWarningsTitle(warnings: SearchResponseWarning[]): string; +export declare function getWarningsDescription(warnings: SearchResponseWarning[]): string; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/index.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/index.d.ts new file mode 100644 index 0000000000000..b2941bd6490b9 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/index.d.ts @@ -0,0 +1,6 @@ +export { getWarningsDescription, getWarningsTitle } from './i18n_utils'; +export { SearchResponseWarningsBadge } from './badge'; +export { SearchResponseWarningsBadgePopoverContent } from './badge_popover_content'; +export { SearchResponseWarningsCallout } from './callout'; +export { SearchResponseWarningsEmptyPrompt } from './empty_prompt'; +export { ViewDetailsPopover } from './view_details_popover'; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/view_details_popover.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/view_details_popover.d.ts new file mode 100644 index 0000000000000..91814026765bd --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/view_details_popover.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import type { SearchResponseWarning } from '../../types'; +interface Props { + displayAsLink?: boolean; + warnings: SearchResponseWarning[]; +} +export declare const ViewDetailsPopover: (props: Props) => React.JSX.Element | null; +export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/extract_warnings.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/extract_warnings.d.ts new file mode 100644 index 0000000000000..d1f3ac61f9bfa --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/extract_warnings.d.ts @@ -0,0 +1,8 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { ESQLSearchResponse } from '@kbn/es-types'; +import type { Start as InspectorStartContract, RequestAdapter } from '@kbn/inspector-plugin/public'; +import type { SearchResponseWarning } from './types'; +/** + * @internal + */ +export declare function extractWarnings(rawResponse: estypes.SearchResponse | ESQLSearchResponse, inspectorService: InspectorStartContract, requestAdapter: RequestAdapter, requestName: string, requestId?: string): SearchResponseWarning[]; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/handle_warnings.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/handle_warnings.d.ts new file mode 100644 index 0000000000000..7642896d75d40 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/handle_warnings.d.ts @@ -0,0 +1,27 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { AnalyticsServiceStart, NotificationsStart, ThemeServiceStart, UserProfileService } from '@kbn/core/public'; +import type { I18nStart } from '@kbn/core-i18n-browser'; +import type { Start as InspectorStart, RequestAdapter } from '@kbn/inspector-plugin/public'; +import type { WarningHandlerCallback } from './types'; +interface Services { + analytics: AnalyticsServiceStart; + i18n: I18nStart; + inspector: InspectorStart; + notifications: NotificationsStart; + theme: ThemeServiceStart; + userProfile: UserProfileService; +} +/** + * @internal + * All warnings are expected to come from the same response. + */ +export declare function handleWarnings({ callback, request, requestId, requestName, requestAdapter, response, services, }: { + callback?: WarningHandlerCallback; + request: estypes.SearchRequest; + requestAdapter: RequestAdapter; + requestId?: string; + requestName: string; + response: estypes.SearchResponse; + services: Services; +}): void; +export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/has_unsupported_downsampled_aggregation_failure.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/has_unsupported_downsampled_aggregation_failure.d.ts new file mode 100644 index 0000000000000..529abc9f3806a --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/has_unsupported_downsampled_aggregation_failure.d.ts @@ -0,0 +1,2 @@ +import type { SearchResponseWarning } from './types'; +export declare function hasUnsupportedDownsampledAggregationFailure(warning: SearchResponseWarning): boolean; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/types.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/types.d.ts new file mode 100644 index 0000000000000..0b798f163c2b4 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-response-warnings/src/types.d.ts @@ -0,0 +1,44 @@ +import type { estypes } from '@elastic/elasticsearch'; +/** + * A warning object for a search response with incomplete ES results + * ES returns incomplete results when: + * 1) Set timeout flag on search and the timeout expires on cluster + * 2) Some shard failures on a cluster + * 3) skipped remote(s) (skip_unavailable=true) + * a. all shards failed + * b. disconnected/not-connected + * @public + */ +export interface SearchResponseIncompleteWarning { + /** + * type: for sorting out incomplete warnings + */ + type: 'incomplete'; + /** + * requestName: human-friendly request name + */ + requestName: string; + /** + * clusters: cluster details. + */ + clusters: Record; + /** + * openInInspector: callback to open warning in inspector + */ + openInInspector: () => void; +} +/** + * A warning object for a search response with warnings + * @public + */ +export type SearchResponseWarning = SearchResponseIncompleteWarning; +/** + * A callback function which can intercept warnings when passed to {@link showWarnings}. Pass `true` from the + * function to prevent the search service from showing warning notifications by default. + * @public + */ +export type WarningHandlerCallback = (warning: SearchResponseWarning, meta: { + request: estypes.SearchRequest; + response: estypes.SearchResponse; + requestId: string | undefined; +}) => boolean | undefined; diff --git a/src/platform/packages/shared/kbn-search-types/index.d.ts b/src/platform/packages/shared/kbn-search-types/index.d.ts new file mode 100644 index 0000000000000..fd934ed1ada65 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-types/index.d.ts @@ -0,0 +1,3 @@ +export type { ISearchGeneric, ISearchClient, SanitizedConnectionRequestParams, IEsErrorAttributes, ISearchOptions, ISearchOptionsSerializable, } from './src/types'; +export type { IKibanaSearchRequest, IKibanaSearchResponse } from './src/kibana_search_types'; +export type { ISearchRequestParams, IEsSearchResponse, IEsSearchRequest, } from './src/es_search_types'; diff --git a/src/platform/packages/shared/kbn-search-types/src/es_search_types.d.ts b/src/platform/packages/shared/kbn-search-types/src/es_search_types.d.ts new file mode 100644 index 0000000000000..bf052c94d9f2f --- /dev/null +++ b/src/platform/packages/shared/kbn-search-types/src/es_search_types.d.ts @@ -0,0 +1,9 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { IKibanaSearchRequest, IKibanaSearchResponse } from './kibana_search_types'; +export type ISearchRequestParams = { + trackTotalHits?: boolean; +} & estypes.SearchRequest; +export interface IEsSearchRequest extends IKibanaSearchRequest { + indexType?: string; +} +export type IEsSearchResponse = IKibanaSearchResponse>; diff --git a/src/platform/packages/shared/kbn-search-types/src/kibana_search_types.d.ts b/src/platform/packages/shared/kbn-search-types/src/kibana_search_types.d.ts new file mode 100644 index 0000000000000..1c1364ce564b3 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-types/src/kibana_search_types.d.ts @@ -0,0 +1,52 @@ +import type { SanitizedConnectionRequestParams } from './types'; +export interface IKibanaSearchRequest { + /** + * An id can be used to uniquely identify this request. + */ + id?: string; + params?: Params; +} +export interface IKibanaSearchResponse { + /** + * Some responses may contain a unique id to identify the request this response came from. + */ + id?: string; + /** + * If relevant to the search strategy, return a total number + * that represents how progress is indicated. + */ + total?: number; + /** + * If relevant to the search strategy, return a loaded number + * that represents how progress is indicated. + */ + loaded?: number; + /** + * Indicates whether search is still in flight + */ + isRunning?: boolean; + /** + * Indicates whether the results returned are complete or partial + */ + isPartial?: boolean; + /** + * Indicates whether the results returned are from the async-search index + */ + isRestored?: boolean; + /** + * Indicates whether the search has been saved to a search-session object and long keepAlive was set + */ + isStored?: boolean; + /** + * Optional warnings returned from Elasticsearch (for example, deprecation warnings) + */ + warning?: string; + /** + * The raw response returned by the internal search method (usually the raw ES response) + */ + rawResponse: RawResponse; + /** + * HTTP request parameters from elasticsearch transport client t + */ + requestParams?: SanitizedConnectionRequestParams; +} diff --git a/src/platform/packages/shared/kbn-search-types/src/types.d.ts b/src/platform/packages/shared/kbn-search-types/src/types.d.ts new file mode 100644 index 0000000000000..daf2d81049933 --- /dev/null +++ b/src/platform/packages/shared/kbn-search-types/src/types.d.ts @@ -0,0 +1,96 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { ConnectionRequestParams } from '@elastic/transport'; +import type { TransportRequestOptions } from '@elastic/elasticsearch'; +import type { KibanaExecutionContext } from '@kbn/core/public'; +import type { AbstractDataView } from '@kbn/data-views-plugin/common'; +import type { Observable } from 'rxjs'; +import type { ProjectRouting } from '@kbn/es-query'; +import type { IEsSearchRequest, IEsSearchResponse } from './es_search_types'; +import type { IKibanaSearchRequest, IKibanaSearchResponse } from './kibana_search_types'; +export type ISearchGeneric = (request: SearchStrategyRequest, options?: ISearchOptions) => Observable; +export type ISearchCancelGeneric = (id: string, options?: ISearchOptions) => Promise; +export type ISearchExtendGeneric = (id: string, keepAlive: string, options?: ISearchOptions) => Promise; +export interface ISearchClient { + search: ISearchGeneric; + /** + * Used to cancel an in-progress search request. + */ + cancel: ISearchCancelGeneric; + /** + * Used to extend the TTL of an in-progress search request. + */ + extend: ISearchExtendGeneric; +} +export type SanitizedConnectionRequestParams = Pick; +export interface IEsErrorAttributes { + error?: estypes.ErrorCause; + rawResponse?: estypes.SearchResponseBody; + requestParams?: SanitizedConnectionRequestParams; +} +export interface ISearchOptions { + /** + * An `AbortSignal` that allows the caller of `search` to abort a search request. + */ + abortSignal?: AbortSignal; + /** + * Use this option to force using a specific server side search strategy. Leave empty to use the default strategy. + */ + strategy?: string | symbol; + /** + * Request the legacy format for the total number of hits. If sending `rest_total_hits_as_int` to + * something other than `true`, this should be set to `false`. + */ + legacyHitsTotal?: boolean; + /** + * A session ID, grouping multiple search requests into a single session. + */ + sessionId?: string; + /** + * Whether the session is already saved (i.e. sent to background) + */ + isStored?: boolean; + /** + * Whether the search was successfully polled after session was saved. Search was added to a session saved object and keepAlive extended. + */ + isSearchStored?: boolean; + /** + * Whether the session is restored (i.e. search requests should re-use the stored search IDs, + * rather than starting from scratch) + */ + isRestore?: boolean; + /** + * By default, when polling, we don't retrieve the results of the search request (until it is complete). + * setting this to `true` will request the search results, regardless of whether or not the search is complete. + */ + returnIntermediateResults?: boolean; + /** + * Represents a meta-information about a Kibana entity intitating a saerch request. + */ + executionContext?: KibanaExecutionContext; + /** + * Index pattern reference is used for better error messages + */ + indexPattern?: AbstractDataView; + /** + * TransportRequestOptions, other than `signal`, to pass through to the ES client. + * To pass an abort signal, use {@link ISearchOptions.abortSignal} + */ + transport?: Omit; + /** + * When set es results are streamed back to the caller without any parsing of the content. + */ + stream?: boolean; + /** + * A hash of the request params. This is attached automatically by the search interceptor. It is used to link this request with a search session. + */ + requestHash?: string; + /** + * Project routing configuration for cross-project search (CPS). + */ + projectRouting?: ProjectRouting; +} +/** + * Same as `ISearchOptions`, but contains only serializable fields, which can + * be sent over the network. + */ +export type ISearchOptionsSerializable = Pick; diff --git a/src/platform/packages/shared/kbn-server-route-repository-utils/index.d.ts b/src/platform/packages/shared/kbn-server-route-repository-utils/index.d.ts new file mode 100644 index 0000000000000..aaa39a220b61e --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository-utils/index.d.ts @@ -0,0 +1,3 @@ +export { formatRequest } from './src/format_request'; +export { parseEndpoint } from './src/parse_endpoint'; +export type { ServerRouteCreateOptions, ServerRouteHandlerResources, RouteParamsRT, ServerRoute, EndpointOf, ReturnOf, RouteRepositoryClient, ClientRequestParamsOf, DecodedRequestParamsOf, ServerRouteRepository, DefaultClientOptions, DefaultRouteCreateOptions, DefaultRouteHandlerResources, IoTsParamsObject, ZodParamsObject, } from './src/typings'; diff --git a/src/platform/packages/shared/kbn-server-route-repository-utils/src/format_request.d.ts b/src/platform/packages/shared/kbn-server-route-repository-utils/src/format_request.d.ts new file mode 100644 index 0000000000000..682b6f811e8de --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository-utils/src/format_request.d.ts @@ -0,0 +1,5 @@ +export declare function formatRequest(endpoint: string, pathParams?: Record): { + method: "get" | import("@kbn/core/server").DestructiveRouteMethod; + pathname: string; + version: string; +}; diff --git a/src/platform/packages/shared/kbn-server-route-repository-utils/src/parse_endpoint.d.ts b/src/platform/packages/shared/kbn-server-route-repository-utils/src/parse_endpoint.d.ts new file mode 100644 index 0000000000000..02475d5bed081 --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository-utils/src/parse_endpoint.d.ts @@ -0,0 +1,5 @@ +export declare function parseEndpoint(endpoint: string): { + method: "get" | import("@kbn/core-http-server").DestructiveRouteMethod; + pathname: string; + version: string; +}; diff --git a/src/platform/packages/shared/kbn-server-route-repository-utils/src/typings.d.ts b/src/platform/packages/shared/kbn-server-route-repository-utils/src/typings.d.ts new file mode 100644 index 0000000000000..7620fad7d374e --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository-utils/src/typings.d.ts @@ -0,0 +1,98 @@ +import type { HttpFetchOptions } from '@kbn/core-http-browser'; +import type { IKibanaResponse, RouteAccess, RouteSecurity } from '@kbn/core-http-server'; +import type { KibanaRequest, KibanaResponseFactory, Logger, RequestHandlerContext, RouteConfigOptions, RouteMethod } from '@kbn/core/server'; +import type { ServerSentEvent } from '@kbn/sse-utils'; +import type { z } from '@kbn/zod/v4'; +import type * as t from 'io-ts'; +import type { Observable } from 'rxjs'; +import type { Readable } from 'stream'; +import type { Required, RequiredKeys, ValuesType } from 'utility-types'; +type MaybeOptional; +}> = RequiredKeys extends never ? { + params?: T['params']; +} : { + params: T['params']; +}; +type WithoutIncompatibleMethods = Omit & { + encode: t.Encode; + asEncoder: () => t.Encoder; +}; +export interface RouteParams { + path?: any; + query?: any; + body?: any; +} +export type ZodParamsObject = z.ZodObject<{ + path?: z.ZodType; + query?: z.ZodType; + body?: z.ZodType; +}>; +export type IoTsParamsObject = WithoutIncompatibleMethods>; +export type RouteParamsRT = IoTsParamsObject | ZodParamsObject; +export type ServerRouteHandlerResources = Record; +export interface ServerRouteCreateOptions { + [x: string]: any; +} +type RouteMethodOf = TEndpoint extends `${infer TRouteMethod} ${string}` ? Lowercase extends RouteMethod ? Lowercase : never : never; +type IsPublicEndpoint = TRouteAccess extends 'public' ? true : TRouteAccess extends 'internal' ? false : TEndpoint extends `${string} /api${string}` ? true : false; +type IsVersionSpecified = TEndpoint extends `${string} ${string} ${string}` ? true : false; +type ValidateEndpoint = IsPublicEndpoint extends true ? IsVersionSpecified : true; +type IsAny = 1 | 0 extends (T extends never ? 1 : 0) ? true : false; +type ValidateSerializableValue = IsAny extends true ? 1 : T extends Function ? 0 : T extends Record ? TWalkRecursively extends true ? ValuesType<{ + [key in keyof T]: ValidateSerializableValue; +}> : 1 : T extends string | number | boolean | null | undefined ? 1 : T extends any[] ? 1 : 0; +type GuardAgainstInvalidRecord = 0 extends ValidateSerializableValue ? never : T; +type ServerRouteHandlerReturnTypeWithoutRecord = Observable | Readable | IKibanaResponse | string | number | boolean | null | void; +type ServerRouteHandlerReturnType = ServerRouteHandlerReturnTypeWithoutRecord | Record; +type ServerRouteHandler = (options: TRouteHandlerResources & (TRouteParamsRT extends RouteParamsRT ? DecodedRequestParamsOfType : {})) => Promise>; +export type CreateServerRouteFactory = (options: { + endpoint: ValidateEndpoint extends true ? TEndpoint : never; + handler: ServerRouteHandler; + params?: TRouteParamsRT; + security: RouteSecurity; +} & Required<{ + options?: (TRouteCreateOptions extends DefaultRouteCreateOptions ? TRouteCreateOptions : {}) & RouteConfigOptions> & { + access?: TRouteAccess; + }; +}, RequiredKeys extends never ? never : 'options'>) => Record, TRouteCreateOptions>>; +export type ServerRoute = { + endpoint: TEndpoint; + handler: ServerRouteHandler; + security: RouteSecurity; +} & (TRouteParamsRT extends RouteParamsRT ? { + params: TRouteParamsRT; +} : {}) & (TRouteCreateOptions extends DefaultRouteCreateOptions ? { + options: TRouteCreateOptions; +} : {}); +export type ServerRouteRepository = Record>; +type ClientRequestParamsOfType = TRouteParamsRT extends t.Mixed ? MaybeOptional<{ + params: t.OutputOf; +}> : TRouteParamsRT extends z.ZodType ? z.input extends Record ? MaybeOptional<{ + params: z.input; +}> : never : never; +type DecodedRequestParamsOfType = TRouteParamsRT extends t.Mixed ? MaybeOptional<{ + params: t.TypeOf; +}> : TRouteParamsRT extends z.ZodType> ? MaybeOptional<{ + params: O; +}> : never; +export type EndpointOf = keyof TServerRouteRepository & string; +export type ReturnOf = TServerRouteRepository[TEndpoint] extends ServerRoute ? TReturnType extends IKibanaResponse ? TWrappedResponseType : TReturnType : never; +export type DecodedRequestParamsOf = TServerRouteRepository[TEndpoint] extends ServerRoute ? TRouteParamsRT extends RouteParamsRT ? DecodedRequestParamsOfType : {} : never; +export type ClientRequestParamsOf = TServerRouteRepository[TEndpoint] extends ServerRoute ? TRouteParamsRT extends RouteParamsRT ? ClientRequestParamsOfType : TRouteParamsRT extends undefined ? {} : never : never; +type MaybeOptionalArgs> = RequiredKeys extends never ? [T] | [] : [T]; +export interface RouteRepositoryClient> { + fetch>(endpoint: TEndpoint, ...args: MaybeOptionalArgs & TAdditionalClientOptions & HttpFetchOptions>): Promise>; + stream>(endpoint: TEndpoint, ...args: MaybeOptionalArgs & TAdditionalClientOptions & HttpFetchOptions>): ReturnOf extends Observable ? TReturnType extends ServerSentEvent ? Observable : never : never; +} +interface CoreRouteHandlerResources { + request: KibanaRequest; + response: KibanaResponseFactory; + context: RequestHandlerContext; +} +export type DefaultClientOptions = HttpFetchOptions; +export interface DefaultRouteHandlerResources extends CoreRouteHandlerResources { + logger: Logger; +} +export type DefaultRouteCreateOptions = RouteConfigOptions>; +export {}; diff --git a/src/platform/packages/shared/kbn-server-route-repository/index.d.ts b/src/platform/packages/shared/kbn-server-route-repository/index.d.ts new file mode 100644 index 0000000000000..d54579d2b465e --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository/index.d.ts @@ -0,0 +1,7 @@ +export { formatRequest, parseEndpoint } from '@kbn/server-route-repository-utils'; +export { createServerRouteFactory } from './src/create_server_route_factory'; +export { decodeRequestParams } from './src/decode_request_params'; +export { stripNullishRequestParameters } from './src/strip_nullish_request_parameters'; +export { passThroughValidationObject } from './src/validation_objects'; +export { registerRoutes } from './src/register_routes'; +export type { RouteRepositoryClient, ReturnOf, EndpointOf, ClientRequestParamsOf, DecodedRequestParamsOf, ServerRouteRepository, ServerRoute, RouteParamsRT, DefaultRouteCreateOptions, DefaultRouteHandlerResources, IoTsParamsObject, } from '@kbn/server-route-repository-utils'; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/create_server_route_factory.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/create_server_route_factory.d.ts new file mode 100644 index 0000000000000..0cbf1dbac7e65 --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository/src/create_server_route_factory.d.ts @@ -0,0 +1,3 @@ +import type { DefaultRouteHandlerResources, ServerRouteHandlerResources } from '@kbn/server-route-repository-utils'; +import type { CreateServerRouteFactory, DefaultRouteCreateOptions } from '@kbn/server-route-repository-utils/src/typings'; +export declare function createServerRouteFactory(): CreateServerRouteFactory; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/decode_request_params.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/decode_request_params.d.ts new file mode 100644 index 0000000000000..db492a8bd2f94 --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository/src/decode_request_params.d.ts @@ -0,0 +1,7 @@ +import type { IoTsParamsObject } from '@kbn/server-route-repository-utils'; +import type * as t from 'io-ts'; +export declare function decodeRequestParams(params: Partial<{ + path: any; + query: any; + body: any; +}>, paramsRt: T): t.OutputOf; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/make_zod_validation_object.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/make_zod_validation_object.d.ts new file mode 100644 index 0000000000000..916e85d4b5bcb --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository/src/make_zod_validation_object.d.ts @@ -0,0 +1,7 @@ +import type { z } from '@kbn/zod/v4'; +import type { ZodParamsObject } from '@kbn/server-route-repository-utils'; +export declare function makeZodValidationObject(params: ZodParamsObject): { + params: z.ZodObject<{}, z.core.$strict> | z.ZodPipe>>; + query: z.ZodObject<{}, z.core.$strict> | z.ZodPipe>>; + body: z.ZodUnion, z.ZodNull, z.ZodUndefined]> | z.ZodPipe>>; +}; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/register_routes.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/register_routes.d.ts new file mode 100644 index 0000000000000..91e781fceefe4 --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository/src/register_routes.d.ts @@ -0,0 +1,10 @@ +import type { CoreSetup } from '@kbn/core-lifecycle-server'; +import type { Logger } from '@kbn/logging'; +import type { RouteParamsRT, ServerRoute } from '@kbn/server-route-repository-utils'; +export declare function registerRoutes>({ core, repository, logger, dependencies, runDevModeChecks, }: { + core: CoreSetup; + repository: Record>; + logger: Logger; + dependencies: TDependencies; + runDevModeChecks: boolean; +}): void; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/strip_nullish_request_parameters.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/strip_nullish_request_parameters.d.ts new file mode 100644 index 0000000000000..7d16ef6ff0759 --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository/src/strip_nullish_request_parameters.d.ts @@ -0,0 +1,11 @@ +interface KibanaRequestParams { + body?: unknown; + query?: unknown; + params?: unknown; +} +export declare function stripNullishRequestParameters(params: KibanaRequestParams): Partial<{ + path: any; + body: any; + query: any; +}>; +export {}; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/validate_and_decode_params.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/validate_and_decode_params.d.ts new file mode 100644 index 0000000000000..d5932bf852d8e --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository/src/validate_and_decode_params.d.ts @@ -0,0 +1,3 @@ +import type { KibanaRequest } from '@kbn/core-http-server'; +import type { ZodParamsObject, IoTsParamsObject } from '@kbn/server-route-repository-utils'; +export declare function validateAndDecodeParams(request: KibanaRequest, paramsSchema: ZodParamsObject | IoTsParamsObject | undefined): import("@kbn/server-route-repository-utils/src/typings").RouteParams | undefined; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/validation_objects.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/validation_objects.d.ts new file mode 100644 index 0000000000000..6d687b9ed04b2 --- /dev/null +++ b/src/platform/packages/shared/kbn-server-route-repository/src/validation_objects.d.ts @@ -0,0 +1,11 @@ +import { z } from '@kbn/zod/v4'; +export declare const passThroughValidationObject: { + body: z.ZodAny & import("@kbn/zod-helpers/v4/kbn_zod_types/kbn_zod_type").KbnZodType; + params: z.ZodAny & import("@kbn/zod-helpers/v4/kbn_zod_types/kbn_zod_type").KbnZodType; + query: z.ZodAny & import("@kbn/zod-helpers/v4/kbn_zod_types/kbn_zod_type").KbnZodType; +}; +export declare const noParamsValidationObject: { + params: z.ZodObject<{}, z.core.$strict>; + query: z.ZodObject<{}, z.core.$strict>; + body: z.ZodUnion, z.ZodNull, z.ZodUndefined]>; +}; diff --git a/src/platform/packages/shared/kbn-sse-utils-server/index.d.ts b/src/platform/packages/shared/kbn-sse-utils-server/index.d.ts new file mode 100644 index 0000000000000..fb3845c39a314 --- /dev/null +++ b/src/platform/packages/shared/kbn-sse-utils-server/index.d.ts @@ -0,0 +1,2 @@ +export { observableIntoEventSourceStream, cloudProxyBufferSize, } from './src/observable_into_event_source_stream'; +export { supertestToObservable } from './src/supertest_to_observable'; diff --git a/src/platform/packages/shared/kbn-sse-utils-server/src/observable_into_event_source_stream.d.ts b/src/platform/packages/shared/kbn-sse-utils-server/src/observable_into_event_source_stream.d.ts new file mode 100644 index 0000000000000..c16244fa4bdc0 --- /dev/null +++ b/src/platform/packages/shared/kbn-sse-utils-server/src/observable_into_event_source_stream.d.ts @@ -0,0 +1,29 @@ +import type { Logger } from '@kbn/logging'; +import type { ServerSentEvent } from '@kbn/sse-utils/src/events'; +import type { Observable } from 'rxjs'; +import { PassThrough } from 'stream'; +import type { Zlib } from 'zlib'; +declare class ResponseStream extends PassThrough { + private _compressor?; + setCompressor(compressor: Zlib): void; + flush(): void; +} +export declare const cloudProxyBufferSize = 4096; +export declare function observableIntoEventSourceStream(source$: Observable, { logger, signal, flushThrottleMs, flushMinBytes, }: { + logger: Pick; + signal: AbortSignal; + /** + * The minimum time in milliseconds between flushes of the stream. + * This is to avoid flushing too often if the source emits events in quick succession. + * + * @default 100 + */ + flushThrottleMs?: number; + /** + * The Cloud proxy currently buffers 4kb or 8kb of data until flushing. + * This decreases the responsiveness of the streamed response, + * so we manually insert some data during stream flushes to force the proxy to flush too. + */ + flushMinBytes?: number; +}): ResponseStream; +export {}; diff --git a/src/platform/packages/shared/kbn-sse-utils-server/src/supertest_to_observable.d.ts b/src/platform/packages/shared/kbn-sse-utils-server/src/supertest_to_observable.d.ts new file mode 100644 index 0000000000000..3f7aeed5cfcd0 --- /dev/null +++ b/src/platform/packages/shared/kbn-sse-utils-server/src/supertest_to_observable.d.ts @@ -0,0 +1,20 @@ +import type supertest from 'supertest'; +import { Observable } from 'rxjs'; +/** + * Convert a supertest response to an SSE observable. + * + * Note: the supertest response should *NOT* be awaited when using that utility, + * or at least not before calling it. + * + * @example + * ```ts + * const response = supertest + * .post(`/some/sse/endpoint`) + * .set('kbn-xsrf', 'kibana') + * .send({ + * some: 'thing' + * }); + * const events = supertestIntoObservable(response); + * ``` + */ +export declare function supertestToObservable(response: supertest.Test): Observable; diff --git a/src/platform/packages/shared/kbn-ui-actions-browser/src/types/index.d.ts b/src/platform/packages/shared/kbn-ui-actions-browser/src/types/index.d.ts new file mode 100644 index 0000000000000..89711022a2bd2 --- /dev/null +++ b/src/platform/packages/shared/kbn-ui-actions-browser/src/types/index.d.ts @@ -0,0 +1 @@ +export type * from './presentable'; diff --git a/src/platform/packages/shared/kbn-ui-actions-browser/src/types/presentable.d.ts b/src/platform/packages/shared/kbn-ui-actions-browser/src/types/presentable.d.ts new file mode 100644 index 0000000000000..6e8d181d64bd0 --- /dev/null +++ b/src/platform/packages/shared/kbn-ui-actions-browser/src/types/presentable.d.ts @@ -0,0 +1,57 @@ +import type { FC } from 'react'; +import type { IconType } from '@elastic/eui'; +/** + * Represents something that can be displayed to user in UI. + */ +export interface Presentable { + /** + * ID that uniquely identifies this object. + */ + readonly id: string; + /** + * Determines the display order in relation to other items. Higher numbers are + * displayed first. + */ + readonly order: number; + /** + * Component to render when displaying this entity as a context menu item. + * If not provided, `getDisplayName` will be used instead. + */ + readonly MenuItem?: FC<{ + context: Context; + }>; + /** + * Optional EUI icon type that can be displayed along with the title. + */ + getIconType(context: Context): IconType | undefined; + /** + * Returns a title to be displayed to the user. + */ + getDisplayName(context: Context): string; + /** + * Returns tooltip text which should be displayed when user hovers this object. + * Should return empty string if tooltip should not be displayed. + */ + getDisplayNameTooltip?(context: Context): string; + /** + * This method should return a link if this item can be clicked on. The link + * is used to navigate user if user middle-clicks it or Ctrl + clicks or + * right-clicks and selects "Open in new tab". + */ + getHref?(context: Context): Promise; + /** + * Returns a promise that resolves to true if this item is compatible given + * the context and should be displayed to user, otherwise resolves to false. + */ + isCompatible(context: Context): Promise; + /** + * Grouping where this item should appear as a submenu. Each entry is a new + * sub-menu level. For example, used to show drilldowns and sharing options + * in panel context menu in a sub-menu. + */ + readonly grouping?: PresentableGrouping; +} +export interface PresentableGroup extends Partial, 'getDisplayName' | 'getDisplayNameTooltip' | 'getIconType' | 'order'>> { + id: string; +} +export type PresentableGrouping = Array>; diff --git a/src/platform/packages/shared/kbn-use-tracked-promise/index.d.ts b/src/platform/packages/shared/kbn-use-tracked-promise/index.d.ts new file mode 100644 index 0000000000000..8402bf03faec2 --- /dev/null +++ b/src/platform/packages/shared/kbn-use-tracked-promise/index.d.ts @@ -0,0 +1 @@ +export { useTrackedPromise } from './use_tracked_promise'; diff --git a/src/platform/packages/shared/kbn-use-tracked-promise/use_tracked_promise.d.ts b/src/platform/packages/shared/kbn-use-tracked-promise/use_tracked_promise.d.ts new file mode 100644 index 0000000000000..20e8ea34acaeb --- /dev/null +++ b/src/platform/packages/shared/kbn-use-tracked-promise/use_tracked_promise.d.ts @@ -0,0 +1,96 @@ +import type { DependencyList } from 'react'; +interface UseTrackedPromiseArgs { + createPromise: (...args: Arguments) => Promise; + onResolve?: (result: Result) => void; + onReject?: (value: unknown) => void; + cancelPreviousOn?: 'creation' | 'settlement' | 'resolution' | 'rejection' | 'never'; + triggerOrThrow?: 'always' | 'whenMounted'; +} +/** + * This hook manages a Promise factory and can create new Promises from it. The + * state of these Promises is tracked and they can be canceled when superseded + * to avoid race conditions. + * + * ``` + * const [requestState, performRequest] = useTrackedPromise( + * { + * cancelPreviousOn: 'resolution', + * createPromise: async (url: string) => { + * return await fetchSomething(url) + * }, + * onResolve: response => { + * setSomeState(response.data); + * }, + * onReject: response => { + * setSomeError(response); + * }, + * }, + * [fetchSomething] + * ); + * ``` + * + * The `onResolve` and `onReject` handlers are registered separately, because + * the hook will inject a rejection when in case of a canellation. The + * `cancelPreviousOn` attribute can be used to indicate when the preceding + * pending promises should be canceled: + * + * 'never': No preceding promises will be canceled. + * + * 'creation': Any preceding promises will be canceled as soon as a new one is + * created. + * + * 'settlement': Any preceding promise will be canceled when a newer promise is + * resolved or rejected. + * + * 'resolution': Any preceding promise will be canceled when a newer promise is + * resolved. + * + * 'rejection': Any preceding promise will be canceled when a newer promise is + * rejected. + * + * Any pending promises will be canceled when the component using the hook is + * unmounted, but their status will not be tracked to avoid React warnings + * about memory leaks. + * + * The last argument is a normal React hook dependency list that indicates + * under which conditions a new reference to the configuration object should be + * used. + * + * The `onResolve`, `onReject` and possible uncatched errors are only triggered + * if the underlying component is mounted. To ensure they always trigger (i.e. + * if the promise is called in a `useLayoutEffect`) use the `triggerOrThrow` + * attribute: + * + * 'whenMounted': (default) they are called only if the component is mounted. + * + * 'always': they always call. The consumer is then responsible of ensuring no + * side effects happen if the underlying component is not mounted. + */ +export declare const useTrackedPromise: ({ createPromise, onResolve, onReject, cancelPreviousOn, triggerOrThrow, }: UseTrackedPromiseArgs, dependencies: DependencyList) => [PromiseState, (...args: Arguments) => Promise, () => void]; +export interface UninitializedPromiseState { + state: 'uninitialized'; +} +export interface PendingPromiseState { + state: 'pending'; + promise: Promise; +} +export interface ResolvedPromiseState { + state: 'resolved'; + promise: Promise; + value: ResolvedValue; +} +export interface RejectedPromiseState { + state: 'rejected'; + promise: Promise; + value: RejectedValue; +} +export type SettledPromiseState = ResolvedPromiseState | RejectedPromiseState; +export type PromiseState = UninitializedPromiseState | PendingPromiseState | SettledPromiseState; +export declare const isRejectedPromiseState: (promiseState: PromiseState) => promiseState is RejectedPromiseState; +export declare class CanceledPromiseError extends Error { + isCanceled: boolean; + constructor(message?: string); +} +export declare class SilentCanceledPromiseError extends CanceledPromiseError { +} +export {}; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/constants.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/constants.d.ts new file mode 100644 index 0000000000000..1077e6bbe7c15 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/constants.d.ts @@ -0,0 +1 @@ +export declare const SAVED_OBJECT_REF_NAME = "savedObjectRef"; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.d.ts new file mode 100644 index 0000000000000..c14aeb90d75c5 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.d.ts @@ -0,0 +1,8 @@ +export interface EmbeddableApiContext { + /** + * TODO: once all actions are entirely decoupled from the embeddable system, this key should be renamed to "api" + * to reflect the fact that this context could contain any api. + */ + embeddable: unknown; +} +export declare const isEmbeddableApiContext: (context: unknown) => context is EmbeddableApiContext; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/index.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/index.d.ts new file mode 100644 index 0000000000000..62c2b30a5da4b --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/index.d.ts @@ -0,0 +1,55 @@ +export { isEmbeddableApiContext, type EmbeddableApiContext } from './embeddable_api_context'; +export { type ComparatorFunction, type StateComparators, type WithAllKeys, runComparator, areComparatorsEqual, diffComparators, initializeStateManager, shouldLogStateDiff, logStateDiff, } from './state_manager'; +export { apiCanAccessViewMode, getInheritedViewMode, getViewModeSubject, type CanAccessViewMode, } from './interfaces/can_access_view_mode'; +export { apiCanLockHoverActions, type CanLockHoverActions, } from './interfaces/can_lock_hover_actions'; +export { fetch$, useFetchContext } from './interfaces/fetch/fetch'; +export type { FetchContext } from './interfaces/fetch/fetch_context'; +export { type PublishesPauseFetch, apiPublishesPauseFetch, type PublishesEditablePauseFetch, apiPublishesEditablePauseFetch, } from './interfaces/fetch/publishes_pause_fetch'; +export { initializeTimeRangeManager, timeRangeComparators, type SerializedTimeRange, } from './interfaces/fetch/time_range_manager'; +export { transformTimeRangeOut } from './interfaces/fetch/bwc/time_range_transforms'; +export { apiPublishesReload, type PublishesReload } from './interfaces/fetch/publishes_reload'; +export { apiAppliesFilters, type AppliesFilters, apiAppliesTimeslice, type AppliesTimeslice, apiHasUseGlobalFiltersSetting, type HasUseGlobalFiltersSetting, } from './interfaces/fetch/applies_filters'; +export { apiPublishesFilters, apiPublishesPartialUnifiedSearch, apiPublishesTimeRange, apiPublishesTimeslice, apiPublishesUnifiedSearch, apiPublishesWritableUnifiedSearch, useSearchApi, type PublishesFilters, type PublishesTimeRange, type PublishesTimeslice, type PublishesUnifiedSearch, type PublishesWritableUnifiedSearch, } from './interfaces/fetch/publishes_unified_search'; +export { apiPublishesProjectRouting, type PublishesProjectRouting, apiPublishesProjectRoutingOverrides, type ProjectRoutingOverrides, type PublishesProjectRoutingOverrides, } from './interfaces/fetch/publishes_project_routing'; +export { apiHasAppContext, type EmbeddableAppContext, type HasAppContext, } from './interfaces/has_app_context'; +export { apiHasDisableTriggers, areTriggersDisabled, type HasDisableTriggers, } from './interfaces/has_disable_triggers'; +export { hasEditCapabilities, type HasEditCapabilities } from './interfaces/has_edit_capabilities'; +export { canOverrideHoverActions, type CanOverrideHoverActions, } from './interfaces/can_override_hover_actions'; +export { hasReadOnlyCapabilities, type HasReadOnlyCapabilities, } from './interfaces/has_read_only_capabilities'; +export { apiHasExecutionContext, type HasExecutionContext, } from './interfaces/has_execution_context'; +export { apiHasLibraryTransforms, type HasLibraryTransforms, } from './interfaces/has_library_transforms'; +export { apiHasParentApi, type HasParentApi } from './interfaces/has_parent_api'; +export { apiHasSerializableState, type HasSerializableState, } from './interfaces/has_serializable_state'; +export { apiHasSupportedTriggers, type HasSupportedTriggers, } from './interfaces/has_supported_triggers'; +export { apiHasType, apiIsOfType, type HasType, type HasTypeDisplayName, } from './interfaces/has_type'; +export { apiHasUniqueId, type HasUniqueId } from './interfaces/has_uuid'; +export { apiPublishesBlockingError, hasBlockingError, type PublishesBlockingError, } from './interfaces/publishes_blocking_error'; +export { apiPublishesDataLoading, type PublishesDataLoading, } from './interfaces/publishes_data_loading'; +export { apiPublishesDataViews, type PublishesDataViews, type PublishesWritableDataViews, } from './interfaces/publishes_data_views'; +export { apiPublishesDisabledActionIds, type PublishesDisabledActionIds, } from './interfaces/publishes_disabled_action_ids'; +export { apiPublishesPhaseEvents, type PhaseEvent, type PhaseEventType, type PublishesPhaseEvents, } from './interfaces/publishes_phase_events'; +export { apiPublishesRendered, type PublishesRendered } from './interfaces/publishes_rendered'; +export { apiPublishesSavedObjectId, type PublishesSavedObjectId, } from './interfaces/publishes_saved_object_id'; +export { apiPublishesUnsavedChanges, type PublishesUnsavedChanges, } from './interfaces/publishes_unsaved_changes'; +export { apiPublishesViewMode, apiPublishesWritableViewMode, type PublishesViewMode, type PublishesWritableViewMode, type ViewMode, } from './interfaces/publishes_view_mode'; +export { apiPublishesDescription, apiPublishesWritableDescription, getDescription, type PublishesDescription, type PublishesWritableDescription, } from './interfaces/titles/publishes_description'; +export { apiPublishesTitle, apiPublishesWritableTitle, getTitle, type PublishesTitle, type PublishesWritableTitle, } from './interfaces/titles/publishes_title'; +export { apiPublishesHideBorder, apiPublishesWritableHideBorder, type PublishesHideBorder, type PublishesWritableHideBorder, } from './interfaces/titles/publishes_hide_border'; +export { initializeTitleManager, stateHasTitles, titleComparators, type TitlesApi, type SerializedTitles, } from './interfaces/titles/title_manager'; +export { transformTitlesOut } from './interfaces/titles/bwc/titles_transforms'; +export { useBatchedPublishingSubjects, usePublishingSubject, useStateFromPublishingSubject, type PublishingSubject, } from './publishing_subject'; +export { SAVED_OBJECT_REF_NAME } from './constants'; +export { convertCamelCasedKeysToSnakeCase } from './utils/snake_case'; +export type { PublishesSearchSession } from './interfaces/fetch/publishes_search_session'; +export { apiCanAddNewPanel, type CanAddNewPanel } from './interfaces/containers/can_add_new_panel'; +export { apiHasSerializedChildState, type HasSerializedChildState, } from './interfaces/containers/child_state'; +export { childrenUnsavedChanges$ } from './interfaces/containers/container_state/children_unsaved_changes'; +export { initializeStateApi } from './interfaces/containers/container_state/initialize_state_api'; +export { apiCanDuplicatePanels, apiCanExpandPanels, apiCanPinPanels, apiHasPinnedPanels, type CanDuplicatePanels, type CanExpandPanels, type CanPinPanels, } from './interfaces/containers/panel_management'; +export { apiCanBeDuplicated, apiCanBeCustomized, apiCanBeExpanded, apiCanBePinned, type IsDuplicable, type IsExpandable, type IsCustomizable, type IsPinnable, type HasPanelCapabilities, } from './interfaces/containers/panel_capabilities'; +export { type CanAddNewSection, apiCanAddNewSection, } from './interfaces/containers/can_add_new_section'; +export { canTrackContentfulRender, type TrackContentfulRender, } from './interfaces/containers/performance_trackers'; +export { type HasLastSavedChildState, apiHasLastSavedChildState, } from './interfaces/containers/last_saved_child_state'; +export { apiIsPresentationContainer, apiPublishesChildren, combineCompatibleChildrenApis, getContainerParentFromAPI, listenForCompatibleApi, apiHasSections, type PanelPackage, type PresentationContainer, type HasSections, } from './interfaces/containers/presentation_container'; +export { apiPublishesSettings, type PublishesSettings, } from './interfaces/containers/publishes_settings'; +export { apiCanFocusPanel, type CanFocusPanel } from './interfaces/containers/can_focus_panel'; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.d.ts new file mode 100644 index 0000000000000..cf85eba0dd68a --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.d.ts @@ -0,0 +1,16 @@ +import type { HasParentApi } from './has_parent_api'; +import type { PublishesViewMode } from './publishes_view_mode'; +/** + * This API can access a view mode, either its own or from its parent API. + */ +export type CanAccessViewMode = Partial | Partial>>; +/** + * A type guard which can be used to determine if a given API has access to a view mode, its own or from its parent. + */ +export declare const apiCanAccessViewMode: (api: unknown) => api is CanAccessViewMode; +/** + * A function which will get the view mode from the API or the parent API. if this api has a view mode AND its + * parent has a view mode, we consider the APIs version the source of truth. + */ +export declare const getInheritedViewMode: (api?: unknown) => import("./publishes_view_mode").ViewMode | undefined; +export declare const getViewModeSubject: (api?: unknown) => import("..").PublishingSubject | undefined; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.d.ts new file mode 100644 index 0000000000000..6614e3bf80bd7 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.d.ts @@ -0,0 +1,9 @@ +import type { PublishingSubject } from '../publishing_subject'; +/** + * This API can lock hover actions + */ +export interface CanLockHoverActions { + hasLockedHoverActions$: PublishingSubject; + lockHoverActions: (lock: boolean) => void; +} +export declare const apiCanLockHoverActions: (api: unknown) => api is CanLockHoverActions; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_override_hover_actions.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_override_hover_actions.d.ts new file mode 100644 index 0000000000000..c2c6b9515f322 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_override_hover_actions.d.ts @@ -0,0 +1,12 @@ +import type { PublishingSubject } from '../publishing_subject'; +/** + * An interface which determines whether the hover actions are overridden by the embeddable + */ +export interface CanOverrideHoverActions { + overrideHoverActions$: PublishingSubject; + OverriddenHoverActionsComponent: React.ComponentType; +} +/** + * A type guard which determines whether or not a given API overrides the hover actions. + */ +export declare const canOverrideHoverActions: (unknownApi: unknown) => unknownApi is CanOverrideHoverActions; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_panel.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_panel.d.ts new file mode 100644 index 0000000000000..3cd53b6c814e9 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_panel.d.ts @@ -0,0 +1,15 @@ +import type { PanelPackage } from './presentation_container'; +/** + * This API can add a new panel as a child. + */ +export interface CanAddNewPanel { + addNewPanel: (panel: PanelPackage, options?: { + displaySuccessMessage?: boolean; + scrollToPanel?: boolean; + beside?: string; + }) => Promise; +} +/** + * A type guard which can be used to determine if a given API can add a new panel. + */ +export declare const apiCanAddNewPanel: (api: unknown) => api is CanAddNewPanel; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_section.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_section.d.ts new file mode 100644 index 0000000000000..224e317b4de2f --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_section.d.ts @@ -0,0 +1,4 @@ +export interface CanAddNewSection { + addNewSection: () => void; +} +export declare const apiCanAddNewSection: (api: unknown) => api is CanAddNewSection; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_focus_panel.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_focus_panel.d.ts new file mode 100644 index 0000000000000..18e4c56218db7 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_focus_panel.d.ts @@ -0,0 +1,10 @@ +/** + * This API can focus a child panel + */ +export interface CanFocusPanel { + setFocusedPanelId: (panelId?: string) => void; +} +/** + * A type guard which can be used to determine if a given API can focus a child panel + */ +export declare const apiCanFocusPanel: (api: unknown) => api is CanFocusPanel; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/child_state.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/child_state.d.ts new file mode 100644 index 0000000000000..2f76b0029a55d --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/child_state.d.ts @@ -0,0 +1,4 @@ +export interface HasSerializedChildState { + getSerializedStateForChild: (childId: string) => SerializedState | undefined; +} +export declare const apiHasSerializedChildState: (api: unknown) => api is HasSerializedChildState; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/children_unsaved_changes.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/children_unsaved_changes.d.ts new file mode 100644 index 0000000000000..3459824289878 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/children_unsaved_changes.d.ts @@ -0,0 +1,11 @@ +import type { PublishingSubject } from '../../../publishing_subject'; +export declare const DEBOUNCE_TIME = 100; +/** + * Create an observable stream of unsaved changes from all react embeddable children + */ +export declare function childrenUnsavedChanges$(children$: PublishingSubject<{ + [key: string]: Api; +}>): import("rxjs").Observable<{ + uuid: string; + hasUnsavedChanges: boolean; +}[]>; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/initialize_state_api.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/initialize_state_api.d.ts new file mode 100644 index 0000000000000..4673a0aa89b20 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/initialize_state_api.d.ts @@ -0,0 +1,9 @@ +import type { HasSerializableState } from '../../has_serializable_state'; +import type { PublishesUnsavedChanges } from '../../publishes_unsaved_changes'; +import { type StateComparators } from '../../../state_manager'; +import type { HasUniqueId } from '../../has_uuid'; +import type { HasParentApi } from '../../has_parent_api'; +export declare const initializeStateApi: ({ uuid, applySerializedState, parentApi, getComparators, defaultState, serializeState, anyStateChange$, }: HasSerializableState & HasUniqueId & HasParentApi & { + getComparators: () => StateComparators; + defaultState?: Partial; +}) => PublishesUnsavedChanges & HasSerializableState; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/last_saved_child_state.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/last_saved_child_state.d.ts new file mode 100644 index 0000000000000..fe0e69019ca42 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/last_saved_child_state.d.ts @@ -0,0 +1,6 @@ +import type { Observable } from 'rxjs'; +export interface HasLastSavedChildState { + lastSavedStateForChild$: (childId: string) => Observable; + getLastSavedStateForChild: (childId: string) => SerializedState | undefined; +} +export declare const apiHasLastSavedChildState: (api: unknown) => api is HasLastSavedChildState; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_capabilities.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_capabilities.d.ts new file mode 100644 index 0000000000000..274985952cc72 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_capabilities.d.ts @@ -0,0 +1,17 @@ +export interface IsDuplicable { + isDuplicable: boolean; +} +export declare const apiCanBeDuplicated: (unknownApi: unknown | null) => unknownApi is IsDuplicable; +export interface IsExpandable { + isExpandable: boolean; +} +export declare const apiCanBeExpanded: (unknownApi: unknown | null) => unknownApi is IsExpandable; +export interface IsCustomizable { + isCustomizable: boolean; +} +export declare const apiCanBeCustomized: (unknownApi: unknown | null) => unknownApi is IsCustomizable; +export interface IsPinnable { + isPinnable: boolean; +} +export declare const apiCanBePinned: (unknownApi: unknown | null) => unknownApi is IsPinnable; +export type HasPanelCapabilities = IsExpandable & IsCustomizable & IsDuplicable & IsPinnable; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_management.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_management.d.ts new file mode 100644 index 0000000000000..7383b0d5ae703 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_management.d.ts @@ -0,0 +1,21 @@ +import type { PublishingSubject } from '../../publishing_subject'; +import type { PanelPackage } from './presentation_container'; +export interface CanDuplicatePanels { + duplicatePanel: (panelId: string) => void; +} +export declare const apiCanDuplicatePanels: (unknownApi: unknown | null) => unknownApi is CanDuplicatePanels; +export interface CanExpandPanels { + expandPanel: (panelId: string) => void; + expandedPanelId$: PublishingSubject; +} +export declare const apiCanExpandPanels: (unknownApi: unknown | null) => unknownApi is CanExpandPanels; +export interface HasPinnedPanels { + panelIsPinned: (panelId: string) => boolean; +} +export interface CanPinPanels extends HasPinnedPanels { + pinPanel: (panelId: string) => void; + unpinPanel: (panelId: string) => void; + addPinnedPanel: (panel: PanelPackage) => Promise; +} +export declare const apiHasPinnedPanels: (api: unknown) => api is HasPinnedPanels; +export declare const apiCanPinPanels: (api: unknown) => api is CanPinPanels; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/performance_trackers.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/performance_trackers.d.ts new file mode 100644 index 0000000000000..27194459d61dc --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/performance_trackers.d.ts @@ -0,0 +1,7 @@ +export interface TrackContentfulRender { + /** + * A way to report that the contentful render has been completed + */ + trackContentfulRender: () => void; +} +export declare const canTrackContentfulRender: (root: unknown) => root is TrackContentfulRender; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/presentation_container.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/presentation_container.d.ts new file mode 100644 index 0000000000000..8349281b9c587 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/presentation_container.d.ts @@ -0,0 +1,54 @@ +import type { Observable } from 'rxjs'; +import type { PublishingSubject } from '../../publishing_subject'; +import type { CanAddNewPanel } from './can_add_new_panel'; +import type { CanAddNewSection } from './can_add_new_section'; +export interface PanelPackage { + panelType: string; + maybePanelId?: string; + /** + * The serialized state of this panel. + */ + serializedState?: SerializedState; +} +export interface PresentationContainer extends CanAddNewPanel { + /** + * Removes a panel from the container. + */ + removePanel: (panelId: string) => void; + /** + * Determines whether or not a container is capable of removing panels. + */ + canRemovePanels?: () => boolean; + /** + * Replaces a panel in the container with a new panel. + */ + replacePanel: (idToRemove: string, newPanel: PanelPackage) => Promise; + /** + * Returns the number of panels in the container. + */ + getPanelCount: () => number; + /** + * Gets a child API for the given ID. This is asynchronous and should await for the + * child API to be available. It is best practice to retrieve a child API using this method + */ + getChildApi: (uuid: string) => Promise; + /** + * A publishing subject containing the child APIs of the container. Note that + * children are created asynchronously. This means that the children$ observable might + * contain fewer children than the actual number of panels in the container. Use getChildApi + * to retrieve the child API for a specific panel. + */ + children$: PublishingSubject<{ + [key: string]: ApiType; + }>; +} +export declare const apiIsPresentationContainer: (api: unknown | null) => api is PresentationContainer; +export interface HasSections extends CanAddNewSection { + getPanelSection: (uuid: string) => string | undefined; + panelSection$: (uuid: string) => Observable; +} +export declare const apiHasSections: (api: unknown) => api is HasSections; +export declare const apiPublishesChildren: (api: unknown | null) => api is Pick; +export declare const getContainerParentFromAPI: (api: null | unknown) => PresentationContainer | undefined; +export declare const listenForCompatibleApi: (parent: unknown, isCompatible: (api: unknown) => api is ApiType, apiFound: (api: ApiType | undefined) => (() => void) | void) => () => void; +export declare const combineCompatibleChildrenApis: (api: unknown, observableKey: keyof ApiType, isCompatible: (api: unknown) => api is ApiType, emptyState: PublishingSubjectType, flattenMethod?: (array: PublishingSubjectType[]) => PublishingSubjectType) => Observable; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/publishes_settings.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/publishes_settings.d.ts new file mode 100644 index 0000000000000..61000e6c4efbd --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/publishes_settings.d.ts @@ -0,0 +1,5 @@ +import type { PublishingSubject } from '../../publishing_subject'; +export interface PublishesSettings { + settings: Record>; +} +export declare const apiPublishesSettings: (unknownApi: null | unknown) => unknownApi is PublishesSettings; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/applies_filters.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/applies_filters.d.ts new file mode 100644 index 0000000000000..8d33615ccfd2e --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/applies_filters.d.ts @@ -0,0 +1,15 @@ +import type { Filter } from '@kbn/es-query'; +import type { PublishingSubject } from '../../publishing_subject'; +export interface AppliesFilters { + filtersLoading$: PublishingSubject; + appliedFilters$: PublishingSubject; +} +export declare const apiAppliesFilters: (unknownApi: unknown) => unknownApi is AppliesFilters; +export interface AppliesTimeslice { + appliedTimeslice$: PublishingSubject<[number, number] | undefined>; +} +export declare const apiAppliesTimeslice: (unknownApi: unknown) => unknownApi is AppliesTimeslice; +export interface HasUseGlobalFiltersSetting { + useGlobalFilters$: PublishingSubject; +} +export declare const apiHasUseGlobalFiltersSetting: (unknownApi: unknown) => unknownApi is HasUseGlobalFiltersSetting; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/bwc/time_range_transforms.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/bwc/time_range_transforms.d.ts new file mode 100644 index 0000000000000..a82d5801bca4f --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/bwc/time_range_transforms.d.ts @@ -0,0 +1,7 @@ +import type { SerializedTimeRange } from '@kbn/presentation-publishing-schemas'; +/** + * Pre 9.4 the time_range state was stored in a camelCased key called timeRange. + * This transform out function ensures that this state is not dropped when loading from + * a legacy stored state. This should only be used for embeddables that existed before 9.4. + */ +export declare const transformTimeRangeOut: >(storedState: StoredStateType) => StoredStateType; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.d.ts new file mode 100644 index 0000000000000..f7030869a7f3e --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.d.ts @@ -0,0 +1,4 @@ +import { type Observable } from 'rxjs'; +import { type FetchContext } from './fetch_context'; +export declare function fetch$(api: unknown): Observable; +export declare const useFetchContext: (api: unknown) => FetchContext; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch_context.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch_context.d.ts new file mode 100644 index 0000000000000..161137b52fe9f --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch_context.d.ts @@ -0,0 +1,21 @@ +import type { AggregateQuery, Filter, Query, TimeRange, ProjectRouting } from '@kbn/es-query'; +import type { ESQLControlVariable } from '@kbn/esql-types'; +export interface FetchContext { + isReload: boolean; + filters: Filter[] | undefined; + query: Query | AggregateQuery | undefined; + searchSessionId: string | undefined; + timeRange: TimeRange | undefined; + timeslice: [number, number] | undefined; + esqlVariables: ESQLControlVariable[] | undefined; + projectRouting: ProjectRouting | undefined; +} +export interface ReloadTimeFetchContext extends Omit { + reloadTimestamp?: number; +} +export declare function isReloadTimeFetchContextEqual(previousContext: ReloadTimeFetchContext, currentContext: ReloadTimeFetchContext): boolean; +export declare const areFiltersEqualForFetch: (currentFilters?: Filter[], lastFilters?: Filter[]) => boolean; +export declare const isReloadTimestampEqualForFetch: (previousReloadTimestamp?: number, currentReloadTimestamp?: number) => boolean; +export declare const isQueryEqualForFetch: (currentQuery: Query | AggregateQuery | undefined, lastQuery: Query | AggregateQuery | undefined) => boolean; +export declare const isTimeRangeEqualForFetch: (currentTimeRange: TimeRange | undefined, lastTimeRange: TimeRange | undefined) => boolean; +export declare const isTimeSliceEqualForFetch: (currentTimeslice: [number, number] | undefined, lastTimeslice: [number, number] | undefined) => boolean; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_pause_fetch.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_pause_fetch.d.ts new file mode 100644 index 0000000000000..f3a7b5b486bbe --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_pause_fetch.d.ts @@ -0,0 +1,9 @@ +import type { Observable } from 'rxjs'; +export interface PublishesPauseFetch { + isFetchPaused$: Observable; +} +export interface PublishesEditablePauseFetch extends PublishesPauseFetch { + setFetchPaused: (paused: boolean) => void; +} +export declare const apiPublishesPauseFetch: (unknownApi: null | unknown) => unknownApi is PublishesPauseFetch; +export declare const apiPublishesEditablePauseFetch: (unknownApi: null | unknown) => unknownApi is PublishesEditablePauseFetch; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_project_routing.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_project_routing.d.ts new file mode 100644 index 0000000000000..333fc541f88cf --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_project_routing.d.ts @@ -0,0 +1,14 @@ +import type { ProjectRouting } from '@kbn/es-query'; +import type { PublishingSubject } from '../../publishing_subject'; +export interface PublishesProjectRouting { + projectRouting$: PublishingSubject; +} +export declare const apiPublishesProjectRouting: (unknownApi: unknown) => unknownApi is PublishesProjectRouting; +export type ProjectRoutingOverrides = { + name?: string; + value: string; +}[] | undefined; +export interface PublishesProjectRoutingOverrides { + projectRoutingOverrides$: PublishingSubject; +} +export declare const apiPublishesProjectRoutingOverrides: (unknownApi: unknown) => unknownApi is PublishesProjectRoutingOverrides; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.d.ts new file mode 100644 index 0000000000000..131dca02644da --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.d.ts @@ -0,0 +1,5 @@ +import type { Observable } from 'rxjs'; +export interface PublishesReload { + reload$: Observable; +} +export declare const apiPublishesReload: (unknownApi: null | unknown) => unknownApi is PublishesReload; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.d.ts new file mode 100644 index 0000000000000..fe6bb44523474 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.d.ts @@ -0,0 +1,6 @@ +import type { PublishingSubject } from '../../publishing_subject'; +export interface PublishesSearchSession { + searchSessionId$: PublishingSubject; + requestSearchSessionId?: () => Promise; +} +export declare const apiPublishesSearchSession: (unknownApi: null | unknown) => unknownApi is PublishesSearchSession; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.d.ts new file mode 100644 index 0000000000000..849ed7311656c --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.d.ts @@ -0,0 +1,43 @@ +import type { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query'; +import { BehaviorSubject } from 'rxjs'; +import type { PublishingSubject } from '../../publishing_subject'; +export interface PublishesTimeslice { + timeslice$: PublishingSubject<[number, number] | undefined>; +} +export interface PublishesTimeRange extends Partial { + timeRange$: PublishingSubject; + timeRestore$?: PublishingSubject; +} +export type PublishesWritableTimeRange = PublishesTimeRange & { + setTimeRange: (timeRange: TimeRange | undefined) => void; +}; +export interface PublishesFilters { + filters$: PublishingSubject; +} +export type PublishesUnifiedSearch = PublishesTimeRange & PublishesFilters & { + isCompatibleWithUnifiedSearch?: () => boolean; + canEditUnifiedSearch?: () => boolean; + query$: PublishingSubject; +}; +export type PublishesWritableUnifiedSearch = PublishesUnifiedSearch & PublishesWritableTimeRange & { + setFilters: (filters: Filter[] | undefined) => void; + setQuery: (query: Query | undefined) => void; +}; +export declare const apiPublishesTimeslice: (unknownApi: null | unknown) => unknownApi is PublishesTimeslice; +export declare const apiPublishesTimeRange: (unknownApi: null | unknown) => unknownApi is PublishesTimeRange; +export declare const apiPublishesFilters: (unknownApi: unknown) => unknownApi is PublishesFilters; +export declare const apiPublishesUnifiedSearch: (unknownApi: null | unknown) => unknownApi is PublishesUnifiedSearch; +export declare const apiPublishesPartialUnifiedSearch: (unknownApi: null | unknown) => unknownApi is Partial; +export declare const apiPublishesWritableUnifiedSearch: (unknownApi: null | unknown) => unknownApi is PublishesWritableUnifiedSearch; +/** + * React hook that converts search props into search observable API + */ +export declare function useSearchApi({ filters, query, timeRange, }: { + filters?: Filter[]; + query?: Query | AggregateQuery; + timeRange?: TimeRange; +}): { + filters$: BehaviorSubject; + query$: BehaviorSubject; + timeRange$: BehaviorSubject; +}; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/time_range_manager.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/time_range_manager.d.ts new file mode 100644 index 0000000000000..f995acb6415cf --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/time_range_manager.d.ts @@ -0,0 +1,6 @@ +import type { SerializedTimeRange } from '@kbn/presentation-publishing-schemas'; +import type { StateManager } from '../../state_manager/types'; +import type { StateComparators } from '../../state_manager'; +export type { SerializedTimeRange } from '@kbn/presentation-publishing-schemas'; +export declare const timeRangeComparators: StateComparators; +export declare const initializeTimeRangeManager: (initialTimeRangeState: SerializedTimeRange) => StateManager; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.d.ts new file mode 100644 index 0000000000000..98a7f820fc35f --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.d.ts @@ -0,0 +1,11 @@ +export interface EmbeddableAppContext { + /** + * Current app's path including query and hash starting from {appId} + */ + getCurrentPath?: () => string; + currentAppId: string; +} +export interface HasAppContext { + getAppContext: () => EmbeddableAppContext; +} +export declare const apiHasAppContext: (unknownApi: unknown) => unknownApi is HasAppContext; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.d.ts new file mode 100644 index 0000000000000..1239de08c5af0 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.d.ts @@ -0,0 +1,5 @@ +export interface HasDisableTriggers { + disableTriggers: boolean; +} +export declare const apiHasDisableTriggers: (api: unknown | null) => api is HasDisableTriggers; +export declare function areTriggersDisabled(api?: unknown): boolean; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.d.ts new file mode 100644 index 0000000000000..49044d57cf384 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.d.ts @@ -0,0 +1,18 @@ +import type { HasTypeDisplayName } from './has_type'; +/** + * An interface which determines whether or not a given API is editable. + * In order to be editable, the api requires an edit function to execute the action + * a getTypeDisplayName function to display to the user which type of chart is being + * edited, and an isEditingEnabled function. + */ +export interface HasEditCapabilities extends HasTypeDisplayName { + onEdit: ({ isNewPanel }?: { + isNewPanel?: boolean; + }) => Promise; + isEditingEnabled: () => boolean; + getEditHref?: () => Promise; +} +/** + * A type guard which determines whether or not a given API is editable. + */ +export declare const hasEditCapabilities: (root: unknown) => root is HasEditCapabilities; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.d.ts new file mode 100644 index 0000000000000..cab98dc2d6fbc --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.d.ts @@ -0,0 +1,5 @@ +import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; +export interface HasExecutionContext { + executionContext: KibanaExecutionContext; +} +export declare const apiHasExecutionContext: (unknownApi: null | unknown) => unknownApi is HasExecutionContext; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.d.ts new file mode 100644 index 0000000000000..39a55eefdb35e --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.d.ts @@ -0,0 +1,40 @@ +/** + * APIs that inherit this interface can be linked to and unlinked from the library. + */ +export interface HasLibraryTransforms { + /** + * @returns {Promise} + */ + hasLibraryItemWithTitle: (title: string) => Promise; + /** + * + * @returns {Promise} + * Returns true when this API is by-value and can be converted to by-reference + */ + canLinkToLibrary: () => Promise; + /** + * + * @returns {Promise} + * Returns true when this API is by-reference and can be converted to by-value + */ + canUnlinkFromLibrary: () => Promise; + /** + * Save the state of this API to the library. This will return the ID of the persisted library item. + * + * @returns {Promise} id of persisted library item + */ + saveToLibrary: (title: string) => Promise; + /** + * + * @returns {ByReferenceSerializedState} + * get by-reference serialized state from this API. + */ + getSerializedStateByReference: (newId: string) => ByReferenceSerializedState; + /** + * + * @returns {ByValueSerializedState} + * get by-value serialized state from this API + */ + getSerializedStateByValue: () => ByValueSerializedState; +} +export declare const apiHasLibraryTransforms: (unknownApi: null | unknown) => unknownApi is HasLibraryTransforms; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.d.ts new file mode 100644 index 0000000000000..d7ee41588f6d5 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.d.ts @@ -0,0 +1,7 @@ +export interface HasParentApi { + parentApi: ParentApiType; +} +/** + * A type guard which checks whether or not a given API has a parent API. + */ +export declare const apiHasParentApi: (unknownApi: null | unknown) => unknownApi is HasParentApi; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_read_only_capabilities.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_read_only_capabilities.d.ts new file mode 100644 index 0000000000000..1a980b9d579d2 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_read_only_capabilities.d.ts @@ -0,0 +1,18 @@ +import type { HasTypeDisplayName } from './has_type'; +/** + * An interface which determines whether or not a given API offers to show the config for read only permissions. + * In order to be read only, the api requires a show config function to execute the action + * a getTypeDisplayName function to display to the user which type of chart is being + * shown, and an isReadOnlyEnabled function. + */ +export interface HasReadOnlyCapabilities extends HasTypeDisplayName { + onShowConfig: () => Promise; + isReadOnlyEnabled: () => { + read: boolean; + write: boolean; + }; +} +/** + * A type guard which determines whether or not a given API is editable. + */ +export declare const hasReadOnlyCapabilities: (root: unknown) => root is HasReadOnlyCapabilities; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_serializable_state.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_serializable_state.d.ts new file mode 100644 index 0000000000000..bee86ff3fa792 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_serializable_state.d.ts @@ -0,0 +1,21 @@ +import type { MaybePromise } from '@kbn/utility-types'; +import type { Observable } from 'rxjs'; +export interface HasSerializableState { + /** + * Emit on any state change. + * + * Must not emit on subscribe. + * Must not debounce. + */ + anyStateChange$: Observable; + /** + * Serializes all state into a format that can be saved into + * some external store. The opposite of `deserialize` in the {@link ReactEmbeddableFactory} + */ + serializeState: () => SerializedState; + /** + * Applies a serialized state snapshot owned by the parent container. + */ + applySerializedState: (state: SerializedState) => MaybePromise; +} +export declare const apiHasSerializableState: (api: unknown | null) => api is HasSerializableState; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.d.ts new file mode 100644 index 0000000000000..b246b5dbaec44 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.d.ts @@ -0,0 +1,4 @@ +export interface HasSupportedTriggers { + supportedTriggers: () => string[]; +} +export declare const apiHasSupportedTriggers: (api: unknown | null) => api is HasSupportedTriggers; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.d.ts new file mode 100644 index 0000000000000..99e57318335f9 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.d.ts @@ -0,0 +1,9 @@ +export interface HasType { + type: T; +} +export interface HasTypeDisplayName { + getTypeDisplayName: () => string; + getTypeDisplayNameLowerCase?: () => string; +} +export declare const apiHasType: (api: unknown | null) => api is HasType; +export declare const apiIsOfType: (api: unknown | null, typeToCheck: T) => api is HasType; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.d.ts new file mode 100644 index 0000000000000..346a153af4f69 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.d.ts @@ -0,0 +1,4 @@ +export interface HasUniqueId { + uuid: string; +} +export declare const apiHasUniqueId: (unknownApi: null | unknown) => unknownApi is HasUniqueId; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.d.ts new file mode 100644 index 0000000000000..81c2c8a67565e --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.d.ts @@ -0,0 +1,6 @@ +import type { PublishingSubject } from '../publishing_subject'; +export interface PublishesBlockingError { + blockingError$: PublishingSubject; +} +export declare const apiPublishesBlockingError: (unknownApi: null | unknown) => unknownApi is PublishesBlockingError; +export declare function hasBlockingError(api: unknown): boolean; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.d.ts new file mode 100644 index 0000000000000..0fa8f897ade3f --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.d.ts @@ -0,0 +1,5 @@ +import type { PublishingSubject } from '../publishing_subject'; +export interface PublishesDataLoading { + dataLoading$: PublishingSubject; +} +export declare const apiPublishesDataLoading: (unknownApi: null | unknown) => unknownApi is PublishesDataLoading; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.d.ts new file mode 100644 index 0000000000000..fb8f7c84e6bb7 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.d.ts @@ -0,0 +1,12 @@ +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { PublishingSubject } from '../publishing_subject'; +/** + * This API publishes a list of data views that it uses. + */ +export interface PublishesDataViews { + dataViews$: PublishingSubject; +} +export type PublishesWritableDataViews = PublishesDataViews & { + setDataViews: (dataViews: DataView[]) => void; +}; +export declare const apiPublishesDataViews: (unknownApi: null | unknown) => unknownApi is PublishesDataViews; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.d.ts new file mode 100644 index 0000000000000..dee59e471b4a8 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.d.ts @@ -0,0 +1,11 @@ +import type { PublishingSubject } from '../publishing_subject'; +export interface PublishesDisabledActionIds { + disabledActionIds$: PublishingSubject; + setDisabledActionIds: (ids: string[] | undefined) => void; + getAllTriggersDisabled?: () => boolean; +} +/** + * A type guard which checks whether or not a given API publishes Disabled Action IDs. This can be used + * to programatically limit which actions are available on a per-API basis. + */ +export declare const apiPublishesDisabledActionIds: (unknownApi: null | unknown) => unknownApi is PublishesDisabledActionIds; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.d.ts new file mode 100644 index 0000000000000..851f35acf8bc0 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.d.ts @@ -0,0 +1,16 @@ +import type { ErrorLike } from '@kbn/expressions-plugin/common'; +import type { PublishingSubject } from '../publishing_subject'; +/** ------------------------------------------------------------------------------------------ + * Performance Tracking Types + * ------------------------------------------------------------------------------------------ */ +export type PhaseEventType = 'loading' | 'loaded' | 'rendered' | 'error'; +export interface PhaseEvent { + id: string; + status: PhaseEventType; + error?: ErrorLike; + timeToEvent: number; +} +export interface PublishesPhaseEvents { + phase$: PublishingSubject; +} +export declare const apiPublishesPhaseEvents: (unknownApi: null | unknown) => unknownApi is PublishesPhaseEvents; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.d.ts new file mode 100644 index 0000000000000..d67b23aee8eca --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.d.ts @@ -0,0 +1,5 @@ +import type { PublishingSubject } from '../publishing_subject'; +export interface PublishesRendered { + rendered$: PublishingSubject; +} +export declare const apiPublishesRendered: (unknownApi: null | unknown) => unknownApi is PublishesRendered; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.d.ts new file mode 100644 index 0000000000000..c48b9872b691f --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.d.ts @@ -0,0 +1,11 @@ +import type { PublishingSubject } from '../publishing_subject'; +/** + * This API publishes a saved object id which can be used to determine which saved object this API is linked to. + */ +export interface PublishesSavedObjectId { + savedObjectId$: PublishingSubject; +} +/** + * A type guard which can be used to determine if a given API publishes a saved object id. + */ +export declare const apiPublishesSavedObjectId: (unknownApi: null | unknown) => unknownApi is PublishesSavedObjectId; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.d.ts new file mode 100644 index 0000000000000..3ae88b4d30ae0 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.d.ts @@ -0,0 +1,5 @@ +import type { Observable } from 'rxjs'; +export interface PublishesUnsavedChanges { + hasUnsavedChanges$: Observable; +} +export declare const apiPublishesUnsavedChanges: (api: unknown) => api is PublishesUnsavedChanges; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.d.ts new file mode 100644 index 0000000000000..1dc258428d8cf --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.d.ts @@ -0,0 +1,21 @@ +import type { PublishingSubject } from '../publishing_subject'; +export type ViewMode = 'view' | 'edit' | 'print' | 'preview'; +/** + * This API publishes a universal view mode which can change compatibility of actions and the + * visibility of components. + */ +export interface PublishesViewMode { + viewMode$: PublishingSubject; +} +/** + * This API publishes a writable universal view mode which can change compatibility of actions and the + * visibility of components. + */ +export type PublishesWritableViewMode = PublishesViewMode & { + setViewMode: (viewMode: ViewMode) => void; +}; +/** + * A type guard which can be used to determine if a given API publishes a view mode. + */ +export declare const apiPublishesViewMode: (unknownApi: null | unknown) => unknownApi is PublishesViewMode; +export declare const apiPublishesWritableViewMode: (unknownApi: null | unknown) => unknownApi is PublishesWritableViewMode; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/bwc/titles_transforms.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/bwc/titles_transforms.d.ts new file mode 100644 index 0000000000000..cb382484f5c36 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/bwc/titles_transforms.d.ts @@ -0,0 +1,7 @@ +import type { SerializedTitles } from '@kbn/presentation-publishing-schemas'; +/** + * Pre 9.4 the hide_titles state was stored in a camelCased key called hidePanelTitles. + * This transform out function ensures that this state is not dropped when loading from + * a legacy stored state. This should only be used for embeddables that existed before 9.4. + */ +export declare const transformTitlesOut: (storedState: StoredStateType) => StoredStateType; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_description.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_description.d.ts new file mode 100644 index 0000000000000..e4a5bb5a0a2d4 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_description.d.ts @@ -0,0 +1,11 @@ +import type { PublishingSubject } from '../../publishing_subject'; +export interface PublishesDescription { + description$: PublishingSubject; + defaultDescription$?: PublishingSubject; +} +export declare function getDescription(api: Partial): string | undefined; +export type PublishesWritableDescription = PublishesDescription & { + setDescription: (newTitle: string | undefined) => void; +}; +export declare const apiPublishesDescription: (unknownApi: null | unknown) => unknownApi is PublishesDescription; +export declare const apiPublishesWritableDescription: (unknownApi: null | unknown) => unknownApi is PublishesWritableDescription; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_hide_border.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_hide_border.d.ts new file mode 100644 index 0000000000000..d4c7e815c6ff2 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_hide_border.d.ts @@ -0,0 +1,9 @@ +import type { PublishingSubject } from '../../publishing_subject'; +export interface PublishesHideBorder { + hideBorder$: PublishingSubject; +} +export type PublishesWritableHideBorder = PublishesHideBorder & { + setHideBorder: (hideBorder: boolean | undefined) => void; +}; +export declare const apiPublishesHideBorder: (unknownApi: unknown | null) => unknownApi is PublishesHideBorder; +export declare const apiPublishesWritableHideBorder: (unknownApi: unknown | null) => unknownApi is PublishesWritableHideBorder; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_title.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_title.d.ts new file mode 100644 index 0000000000000..0594ac24bc828 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_title.d.ts @@ -0,0 +1,13 @@ +import type { PublishingSubject } from '../../publishing_subject'; +export interface PublishesTitle { + title$: PublishingSubject; + hideTitle$: PublishingSubject; + defaultTitle$?: PublishingSubject; +} +export declare function getTitle(api: Partial): string | undefined; +export type PublishesWritableTitle = PublishesTitle & { + setTitle: (newTitle: string | undefined) => void; + setHideTitle: (hide: boolean | undefined) => void; +}; +export declare const apiPublishesTitle: (unknownApi: null | unknown) => unknownApi is PublishesTitle; +export declare const apiPublishesWritableTitle: (unknownApi: null | unknown) => unknownApi is PublishesWritableTitle; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/title_manager.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/title_manager.d.ts new file mode 100644 index 0000000000000..93518d0a0b78e --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/title_manager.d.ts @@ -0,0 +1,14 @@ +import type { SerializedTitles } from '@kbn/presentation-publishing-schemas'; +import type { StateComparators, StateManager } from '../../state_manager/types'; +import type { PublishesWritableDescription } from './publishes_description'; +import type { PublishesWritableTitle } from './publishes_title'; +import type { PublishesWritableHideBorder } from './publishes_hide_border'; +export type { SerializedTitles } from '@kbn/presentation-publishing-schemas'; +export type TitleManager = { + api: PublishesWritableTitle & PublishesWritableDescription & PublishesWritableHideBorder; +} & Pick, 'anyStateChange$' | 'getLatestState' | 'reinitializeState'>; +export declare const titleComparators: StateComparators; +export declare const stateHasTitles: (state: unknown) => state is SerializedTitles; +export interface TitlesApi extends PublishesWritableTitle, PublishesWritableDescription, PublishesWritableHideBorder { +} +export declare const initializeTitleManager: (initialTitlesState: SerializedTitles) => TitleManager; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.d.ts new file mode 100644 index 0000000000000..163e46fd8697f --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.d.ts @@ -0,0 +1,3 @@ +export { useBatchedPublishingSubjects } from './publishing_batcher'; +export { useStateFromPublishingSubject, usePublishingSubject } from './publishing_subject'; +export type { PublishingSubject, ValueFromPublishingSubject, UnwrapPublishingSubjectTuple, } from './types'; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.d.ts new file mode 100644 index 0000000000000..f3c6bb7573933 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.d.ts @@ -0,0 +1,10 @@ +import type { PublishingSubject, UnwrapPublishingSubjectTuple } from './types'; +/** + * Batches the latest values of multiple publishing subjects into a single object. Use this to avoid unnecessary re-renders. + * Use when `subjects` are static and do not change over the lifetime of the component. + * + * Do not use when value is used as an input value to avoid debouncing user interactions + * + * @param subjects Publishing subjects array. + */ +export declare const useBatchedPublishingSubjects: >]>(...subjects: [...SubjectsType]) => UnwrapPublishingSubjectTuple; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.d.ts new file mode 100644 index 0000000000000..3befb54511154 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.d.ts @@ -0,0 +1,12 @@ +import type { PublishingSubject, ValueFromPublishingSubject } from './types'; +/** + * Declares a publishing subject, allowing external code to subscribe to react state changes. + * Changes to state fire subject.next + * @param state React state from useState hook. + */ +export declare const usePublishingSubject: (state: T) => PublishingSubject; +/** + * Declares a state variable that is synced with a publishing subject value. + * @param subject Publishing subject. + */ +export declare const useStateFromPublishingSubject: >(subject: SubjectType) => ValueFromPublishingSubject; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.d.ts new file mode 100644 index 0000000000000..69d45997e5156 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.d.ts @@ -0,0 +1,13 @@ +import type { BehaviorSubject } from 'rxjs'; +/** + * A publishing subject is a RxJS subject that can be used to listen to value changes, but does not allow pushing values via the Next method. + */ +export type PublishingSubject = Omit, 'next'>; +type AnyValue = any; +export type AnyPublishingSubject = PublishingSubject | undefined; +export type ValueFromPublishingSubject | undefined = PublishingSubject | undefined> = T extends PublishingSubject ? ValueType : T extends undefined ? undefined : never; +export type UnwrapPublishingSubjectTuple = T extends [ + infer Head extends AnyPublishingSubject, + ...infer Tail extends AnyPublishingSubject[] +] ? [ValueFromPublishingSubject, ...UnwrapPublishingSubjectTuple] : []; +export {}; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/index.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/index.d.ts new file mode 100644 index 0000000000000..9b54858878898 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/index.d.ts @@ -0,0 +1,4 @@ +export { shouldLogStateDiff, logStateDiff } from './state_diff_logger'; +export { areComparatorsEqual, diffComparators, runComparator } from './state_comparators'; +export { initializeStateManager } from './state_manager'; +export type { ComparatorFunction, StateComparators, WithAllKeys } from './types'; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_comparators.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_comparators.d.ts new file mode 100644 index 0000000000000..d4fe79e4a30a4 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_comparators.d.ts @@ -0,0 +1,10 @@ +import type { StateComparators } from './types'; +export declare const runComparator: (comparator: StateComparators[keyof StateType], lastSavedState?: Partial, latestState?: Partial, lastSavedValue?: StateType[keyof StateType], latestValue?: StateType[keyof StateType]) => boolean; +/** + * Run all comparators, and return an object containing only the keys that are not equal, set to the value of the latest state + */ +export declare const diffComparators: (comparators: StateComparators, lastSavedState?: Partial, latestState?: Partial, defaultState?: Partial) => Partial; +/** + * Run comparators until at least one returns false + */ +export declare const areComparatorsEqual: (comparators: StateComparators, lastSavedState?: StateType, currentState?: StateType, defaultState?: Partial, getCustomLogLabel?: (key: string) => string) => boolean; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_diff_logger.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_diff_logger.d.ts new file mode 100644 index 0000000000000..e0500789d713e --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_diff_logger.d.ts @@ -0,0 +1,5 @@ +export declare function shouldLogStateDiff(): boolean; +/** + * Conditional (window.ELASTIC_PRESENTATION_LOGGER needs to be set to true) logger function + */ +export declare function logStateDiff(label: string, lastValue: unknown, currentValue: unknown): Promise; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_manager.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_manager.d.ts new file mode 100644 index 0000000000000..fa7accbfad88d --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_manager.d.ts @@ -0,0 +1,8 @@ +import type { StateComparators, StateManager, WithAllKeys } from './types'; +/** + * Initializes a composable state manager instance for a given state type. + * @param initialState - The initial state of the state manager. + * @param defaultState - The default state of the state manager. Every key in this state must be present, for optional keys specify undefined explicly. + * @param comparators - Optional StateComparators. When provided, subject will only emit when value changes. + */ +export declare const initializeStateManager: (initialState: Partial, defaultState: WithAllKeys, comparators?: StateComparators) => StateManager; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/types.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/types.d.ts new file mode 100644 index 0000000000000..7137b3d26f259 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/types.d.ts @@ -0,0 +1,29 @@ +import type { Observable } from 'rxjs'; +import type { PublishingSubject } from '../publishing_subject'; +import type { SnakeToCamelCase } from '../utils/types'; +export type WithAllKeys = { + [Key in keyof Required]: T[Key]; +}; +export type ComparatorFunction = (last: StateType[KeyType] | undefined, current: StateType[KeyType] | undefined, lastState?: Partial, currentState?: Partial) => boolean; +/** + * A type that maps each key in a state type to a definition of how it should be compared. If a custom + * comparator is provided, return true if the values are equal, false otherwise. + */ +export type StateComparators = { + [KeyType in keyof Required]: 'referenceEquality' | 'deepEquality' | 'skip' | ComparatorFunction; +}; +export type CustomComparators = { + [KeyType in keyof StateType]?: ComparatorFunction; +}; +export type SubjectsOf = { + [KeyType in keyof Required as `${SnakeToCamelCase}$`]: PublishingSubject; +}; +export type SettersOf = { + [KeyType in keyof Required as `set${Capitalize>}`]: (value: T[KeyType]) => void; +}; +export interface StateManager { + getLatestState: () => WithAllKeys; + reinitializeState: (newState?: Partial, comparators?: StateComparators) => void; + api: SettersOf & SubjectsOf; + anyStateChange$: Observable; +} diff --git a/src/platform/packages/shared/presentation/presentation_publishing/utils/snake_case.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/utils/snake_case.d.ts new file mode 100644 index 0000000000000..27adbbc51fe80 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/utils/snake_case.d.ts @@ -0,0 +1,7 @@ +import type { SnakeCasedKeys } from './types'; +/** + * This function takes an object and recursively converts all of the keys to `snaked_cased` + * @param input The object with `camelCased` keys + * @returns The object with `snake_cased` keys + */ +export declare const convertCamelCasedKeysToSnakeCase: (input: StateType) => SnakeCasedKeys; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/utils/types.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/utils/types.d.ts new file mode 100644 index 0000000000000..a4786ec80ae72 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_publishing/utils/types.d.ts @@ -0,0 +1,14 @@ +/** + * A type that converts a single key from snake case to camel case. + */ +export type SnakeToCamelCase = S extends `${infer P1}_${infer P2}${infer P3}` ? `${P1}${Uppercase}${SnakeToCamelCase}` : S; +/** + * A type that converts a single key from camel case to snake case. + */ +export type CamelToSnakeCase = S extends `${infer C}${infer R}` ? `${C extends Lowercase ? '' : '_'}${Lowercase}${CamelToSnakeCase}` : S; +/** + * A type that recursively converts all keys in an object from camel case to snake case. + */ +export type SnakeCasedKeys = { + [KeyType in keyof StateType as `${CamelToSnakeCase}`]: StateType[KeyType] extends object ? StateType[KeyType] extends Array ? StateType[KeyType] : SnakeCasedKeys : StateType[KeyType]; +}; diff --git a/src/platform/packages/shared/presentation/presentation_util/index.d.ts b/src/platform/packages/shared/presentation/presentation_util/index.d.ts new file mode 100644 index 0000000000000..5dec67a4b55d5 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_util/index.d.ts @@ -0,0 +1,2 @@ +export { openLazyFlyout } from './src/open_lazy_flyout'; +export { tracksOverlays, type TracksOverlays } from './src/tracks_overlays'; diff --git a/src/platform/packages/shared/presentation/presentation_util/src/focus_helpers.d.ts b/src/platform/packages/shared/presentation/presentation_util/src/focus_helpers.d.ts new file mode 100644 index 0000000000000..28db792feac34 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_util/src/focus_helpers.d.ts @@ -0,0 +1 @@ +export declare const focusFirstFocusable: (elId: Element | null) => void; diff --git a/src/platform/packages/shared/presentation/presentation_util/src/loading_flyout.d.ts b/src/platform/packages/shared/presentation/presentation_util/src/loading_flyout.d.ts new file mode 100644 index 0000000000000..c81121215af22 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_util/src/loading_flyout.d.ts @@ -0,0 +1,2 @@ +import React from 'react'; +export declare const LoadingFlyout: React.JSX.Element; diff --git a/src/platform/packages/shared/presentation/presentation_util/src/open_lazy_flyout.d.ts b/src/platform/packages/shared/presentation/presentation_util/src/open_lazy_flyout.d.ts new file mode 100644 index 0000000000000..50450a4fe3a1f --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_util/src/open_lazy_flyout.d.ts @@ -0,0 +1,35 @@ +import type { CoreStart, OverlayFlyoutOpenOptions } from '@kbn/core/public'; +interface LoadContentArgs { + closeFlyout: () => void; + ariaLabelledBy: string; +} +interface OpenLazyFlyoutParams { + core: CoreStart; + parentApi?: unknown; + loadContent: (args: LoadContentArgs) => Promise; + flyoutProps?: Partial & { + triggerId?: string; + focusedPanelId?: string; + }; +} +/** + * Opens a flyout panel with lazily loaded content. + * + * This helper handles: + * - Mounting a flyout panel with async content. + * - Automatically focusing the flyout when content is ready. + * - Tracking the flyout if `parentApi` supports overlay tracking. + * - Returning focus to a trigger element when the flyout closes. + * + * @param params - Configuration object. + * @param params.core - The `CoreStart` contract, used for overlays and notifications. + * @param params.loadContent - Async function that loads the flyout content. Must return a valid React element. + * If it resolves to `null` or `undefined`, the flyout will close automatically. + * @param params.flyoutProps - Optional props passed to `openFlyout` (e.g. size, className, etc). + * Supports `OverlayFlyoutOpenOptions`. + * @param params.parentApi - Optional parent API to track opened overlays (e.g. dashboardsApi). + * + * @returns A handle to the opened flyout (`OverlayRef`). + */ +export declare const openLazyFlyout: (params: OpenLazyFlyoutParams) => import("@kbn/core/public").OverlayRef; +export {}; diff --git a/src/platform/packages/shared/presentation/presentation_util/src/tracks_overlays.d.ts b/src/platform/packages/shared/presentation/presentation_util/src/tracks_overlays.d.ts new file mode 100644 index 0000000000000..ecb025ecae074 --- /dev/null +++ b/src/platform/packages/shared/presentation/presentation_util/src/tracks_overlays.d.ts @@ -0,0 +1,47 @@ +import type { EuiFlyoutProps } from '@elastic/eui'; +import type { OverlayRef } from '@kbn/core-mount-utils-browser'; +/** + * Options for tracking overlays. + * + * @public + */ +export interface TracksOverlaysOptions { + /** + * If present, the panel with this ID will be focused when the overlay is opened. This can be used in tandem with a push + * flyout to edit a panel's settings in context + */ + focusedPanelId?: string; +} +/** + * API for tracking overlays. + * + * Used by parent containers (like dashboards) to track opened overlays (e.g. flyouts) and clear them when needed. + * + * @public + */ +export interface TracksOverlays { + /** + * Preferred flyout type for panel flyouts opened from this host (`push` pushes app content, `overlay` opens above layout). + */ + panelFlyoutType?: EuiFlyoutProps['type']; + /** + * Registers an overlay. + * + * @param ref - The overlay reference to track. + * @param options - Optional options such as `focusedPanelId` for context. + */ + openOverlay: (ref: OverlayRef, options?: TracksOverlaysOptions) => void; + /** + * Clears all tracked overlays. + * + * Typically called when the container is destroyed or when overlays should be force-closed. + */ + clearOverlays: () => void; +} +/** + * Type guard to check if an object implements {@link TracksOverlays}. + * + * @param root - The object to check. + * @returns `true` if the object has `openOverlay` and `clearOverlays` methods. + */ +export declare const tracksOverlays: (root: unknown) => root is TracksOverlays; diff --git a/src/platform/packages/shared/react/kibana_mount/index.d.ts b/src/platform/packages/shared/react/kibana_mount/index.d.ts new file mode 100644 index 0000000000000..ecfc58348fdb4 --- /dev/null +++ b/src/platform/packages/shared/react/kibana_mount/index.d.ts @@ -0,0 +1,5 @@ +export { toMountPoint } from './to_mount_point'; +export type { ToMountPointParams } from './to_mount_point'; +export { MountPointPortal } from './mount_point_portal'; +export type { MountPointPortalProps } from './mount_point_portal'; +export { useIfMounted } from './utils'; diff --git a/src/platform/packages/shared/react/kibana_mount/mount_point_portal.d.ts b/src/platform/packages/shared/react/kibana_mount/mount_point_portal.d.ts new file mode 100644 index 0000000000000..a223a5e0af8e3 --- /dev/null +++ b/src/platform/packages/shared/react/kibana_mount/mount_point_portal.d.ts @@ -0,0 +1,14 @@ +import type { FC, PropsWithChildren } from 'react'; +import React from 'react'; +import type { MountPoint } from '@kbn/core-mount-utils-browser'; +export interface MountPointPortalProps { + setMountPoint: SetMountPointFn; + children: React.ReactNode; +} +type SetMountPointFn = (mountPoint: MountPoint | undefined) => UnsetMountPointFn | void; +type UnsetMountPointFn = () => void; +/** + * Utility component to portal a part of a react application into the provided `MountPoint`. + */ +export declare const MountPointPortal: FC>; +export {}; diff --git a/src/platform/packages/shared/react/kibana_mount/to_mount_point.d.ts b/src/platform/packages/shared/react/kibana_mount/to_mount_point.d.ts new file mode 100644 index 0000000000000..3b1d6e259fc5d --- /dev/null +++ b/src/platform/packages/shared/react/kibana_mount/to_mount_point.d.ts @@ -0,0 +1,17 @@ +import type { MountPoint } from '@kbn/core-mount-utils-browser'; +import type { RenderingService } from '@kbn/core-rendering-browser'; +import type { KibanaRenderContextProviderProps } from '@kbn/react-kibana-context-render'; +import React from 'react'; +/** + * @deprecated Pass RenderingService as the second parameter to toMountPoint instead + */ +type ToMountPointParamsDeprecated = Pick; +export type ToMountPointParams = ToMountPointParamsDeprecated | RenderingService; +/** + * MountPoint converter for react nodes. + * + * @param node React node to get a mount point for + * @param params services needed for rendering fully-featured React nodes in Kibana + */ +export declare const toMountPoint: (node: React.ReactNode, params: ToMountPointParams) => MountPoint; +export {}; diff --git a/src/platform/packages/shared/react/kibana_mount/utils.d.ts b/src/platform/packages/shared/react/kibana_mount/utils.d.ts new file mode 100644 index 0000000000000..c099c392c5c1e --- /dev/null +++ b/src/platform/packages/shared/react/kibana_mount/utils.d.ts @@ -0,0 +1 @@ +export declare const useIfMounted: () => (func?: () => void) => void; diff --git a/src/platform/packages/shared/shared-ux/avatar/solution/index.d.ts b/src/platform/packages/shared/shared-ux/avatar/solution/index.d.ts new file mode 100644 index 0000000000000..d9e5cbff58a40 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/avatar/solution/index.d.ts @@ -0,0 +1,2 @@ +export { KibanaSolutionAvatar } from './src/solution_avatar'; +export type { KibanaSolutionAvatarProps } from './src/solution_avatar'; diff --git a/src/platform/packages/shared/shared-ux/avatar/solution/src/solution_avatar.d.ts b/src/platform/packages/shared/shared-ux/avatar/solution/src/solution_avatar.d.ts new file mode 100644 index 0000000000000..811274df5b837 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/avatar/solution/src/solution_avatar.d.ts @@ -0,0 +1,24 @@ +import React from 'react'; +import type { DistributiveOmit, EuiAvatarProps, IconType } from '@elastic/eui'; +import type { SolutionNameType } from './types'; +export type KnownSolutionProps = DistributiveOmit & { + /** + * Any EuiAvatar size available, or `xxl` for custom large, brand-focused version + */ + size?: EuiAvatarProps['size'] | 'xxl'; + name: SolutionNameType; +}; +export type IconTypeProps = DistributiveOmit & { + /** + * Any EuiAvatar size available, or `xxl` for custom large, brand-focused version + */ + size?: EuiAvatarProps['size'] | 'xxl'; + name?: string; + iconType: IconType; +}; +export type KibanaSolutionAvatarProps = KnownSolutionProps | IconTypeProps; +/** + * Applies extra styling to a typical EuiAvatar. + * The `name` value will be appended to 'logo' to configure the `iconType` unless `iconType` is provided. + */ +export declare const KibanaSolutionAvatar: (props: KibanaSolutionAvatarProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/avatar/solution/src/types.d.ts b/src/platform/packages/shared/shared-ux/avatar/solution/src/types.d.ts new file mode 100644 index 0000000000000..ab6a9cd2be692 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/avatar/solution/src/types.d.ts @@ -0,0 +1 @@ +export type SolutionNameType = 'App Search' | 'Beats' | 'Business Analytics' | 'Cloud' | 'Cloud Enterprise' | 'Code' | 'Elastic' | 'Elastic Stack' | 'Elasticsearch' | 'Enterprise Search' | 'Logstash' | 'Maps' | 'Metrics' | 'Observability' | 'Security' | 'Site Search' | 'Uptime' | 'Webhook' | 'Workplace Search'; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/index.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/index.d.ts new file mode 100644 index 0000000000000..51fab1f8254d4 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/card/no_data/impl/index.d.ts @@ -0,0 +1,3 @@ +export type { NoDataCardKibanaDependencies, NoDataCardProps, NoDataCardComponentProps, NoDataCardServices, } from '@kbn/shared-ux-card-no-data-types'; +export { NoDataCard } from './src/no_data_card'; +export { NoDataCardKibanaProvider, NoDataCardProvider } from './src/services'; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/elastic_agent_card_illustration.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/elastic_agent_card_illustration.d.ts new file mode 100644 index 0000000000000..258be452f6a37 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/elastic_agent_card_illustration.d.ts @@ -0,0 +1,2 @@ +import React from 'react'; +export declare const ElasticAgentCardIllustration: () => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.component.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.component.d.ts new file mode 100644 index 0000000000000..66cea61c289e0 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.component.d.ts @@ -0,0 +1,4 @@ +import React from 'react'; +import type { NoDataCardComponentProps as Props } from '@kbn/shared-ux-card-no-data-types'; +export declare const NO_DATA_CARD_MAX_WIDTH = 400; +export declare const NoDataCard: ({ title, description, canAccessFleet, href, buttonText, buttonIsDisabled, disabledButtonTooltipText, docsLink: link, onClick, icon, "data-test-subj": dataTestSubj, }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.d.ts new file mode 100644 index 0000000000000..d1db78c920019 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.d.ts @@ -0,0 +1,3 @@ +import React from 'react'; +import type { NoDataCardProps as Props } from '@kbn/shared-ux-card-no-data-types'; +export declare const NoDataCard: ({ href: srcHref, ...props }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/services.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/services.d.ts new file mode 100644 index 0000000000000..f3ff6789709ad --- /dev/null +++ b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/services.d.ts @@ -0,0 +1,14 @@ +import type { FC, PropsWithChildren } from 'react'; +import type { Services, NoDataCardServices, NoDataCardKibanaDependencies } from '@kbn/shared-ux-card-no-data-types'; +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export declare const NoDataCardProvider: FC>; +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export declare const NoDataCardKibanaProvider: FC>; +/** + * React hook for accessing pre-wired services. + */ +export declare function useServices(): Services; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/types/index.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/types/index.d.ts new file mode 100644 index 0000000000000..0a93cec4c037d --- /dev/null +++ b/src/platform/packages/shared/shared-ux/card/no_data/types/index.d.ts @@ -0,0 +1,85 @@ +import type { EuiEmptyPromptProps } from '@elastic/eui'; +/** + * A list of services that are consumed by this component. + */ +export interface Services { + addBasePath: (path: string) => string; + canAccessFleet: boolean; +} +/** + * Services that are consumed by this component and any dependencies. + */ +export type NoDataCardServices = Services; +/** + * An interface containing a collection of Kibana plugins and services required to + * render this component. + */ +interface KibanaDependencies { + coreStart: { + http: { + basePath: { + prepend: (path: string) => string; + }; + }; + application: { + capabilities: { + navLinks: Record; + }; + }; + }; +} +/** + * An interface containing a collection of Kibana plugins and services required to + * render this component as well as any dependencies. + */ +export type NoDataCardKibanaDependencies = KibanaDependencies; +/** + * Props for the `NoDataCard` pure component. + */ +export type NoDataCardComponentProps = Pick & { + /** + * Title for the card; + * If not provided, the default will be used + */ + title?: string; + /** + * Description for the card; + * If not provided, the default will be used + */ + description?: React.ReactNode; + /** True if the person has access to Fleet, false otherwise */ + canAccessFleet?: boolean; + /** + * Provide a string for the button's label; + * The button will be hidden completely if `canAccessFleet=false` or `hideActionButton=true` + */ + buttonText?: string; + /** + * Provide a boolean to disable the button; + * The button will be disabled if `buttonIsDisabled` or `disabledButtonTooltipText`is provided otherwise the button will be hidden completely + */ + buttonIsDisabled?: boolean; + /** + * Provide a tooltip text for the disabled button; + * The button will be disabled if `buttonIsDisabled` or `disabledButtonTooltipText` is provided otherwise the button will be hidden completely + */ + disabledButtonTooltipText?: string; + /** + * Provide a href for the button; + */ + href?: string; + /** + * Link to the documentation for this card; + * If not provided, the default will be used + */ + docsLink?: string; + /** Callback function for when the button is clicked */ + onClick?: (e: React.MouseEvent) => void; + /** Data test subject for the card */ + 'data-test-subj'?: string; +}; +/** + * Props for the `NoDataCard` sevice-connected component. + */ +export type NoDataCardProps = NoDataCardComponentProps; +export {}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/code_editor.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/code_editor.d.ts new file mode 100644 index 0000000000000..26b15a03eb85c --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/code_editor.d.ts @@ -0,0 +1,147 @@ +import React from 'react'; +import { monaco } from '@kbn/monaco'; +import type { Interpolation, Theme } from '@emotion/react'; +import { type MonacoEditorProps as ReactMonacoEditorProps } from './react_monaco_editor'; +import { type ContextMenuAction } from './mods'; +export interface CodeEditorProps extends Pick { + /** Width of editor. Defaults to 100%. */ + width?: string | number; + /** Height of editor. Defaults to 100px. */ + height?: string | number; + /** ID of the editor language */ + languageId: string; + /** Value of the editor */ + value: string; + /** Function invoked when text in editor is changed */ + onChange?: (value: string, event: monaco.editor.IModelContentChangedEvent) => void; + /** + * Options for the Monaco Code Editor + * Documentation of options can be found here: + * https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneEditorConstructionOptions.html + */ + options?: monaco.editor.IStandaloneEditorConstructionOptions; + /** + * Suggestion provider for autocompletion + * Documentation for the provider can be found here: + * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.CompletionItemProvider.html + */ + suggestionProvider?: monaco.languages.CompletionItemProvider; + /** + * Signature provider for function parameter info + * Documentation for the provider can be found here: + * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.SignatureHelpProvider.html + */ + signatureProvider?: monaco.languages.SignatureHelpProvider; + /** + * Hover provider for hover documentation + * Documentation for the provider can be found here: + * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.HoverProvider.html + */ + hoverProvider?: monaco.languages.HoverProvider; + /** + * Inline completions provider for inline suggestions + * Documentation for the provider can be found here: + * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.InlineCompletionsProvider.html + */ + inlineCompletionsProvider?: monaco.languages.InlineCompletionsProvider; + /** + * Language config provider for bracket + * Documentation for the provider can be found here: + * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.LanguageConfiguration.html + */ + languageConfiguration?: monaco.languages.LanguageConfiguration; + /** + * CodeAction provider for code actions on markers feedback + * Documentation for the provider can be found here: + * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.CodeActionProvider.html + */ + codeActions?: monaco.languages.CodeActionProvider; + /** + * Document highlight provider for highlighting all occurrences of a symbol + * Documentation for the provider can be found here: + * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.DocumentHighlightProvider.html + */ + documentHighlightProvider?: monaco.languages.DocumentHighlightProvider; + /** + * Function called before the editor is mounted in the view + */ + editorWillMount?: () => void; + /** + * Function called before the editor is mounted in the view + * and completely replaces the setup behavior called by the component + */ + overrideEditorWillMount?: () => void; + /** + * Function called after the editor is mounted in the view + */ + editorDidMount?: (editor: monaco.editor.IStandaloneCodeEditor) => void; + editorWillUnmount?: () => void; + /** + * Should the editor use a transparent background + */ + transparentBackground?: boolean; + /** + * Should the editor be rendered using the fullWidth EUI attribute + */ + fullWidth?: boolean; + placeholder?: string; + /** + * Accessible name for the editor. (Defaults to "Code editor") + */ + 'aria-label'?: string; + /** + * ID of the element that describes the editor. + */ + 'aria-describedby'?: string; + isCopyable?: boolean; + allowFullScreen?: boolean; + /** + * Alternate text to display, when an attempt is made to edit read only content. (Defaults to "Cannot edit in read-only editor") + */ + readOnlyMessage?: string; + /** + * Enables the editor to grow vertically to fit its content. + * This option overrides the `height` option. + */ + fitToContent?: { + minLines?: number; + maxLines?: number; + }; + /** + * Enables the editor to get disabled when pressing ESC to resolve focus trapping for accessibility. + */ + accessibilityOverlayEnabled?: boolean; + /** + * Enables the Search bar functionality in the editor. Disabled by default. + */ + enableFindAction?: boolean; + dataTestSubj?: string; + /** + * Custom CSS class to apply to the container + */ + classNameCss?: Interpolation; + /** + * Enables a custom context menu with Cut, Copy, Paste actions. Disabled by default. + */ + enableCustomContextMenu?: boolean; + /** + * If the custom context menu is enable through {@link enableCustomContextMenu}, + * this prop allows adding more custom menu actions, on top of the default Cut, Copy, and Paste actions. + */ + customContextMenuActions?: ContextMenuAction[]; + /** + * Optional html id for accessibility labeling + */ + htmlId?: string; + /** + * Enables clickable links in the editor. URLs will be underlined and can be opened + * in a new tab using Cmd/Ctrl+Click. Disabled by default. + */ + links?: boolean; + /** + * Callbacks for when editor is focused/blurred + */ + onFocus?: () => void; + onBlur?: () => void; +} +export declare const CodeEditor: React.FC; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/editor.styles.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/editor.styles.d.ts new file mode 100644 index 0000000000000..f2dc47208d330 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/editor.styles.d.ts @@ -0,0 +1,9 @@ +import type { EuiThemeComputed } from '@elastic/eui'; +export declare const styles: { + container: import("@emotion/react").SerializedStyles; + keyboardHint: (euiTheme: EuiThemeComputed) => import("@emotion/react").SerializedStyles; + controls: { + base: (euiTheme: EuiThemeComputed) => import("@emotion/react").SerializedStyles; + fullscreen: (euiTheme: EuiThemeComputed) => import("@emotion/react").SerializedStyles; + }; +}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/index.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/index.d.ts new file mode 100644 index 0000000000000..85dfa8f5e67c2 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/index.d.ts @@ -0,0 +1,17 @@ +import React from 'react'; +import type { CodeEditorProps } from './code_editor'; +export type { CodeEditorProps } from './code_editor'; +export { monaco, BarePluginApi } from '@kbn/monaco'; +export * from './react_monaco_editor/languages/supported'; +export { CODE_EDITOR_DEFAULT_THEME_ID, CODE_EDITOR_TRANSPARENT_THEME_ID, defaultThemesResolvers, XJsonLang, PainlessLang, SQLLang, ESQLLang, YamlLang, ConsoleLang, ConsoleOutputLang, MarkdownLang, GrokLang, HandlebarsLang, CssLang, HJsonLang, PromQLLang, ESQL_DARK_THEME_ID, ESQL_LIGHT_THEME_ID, ESQL_AUTOCOMPLETE_TRIGGER_CHARS, CONSOLE_THEME_ID, CONSOLE_OUTPUT_THEME_ID, getParsedRequestsProvider, ConsoleParsedRequestsProvider, ConsoleWorkerProxyService, createOutputParser, configureMonacoYamlSchema, EditorStateService, PainlessCompletionAdapter, initializeSupportedLanguages, getUndoRedoService, } from '@kbn/monaco'; +export type { LangModuleType, CompleteLangModuleType, CustomLangModuleType, MonacoEditorError, LangValidation, SyntaxErrors, BaseWorkerDefinition, UndoRedoService, UndoRedoElement, ESQLDependencies, MonacoMessage, ConsoleOutputParser, ConsoleParserResult, ErrorAnnotation, ParsedRequest, PainlessContext, PainlessCompletionKind, PainlessCompletionItem, PainlessCompletionResult, PainlessAutocompleteField, EditorState, Language, } from '@kbn/monaco'; +/** + * Renders a Monaco code editor with EUI color theme. + * + * @see CodeEditorField to render a code editor in the same style as other EUI form fields. + */ +export declare const CodeEditor: React.FunctionComponent; +/** + * Renders a Monaco code editor in the same style as other EUI form fields. + */ +export declare const CodeEditorField: React.FunctionComponent; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/components/rebroadcast_mouse_down_events.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/components/rebroadcast_mouse_down_events.d.ts new file mode 100644 index 0000000000000..64f8b0873d527 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/components/rebroadcast_mouse_down_events.d.ts @@ -0,0 +1,7 @@ +import React, { type FC } from 'react'; +/** + * @description See {@link https://github.com/elastic/kibana/issues/177756 | GitHub issue #177756} for the rationale behind this bug fix implementation + */ +export declare const ReBroadcastMouseDownEvents: FC<{ + children: React.ReactNode; +}>; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_context_menu_utils.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_context_menu_utils.d.ts new file mode 100644 index 0000000000000..09823a3ae5c8c --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_context_menu_utils.d.ts @@ -0,0 +1,18 @@ +import type { monaco } from '@kbn/monaco'; +interface RegisterContextMenuActionsParams { + editor: monaco.editor.IStandaloneCodeEditor; + enableWriteActions: boolean; + customActions?: ContextMenuAction[]; +} +export interface ContextMenuAction { + actionDescriptor: monaco.editor.IActionDescriptor; + writeAction: boolean; +} +/** + * Hook that returns a function for registering context menu actions in the Monaco editor. + */ +export declare const useContextMenuUtils: () => { + registerContextMenuActions: ({ editor, enableWriteActions, customActions, }: RegisterContextMenuActionsParams) => void; + unregisterContextMenuActions: () => void; +}; +export {}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_copy.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_copy.d.ts new file mode 100644 index 0000000000000..ac1327220adb0 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_copy.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +export declare const useCopy: ({ isCopyable, value }: { + isCopyable: boolean; + value: string; +}) => { + showCopyButton: string | false; + CopyButton: () => React.JSX.Element | null; +}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fit_content.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fit_content.d.ts new file mode 100644 index 0000000000000..3a225d173ad9c --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fit_content.d.ts @@ -0,0 +1,9 @@ +import { monaco } from '@kbn/monaco'; +export declare const useFitToContent: ({ editor, fitToContent, isFullScreen, }: { + editor: monaco.editor.IStandaloneCodeEditor | null; + isFullScreen: boolean; + fitToContent?: { + minLines?: number; + maxLines?: number; + }; +}) => void; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fullscreen.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fullscreen.d.ts new file mode 100644 index 0000000000000..457fdaa32bc72 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fullscreen.d.ts @@ -0,0 +1,15 @@ +/** + * Fullscreen logic + */ +import React, { type KeyboardEvent } from 'react'; +export declare const useFullScreen: ({ allowFullScreen }: { + allowFullScreen?: boolean; +}) => { + FullScreenButton: React.FC<{}>; + FullScreenDisplay: ({ children }: { + children: Array | JSX.Element; + }) => React.JSX.Element; + onKeyDown: (event: KeyboardEvent) => void; + isFullScreen: boolean; + setIsFullScreen: React.Dispatch>; +}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_placeholder.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_placeholder.d.ts new file mode 100644 index 0000000000000..76e164e49ae82 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_placeholder.d.ts @@ -0,0 +1,8 @@ +import type { monaco } from '@kbn/monaco'; +import type { UseEuiTheme } from '@elastic/eui'; +export declare const usePlaceholder: ({ placeholder, euiTheme, editor, value, }: { + placeholder: string | undefined; + euiTheme: UseEuiTheme["euiTheme"]; + editor: monaco.editor.IStandaloneCodeEditor | null; + value: string; +}) => void; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/index.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/index.d.ts new file mode 100644 index 0000000000000..24463303c47b2 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/index.d.ts @@ -0,0 +1,6 @@ +export { ReBroadcastMouseDownEvents } from './components/rebroadcast_mouse_down_events'; +export { type ContextMenuAction, useContextMenuUtils } from './hooks/use_context_menu_utils'; +export { useFullScreen } from './hooks/use_fullscreen'; +export { useCopy } from './hooks/use_copy'; +export { usePlaceholder } from './hooks/use_placeholder'; +export { useFitToContent } from './hooks/use_fit_content'; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/editor.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/editor.d.ts new file mode 100644 index 0000000000000..6f0082b2abc1e --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/editor.d.ts @@ -0,0 +1,97 @@ +/** + * @notice + * This code is forked from the `react-monaco-editor` + * https://github.com/react-monaco-editor/react-monaco-editor/blob/975cc47b5cb411ee2ffcbdb973daa9342e81a805/src/editor.tsx + * + * The MIT License (MIT) + * + * Copyright (c) 2016-present Leon Shi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +import type { monaco as monacoEditor } from '@kbn/monaco'; +import * as React from 'react'; +export type EditorConstructionOptions = monacoEditor.editor.IStandaloneEditorConstructionOptions; +export type EditorWillMount = (monaco: typeof monacoEditor) => void | EditorConstructionOptions; +export type EditorDidMount = (editor: monacoEditor.editor.IStandaloneCodeEditor, monaco: typeof monacoEditor) => void; +export type EditorWillUnmount = (editor: monacoEditor.editor.IStandaloneCodeEditor, monaco: typeof monacoEditor) => void | EditorConstructionOptions; +export type ChangeHandler = (value: string, event: monacoEditor.editor.IModelContentChangedEvent) => void; +export interface MonacoEditorProps { + /** + * Width of editor. Defaults to 100%. + */ + width?: string | number; + /** + * Height of editor. Defaults to 100%. + */ + height?: string | number; + /** + * The initial value of the auto created model in the editor. + */ + defaultValue?: string; + /** + * Value of the auto created model in the editor. + * If you specify `null` or `undefined` for this property, the component behaves in uncontrolled mode. + * Otherwise, it behaves in controlled mode. + */ + value?: string | null; + /** + * The initial language of the auto created model in the editor. Defaults to 'javascript'. + */ + language?: string; + /** + * Theme to be used for rendering. + * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. + * You can create custom themes via `monaco.editor.defineTheme`. + */ + theme?: string | null; + /** + * Optional string classname to append to the editor. + */ + className?: string | null; + /** + * Refer to Monaco interface {monaco.editor.IStandaloneEditorConstructionOptions}. + */ + options?: monacoEditor.editor.IStandaloneEditorConstructionOptions; + /** + * An event emitted before the editor mounted (similar to componentWillMount of React). + */ + editorWillMount?: EditorWillMount; + /** + * An event emitted when the editor has been mounted (similar to componentDidMount of React). + */ + editorDidMount?: EditorDidMount; + /** + * An event emitted before the editor unmount (similar to componentWillUnmount of React). + */ + editorWillUnmount?: EditorWillUnmount; + /** + * An event emitted when the content of the current model has changed. + */ + onChange?: ChangeHandler; + /** + * Optional z-index to override the default z-index of the overflow widgets container. + */ + overflowWidgetsContainerZIndexOverride?: number; +} +export declare const OVERFLOW_WIDGETS_TEST_ID = "kbnCodeEditorEditorOverflowWidgetsContainer"; +export declare function MonacoEditor({ width, height, value, defaultValue, language, theme, options, editorWillMount, editorDidMount, editorWillUnmount, onChange, className, overflowWidgetsContainerZIndexOverride, }: MonacoEditorProps): React.JSX.Element; +export declare namespace MonacoEditor { + var displayName: string; +} diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/index.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/index.d.ts new file mode 100644 index 0000000000000..0755485603d69 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/index.d.ts @@ -0,0 +1 @@ +export * from './editor'; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/languages/supported.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/languages/supported.d.ts new file mode 100644 index 0000000000000..c7996041207ed --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/languages/supported.d.ts @@ -0,0 +1 @@ +export { CSS_LANG_ID, HANDLEBARS_LANG_ID, MARKDOWN_LANG_ID, YAML_LANG_ID, HJSON_LANG_ID, GROK_LANG_ID, XJSON_LANG_ID, PAINLESS_LANG_ID, SQL_LANG_ID, ESQL_LANG_ID, CONSOLE_LANG_ID, CONSOLE_OUTPUT_LANG_ID, PROMQL_LANG_ID, } from '@kbn/monaco/src/languages'; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/utils/placeholder_widget.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/utils/placeholder_widget.d.ts new file mode 100644 index 0000000000000..4f9fd6d9ae65e --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/utils/placeholder_widget.d.ts @@ -0,0 +1,13 @@ +import { monaco } from '@kbn/monaco'; +import type { EuiThemeComputed } from '@elastic/eui'; +export declare class PlaceholderWidget implements monaco.editor.IContentWidget { + private readonly placeholderText; + private readonly euiTheme; + private readonly editor; + constructor(placeholderText: string, euiTheme: EuiThemeComputed, editor: monaco.editor.ICodeEditor); + private domNode; + getId(): string; + getDomNode(): HTMLElement; + getPosition(): monaco.editor.IContentWidgetPosition | null; + dispose(): void; +} diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/utils/remeasure_fonts.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/utils/remeasure_fonts.d.ts new file mode 100644 index 0000000000000..386e409caeea8 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/code_editor/impl/utils/remeasure_fonts.d.ts @@ -0,0 +1,5 @@ +/** + * When using custom fonts with monaco need to call `monaco.editor.remeasureFonts()` when custom fonts finished loading + * Otherwise initial measurements on fallback font are used which causes visual glitches in the editor + */ +export declare const remeasureFonts: () => void; diff --git a/src/platform/packages/shared/shared-ux/link/redirect_app/impl/index.d.ts b/src/platform/packages/shared/shared-ux/link/redirect_app/impl/index.d.ts new file mode 100644 index 0000000000000..7af98954600c9 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/link/redirect_app/impl/index.d.ts @@ -0,0 +1,3 @@ +export { RedirectAppLinks, type RedirectAppLinksServices, type RedirectAppLinksKibanaDependencies, type RedirectAppLinksProps, } from './src/deprecated_redirect_app_links.component'; +export { RedirectAppLinks as RedirectAppLinksContainer } from './src/deprecated_redirect_app_links.component'; +export { RedirectAppLinks as RedirectAppLinksComponent } from './src/deprecated_redirect_app_links.component'; diff --git a/src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/deprecated_redirect_app_links.component.d.ts b/src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/deprecated_redirect_app_links.component.d.ts new file mode 100644 index 0000000000000..39dc2733ea528 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/deprecated_redirect_app_links.component.d.ts @@ -0,0 +1,37 @@ +import type { FC } from 'react'; +import React from 'react'; +import type { Observable } from 'rxjs'; +import type { DetailedHTMLProps, HTMLAttributes } from 'react'; +export type NavigateToUrl = (url: string) => Promise | void; +/** + * Contextual services for this component. + * @deprecated + */ +export interface RedirectAppLinksServices { + navigateToUrl: NavigateToUrl; + currentAppId?: string; +} +/** + * Kibana-specific contextual services to be adapted for this component. + * @deprecated + */ +export interface RedirectAppLinksKibanaDependencies { + coreStart: { + application: { + currentAppId$: Observable; + navigateToUrl: NavigateToUrl; + }; + }; +} +/** + * Props for the `RedirectAppLinks` component. + * @deprecated + */ +export type RedirectAppLinksProps = Partial & DetailedHTMLProps, HTMLDivElement>; +export declare const redirectAppLinksStyles: import("@emotion/react").SerializedStyles; +/** + * @deprecated - This component is deprecated and usages of it can be safely removed from your codebase. + * The link navigation is handled by GlobalRedirectAppLinks component at the root of Kibana. + * When removing the usages of this component, make sure to check that your app layout hasn't been affected since this adds additional div with styles + */ +export declare const RedirectAppLinks: FC>; diff --git a/src/platform/packages/shared/shared-ux/modal/tabbed/index.d.ts b/src/platform/packages/shared/shared-ux/modal/tabbed/index.d.ts new file mode 100644 index 0000000000000..2b00e3308796a --- /dev/null +++ b/src/platform/packages/shared/shared-ux/modal/tabbed/index.d.ts @@ -0,0 +1 @@ +export { TabbedModal, type IModalTabDeclaration } from './src/tabbed_modal'; diff --git a/src/platform/packages/shared/shared-ux/modal/tabbed/src/context/index.d.ts b/src/platform/packages/shared/shared-ux/modal/tabbed/src/context/index.d.ts new file mode 100644 index 0000000000000..2c79da2906eaa --- /dev/null +++ b/src/platform/packages/shared/shared-ux/modal/tabbed/src/context/index.d.ts @@ -0,0 +1,38 @@ +import React, { type PropsWithChildren, type Dispatch } from 'react'; +interface IDispatchAction { + type: string; + payload: any; +} +export type IDispatchFunction = Dispatch; +export interface IMetaState { + defaultSelectedTabId: string; + selectedTabId: string; +} +type IReducer = (state: S, action: IDispatchAction) => S; +export interface ITabDeclaration { + id: string; + name: string; + initialState?: Partial; + reducer?: IReducer; +} +interface IModalContext>>> { + tabs: Array>; + state: { + meta: IMetaState; + [index: string]: any; + }; + dispatch: Dispatch; +} +export declare const useModalContext: >>>() => IModalContext; +export type IModalContextProviderProps>>> = PropsWithChildren<{ + /** + * Array of tab declaration to be rendered into the modal that will be rendered + */ + tabs: Tabs; + /** + * ID of the tab we'd like the modal to have selected on render + */ + defaultSelectedTabId: Tabs[number]['id']; +}>; +export declare function ModalContextProvider>>>({ tabs, defaultSelectedTabId, children, }: IModalContextProviderProps): React.JSX.Element; +export {}; diff --git a/src/platform/packages/shared/shared-ux/modal/tabbed/src/tabbed_modal.d.ts b/src/platform/packages/shared/shared-ux/modal/tabbed/src/tabbed_modal.d.ts new file mode 100644 index 0000000000000..5cf3d9a58ece6 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/modal/tabbed/src/tabbed_modal.d.ts @@ -0,0 +1,34 @@ +import React, { type ComponentProps, type ReactElement, type ReactNode } from 'react'; +import { EuiModal, type EuiTabProps, type CommonProps } from '@elastic/eui'; +import { type ITabDeclaration, type IDispatchFunction, type IModalContextProviderProps } from './context'; +export type IModalTabContent = (props: { + state: S; + dispatch: IDispatchFunction; +}) => ReactElement; +interface IModalTabActionBtn extends CommonProps { + id: string; + dataTestSubj: string; + label: string; + handler: (args: { + state: S; + }) => void; + isCopy?: boolean; + style?: (args: { + state: S; + }) => boolean; +} +export interface IModalTabDeclaration extends EuiTabProps, ITabDeclaration { + description?: string; + 'data-test-subj'?: string; + content: IModalTabContent; + modalActionBtn?: IModalTabActionBtn; +} +export interface ITabbedModalInner extends Pick, 'onClose' | 'outsideClickCloses'> { + modalWidth?: number; + modalTitle?: string; + anchorElement?: HTMLElement; + aboveTabsContent?: ReactNode; + 'data-test-subj'?: string; +} +export declare function TabbedModal>>({ tabs, defaultSelectedTabId, ...rest }: Omit, 'children'> & ITabbedModalInner): React.JSX.Element; +export {}; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/index.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/index.d.ts new file mode 100644 index 0000000000000..ced682ee7d165 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/index.d.ts @@ -0,0 +1,3 @@ +export { KibanaPageTemplate } from './src/page_template'; +export { KibanaPageTemplateProvider, KibanaPageTemplateKibanaProvider } from './src/services'; +export type { NoDataConfig, KibanaPageTemplateProps, KibanaPageTemplateServices, KibanaPageTemplateKibanaDependencies, } from '@kbn/shared-ux-page-kibana-template-types'; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template.d.ts new file mode 100644 index 0000000000000..4b818e56659fa --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template.d.ts @@ -0,0 +1,14 @@ +import type { FC } from 'react'; +import React from 'react'; +import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template-types'; +export declare const _KibanaPageTemplate: FC; +/** + * Kibana-specific wrapper of EuiPageTemplate and it's namespaced components + */ +export declare const KibanaPageTemplate: FC & { + Sidebar: React.FunctionComponent; + Header: React.FunctionComponent; + Section: React.FunctionComponent; + BottomBar: React.FunctionComponent; + EmptyPrompt: React.FunctionComponent; +}; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.d.ts new file mode 100644 index 0000000000000..94ca2d6d18911 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.d.ts @@ -0,0 +1,27 @@ +import type { FC } from 'react'; +import React from 'react'; +import type { KibanaPageTemplateProps as Props } from '@kbn/shared-ux-page-kibana-template-types'; +/** + * A thin wrapper around EuiPageTemplate with a few Kibana specific additions + */ +export declare const KibanaPageTemplateInner: FC; +export declare const KibanaPageTemplateWithSolutionNav: { + (props: import("@elastic/eui/src/components/page_template/outer/page_outer")._EuiPageOuterProps & Omit & import("@elastic/eui/src/components/page/_restrict_width")._EuiPageRestrictWidth & import("@elastic/eui/src/components/page/_bottom_border")._EuiPageBottomBorder & { + contentBorder?: import("@elastic/eui/src/components/page_template/inner/page_inner")._EuiPageInnerProps["border"]; + minHeight?: React.CSSProperties["minHeight"]; + offset?: number; + mainProps?: import("@elastic/eui").CommonProps & React.HTMLAttributes; + component?: import("@elastic/eui/src/components/page_template/inner/page_inner").ComponentTypes; + } & { + isEmptyState?: boolean; + emptyPageBody?: React.ReactNode; + solutionNav?: import("@kbn/shared-ux-page-solution-nav").SolutionNavProps; + noDataConfig?: import("@kbn/shared-ux-page-no-data-config-types").NoDataConfig; + pageHeader?: import("@elastic/eui").EuiPageHeaderProps; + pageSideBar?: React.ReactNode; + pageSideBarProps?: import("@elastic/eui").EuiPageSidebarProps; + } & import("@kbn/shared-ux-page-solution-nav/src/with_solution_nav").TemplateProps & { + solutionNav: import("@kbn/shared-ux-page-solution-nav").SolutionNavProps; + }): React.JSX.Element; + displayName: string; +}; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/services.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/services.d.ts new file mode 100644 index 0000000000000..69ae77ed2d4bd --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/services.d.ts @@ -0,0 +1,10 @@ +import type { FC, PropsWithChildren } from 'react'; +import type { KibanaPageTemplateServices, KibanaPageTemplateKibanaDependencies } from '@kbn/shared-ux-page-kibana-template-types'; +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export declare const KibanaPageTemplateProvider: FC>; +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export declare const KibanaPageTemplateKibanaProvider: FC>; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/types/index.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/types/index.d.ts new file mode 100644 index 0000000000000..87b06dd99086f --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/kibana_template/types/index.d.ts @@ -0,0 +1,32 @@ +import type { EuiPageTemplateProps, EuiPageSidebarProps, EuiPageHeaderProps } from '@elastic/eui'; +import type { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; +import type { ReactNode } from 'react'; +import type { NoDataConfig, NoDataConfigPageServices, NoDataConfigPageKibanaDependencies } from '@kbn/shared-ux-page-no-data-config-types'; +export type KibanaPageTemplateKibanaDependencies = NoDataConfigPageKibanaDependencies; +export type KibanaPageTemplateServices = NoDataConfigPageServices; +export type { NoDataConfig } from '@kbn/shared-ux-page-no-data-config-types'; +export type KibanaPageTemplateProps = EuiPageTemplateProps & { + /** + * Converts the `pageHeader` contents into an EuiEmptyPrompt when no `children` are present + */ + isEmptyState?: boolean; + /** + * Combined with isEmptyState, this prop allows complete override of the empty page + */ + emptyPageBody?: ReactNode; + /** + * Quick creation of EuiSideNav. Hooks up mobile instance too + */ + solutionNav?: SolutionNavProps; + /** + * Accepts a configuration object, that when provided, ignores `pageHeader` and `children` and instead + * displays Agent, Beats, and custom cards to direct users to the right ingest location + */ + noDataConfig?: NoDataConfig; + /** + * BWC Props from old EUI template + */ + pageHeader?: EuiPageHeaderProps; + pageSideBar?: ReactNode; + pageSideBarProps?: EuiPageSidebarProps; +}; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/impl/index.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/impl/index.d.ts new file mode 100644 index 0000000000000..2f005263bd458 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data/impl/index.d.ts @@ -0,0 +1,3 @@ +export { NoDataPage } from './src/no_data_page'; +export type { NoDataPageProps, NoDataPageServices, NoDataPageKibanaDependencies, } from '@kbn/shared-ux-page-no-data-types'; +export { NoDataPageKibanaProvider, NoDataPageProvider } from './src/services'; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/action_card.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/action_card.d.ts new file mode 100644 index 0000000000000..169aa041cf24f --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/action_card.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +import type { NoDataCardProps } from '@kbn/shared-ux-card-no-data'; +import type { ActionCardProps } from '@kbn/shared-ux-page-no-data-types'; +export type NoDataPageActions = NoDataCardProps; +export declare const KEY_ELASTIC_AGENT = "elasticAgent"; +export declare const ActionCard: ({ action }: ActionCardProps) => React.JSX.Element | null; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/no_data_page.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/no_data_page.d.ts new file mode 100644 index 0000000000000..918505dbf09d2 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/no_data_page.d.ts @@ -0,0 +1,3 @@ +import React from 'react'; +import type { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; +export declare const NoDataPage: ({ action, className }: NoDataPageProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/services.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/services.d.ts new file mode 100644 index 0000000000000..2e2517c1fa9ca --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/services.d.ts @@ -0,0 +1,10 @@ +import type { FC, PropsWithChildren } from 'react'; +import type { NoDataPageServices, NoDataPageKibanaDependencies } from '@kbn/shared-ux-page-no-data-types'; +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export declare const NoDataPageProvider: FC>; +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export declare const NoDataPageKibanaProvider: FC>; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/types/index.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/types/index.d.ts new file mode 100644 index 0000000000000..6611c65304607 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data/types/index.d.ts @@ -0,0 +1,23 @@ +import type { CommonProps } from '@elastic/eui'; +import type { NoDataCardProps, NoDataCardServices, NoDataCardKibanaDependencies } from '@kbn/shared-ux-card-no-data-types'; +export type NoDataPageActions = NoDataCardProps; +export interface ActionCardProps { + /** + * An object of `NoDataPageActions`. + * + * Use `elasticAgent` as the primary key for pre-configured cards of this type. + * Otherwise use a custom key that contains `EuiCard` props. + */ + action: Record; +} +export interface NoDataPageProps extends CommonProps, ActionCardProps { +} +/** + * A list of services that are consumed by this component. + */ +export type NoDataPageServices = NoDataCardServices; +/** + * An interface containing a collection of Kibana plugins and services required to + * render this component. + */ +export type NoDataPageKibanaDependencies = NoDataCardKibanaDependencies; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/index.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/index.d.ts new file mode 100644 index 0000000000000..2c160b5503480 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/index.d.ts @@ -0,0 +1,3 @@ +export { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './src/no_data_config_page'; +export { NoDataConfigPageKibanaProvider, NoDataConfigPageProvider } from './src/services'; +export type { NoDataConfigPageProps, NoDataConfigPageServices, NoDataConfigPageKibanaDependencies, } from '@kbn/shared-ux-page-no-data-config-types'; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/constants.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/constants.d.ts new file mode 100644 index 0000000000000..49bae3a2cf035 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/constants.d.ts @@ -0,0 +1 @@ +export declare const NO_DATA_PAGE_MAX_WIDTH = 950; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/no_data_config_page.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/no_data_config_page.d.ts new file mode 100644 index 0000000000000..771d8ea91e406 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/no_data_config_page.d.ts @@ -0,0 +1,19 @@ +import React from 'react'; +import type { NoDataConfigPageProps } from '@kbn/shared-ux-page-no-data-config-types'; +export declare const NoDataConfigPage: (props: NoDataConfigPageProps) => React.JSX.Element | null; +export declare const NoDataConfigPageWithSolutionNavBar: { + (props: import("@elastic/eui/src/components/page_template/outer/page_outer")._EuiPageOuterProps & Omit & import("@elastic/eui/src/components/page/_restrict_width")._EuiPageRestrictWidth & import("@elastic/eui/src/components/page/_bottom_border")._EuiPageBottomBorder & { + contentBorder?: import("@elastic/eui/src/components/page_template/inner/page_inner")._EuiPageInnerProps["border"]; + minHeight?: React.CSSProperties["minHeight"]; + offset?: number; + mainProps?: import("@elastic/eui").CommonProps & React.HTMLAttributes; + component?: import("@elastic/eui/src/components/page_template/inner/page_inner").ComponentTypes; + } & { + noDataConfig?: import("@kbn/shared-ux-page-no-data-config-types").NoDataConfig; + pageSideBar?: React.ReactNode; + pageSideBarProps?: import("@elastic/eui").EuiPageSidebarProps; + } & import("@kbn/shared-ux-page-solution-nav/src/with_solution_nav").TemplateProps & { + solutionNav: import("@kbn/shared-ux-page-solution-nav").SolutionNavProps; + }): React.JSX.Element; + displayName: string; +}; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/services.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/services.d.ts new file mode 100644 index 0000000000000..9370aabd6b92e --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/services.d.ts @@ -0,0 +1,10 @@ +import type { FC, PropsWithChildren } from 'react'; +import type { NoDataConfigPageServices, NoDataConfigPageKibanaDependencies } from '@kbn/shared-ux-page-no-data-config-types'; +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export declare const NoDataConfigPageProvider: FC>; +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export declare const NoDataConfigPageKibanaProvider: FC>; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/types/index.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/types/index.d.ts new file mode 100644 index 0000000000000..58435f53251fd --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/no_data_config/types/index.d.ts @@ -0,0 +1,18 @@ +import type { ReactNode } from 'react'; +import type { EuiPageTemplateProps, EuiPageSidebarProps } from '@elastic/eui'; +import type { NoDataPageProps, NoDataPageServices, NoDataPageKibanaDependencies } from '@kbn/shared-ux-page-no-data-types'; +export type NoDataConfigPageKibanaDependencies = NoDataPageKibanaDependencies; +export type NoDataConfigPageServices = NoDataPageServices; +export type NoDataConfig = NoDataPageProps; +export type NoDataConfigPageProps = EuiPageTemplateProps & { + /** + * Accepts a configuration object, that when provided, ignores `pageHeader` and `children` and instead + * displays Agent, Beats, and custom cards to direct users to the right ingest location + */ + noDataConfig?: NoDataConfig; + /** + * BWC Props from old EUI template + */ + pageSideBar?: ReactNode; + pageSideBarProps?: EuiPageSidebarProps; +}; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/index.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/index.d.ts new file mode 100644 index 0000000000000..c98f73213bdce --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/solution_nav/index.d.ts @@ -0,0 +1,3 @@ +export { SolutionNav } from './src/solution_nav'; +export type { SolutionNavProps } from './src/solution_nav'; +export { withSolutionNav } from './src/with_solution_nav'; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/src/collapse_button.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/src/collapse_button.d.ts new file mode 100644 index 0000000000000..efc9f3299a396 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/solution_nav/src/collapse_button.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import type { EuiButtonIconPropsForButton } from '@elastic/eui'; +export type SolutionNavCollapseButtonProps = Partial & { + /** + * Boolean state of current collapsed status + */ + isCollapsed: boolean; +}; +/** + * Creates the styled icon button for showing/hiding solution nav + */ +export declare const SolutionNavCollapseButton: ({ className, isCollapsed, ...rest }: SolutionNavCollapseButtonProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/src/solution_nav.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/src/solution_nav.d.ts new file mode 100644 index 0000000000000..3e398f43b401f --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/solution_nav/src/solution_nav.d.ts @@ -0,0 +1,51 @@ +import type { FC } from 'react'; +import React from 'react'; +import type { EuiAvatarProps, EuiFlyoutProps, EuiSideNavProps } from '@elastic/eui'; +/** + * Props for the `SolutionNav` component. + */ +export type SolutionNavProps = Omit, 'children' | 'items' | 'heading'> & { + /** + * Name of the solution, i.e. "Observability" + */ + name: EuiAvatarProps['name']; + /** + * Solution logo, i.e. "logoObservability" + */ + icon?: EuiAvatarProps['iconType']; + /** + * An array of #EuiSideNavItem objects. Lists navigation menu items. + */ + items?: EuiSideNavProps<{}>['items']; + /** + * Renders the children instead of default EuiSideNav + */ + children?: React.ReactNode; + /** + * The position of the close button when the navigation flyout is open. + * Note that side navigation turns into a flyout only when the screen has medium size. + */ + closeFlyoutButtonPosition?: EuiFlyoutProps['closeButtonPosition']; + /** + * Control the collapsed state + */ + isOpenOnDesktop?: boolean; + /** + * Handler for when the navigation flyout is collapsed. + */ + onCollapse?: () => void; + /** + * Allows hiding of the navigation by the user. + * If false, forces all breakpoint versions into the open state without the ability to hide. + */ + canBeCollapsed?: boolean; + /** + * Optional content to render at the bottom of the nav, pinned below the scrollable nav items. + * Hidden when the nav is collapsed. + */ + footer?: React.ReactNode; +}; +/** + * A wrapper around `EuiSideNav` that includes the appropriate title with optional solution logo. + */ +export declare const SolutionNav: FC; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.d.ts new file mode 100644 index 0000000000000..197b70b9bbdbe --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.d.ts @@ -0,0 +1,18 @@ +import type { ComponentType, CSSProperties, ReactNode } from 'react'; +import React from 'react'; +import type { EuiPageSidebarProps } from '@elastic/eui'; +import type { SolutionNavProps } from './solution_nav'; +export interface TemplateProps { + children?: ReactNode; + pageSideBar?: ReactNode; + pageSideBarProps?: EuiPageSidebarProps; + style?: CSSProperties; +} +type Props

= P & TemplateProps & { + solutionNav: SolutionNavProps; +}; +export declare const withSolutionNav:

(WrappedComponent: ComponentType

) => { + (props: Props

): React.JSX.Element; + displayName: string; +}; +export {}; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.styles.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.styles.d.ts new file mode 100644 index 0000000000000..70fc96cd8cd36 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.styles.d.ts @@ -0,0 +1,2 @@ +import type { EuiThemeComputed } from '@elastic/eui'; +export declare const WithSolutionNavStyles: (euiTheme: EuiThemeComputed<{}>) => string; diff --git a/src/platform/packages/shared/shared-ux/prompt/not_found/index.d.ts b/src/platform/packages/shared/shared-ux/prompt/not_found/index.d.ts new file mode 100644 index 0000000000000..abd50c6d11411 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/prompt/not_found/index.d.ts @@ -0,0 +1 @@ +export { NotFoundPrompt } from './src/not_found_prompt'; diff --git a/src/platform/packages/shared/shared-ux/prompt/not_found/src/not_found_prompt.d.ts b/src/platform/packages/shared/shared-ux/prompt/not_found/src/not_found_prompt.d.ts new file mode 100644 index 0000000000000..40899498b93e9 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/prompt/not_found/src/not_found_prompt.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import type { EuiEmptyPromptProps } from '@elastic/eui'; +interface NotFoundProps { + /** Array of buttons, links and other actions to show at the bottom of the `EuiEmptyPrompt`. Defaults to a "Back" button. */ + actions?: EuiEmptyPromptProps['actions']; + title?: EuiEmptyPromptProps['title'] | string; + body?: EuiEmptyPromptProps['body']; +} +/** + * Predefined `EuiEmptyPrompt` for 404 pages. + */ +export declare const NotFoundPrompt: ({ actions, title, body }: NotFoundProps) => React.JSX.Element; +export {}; diff --git a/src/platform/packages/shared/shared-ux/table_persist/index.d.ts b/src/platform/packages/shared/shared-ux/table_persist/index.d.ts new file mode 100644 index 0000000000000..7702c42a7f282 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/table_persist/index.d.ts @@ -0,0 +1,2 @@ +export { useEuiTablePersist, DEFAULT_PAGE_SIZE_OPTIONS, withEuiTablePersist } from './src'; +export type { EuiTablePersistInjectedProps, EuiTablePersistPropsGetter, HOCProps } from './src'; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/constants.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/constants.d.ts new file mode 100644 index 0000000000000..eccf2dff167f9 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/table_persist/src/constants.d.ts @@ -0,0 +1,3 @@ +export declare const DEFAULT_PAGE_SIZE_OPTIONS: number[]; +export declare const DEFAULT_INITIAL_PAGE_SIZE = 50; +export declare const LOCAL_STORAGE_PREFIX = "tablePersist"; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/index.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/index.d.ts new file mode 100644 index 0000000000000..fcdb285bfd040 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/table_persist/src/index.d.ts @@ -0,0 +1,4 @@ +export { useEuiTablePersist } from './use_table_persist'; +export { DEFAULT_PAGE_SIZE_OPTIONS } from './constants'; +export { withEuiTablePersist } from './table_persist_hoc'; +export type { EuiTablePersistInjectedProps, EuiTablePersistPropsGetter, HOCProps, } from './table_persist_hoc'; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/storage.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/storage.d.ts new file mode 100644 index 0000000000000..d29206b0ea535 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/table_persist/src/storage.d.ts @@ -0,0 +1,13 @@ +type IStorageEngine = typeof window.localStorage; +declare class Storage { + engine: IStorageEngine; + prefix: string; + encode(val: unknown): string; + decode(val: string | null): any; + encodeKey(key: string): string; + set(key: string, val: unknown): unknown; + has(key: string): boolean; + get(key: string, _default?: T): any; +} +export declare function createStorage(): Storage; +export {}; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/table_persist_hoc.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/table_persist_hoc.d.ts new file mode 100644 index 0000000000000..347094497d4ff --- /dev/null +++ b/src/platform/packages/shared/shared-ux/table_persist/src/table_persist_hoc.d.ts @@ -0,0 +1,26 @@ +import React from 'react'; +import { type CriteriaWithPagination } from '@elastic/eui'; +import type { EuiTablePersistProps } from './use_table_persist'; +import type { PropertySort } from './types'; +export interface EuiTablePersistInjectedProps { + euiTablePersist: { + /** The EuiInMemoryTable onTableChange prop */ + onTableChange: (change: CriteriaWithPagination) => void; + /** The EuiInMemoryTable sorting prop */ + sorting: { + sort: PropertySort; + } | true; + /** The EuiInMemoryTable pagination.pageSize value */ + pageSize: number; + }; +} +export type EuiTablePersistPropsGetter = (props: Omit>) => EuiTablePersistProps; +export type HOCProps = P & { + /** Custom value for the EuiTablePersist HOC */ + euiTablePersistProps?: Partial>; +}; +export declare function withEuiTablePersist(WrappedComponent: React.ComponentClass>, euiTablePersistDefault: (EuiTablePersistProps & { + get?: undefined; +}) | { + get: EuiTablePersistPropsGetter; +}): React.FC>>; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/types.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/types.d.ts new file mode 100644 index 0000000000000..99d0b72d9a195 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/table_persist/src/types.d.ts @@ -0,0 +1,8 @@ +export interface PropertySort { + field: keyof T; + direction: 'asc' | 'desc'; +} +export interface PersistData { + pageSize?: number; + sort?: PropertySort; +} diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/use_table_persist.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/use_table_persist.d.ts new file mode 100644 index 0000000000000..3d855624cef00 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/table_persist/src/use_table_persist.d.ts @@ -0,0 +1,43 @@ +import type { CriteriaWithPagination } from '@elastic/eui'; +import type { PropertySort } from './types'; +export interface EuiTablePersistProps { + /** A unique id that will be included in the local storage variable for this table. */ + tableId: string; + /** (Optional) Specifies a custom onTableChange handler. */ + customOnTableChange?: (change: CriteriaWithPagination) => void; + /** (Optional) Specifies a custom initial table sorting. */ + initialSort?: PropertySort; + /** (Optional) Specifies a custom initial page size for the table. Defaults to 50. */ + initialPageSize?: number; + /** (Optional) Specifies custom page size options for the table. + * Defaults to {@link DEFAULT_PAGE_SIZE_OPTIONS} */ + pageSizeOptions?: number[]; +} +/** + * A hook that stores and retrieves from local storage the table page size and sort criteria. + * Returns the persisting page size and sort and the onTableChange handler that should be passed + * as props to an Eui table component. + */ +export declare function useEuiTablePersist(props: EuiTablePersistProps & { + initialSort: PropertySort; +}): { + sorting: { + sort: PropertySort; + }; + pageSize: number; + onTableChange: (nextValues: CriteriaWithPagination) => void; +}; +export declare function useEuiTablePersist(props: EuiTablePersistProps & { + initialSort?: undefined; +}): { + sorting: true; + pageSize: number; + onTableChange: (nextValues: CriteriaWithPagination) => void; +}; +export declare function useEuiTablePersist(props: EuiTablePersistProps): { + sorting: true | { + sort: PropertySort; + }; + pageSize: number; + onTableChange: (nextValues: CriteriaWithPagination) => void; +}; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/validate_persist_data.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/validate_persist_data.d.ts new file mode 100644 index 0000000000000..fff70eaf53a69 --- /dev/null +++ b/src/platform/packages/shared/shared-ux/table_persist/src/validate_persist_data.d.ts @@ -0,0 +1,11 @@ +/** + * A utility function used to validate a table persist data. + * If any of the properties is not valid, it is returned with undefined value. + * + * @param data The data to be validated + * @param pageSizeOptions The table page size options that are available + */ +export declare const validatePersistData: (data: any, pageSizeOptions: number[]) => { + pageSize: any; + sort: any; +}; diff --git a/src/platform/plugins/private/url_forwarding/public/forward_app/forward_app.d.ts b/src/platform/plugins/private/url_forwarding/public/forward_app/forward_app.d.ts new file mode 100644 index 0000000000000..33b32d1a612dd --- /dev/null +++ b/src/platform/plugins/private/url_forwarding/public/forward_app/forward_app.d.ts @@ -0,0 +1,3 @@ +import type { App, CoreSetup } from '@kbn/core/public'; +import type { ForwardDefinition, UrlForwardingStart } from '../plugin'; +export declare const createLegacyUrlForwardApp: (core: CoreSetup<{}, UrlForwardingStart>, forwards: ForwardDefinition[]) => App; diff --git a/src/platform/plugins/private/url_forwarding/public/forward_app/index.d.ts b/src/platform/plugins/private/url_forwarding/public/forward_app/index.d.ts new file mode 100644 index 0000000000000..4ca7226194532 --- /dev/null +++ b/src/platform/plugins/private/url_forwarding/public/forward_app/index.d.ts @@ -0,0 +1 @@ +export * from './forward_app'; diff --git a/src/platform/plugins/private/url_forwarding/public/forward_app/navigate_to_legacy_kibana_url.d.ts b/src/platform/plugins/private/url_forwarding/public/forward_app/navigate_to_legacy_kibana_url.d.ts new file mode 100644 index 0000000000000..013425f092c80 --- /dev/null +++ b/src/platform/plugins/private/url_forwarding/public/forward_app/navigate_to_legacy_kibana_url.d.ts @@ -0,0 +1,5 @@ +import type { ApplicationStart, IBasePath } from '@kbn/core/public'; +import type { ForwardDefinition } from '..'; +export declare const navigateToLegacyKibanaUrl: (path: string, forwards: ForwardDefinition[], basePath: IBasePath, application: ApplicationStart) => { + navigated: boolean; +}; diff --git a/src/platform/plugins/private/url_forwarding/public/forward_app/normalize_path.d.ts b/src/platform/plugins/private/url_forwarding/public/forward_app/normalize_path.d.ts new file mode 100644 index 0000000000000..5d21403f3d487 --- /dev/null +++ b/src/platform/plugins/private/url_forwarding/public/forward_app/normalize_path.d.ts @@ -0,0 +1 @@ +export declare function normalizePath(path: string): string; diff --git a/src/platform/plugins/private/url_forwarding/public/index.d.ts b/src/platform/plugins/private/url_forwarding/public/index.d.ts new file mode 100644 index 0000000000000..a0948bd9d4596 --- /dev/null +++ b/src/platform/plugins/private/url_forwarding/public/index.d.ts @@ -0,0 +1,4 @@ +import { UrlForwardingPlugin } from './plugin'; +export declare const plugin: () => UrlForwardingPlugin; +export type { ForwardDefinition, UrlForwardingSetup, UrlForwardingStart } from './plugin'; +export { UrlForwardingPlugin } from './plugin'; diff --git a/src/platform/plugins/private/url_forwarding/public/plugin.d.ts b/src/platform/plugins/private/url_forwarding/public/plugin.d.ts new file mode 100644 index 0000000000000..4cbac5e2b1d1d --- /dev/null +++ b/src/platform/plugins/private/url_forwarding/public/plugin.d.ts @@ -0,0 +1,60 @@ +import type { CoreStart, CoreSetup } from '@kbn/core/public'; +export interface ForwardDefinition { + legacyAppId: string; + newAppId: string; + rewritePath: (legacyPath: string) => string; +} +export declare class UrlForwardingPlugin { + private forwardDefinitions; + setup(core: CoreSetup<{}, UrlForwardingStart>): { + /** + * Forwards URLs within the legacy `kibana` app to a new platform application. + * + * @param legacyAppId The name of the old app to forward URLs from + * @param newAppId The name of the new app that handles the URLs now + * @param rewritePath Function to rewrite the legacy sub path of the app to the new path in the core app. + * If none is provided, it will just strip the prefix of the legacyAppId away + * + * path into the new path + * + * Example usage: + * ``` + * urlForwarding.forwardApp( + * 'old', + * 'new', + * path => { + * const [, id] = /old/item\/(.*)$/.exec(path) || []; + * if (!id) { + * return '#/home'; + * } + * return '#/items/${id}'; + * } + * ); + * ``` + * This will cause the following redirects: + * + * * app/kibana#/old/ -> app/new#/home + * * app/kibana#/old/item/123 -> app/new#/items/123 + * + */ + forwardApp: (legacyAppId: string, newAppId: string, rewritePath?: (legacyPath: string) => string) => void; + }; + start({ application, http: { basePath } }: CoreStart): { + /** + * Resolves the provided hash using the registered forwards and navigates to the target app. + * If a navigation happened, `{ navigated: true }` will be returned. + * If no matching forward is found, `{ navigated: false }` will be returned. + * @param hash + */ + navigateToLegacyKibanaUrl: (hash: string) => { + navigated: boolean; + }; + /** + * @deprecated + * Just exported for wiring up with legacy platform, should not be used. + */ + getForwards: () => ForwardDefinition[]; + }; +} +export type UrlForwardingSetup = ReturnType; +export type UrlForwardingStart = ReturnType; diff --git a/src/platform/plugins/shared/content_management/common/constants.d.ts b/src/platform/plugins/shared/content_management/common/constants.d.ts new file mode 100644 index 0000000000000..fa735c80efb19 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/constants.d.ts @@ -0,0 +1,2 @@ +export declare const PLUGIN_ID = "contentManagement"; +export declare const API_ENDPOINT = "/api/content_management/rpc"; diff --git a/src/platform/plugins/shared/content_management/common/index.d.ts b/src/platform/plugins/shared/content_management/common/index.d.ts new file mode 100644 index 0000000000000..00dd2165896ff --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/index.d.ts @@ -0,0 +1,2 @@ +export { PLUGIN_ID, API_ENDPOINT } from './constants'; +export type { ProcedureSchemas, ProcedureName, GetIn, GetResult, BulkGetIn, BulkGetResult, CreateIn, CreateResult, UpdateIn, UpdateResult, DeleteIn, DeleteResult, SearchIn, SearchQuery, SearchResult, MSearchIn, MSearchQuery, MSearchResult, MSearchOut, } from './rpc'; diff --git a/src/platform/plugins/shared/content_management/common/rpc/bulk_get.d.ts b/src/platform/plugins/shared/content_management/common/rpc/bulk_get.d.ts new file mode 100644 index 0000000000000..299fedc4836e5 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/bulk_get.d.ts @@ -0,0 +1,33 @@ +import type { Version } from '@kbn/object-versioning'; +import type { GetResult } from './get'; +export declare const bulkGetSchemas: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + ids: import("@kbn/config-schema").Type; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + hits: import("@kbn/config-schema").Type | undefined; + } & { + item: Readonly<{} & {}>; + }>; + contentTypeId: string; + }>[]>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; +}; +export interface BulkGetIn { + contentTypeId: T; + ids: string[]; + version?: Version; + options?: Options; +} +export type BulkGetResult = ResultMeta extends void ? { + hits: Array>; +} : { + hits: Array>; + meta: ResultMeta; +}; diff --git a/src/platform/plugins/shared/content_management/common/rpc/common.d.ts b/src/platform/plugins/shared/content_management/common/rpc/common.d.ts new file mode 100644 index 0000000000000..6d4098f1800ac --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/common.d.ts @@ -0,0 +1,4 @@ +export declare const itemResultSchema: import("@kbn/config-schema").ObjectType<{ + item: import("@kbn/config-schema").ObjectType<{}>; + meta: import("@kbn/config-schema").Type | undefined>; +}>; diff --git a/src/platform/plugins/shared/content_management/common/rpc/constants.d.ts b/src/platform/plugins/shared/content_management/common/rpc/constants.d.ts new file mode 100644 index 0000000000000..5f878f9a71cc1 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/constants.d.ts @@ -0,0 +1,3 @@ +export declare const procedureNames: readonly ["get", "bulkGet", "create", "update", "delete", "search", "mSearch"]; +export type ProcedureName = (typeof procedureNames)[number]; +export declare const versionSchema: import("@kbn/config-schema").Type; diff --git a/src/platform/plugins/shared/content_management/common/rpc/create.d.ts b/src/platform/plugins/shared/content_management/common/rpc/create.d.ts new file mode 100644 index 0000000000000..35b351f1996d2 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/create.d.ts @@ -0,0 +1,24 @@ +import type { Version } from '@kbn/object-versioning'; +import type { ItemResult } from './types'; +export declare const createSchemas: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + data: import("@kbn/config-schema").Type>; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + item: import("@kbn/config-schema").ObjectType<{}>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; + }>; +}; +export interface CreateIn { + contentTypeId: T; + data: Data; + version?: Version; + options?: Options; +} +export type CreateResult = ItemResult; diff --git a/src/platform/plugins/shared/content_management/common/rpc/delete.d.ts b/src/platform/plugins/shared/content_management/common/rpc/delete.d.ts new file mode 100644 index 0000000000000..275e1fe94d5ba --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/delete.d.ts @@ -0,0 +1,24 @@ +import type { Version } from '@kbn/object-versioning'; +export declare const deleteSchemas: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + id: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + success: import("@kbn/config-schema").Type; + }>; + }>; +}; +export interface DeleteIn { + contentTypeId: T; + id: string; + version?: Version; + options?: Options; +} +export interface DeleteResult { + success: boolean; +} diff --git a/src/platform/plugins/shared/content_management/common/rpc/get.d.ts b/src/platform/plugins/shared/content_management/common/rpc/get.d.ts new file mode 100644 index 0000000000000..f421ed6e5c659 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/get.d.ts @@ -0,0 +1,31 @@ +import type { Version } from '@kbn/object-versioning'; +import type { ItemResult } from './types'; +export declare const getResultSchema: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + item: import("@kbn/config-schema").ObjectType<{}>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; +}>; +export declare const getSchemas: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + id: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + item: import("@kbn/config-schema").ObjectType<{}>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; + }>; +}; +export interface GetIn { + id: string; + contentTypeId: T; + version?: Version; + options?: Options; +} +export type GetResult = ItemResult; diff --git a/src/platform/plugins/shared/content_management/common/rpc/index.d.ts b/src/platform/plugins/shared/content_management/common/rpc/index.d.ts new file mode 100644 index 0000000000000..48e340674dacd --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/index.d.ts @@ -0,0 +1,11 @@ +export { schemas } from './rpc'; +export { procedureNames } from './constants'; +export type { GetIn, GetResult } from './get'; +export type { BulkGetIn, BulkGetResult } from './bulk_get'; +export type { CreateIn, CreateResult } from './create'; +export type { UpdateIn, UpdateResult } from './update'; +export type { DeleteIn, DeleteResult } from './delete'; +export type { SearchIn, SearchQuery, SearchResult } from './search'; +export type { MSearchIn, MSearchQuery, MSearchOut, MSearchResult } from './msearch'; +export type { ProcedureSchemas } from './types'; +export type { ProcedureName } from './constants'; diff --git a/src/platform/plugins/shared/content_management/common/rpc/msearch.d.ts b/src/platform/plugins/shared/content_management/common/rpc/msearch.d.ts new file mode 100644 index 0000000000000..4a2f2fc6b229b --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/msearch.d.ts @@ -0,0 +1,48 @@ +import type { Version } from '@kbn/object-versioning'; +import type { SearchQuery, SearchResult } from './search'; +export declare const mSearchSchemas: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypes: import("@kbn/config-schema").Type[]>; + query: import("@kbn/config-schema").Type | undefined; + limit?: number | undefined; + cursor?: string | undefined; + } & {}>>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypes: import("@kbn/config-schema").Type[]>; + result: import("@kbn/config-schema").ObjectType<{ + hits: import("@kbn/config-schema").Type; + pagination: import("@kbn/config-schema").ObjectType<{ + total: import("@kbn/config-schema").Type; + cursor: import("@kbn/config-schema").Type; + }>; + }>; + }>; +}; +export type MSearchQuery = SearchQuery; +export interface MSearchIn { + contentTypes: Array<{ + contentTypeId: string; + version?: Version; + }>; + query: MSearchQuery; +} +export type MSearchResult = SearchResult; +export interface MSearchOut { + contentTypes: Array<{ + contentTypeId: string; + version?: Version; + }>; + result: MSearchResult; +} diff --git a/src/platform/plugins/shared/content_management/common/rpc/rpc.d.ts b/src/platform/plugins/shared/content_management/common/rpc/rpc.d.ts new file mode 100644 index 0000000000000..8a94779375f56 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/rpc.d.ts @@ -0,0 +1,138 @@ +export declare const schemas: { + get: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + id: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + item: import("@kbn/config-schema").ObjectType<{}>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; + }>; + }; + bulkGet: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + ids: import("@kbn/config-schema").Type; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + hits: import("@kbn/config-schema").Type | undefined; + } & { + item: Readonly<{} & {}>; + }>; + contentTypeId: string; + }>[]>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; + }; + create: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + data: import("@kbn/config-schema").Type>; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + item: import("@kbn/config-schema").ObjectType<{}>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; + }>; + }; + update: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + id: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + data: import("@kbn/config-schema").Type>; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + item: import("@kbn/config-schema").ObjectType<{}>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; + }>; + }; + delete: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + id: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + success: import("@kbn/config-schema").Type; + }>; + }>; + }; + search: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + query: import("@kbn/config-schema").Type | undefined; + limit?: number | undefined; + cursor?: string | undefined; + } & {}>>; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + hits: import("@kbn/config-schema").Type; + pagination: import("@kbn/config-schema").ObjectType<{ + total: import("@kbn/config-schema").Type; + cursor: import("@kbn/config-schema").Type; + }>; + }>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; + }; + mSearch: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypes: import("@kbn/config-schema").Type[]>; + query: import("@kbn/config-schema").Type | undefined; + limit?: number | undefined; + cursor?: string | undefined; + } & {}>>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypes: import("@kbn/config-schema").Type[]>; + result: import("@kbn/config-schema").ObjectType<{ + hits: import("@kbn/config-schema").Type; + pagination: import("@kbn/config-schema").ObjectType<{ + total: import("@kbn/config-schema").Type; + cursor: import("@kbn/config-schema").Type; + }>; + }>; + }>; + }; +}; diff --git a/src/platform/plugins/shared/content_management/common/rpc/search.d.ts b/src/platform/plugins/shared/content_management/common/rpc/search.d.ts new file mode 100644 index 0000000000000..eea454195c827 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/search.d.ts @@ -0,0 +1,79 @@ +import type { Version } from '@kbn/object-versioning'; +export declare const searchQuerySchema: import("@kbn/config-schema").Type | undefined; + limit?: number | undefined; + cursor?: string | undefined; +} & {}>>; +export declare const searchResultSchema: import("@kbn/config-schema").ObjectType<{ + hits: import("@kbn/config-schema").Type; + pagination: import("@kbn/config-schema").ObjectType<{ + total: import("@kbn/config-schema").Type; + cursor: import("@kbn/config-schema").Type; + }>; +}>; +export declare const searchSchemas: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + query: import("@kbn/config-schema").Type | undefined; + limit?: number | undefined; + cursor?: string | undefined; + } & {}>>; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + hits: import("@kbn/config-schema").Type; + pagination: import("@kbn/config-schema").ObjectType<{ + total: import("@kbn/config-schema").Type; + cursor: import("@kbn/config-schema").Type; + }>; + }>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; +}; +export interface SearchQuery { + /** The text to search for */ + text?: string; + /** List of tags id to include and exclude */ + tags?: { + included?: string[]; + excluded?: string[]; + }; + /** The number of result to return */ + limit?: number; + /** The cursor for this query. Can be a page number or a cursor */ + cursor?: string; +} +export interface SearchIn { + contentTypeId: T; + query: SearchQuery; + version?: Version; + options?: Options; +} +export type SearchResult = M extends void ? { + hits: T[]; + pagination: { + total: number; + /** Page number or cursor */ + cursor?: string; + }; +} : { + hits: T[]; + pagination: { + total: number; + /** Page number or cursor */ + cursor?: string; + }; + meta: M; +}; diff --git a/src/platform/plugins/shared/content_management/common/rpc/types.d.ts b/src/platform/plugins/shared/content_management/common/rpc/types.d.ts new file mode 100644 index 0000000000000..5ab2caa447ad8 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/types.d.ts @@ -0,0 +1,12 @@ +import type { Type } from '@kbn/config-schema'; +export interface ProcedureSchemas { + in: Type | false; + out?: Type | false; +} +export type ItemResult = M extends void ? { + item: T; + meta?: never; +} : { + item: T; + meta: M; +}; diff --git a/src/platform/plugins/shared/content_management/common/rpc/update.d.ts b/src/platform/plugins/shared/content_management/common/rpc/update.d.ts new file mode 100644 index 0000000000000..326b0e5000a30 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/rpc/update.d.ts @@ -0,0 +1,26 @@ +import type { Version } from '@kbn/object-versioning'; +import type { ItemResult } from './types'; +export declare const updateSchemas: { + in: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + id: import("@kbn/config-schema").Type; + version: import("@kbn/config-schema").Type; + data: import("@kbn/config-schema").Type>; + options: import("@kbn/config-schema").Type | undefined>; + }>; + out: import("@kbn/config-schema").ObjectType<{ + contentTypeId: import("@kbn/config-schema").Type; + result: import("@kbn/config-schema").ObjectType<{ + item: import("@kbn/config-schema").ObjectType<{}>; + meta: import("@kbn/config-schema").Type | undefined>; + }>; + }>; +}; +export interface UpdateIn { + contentTypeId: T; + id: string; + data: Data; + version?: Version; + options?: Options; +} +export type UpdateResult = ItemResult; diff --git a/src/platform/plugins/shared/content_management/common/schemas.d.ts b/src/platform/plugins/shared/content_management/common/schemas.d.ts new file mode 100644 index 0000000000000..c1f05c9926a62 --- /dev/null +++ b/src/platform/plugins/shared/content_management/common/schemas.d.ts @@ -0,0 +1 @@ +export { schemas as rpcSchemas } from './rpc'; diff --git a/src/platform/plugins/shared/content_management/public/content_client/content_client.d.ts b/src/platform/plugins/shared/content_management/public/content_client/content_client.d.ts new file mode 100644 index 0000000000000..737f9891af046 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/content_client/content_client.d.ts @@ -0,0 +1,38 @@ +import { QueryClient } from '@kbn/react-query'; +import type { CrudClient } from '../crud_client'; +import type { CreateIn, GetIn, UpdateIn, DeleteIn, SearchIn, MSearchIn, MSearchResult } from '../../common'; +import type { ContentTypeRegistry } from '../registry'; +export declare const queryKeyBuilder: { + all: (type: string) => readonly [string]; + item: (type: string, id: string) => readonly [string, string]; + search: (type: string, query: unknown, options?: object) => readonly [string, "search", unknown, object | undefined]; +}; +declare const createQueryOptionBuilder: ({ crudClientProvider, contentTypeRegistry, }: { + crudClientProvider: (contentType: string) => CrudClient; + contentTypeRegistry: ContentTypeRegistry; +}) => { + get: , O = unknown>(_input: I) => { + queryKey: readonly [string, string]; + queryFn: () => Promise; + }; + search: , O = unknown>(_input: I) => { + queryKey: readonly [string, "search", unknown, object | undefined]; + queryFn: () => Promise; + }; +}; +export declare class ContentClient { + private readonly crudClientProvider; + private readonly contentTypeRegistry; + readonly queryClient: QueryClient; + readonly queryOptionBuilder: ReturnType; + constructor(crudClientProvider: (contentType?: string) => CrudClient, contentTypeRegistry: ContentTypeRegistry); + get(input: I): Promise; + get$(input: I): import("rxjs").Observable>; + create(input: I): Promise; + update(input: I): Promise; + delete(input: I): Promise; + search(input: I): Promise; + search$(input: I): import("rxjs").Observable>; + mSearch(input: MSearchIn): Promise>; +} +export {}; diff --git a/src/platform/plugins/shared/content_management/public/content_client/content_client_context.d.ts b/src/platform/plugins/shared/content_management/public/content_client/content_client_context.d.ts new file mode 100644 index 0000000000000..444ad8864d7b6 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/content_client/content_client_context.d.ts @@ -0,0 +1,6 @@ +import type { FC, PropsWithChildren } from 'react'; +import type { ContentClient } from './content_client'; +export declare const useContentClient: () => ContentClient; +export declare const ContentClientProvider: FC>; diff --git a/src/platform/plugins/shared/content_management/public/content_client/content_client_mutation_hooks.d.ts b/src/platform/plugins/shared/content_management/public/content_client/content_client_mutation_hooks.d.ts new file mode 100644 index 0000000000000..3c7c45784420a --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/content_client/content_client_mutation_hooks.d.ts @@ -0,0 +1,4 @@ +import type { CreateIn, UpdateIn, DeleteIn } from '../../common'; +export declare const useCreateContentMutation: () => import("@kbn/react-query").UseMutationResult; +export declare const useUpdateContentMutation: () => import("@kbn/react-query").UseMutationResult; +export declare const useDeleteContentMutation: () => import("@kbn/react-query").UseMutationResult; diff --git a/src/platform/plugins/shared/content_management/public/content_client/content_client_query_hooks.d.ts b/src/platform/plugins/shared/content_management/public/content_client/content_client_query_hooks.d.ts new file mode 100644 index 0000000000000..499b7085df894 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/content_client/content_client_query_hooks.d.ts @@ -0,0 +1,18 @@ +import type { QueryObserverOptions } from '@kbn/react-query'; +import type { GetIn, SearchIn } from '../../common'; +/** + * Exposed `useQuery` options + */ +export type QueryOptions = Pick; +/** + * + * @param input - get content identifier like "id" and "contentType" + * @param queryOptions - query options + */ +export declare const useGetContentQuery: (input: I, queryOptions?: QueryOptions) => import("@kbn/react-query").UseQueryResult; +/** + * + * @param input - get content identifier like "id" and "contentType" + * @param queryOptions - query options + */ +export declare const useSearchContentQuery: (input: I, queryOptions?: QueryOptions) => import("@kbn/react-query").UseQueryResult; diff --git a/src/platform/plugins/shared/content_management/public/content_client/index.d.ts b/src/platform/plugins/shared/content_management/public/content_client/index.d.ts new file mode 100644 index 0000000000000..2bbb939afecf3 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/content_client/index.d.ts @@ -0,0 +1,4 @@ +export { ContentClient } from './content_client'; +export { ContentClientProvider, useContentClient } from './content_client_context'; +export { useGetContentQuery, useSearchContentQuery, type QueryOptions, } from './content_client_query_hooks'; +export { useCreateContentMutation, useUpdateContentMutation, useDeleteContentMutation, } from './content_client_mutation_hooks'; diff --git a/src/platform/plugins/shared/content_management/public/content_client/query_observable.d.ts b/src/platform/plugins/shared/content_management/public/content_client/query_observable.d.ts new file mode 100644 index 0000000000000..02ed35945ae8f --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/content_client/query_observable.d.ts @@ -0,0 +1,3 @@ +import type { QueryObserverOptions, QueryObserverResult, QueryClient, QueryKey } from '@kbn/react-query'; +import { Observable } from 'rxjs'; +export declare const createQueryObservable: (queryClient: QueryClient, queryOptions: QueryObserverOptions) => Observable>; diff --git a/src/platform/plugins/shared/content_management/public/crud_client/crud_client.d.ts b/src/platform/plugins/shared/content_management/public/crud_client/crud_client.d.ts new file mode 100644 index 0000000000000..9b49103cfdec9 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/crud_client/crud_client.d.ts @@ -0,0 +1,9 @@ +import type { GetIn, CreateIn, UpdateIn, DeleteIn, SearchIn, MSearchIn } from '../../common'; +export interface CrudClient { + get(input: GetIn): Promise; + create(input: CreateIn): Promise; + update(input: UpdateIn): Promise; + delete(input: DeleteIn): Promise; + search(input: SearchIn): Promise; + mSearch?(input: MSearchIn): Promise; +} diff --git a/src/platform/plugins/shared/content_management/public/crud_client/index.d.ts b/src/platform/plugins/shared/content_management/public/crud_client/index.d.ts new file mode 100644 index 0000000000000..28e4cd850f719 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/crud_client/index.d.ts @@ -0,0 +1 @@ +export type { CrudClient } from './crud_client'; diff --git a/src/platform/plugins/shared/content_management/public/index.d.ts b/src/platform/plugins/shared/content_management/public/index.d.ts new file mode 100644 index 0000000000000..409eb0f41a91c --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/index.d.ts @@ -0,0 +1,5 @@ +import { ContentManagementPlugin } from './plugin'; +export type { CrudClient } from './crud_client'; +export { ContentClientProvider, ContentClient, useCreateContentMutation, useUpdateContentMutation, useDeleteContentMutation, useSearchContentQuery, useGetContentQuery, useContentClient, type QueryOptions, } from './content_client'; +export declare function plugin(): ContentManagementPlugin; +export type { ContentManagementPublicStart, ContentManagementPublicSetup } from './types'; diff --git a/src/platform/plugins/shared/content_management/public/plugin.d.ts b/src/platform/plugins/shared/content_management/public/plugin.d.ts new file mode 100644 index 0000000000000..7866819d32343 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/plugin.d.ts @@ -0,0 +1,19 @@ +import type { CoreStart, Plugin } from '@kbn/core/public'; +import type { ContentManagementPublicStart, ContentManagementPublicSetup, SetupDependencies, StartDependencies } from './types'; +import { ContentClient } from './content_client'; +export declare class ContentManagementPlugin implements Plugin { + private contentTypeRegistry; + constructor(); + setup(): { + registry: { + register: (definition: import("./registry").ContentTypeDefinition) => import("./registry").ContentType; + }; + }; + start(core: CoreStart, deps: StartDependencies): { + client: ContentClient; + registry: { + get: (id: string) => import("./registry").ContentType | undefined; + getAll: () => import("./registry").ContentType[]; + }; + }; +} diff --git a/src/platform/plugins/shared/content_management/public/registry/content_type.d.ts b/src/platform/plugins/shared/content_management/public/registry/content_type.d.ts new file mode 100644 index 0000000000000..56aa447f29b7c --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/registry/content_type.d.ts @@ -0,0 +1,12 @@ +import type { ContentTypeDefinition } from './content_type_definition'; +import type { CrudClient } from '../crud_client'; +export declare class ContentType { + readonly definition: ContentTypeDefinition; + constructor(definition: ContentTypeDefinition); + get id(): string; + get name(): string; + get description(): string; + get icon(): string; + get crud(): CrudClient | undefined; + get version(): ContentTypeDefinition['version']; +} diff --git a/src/platform/plugins/shared/content_management/public/registry/content_type_definition.d.ts b/src/platform/plugins/shared/content_management/public/registry/content_type_definition.d.ts new file mode 100644 index 0000000000000..b6c9f45c5090b --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/registry/content_type_definition.d.ts @@ -0,0 +1,34 @@ +import type { Version } from '@kbn/object-versioning'; +import type { CrudClient } from '../crud_client'; +/** + * Content type definition as it is registered in the content registry. + */ +export interface ContentTypeDefinition { + /** + * ID of the type. Must be unique. Like "dashboard", "visualization", etc. + */ + id: string; + /** + * Human-readable name of the type. Like "Dashboard", "Visualization", etc. + */ + name?: string; + /** + * Human-readable description of the type. + */ + description?: string; + /** + * Icon to use for this type. Usually an EUI icon type. + * + * @see https://elastic.github.io/eui/#/display/icons + */ + icon?: string; + /** + * CRUD client to use for this type. + * If not provided the default CRUD client is used assuming that this type has a server-side content registry + */ + crud?: CrudClient; + version: { + /** The latest version for this content */ + latest: Version; + }; +} diff --git a/src/platform/plugins/shared/content_management/public/registry/index.d.ts b/src/platform/plugins/shared/content_management/public/registry/index.d.ts new file mode 100644 index 0000000000000..be225ef2dd8f4 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/registry/index.d.ts @@ -0,0 +1,3 @@ +export type { ContentTypeDefinition } from './content_type_definition'; +export { ContentType } from './content_type'; +export { ContentTypeRegistry } from './registry'; diff --git a/src/platform/plugins/shared/content_management/public/registry/registry.d.ts b/src/platform/plugins/shared/content_management/public/registry/registry.d.ts new file mode 100644 index 0000000000000..4838ddb4346a8 --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/registry/registry.d.ts @@ -0,0 +1,8 @@ +import type { ContentTypeDefinition } from './content_type_definition'; +import { ContentType } from './content_type'; +export declare class ContentTypeRegistry { + private readonly types; + register(definition: ContentTypeDefinition): ContentType; + get(id: string): ContentType | undefined; + getAll(): ContentType[]; +} diff --git a/src/platform/plugins/shared/content_management/public/rpc_client/index.d.ts b/src/platform/plugins/shared/content_management/public/rpc_client/index.d.ts new file mode 100644 index 0000000000000..b1f603b1c3b8c --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/rpc_client/index.d.ts @@ -0,0 +1 @@ +export { RpcClient } from './rpc_client'; diff --git a/src/platform/plugins/shared/content_management/public/rpc_client/rpc_client.d.ts b/src/platform/plugins/shared/content_management/public/rpc_client/rpc_client.d.ts new file mode 100644 index 0000000000000..733ac31925e7b --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/rpc_client/rpc_client.d.ts @@ -0,0 +1,25 @@ +import type { HttpSetup } from '@kbn/core/public'; +import type { GetIn, BulkGetIn, CreateIn, UpdateIn, DeleteIn, SearchIn, MSearchIn, MSearchResult } from '../../common'; +import type { CrudClient } from '../crud_client/crud_client'; +export declare class RpcClient implements CrudClient { + private http; + constructor(http: { + post: HttpSetup['post']; + }); + get(input: I): Promise>; + bulkGet(input: I): Promise<{ + hits: import("../../common/rpc/types").ItemResult[]; + }>; + create(input: I): Promise>; + update(input: I): Promise>; + delete(input: I): Promise; + search(input: I): Promise<{ + hits: O[]; + pagination: { + total: number; + cursor?: string; + }; + }>; + mSearch(input: MSearchIn): Promise>; + private sendMessage; +} diff --git a/src/platform/plugins/shared/content_management/public/types.d.ts b/src/platform/plugins/shared/content_management/public/types.d.ts new file mode 100644 index 0000000000000..312d3f7357efd --- /dev/null +++ b/src/platform/plugins/shared/content_management/public/types.d.ts @@ -0,0 +1,13 @@ +import type { ContentClient } from './content_client'; +import type { ContentTypeRegistry } from './registry'; +export interface SetupDependencies { +} +export interface StartDependencies { +} +export interface ContentManagementPublicSetup { + registry: Pick; +} +export interface ContentManagementPublicStart { + client: ContentClient; + registry: Pick; +} diff --git a/src/platform/plugins/shared/content_management/server/content_client/content_client.d.ts b/src/platform/plugins/shared/content_management/server/content_client/content_client.d.ts new file mode 100644 index 0000000000000..c5fd8678ffa4c --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/content_client/content_client.d.ts @@ -0,0 +1,20 @@ +import type { StorageContext } from '../core'; +import { ContentCrud } from '../core/crud'; +import type { IContentClient } from './types'; +interface Context { + crudInstance: ContentCrud; + storageContext: StorageContext; +} +export declare class ContentClient implements IContentClient { + contentTypeId: string; + private readonly ctx; + static create(contentTypeId: string, ctx: Context): IContentClient; + constructor(token: symbol, contentTypeId: string, ctx: Context); + get(id: string, options: object): Promise>; + bulkGet(ids: string[], options: object): Promise>; + create(data: object, options?: object): Promise>; + update(id: string, data: object, options?: object): Promise>; + delete(id: string, options?: object): Promise; + search(query: object, options?: object): Promise>; +} +export {}; diff --git a/src/platform/plugins/shared/content_management/server/content_client/content_client_factory.d.ts b/src/platform/plugins/shared/content_management/server/content_client/content_client_factory.d.ts new file mode 100644 index 0000000000000..8bbe03ee1fd45 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/content_client/content_client_factory.d.ts @@ -0,0 +1,28 @@ +import type { Logger, KibanaRequest } from '@kbn/core/server'; +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import type { Version } from '@kbn/object-versioning'; +import type { MSearchIn, MSearchOut } from '../../common'; +import type { ContentRegistry } from '../core'; +import type { MSearchService } from '../core/msearch'; +export declare const getContentClientFactory: ({ contentRegistry }: { + contentRegistry: ContentRegistry; +}) => (contentTypeId: string) => { + /** + * Client getter to interact with the registered content type. + */ + getForRequest: ({ request, requestHandlerContext, version, }: { + request: KibanaRequest; + requestHandlerContext: RequestHandlerContext; + version?: Version; + }) => import("./types").IContentClient; +}; +export declare const getMSearchClientFactory: ({ contentRegistry, mSearchService, logger, }: { + contentRegistry: ContentRegistry; + mSearchService: MSearchService; + logger: Logger; +}) => ({ requestHandlerContext, request, }: { + requestHandlerContext: RequestHandlerContext; + request: KibanaRequest; +}) => { + msearch: ({ contentTypes, query }: MSearchIn) => Promise; +}; diff --git a/src/platform/plugins/shared/content_management/server/content_client/index.d.ts b/src/platform/plugins/shared/content_management/server/content_client/index.d.ts new file mode 100644 index 0000000000000..a820b1497c1fb --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/content_client/index.d.ts @@ -0,0 +1,2 @@ +export { getContentClientFactory, getMSearchClientFactory } from './content_client_factory'; +export type { IContentClient } from './types'; diff --git a/src/platform/plugins/shared/content_management/server/content_client/types.d.ts b/src/platform/plugins/shared/content_management/server/content_client/types.d.ts new file mode 100644 index 0000000000000..f05640c0fb636 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/content_client/types.d.ts @@ -0,0 +1,39 @@ +import type { ContentCrud } from '../core/crud'; +type CrudGetParameters = Parameters['get']>; +export type GetParameters = [CrudGetParameters[1], CrudGetParameters[2]?]; +type CrudBulkGetParameters = Parameters['bulkGet']>; +export type BulkGetParameters = [ + CrudBulkGetParameters[1], + CrudBulkGetParameters[2]? +]; +type CrudCreateParameters = Parameters['create']>; +export type CreateParameters = [ + CrudCreateParameters[1], + CrudCreateParameters[2]? +]; +type CrudUpdateParameters = Parameters['update']>; +export type UpdateParameters = [ + CrudUpdateParameters[1], + CrudUpdateParameters[2], + CrudUpdateParameters[3]? +]; +type CrudDeleteParameters = Parameters['delete']>; +export type DeleteParameters = [ + CrudDeleteParameters[1], + CrudDeleteParameters[2]? +]; +type CrudSearchParameters = Parameters['search']>; +export type SearchParameters = [ + CrudSearchParameters[1], + CrudSearchParameters[2]? +]; +export interface IContentClient { + contentTypeId: string; + get(...params: GetParameters): ReturnType['get']>; + bulkGet(...params: BulkGetParameters): ReturnType['bulkGet']>; + create(...params: CreateParameters): ReturnType['create']>; + update(...params: UpdateParameters): ReturnType['update']>; + delete(...params: DeleteParameters): ReturnType['delete']>; + search(...params: SearchParameters): ReturnType['search']>; +} +export {}; diff --git a/src/platform/plugins/shared/content_management/server/core/content_type.d.ts b/src/platform/plugins/shared/content_management/server/core/content_type.d.ts new file mode 100644 index 0000000000000..2eb1531d5fb71 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/content_type.d.ts @@ -0,0 +1,17 @@ +import { ContentCrud } from './crud'; +import type { EventBus } from './event_bus'; +import type { ContentStorage, ContentTypeDefinition } from './types'; +export declare class ContentType { + /** Content definition. */ + private readonly _definition; + /** Content crud instance. */ + private readonly contentCrud; + constructor(definition: ContentTypeDefinition, eventBus: EventBus); + get id(): string; + get definition(): ContentTypeDefinition>>; + get storage(): ContentStorage>; + get crud(): ContentCrud; + get version(): { + latest: import("@kbn/object-versioning").Version; + }; +} diff --git a/src/platform/plugins/shared/content_management/server/core/core.d.ts b/src/platform/plugins/shared/content_management/server/core/core.d.ts new file mode 100644 index 0000000000000..131200f8475c9 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/core.d.ts @@ -0,0 +1,50 @@ +import type { Logger, KibanaRequest } from '@kbn/core/server'; +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import type { Version } from '@kbn/object-versioning'; +import type { MSearchIn, MSearchOut } from '../../common'; +import type { IContentClient } from '../content_client'; +import type { ContentCrud } from './crud'; +import { EventBus } from './event_bus'; +import { ContentRegistry } from './registry'; +export interface GetContentClientForRequestDependencies { + requestHandlerContext: RequestHandlerContext; + request: KibanaRequest; +} +export interface CoreApi { + /** + * Register a new content in the registry. + * + * @param contentType The content type to register + * @param config The content configuration + */ + register: ContentRegistry['register']; + /** Handler to retrieve a content crud instance */ + crud: (contentType: string) => ContentCrud; + /** Content management event bus */ + eventBus: EventBus; + /** Client getters to interact with registered content types. */ + contentClient: { + /** Client getter to interact with registered content types for the current HTTP request. */ + getForRequest(deps: GetContentClientForRequestDependencies): { + for: (contentTypeId: string, version?: Version) => IContentClient; + msearch(args: MSearchIn): Promise; + }; + }; +} +export interface CoreInitializerContext { + logger: Logger; +} +export interface CoreSetup { + /** Content registry instance */ + contentRegistry: ContentRegistry; + /** Api exposed to other plugins */ + api: CoreApi; +} +export declare class Core { + private readonly ctx; + private contentRegistry; + private eventBus; + constructor(ctx: CoreInitializerContext); + setup(): CoreSetup; + private getContentClientForRequest; +} diff --git a/src/platform/plugins/shared/content_management/server/core/crud.d.ts b/src/platform/plugins/shared/content_management/server/core/crud.d.ts new file mode 100644 index 0000000000000..466d4cdefc360 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/crud.d.ts @@ -0,0 +1,41 @@ +import type { GetResult, BulkGetResult, CreateResult, UpdateResult, DeleteResult, SearchResult, SearchQuery } from '../../common'; +import type { EventBus } from './event_bus'; +import type { ContentStorage, StorageContext } from './types'; +export interface GetResponse { + contentTypeId: string; + result: GetResult; +} +export interface BulkGetResponse { + contentTypeId: string; + result: BulkGetResult; +} +export interface CreateItemResponse { + contentTypeId: string; + result: CreateResult; +} +export interface UpdateItemResponse { + contentTypeId: string; + result: UpdateResult; +} +export interface DeleteItemResponse { + contentTypeId: string; + result: DeleteResult; +} +export interface SearchResponse { + contentTypeId: string; + result: SearchResult; +} +export declare class ContentCrud { + private storage; + private eventBus; + contentTypeId: string; + constructor(contentTypeId: string, contentStorage: ContentStorage, { eventBus, }: { + eventBus: EventBus; + }); + get(ctx: StorageContext, contentId: string, options?: object): Promise>; + bulkGet(ctx: StorageContext, ids: string[], options?: object): Promise>; + create(ctx: StorageContext, data: object, options?: object): Promise>; + update(ctx: StorageContext, id: string, data: object, options?: object): Promise>; + delete(ctx: StorageContext, id: string, options?: object): Promise; + search(ctx: StorageContext, query: SearchQuery, options?: object): Promise>; +} diff --git a/src/platform/plugins/shared/content_management/server/core/event_bus.d.ts b/src/platform/plugins/shared/content_management/server/core/event_bus.d.ts new file mode 100644 index 0000000000000..24a899b0d5f8a --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/event_bus.d.ts @@ -0,0 +1,56 @@ +import type { ContentEvent, ContentEventType } from './event_types'; +/** + * Content event listener + */ +export type EventListener = (arg: ContentEvent) => void; +/** + * Event bus for all content generated events + */ +export declare class EventBus { + private contentTypeValidator?; + /** The events Rxjs Subject */ + private _events$; + /** Map of listener for each content type */ + private eventListeners; + /** Subscription to the _events$ Observable */ + private eventsSubscription; + /** + * @param contentTypeValidator Handler to validate if a content type is valid or not + */ + constructor(contentTypeValidator?: ((contentType: string) => boolean) | undefined); + /** + * + * + * @param type The event type e.g. "getItemSuccess") + * @param cb Callback to execute + * + * @example + * + * ```ts + * // Register an event for all content types + * eventBus.on('getItemSuccess', (event) => {}) + * + * // Register an event for the "dashboard" content type + * * eventBus.on('getItemSuccess', 'dashboard', (event) => {}) + * ``` + */ + /** + * Register an event listener for specific events on specific content types + * + * @param eventType The event type to listen to + * @param contentType The content type to listen to (if not specified all content types will send the event type) + * @param cb Handler to call when the event occurs + * + * @returns Handler to unsubscribe + */ + on(eventType: ContentEventType, cb: EventListener): () => void; + on(eventType: ContentEventType, contentType: ContentType, cb: EventListener): () => void; + /** + * Send an event to the CM event bus + * @param event The event to send + */ + emit(event: ContentEvent): void; + /** Content management events Observable */ + get events$(): import("rxjs").Observable; + stop(): void; +} diff --git a/src/platform/plugins/shared/content_management/server/core/event_types.d.ts b/src/platform/plugins/shared/content_management/server/core/event_types.d.ts new file mode 100644 index 0000000000000..7bdf91fce2699 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/event_types.d.ts @@ -0,0 +1,74 @@ +interface BaseEvent { + type: T; + contentTypeId: string; + options?: Options; +} +export interface GetItemStart extends BaseEvent<'getItemStart'> { + contentId: string; +} +export interface GetItemSuccess extends BaseEvent<'getItemSuccess'> { + contentId: string; + data: unknown; +} +export interface GetItemError extends BaseEvent<'getItemError'> { + contentId: string; + error: unknown; +} +export interface BulkGetItemStart extends BaseEvent<'bulkGetItemStart'> { + ids: string[]; +} +export interface BulkGetItemSuccess extends BaseEvent<'bulkGetItemSuccess'> { + ids: string[]; + data: unknown; +} +export interface BulkGetItemError extends BaseEvent<'bulkGetItemError'> { + ids: string[]; + error: unknown; +} +export interface CreateItemStart extends BaseEvent<'createItemStart'> { + data: object; +} +export interface CreateItemSuccess extends BaseEvent<'createItemSuccess'> { + data: object; +} +export interface CreateItemError extends BaseEvent<'createItemError'> { + data: object; + error: unknown; +} +export interface UpdateItemStart extends BaseEvent<'updateItemStart'> { + contentId: string; + data: object; +} +export interface UpdateItemSuccess extends BaseEvent<'updateItemSuccess'> { + contentId: string; + data: object; +} +export interface UpdateItemError extends BaseEvent<'updateItemError'> { + contentId: string; + data: object; + error: unknown; +} +export interface DeleteItemStart extends BaseEvent<'deleteItemStart'> { + contentId: string; +} +export interface DeleteItemSuccess extends BaseEvent<'deleteItemSuccess'> { + contentId: string; +} +export interface DeleteItemError extends BaseEvent<'deleteItemError'> { + contentId: string; + error: unknown; +} +export interface SearchItemStart extends BaseEvent<'searchItemStart'> { + query: object; +} +export interface SearchItemSuccess extends BaseEvent<'searchItemSuccess'> { + query: object; + data: unknown; +} +export interface SearchItemError extends BaseEvent<'searchItemError'> { + query: object; + error: unknown; +} +export type ContentEvent = GetItemStart | GetItemSuccess | GetItemError | BulkGetItemStart | BulkGetItemSuccess | BulkGetItemError | CreateItemStart | CreateItemSuccess | CreateItemError | UpdateItemStart | UpdateItemSuccess | UpdateItemError | DeleteItemStart | DeleteItemSuccess | DeleteItemError | SearchItemStart | SearchItemSuccess | SearchItemError; +export type ContentEventType = ContentEvent['type']; +export {}; diff --git a/src/platform/plugins/shared/content_management/server/core/index.d.ts b/src/platform/plugins/shared/content_management/server/core/index.d.ts new file mode 100644 index 0000000000000..37659f58dd2f1 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/index.d.ts @@ -0,0 +1,6 @@ +export { Core } from './core'; +export type { CoreApi } from './core'; +export type { ContentType } from './content_type'; +export type { ContentStorage, ContentTypeDefinition, StorageContext, StorageContextGetTransformFn, MSearchConfig, } from './types'; +export type { ContentRegistry } from './registry'; +export type { ContentCrud } from './crud'; diff --git a/src/platform/plugins/shared/content_management/server/core/msearch.d.ts b/src/platform/plugins/shared/content_management/server/core/msearch.d.ts new file mode 100644 index 0000000000000..88e88af8630c4 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/msearch.d.ts @@ -0,0 +1,19 @@ +import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import type { MSearchResult, SearchQuery } from '../../common'; +import type { ContentRegistry } from './registry'; +import type { StorageContext } from './types'; +export declare class MSearchService { + private readonly deps; + constructor(deps: { + getSavedObjectsClient: () => Promise; + contentRegistry: ContentRegistry; + getConfig: { + listingLimit: () => Promise; + perPage: () => Promise; + }; + }); + search(contentTypes: Array<{ + contentTypeId: string; + ctx: StorageContext; + }>, query: SearchQuery): Promise; +} diff --git a/src/platform/plugins/shared/content_management/server/core/registry.d.ts b/src/platform/plugins/shared/content_management/server/core/registry.d.ts new file mode 100644 index 0000000000000..7697bac57595d --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/registry.d.ts @@ -0,0 +1,34 @@ +import { ContentType } from './content_type'; +import type { EventBus } from './event_bus'; +import type { ContentStorage, ContentTypeDefinition, MSearchConfig } from './types'; +import type { ContentCrud } from './crud'; +export declare class ContentRegistry { + private eventBus; + private types; + constructor(eventBus: EventBus); + /** + * Register a new content in the registry. + * + * @param contentType The content type to register + * @param config The content configuration + */ + register> = ContentStorage>(definition: ContentTypeDefinition): { + /** + * Client getters to interact with the registered content type. + */ + contentClient: { + getForRequest: ({ request, requestHandlerContext, version, }: { + request: import("@kbn/core/packages/http/server").KibanaRequest; + requestHandlerContext: import("@kbn/core/packages/http/request-handler-context-server").RequestHandlerContext; + version?: import("@kbn/object-versioning").Version; + }) => import("../content_client").IContentClient; + }; + }; + getContentType(id: string): ContentType; + /** Get the definition for a specific content type */ + getDefinition(id: string): ContentTypeDefinition>>; + /** Get the crud instance of a content type */ + getCrud(id: string): ContentCrud; + /** Helper to validate if a content type has been registered */ + isContentRegistered(id: string): boolean; +} diff --git a/src/platform/plugins/shared/content_management/server/core/types.d.ts b/src/platform/plugins/shared/content_management/server/core/types.d.ts new file mode 100644 index 0000000000000..8e5ef52b88d92 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/core/types.d.ts @@ -0,0 +1,80 @@ +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import type { Version, ContentManagementServiceTransforms, ContentManagementServiceDefinitionVersioned } from '@kbn/object-versioning'; +import type { SavedObjectsFindResult } from '@kbn/core-saved-objects-api-server'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { GetResult, BulkGetResult, CreateResult, UpdateResult, DeleteResult, SearchQuery, SearchResult } from '../../common'; +export type StorageContextGetTransformFn = (definitions: ContentManagementServiceDefinitionVersioned, requestVersion?: Version) => ContentManagementServiceTransforms; +/** Context that is sent to all storage instance methods */ +export interface StorageContext { + request: KibanaRequest; + /** The Core HTTP request handler context */ + requestHandlerContext: RequestHandlerContext; + version: { + /** + * The content type version for the request. It usually is the latest version although in some + * cases the client (browser) might still be on an older version and make requests with that version. + */ + request: Version; + /** + * The latest version of the content type. This is the version that the content type is currently on + * after updating the Kibana server. + */ + latest: Version; + }; + utils: { + /** + * Get the transforms handlers for the content type. + * The transforms are used to transform the content object to the latest schema (up) and back + * to a previous schema (down). + */ + getTransforms: StorageContextGetTransformFn; + }; +} +export interface ContentStorage = MSearchConfig> { + /** Get a single item */ + get(ctx: StorageContext, id: string, options?: object): Promise>; + /** Get multiple items */ + bulkGet(ctx: StorageContext, ids: string[], options?: object): Promise>; + /** Create an item */ + create(ctx: StorageContext, data: object, options?: object): Promise>; + /** Update an item */ + update(ctx: StorageContext, id: string, data: object, options?: object): Promise>; + /** Delete an item */ + delete(ctx: StorageContext, id: string, options?: object): Promise; + /** Search items */ + search(ctx: StorageContext, query: SearchQuery, options?: object): Promise>; + /** + * Opt-in to multi-type search. + * Can only be supported if the content type is backed by a saved object since `mSearch` is using the `savedObjects.find` API. + **/ + mSearch?: TMSearchConfig; +} +export interface ContentTypeDefinition { + /** Unique id for the content type */ + id: string; + /** The storage layer for the content. It must implement the ContentStorage interface. */ + storage: S; + version: { + latest: Version; + }; +} +/** + * A configuration for multi-type search. + * By configuring a content type with a `MSearchConfig`, it can be searched in the multi-type search. + * Underneath content management is using the `savedObjects.find` API to search the saved objects. + */ +export interface MSearchConfig { + /** + * The saved object type that corresponds to this content type. + */ + savedObjectType: string; + /** + * Mapper function that transforms the saved object into the content item result. + */ + toItemResult: (ctx: StorageContext, savedObject: SavedObjectsFindResult) => T; + /** + * Additional fields to search on. These fields will be added to the search query. + * By default, only `title` and `description` are searched. + */ + additionalSearchFields?: string[]; +} diff --git a/src/platform/plugins/shared/content_management/server/index.d.ts b/src/platform/plugins/shared/content_management/server/index.d.ts new file mode 100644 index 0000000000000..2c464992f7296 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/index.d.ts @@ -0,0 +1,4 @@ +import type { PluginInitializerContext } from '@kbn/core/server'; +export declare function plugin(initializerContext: PluginInitializerContext): Promise; +export type { ContentManagementServerSetup, ContentManagementServerStart } from './types'; +export type { ContentStorage, StorageContext, MSearchConfig } from './core'; diff --git a/src/platform/plugins/shared/content_management/server/plugin.d.ts b/src/platform/plugins/shared/content_management/server/plugin.d.ts new file mode 100644 index 0000000000000..3471fa25fc21e --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/plugin.d.ts @@ -0,0 +1,20 @@ +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; +import type { ContentManagementServerSetup, ContentManagementServerStart, ContentManagementServerSetupDependencies, ContentManagementServerStartDependencies } from './types'; +export declare class ContentManagementPlugin implements Plugin { + private readonly logger; + private readonly core; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup, plugins: ContentManagementServerSetupDependencies): { + favorites: import("@kbn/content-management-favorites-server/src/favorites_registry").FavoritesRegistrySetup; + register: import("./core").ContentRegistry["register"]; + crud: (contentType: string) => import("./core").ContentCrud; + eventBus: import("./core/event_bus").EventBus; + contentClient: { + getForRequest(deps: import("./core/core").GetContentClientForRequestDependencies): { + for: (contentTypeId: string, version?: import("@kbn/object-versioning").Version) => import("./types").IContentClient; + msearch(args: import("../common/rpc").MSearchIn): Promise; + }; + }; + }; + start(core: CoreStart): {}; +} diff --git a/src/platform/plugins/shared/content_management/server/rpc/index.d.ts b/src/platform/plugins/shared/content_management/server/rpc/index.d.ts new file mode 100644 index 0000000000000..2c99225930c22 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/index.d.ts @@ -0,0 +1,5 @@ +export { RpcService } from './rpc_service'; +export { initRpcRoutes } from './routes'; +export { registerProcedures } from './procedures'; +export type { Context } from './types'; +export type { ProcedureDefinition } from './rpc_service'; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/all_procedures.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/all_procedures.d.ts new file mode 100644 index 0000000000000..c254f7c72776f --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/all_procedures.d.ts @@ -0,0 +1,5 @@ +import type { Logger } from '@kbn/core/server'; +import type { ProcedureName } from '../../../common'; +import type { ProcedureDefinition } from '../rpc_service'; +import type { Context } from '../types'; +export declare const getProcedures: (logger: Logger) => { [key in ProcedureName]: ProcedureDefinition; }; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/bulk_get.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/bulk_get.d.ts new file mode 100644 index 0000000000000..bc3ce54d5ec20 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/bulk_get.d.ts @@ -0,0 +1,5 @@ +import type { BulkGetIn } from '../../../common'; +import type { ProcedureDefinition } from '../rpc_service'; +import type { Context } from '../types'; +import type { BulkGetResponse } from '../../core/crud'; +export declare const bulkGet: ProcedureDefinition, BulkGetResponse>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/create.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/create.d.ts new file mode 100644 index 0000000000000..b4ccc213288be --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/create.d.ts @@ -0,0 +1,4 @@ +import type { CreateIn } from '../../../common'; +import type { ProcedureDefinition } from '../rpc_service'; +import type { Context } from '../types'; +export declare const create: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/delete.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/delete.d.ts new file mode 100644 index 0000000000000..b99febeaff878 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/delete.d.ts @@ -0,0 +1,4 @@ +import type { DeleteIn } from '../../../common'; +import type { ProcedureDefinition } from '../rpc_service'; +import type { Context } from '../types'; +export declare const deleteProc: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/get.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/get.d.ts new file mode 100644 index 0000000000000..737976ac70f70 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/get.d.ts @@ -0,0 +1,4 @@ +import type { GetIn } from '../../../common'; +import type { ProcedureDefinition } from '../rpc_service'; +import type { Context } from '../types'; +export declare const get: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/index.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/index.d.ts new file mode 100644 index 0000000000000..a6e69a72fc02f --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/index.d.ts @@ -0,0 +1,5 @@ +import type { Logger } from '@kbn/core/server'; +import type { ProcedureName } from '../../../common'; +import type { RpcService } from '../rpc_service'; +import type { Context } from '../types'; +export declare function registerProcedures(rpc: RpcService, logger: Logger): void; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/msearch.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/msearch.d.ts new file mode 100644 index 0000000000000..4dd9a9e8bfd98 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/msearch.d.ts @@ -0,0 +1,5 @@ +import type { Logger } from '@kbn/core/server'; +import type { MSearchIn, MSearchOut } from '../../../common'; +import type { ProcedureDefinition } from '../rpc_service'; +import type { Context } from '../types'; +export declare const getMSearch: (logger: Logger) => ProcedureDefinition; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/search.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/search.d.ts new file mode 100644 index 0000000000000..712b1676b35b3 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/search.d.ts @@ -0,0 +1,4 @@ +import type { SearchIn } from '../../../common'; +import type { ProcedureDefinition } from '../rpc_service'; +import type { Context } from '../types'; +export declare const search: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/update.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/update.d.ts new file mode 100644 index 0000000000000..5fbb12fb36d45 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/procedures/update.d.ts @@ -0,0 +1,4 @@ +import type { UpdateIn } from '../../../common'; +import type { ProcedureDefinition } from '../rpc_service'; +import type { Context } from '../types'; +export declare const update: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/routes/error_wrapper.d.ts b/src/platform/plugins/shared/content_management/server/rpc/routes/error_wrapper.d.ts new file mode 100644 index 0000000000000..5fd05fbc65beb --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/routes/error_wrapper.d.ts @@ -0,0 +1,2 @@ +import type { ResponseError, CustomHttpResponseOptions } from '@kbn/core/server'; +export declare function wrapError(error: any): CustomHttpResponseOptions; diff --git a/src/platform/plugins/shared/content_management/server/rpc/routes/index.d.ts b/src/platform/plugins/shared/content_management/server/rpc/routes/index.d.ts new file mode 100644 index 0000000000000..96808fbde15aa --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/routes/index.d.ts @@ -0,0 +1 @@ +export { initRpcRoutes } from './routes'; diff --git a/src/platform/plugins/shared/content_management/server/rpc/routes/routes.d.ts b/src/platform/plugins/shared/content_management/server/rpc/routes/routes.d.ts new file mode 100644 index 0000000000000..a99b9269e1d6a --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/routes/routes.d.ts @@ -0,0 +1,11 @@ +import type { IRouter } from '@kbn/core/server'; +import type { ProcedureName } from '../../../common'; +import type { ContentRegistry } from '../../core'; +import type { RpcService } from '../rpc_service'; +import type { Context as RpcContext } from '../types'; +interface RouteContext { + rpc: RpcService; + contentRegistry: ContentRegistry; +} +export declare function initRpcRoutes(procedureNames: readonly ProcedureName[], router: IRouter, { rpc, contentRegistry }: RouteContext): void; +export {}; diff --git a/src/platform/plugins/shared/content_management/server/rpc/rpc_service.d.ts b/src/platform/plugins/shared/content_management/server/rpc/rpc_service.d.ts new file mode 100644 index 0000000000000..53cf6329bec55 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/rpc_service.d.ts @@ -0,0 +1,12 @@ +import type { ProcedureSchemas } from '../../common'; +export interface ProcedureDefinition { + fn: (context: Context, input: I extends void ? undefined : I) => Promise; + schemas?: ProcedureSchemas; +} +export declare class RpcService { + private registry; + register(name: Names, definition: ProcedureDefinition): void; + call(context: Context, name: Names, input?: unknown): Promise<{ + result: unknown; + }>; +} diff --git a/src/platform/plugins/shared/content_management/server/rpc/types.d.ts b/src/platform/plugins/shared/content_management/server/rpc/types.d.ts new file mode 100644 index 0000000000000..ac5563ec4e8e3 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/rpc/types.d.ts @@ -0,0 +1,10 @@ +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import type { KibanaRequest } from '@kbn/core-http-server'; +import type { ContentRegistry } from '../core'; +import type { MSearchService } from '../core/msearch'; +export interface Context { + contentRegistry: ContentRegistry; + requestHandlerContext: RequestHandlerContext; + request: KibanaRequest; + mSearchService: MSearchService; +} diff --git a/src/platform/plugins/shared/content_management/server/types.d.ts b/src/platform/plugins/shared/content_management/server/types.d.ts new file mode 100644 index 0000000000000..f85f5e1f201b5 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/types.d.ts @@ -0,0 +1,18 @@ +import type { Version } from '@kbn/object-versioning'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { FavoritesSetup } from '@kbn/content-management-favorites-server'; +import type { CoreApi, StorageContextGetTransformFn } from './core'; +export type { IContentClient } from './content_client/types'; +export interface ContentManagementServerSetupDependencies { + usageCollection?: UsageCollectionSetup; +} +export interface ContentManagementServerStartDependencies { +} +export interface ContentManagementServerSetup extends CoreApi { + favorites: FavoritesSetup; +} +export interface ContentManagementServerStart { +} +export type GetTransformsFactoryFn = (contentTypeId: string, requestVersion: Version, options?: { + cacheEnabled?: boolean; +}) => StorageContextGetTransformFn; diff --git a/src/platform/plugins/shared/content_management/server/utils/index.d.ts b/src/platform/plugins/shared/content_management/server/utils/index.d.ts new file mode 100644 index 0000000000000..481f39c1d17de --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/utils/index.d.ts @@ -0,0 +1,2 @@ +export { getStorageContext, validate } from './utils'; +export { getServiceObjectTransformFactory, disableCache as disableTransformsCache, } from './services_transforms_factory'; diff --git a/src/platform/plugins/shared/content_management/server/utils/services_transforms_factory.d.ts b/src/platform/plugins/shared/content_management/server/utils/services_transforms_factory.d.ts new file mode 100644 index 0000000000000..bb9c8be15a996 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/utils/services_transforms_factory.d.ts @@ -0,0 +1,13 @@ +import type { Version } from '@kbn/object-versioning'; +import type { StorageContextGetTransformFn } from '../core'; +export declare const disableCache: () => void; +/** + * Wrap the "getContentManagementServicesTransforms()" handler from the @kbn/object-versioning package + * to be able to cache the service definitions compilations so we can reuse them accross request as the + * services definitions won't change until a new Elastic version is released. In which case the cache + * will be cleared. + * + * @param contentTypeId The content type id for the service definition + * @returns A "getContentManagementServicesTransforms()" + */ +export declare const getServiceObjectTransformFactory: (contentTypeId: string, _requestVersion: Version) => StorageContextGetTransformFn; diff --git a/src/platform/plugins/shared/content_management/server/utils/utils.d.ts b/src/platform/plugins/shared/content_management/server/utils/utils.d.ts new file mode 100644 index 0000000000000..a9c9b7a1f4302 --- /dev/null +++ b/src/platform/plugins/shared/content_management/server/utils/utils.d.ts @@ -0,0 +1,16 @@ +import type { Type, ValidationError } from '@kbn/config-schema'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import type { ContentRegistry, StorageContext } from '../core'; +import type { GetTransformsFactoryFn } from '../types'; +export declare const validate: (input: unknown, schema: Type) => ValidationError | null; +export declare const getStorageContext: ({ request, contentTypeId, version: _version, ctx: { contentRegistry, requestHandlerContext, getTransformsFactory }, }: { + request: KibanaRequest; + contentTypeId: string; + version?: number; + ctx: { + contentRegistry: ContentRegistry; + requestHandlerContext: RequestHandlerContext; + getTransformsFactory: GetTransformsFactoryFn; + }; +}) => StorageContext; diff --git a/src/platform/plugins/shared/cps/public/index.d.ts b/src/platform/plugins/shared/cps/public/index.d.ts new file mode 100644 index 0000000000000..8b239ee02c8f8 --- /dev/null +++ b/src/platform/plugins/shared/cps/public/index.d.ts @@ -0,0 +1,4 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import { CpsPlugin } from './plugin'; +export declare function plugin(initContext: PluginInitializerContext): CpsPlugin; +export type { CPSPluginSetup, CPSPluginStart, CPSConfigType } from './types'; diff --git a/src/platform/plugins/shared/cps/public/plugin.d.ts b/src/platform/plugins/shared/cps/public/plugin.d.ts new file mode 100644 index 0000000000000..9eed73912e72c --- /dev/null +++ b/src/platform/plugins/shared/cps/public/plugin.d.ts @@ -0,0 +1,10 @@ +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { CPSPluginSetup, CPSPluginStart, CPSConfigType } from './types'; +export declare class CpsPlugin implements Plugin { + private readonly initializerContext; + private readonly appAccessResolvers; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup): CPSPluginSetup; + start(core: CoreStart): CPSPluginStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/cps/public/services/async_services.d.ts b/src/platform/plugins/shared/cps/public/services/async_services.d.ts new file mode 100644 index 0000000000000..437d03130a500 --- /dev/null +++ b/src/platform/plugins/shared/cps/public/services/async_services.d.ts @@ -0,0 +1,7 @@ +import type { HttpSetup } from '@kbn/core/public'; +export { createProjectFetcher } from './project_fetcher'; +/** + * Resolves the default project routing for the current space. + * Returns {@link PROJECT_ROUTING.ALL} when the expression doesn't exist (404). + */ +export declare const fetchDefaultProjectRouting: (http: HttpSetup) => Promise; diff --git a/src/platform/plugins/shared/cps/public/services/cps_manager.d.ts b/src/platform/plugins/shared/cps/public/services/cps_manager.d.ts new file mode 100644 index 0000000000000..d865d82773092 --- /dev/null +++ b/src/platform/plugins/shared/cps/public/services/cps_manager.d.ts @@ -0,0 +1,84 @@ +import type { ApplicationStart, HttpSetup } from '@kbn/core/public'; +import type { Logger } from '@kbn/logging'; +import type { ProjectRouting } from '@kbn/es-query'; +import { BehaviorSubject } from 'rxjs'; +import { type CPSAppAccessResolver, type ICPSManager, type ProjectsData, ProjectRoutingAccess } from '@kbn/cps-utils'; +/** + * Central service for managing project routing and project data. + * + * - Fetches project data from ES via `/internal/cps/projects_tags` endpoint (with caching and retry logic) + * - Manages current project routing state using observables + * - projectRouting$ represents temporary UI state; apps should reset to their saved value or spaces project routing on navigation + */ +export declare class CPSManager implements ICPSManager { + private readonly http; + private readonly logger; + private readonly application; + private projectFetcherPromise; + private defaultProjectRouting; + private allProjects; + private readonly readyPromise; + private readonly appAccessResolvers; + private currentAppId; + private currentLocation; + private readonly projectRouting$; + private readonly projectPickerAccess$; + private lastEditableProjectRouting; + constructor(deps: { + http: HttpSetup; + logger: Logger; + application: ApplicationStart; + appAccessResolvers?: Map; + }); + /** + * Resolves once the default project routing and total count of projects has been fetched + */ + whenReady(): Promise; + /** + * Initialize the default project routing from the active space. + * Fetches the default project routing for the current space from the CPS plugin. + */ + private initializeDefaultProjectRouting; + /** + * Get the default project routing value from a global space setting. + * This is the fallback value used when no app-specific or saved value exists. + */ + getDefaultProjectRouting(): ProjectRouting; + updateDefaultProjectRouting(projectRouting: string): void; + /** + * Fetches all projects + */ + private fetchAllProjects; + /** + * Returns the total number of projects (origin + linked) across all project routings. + */ + getTotalProjectCount(): number; + /** + * Get the current project routing as an observable + */ + getProjectRouting$(): import("rxjs").Observable; + registerAppAccess(appId: string, resolver: CPSAppAccessResolver): void; + private applyAccess; + private resolveAccess; + /** + * Set the current project routing + */ + setProjectRouting(projectRouting: ProjectRouting): void; + /** + * Get the current project routing value + */ + getProjectRouting(overrideValue?: ProjectRouting): ProjectRouting; + /** + * Get the project picker access level as an observable. + * This combines the current app ID and location to determine whether + * the project picker should be editable, readonly, or disabled. + */ + getProjectPickerAccess$(): BehaviorSubject; + /** + * Fetches projects from the server with caching and retry logic. + * Returns cached data if already loaded. If a fetch is already in progress, returns the existing promise. + * @returns Promise resolving to ProjectsData + */ + fetchProjects(projectRouting?: ProjectRouting): Promise; + private getProjectFetcher; +} diff --git a/src/platform/plugins/shared/cps/public/services/project_fetcher.d.ts b/src/platform/plugins/shared/cps/public/services/project_fetcher.d.ts new file mode 100644 index 0000000000000..20bc639c11a4f --- /dev/null +++ b/src/platform/plugins/shared/cps/public/services/project_fetcher.d.ts @@ -0,0 +1,17 @@ +import type { HttpSetup } from '@kbn/core/public'; +import type { Logger } from '@kbn/logging'; +import type { ProjectsData } from '@kbn/cps-utils'; +import type { ProjectRouting } from '@kbn/es-query'; +export declare const CACHE_TTL_MS = 15000; +export interface ProjectFetcher { + fetchProjects: (projectRouting?: ProjectRouting) => Promise; +} +/** + * Creates project fetcher with retry logic, in-flight deduplication, and short-lived caching. + * + * - Concurrent calls with the same `projectRouting` share a single HTTP round-trip. + * - Successful responses are cached for {@link CACHE_TTL_MS}; subsequent calls within that + * window return the cached result without a network request. + * - Errors are never cached — the next call always retries. + */ +export declare function createProjectFetcher(http: HttpSetup, logger: Logger): ProjectFetcher; diff --git a/src/platform/plugins/shared/cps/public/types.d.ts b/src/platform/plugins/shared/cps/public/types.d.ts new file mode 100644 index 0000000000000..205358f9b5318 --- /dev/null +++ b/src/platform/plugins/shared/cps/public/types.d.ts @@ -0,0 +1,17 @@ +import type { ICPSManager, CPSAppAccessResolver } from '@kbn/cps-utils'; +export interface CPSPluginSetup { + cpsEnabled?: boolean; + /** + * Register a dynamic access resolver for a specific app during plugin setup. + * See {@link ICPSManager.registerAppAccess} for details. + */ + registerAppAccess(appId: string, resolver: CPSAppAccessResolver): void; +} +export interface CPSConfigType { + cpsEnabled: boolean; +} +export interface CPSPluginStart { + cpsManager?: ICPSManager; +} +export interface CPSPluginStop { +} diff --git a/src/platform/plugins/shared/custom_integrations/common/index.d.ts b/src/platform/plugins/shared/custom_integrations/common/index.d.ts new file mode 100644 index 0000000000000..d9fb29c12598e --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/common/index.d.ts @@ -0,0 +1,76 @@ +export declare const PLUGIN_ID = "customIntegrations"; +export declare const PLUGIN_NAME = "customIntegrations"; +/** + * A map of category names and their corresponding titles. + */ +export declare const INTEGRATION_CATEGORY_DISPLAY: { + [key: string]: { + title: string; + parent_id?: string; + }; +}; +export declare const FEATURED_INTEGRATIONS_BY_CATEGORY: { + security: string[]; + '': string[]; +}; +/** + * A category applicable to an Integration. + */ +export type IntegrationCategory = string; +/** + * The list of all available categories. + */ +export declare const category: IntegrationCategory[]; +/** + * An object containing the id of an `IntegrationCategory` and the count of all Integrations in that category. + */ +export interface IntegrationCategoryCount { + count: number; + id: IntegrationCategory; +} +/** + * A map of shipper names and their corresponding titles. + */ +export declare const SHIPPER_DISPLAY: { + beats: string; + search: string; + language_clients: string; + other: string; + sample_data: string; + tests: string; + tutorial: string; + placeholders: string; +}; +/** + * A shipper-- an internal or external system capable of storing data in ES/Kibana-- applicable to an Integration. + */ +export type Shipper = keyof typeof SHIPPER_DISPLAY; +/** + * The list of all known shippers. + */ +export declare const shipper: Shipper[]; +/** + * An icon representing an Integration. + */ +export interface CustomIntegrationIcon { + src: string; + type: 'eui' | 'svg'; +} +/** + * A definition of a dataintegration, which can be registered with Kibana. + */ +export interface CustomIntegration { + id: string; + title: string; + description: string; + type: 'ui_link'; + uiInternalPath: string; + uiExternalLink?: string; + isBeta: boolean; + icons: CustomIntegrationIcon[]; + categories: IntegrationCategory[]; + shipper: Shipper; + eprOverlap?: string; +} +export declare const ROUTES_APPEND_CUSTOM_INTEGRATIONS = "/internal/customIntegrations/appendCustomIntegrations"; +export declare const ROUTES_REPLACEMENT_CUSTOM_INTEGRATIONS = "/internal/customIntegrations/replacementCustomIntegrations"; diff --git a/src/platform/plugins/shared/custom_integrations/common/language_integrations.d.ts b/src/platform/plugins/shared/custom_integrations/common/language_integrations.d.ts new file mode 100644 index 0000000000000..c4a845b5e656a --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/common/language_integrations.d.ts @@ -0,0 +1,11 @@ +export interface LanguageIntegration { + id: string; + title: string; + icon?: string; + euiIconName?: string; + description: string; + docUrlTemplate: string; + integrationsAppUrl: string; + exportLanguageUiComponent: boolean; +} +export declare const languageIntegrations: LanguageIntegration[]; diff --git a/src/platform/plugins/shared/custom_integrations/server/custom_integration_registry.d.ts b/src/platform/plugins/shared/custom_integrations/server/custom_integration_registry.d.ts new file mode 100644 index 0000000000000..aa2023bb70339 --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/server/custom_integration_registry.d.ts @@ -0,0 +1,20 @@ +import type { Logger } from '@kbn/core/server'; +import type { CustomIntegration } from '../common'; +export declare class CustomIntegrationRegistry { + private readonly _integrations; + private readonly _logger; + private readonly _isDev; + /** + * Deferred initializers registered via {@link registerDeferredInitializer}. They are + * called (in order, exactly once) the first time the integration list is read, so that + * callers can avoid executing expensive work (e.g. evaluating i18n strings) at plugin + * start time. + */ + private readonly _deferredInitializers; + constructor(logger: Logger, isDev: boolean); + registerDeferredInitializer(init: () => void): void; + private _materializeDeferredInitializers; + registerCustomIntegration(customIntegration: CustomIntegration): void; + getAppendCustomIntegrations(): CustomIntegration[]; + getReplacementCustomIntegrations(): CustomIntegration[]; +} diff --git a/src/platform/plugins/shared/custom_integrations/server/external_integration/index.d.ts b/src/platform/plugins/shared/custom_integrations/server/external_integration/index.d.ts new file mode 100644 index 0000000000000..fae9eae792f07 --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/server/external_integration/index.d.ts @@ -0,0 +1,15 @@ +import type { CoreSetup } from '@kbn/core/server'; +import type { CustomIntegrationRegistry } from '../custom_integration_registry'; +import type { IntegrationCategory } from '../../common'; +interface ExternalIntegration { + id: string; + title: string; + icon?: string; + euiIconName?: string; + description: string; + docUrlTemplate: string; + categories: IntegrationCategory[]; +} +export declare const integrations: ExternalIntegration[]; +export declare function registerExternalIntegrations(core: CoreSetup, registry: CustomIntegrationRegistry, branch: string): void; +export {}; diff --git a/src/platform/plugins/shared/custom_integrations/server/index.d.ts b/src/platform/plugins/shared/custom_integrations/server/index.d.ts new file mode 100644 index 0000000000000..a5fcd392eb0d7 --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/server/index.d.ts @@ -0,0 +1,7 @@ +import type { PluginInitializerContext } from '@kbn/core/server'; +export declare function plugin(initializerContext: PluginInitializerContext): Promise; +export type { CustomIntegrationsPluginSetup, CustomIntegrationsPluginStart } from './types'; +export type { IntegrationCategory, CustomIntegration } from '../common'; +export declare const config: { + schema: import("@kbn/config-schema").ObjectType<{}>; +}; diff --git a/src/platform/plugins/shared/custom_integrations/server/language_clients/index.d.ts b/src/platform/plugins/shared/custom_integrations/server/language_clients/index.d.ts new file mode 100644 index 0000000000000..47f8f6acf2a13 --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/server/language_clients/index.d.ts @@ -0,0 +1,3 @@ +import type { CoreSetup } from '@kbn/core/server'; +import type { CustomIntegrationRegistry } from '../custom_integration_registry'; +export declare function registerLanguageClients(core: CoreSetup, registry: CustomIntegrationRegistry, branch: string): void; diff --git a/src/platform/plugins/shared/custom_integrations/server/plugin.d.ts b/src/platform/plugins/shared/custom_integrations/server/plugin.d.ts new file mode 100644 index 0000000000000..40f47ef79204c --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/server/plugin.d.ts @@ -0,0 +1,11 @@ +import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; +import type { CustomIntegrationsPluginSetup, CustomIntegrationsPluginStart } from './types'; +export declare class CustomIntegrationsPlugin implements Plugin { + private readonly logger; + private readonly customIngegrationRegistry; + private readonly branch; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup): CustomIntegrationsPluginSetup; + start(core: CoreStart): {}; + stop(): void; +} diff --git a/src/platform/plugins/shared/custom_integrations/server/routes/define_routes.d.ts b/src/platform/plugins/shared/custom_integrations/server/routes/define_routes.d.ts new file mode 100644 index 0000000000000..e4f5845bfa079 --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/server/routes/define_routes.d.ts @@ -0,0 +1,3 @@ +import type { IRouter } from '@kbn/core/server'; +import type { CustomIntegrationRegistry } from '../custom_integration_registry'; +export declare function defineRoutes(router: IRouter, customIntegrationsRegistry: CustomIntegrationRegistry): void; diff --git a/src/platform/plugins/shared/custom_integrations/server/types.d.ts b/src/platform/plugins/shared/custom_integrations/server/types.d.ts new file mode 100644 index 0000000000000..3bec666438c52 --- /dev/null +++ b/src/platform/plugins/shared/custom_integrations/server/types.d.ts @@ -0,0 +1,14 @@ +import type { CustomIntegration } from '../common'; +export interface CustomIntegrationsPluginSetup { + registerCustomIntegration(customIntegration: Omit): void; + getAppendCustomIntegrations(): CustomIntegration[]; + /** + * Registers a deferred initializer that will be called (once, in registration order) the + * first time the integration list is read. Use this to avoid evaluating i18n strings and + * building registration payloads at plugin start time — work is deferred to the first + * incoming HTTP request instead. + */ + registerDeferredIntegrations(init: () => void): void; +} +export interface CustomIntegrationsPluginStart { +} diff --git a/src/platform/plugins/shared/data/common/constants.d.ts b/src/platform/plugins/shared/data/common/constants.d.ts new file mode 100644 index 0000000000000..e99bc98f29104 --- /dev/null +++ b/src/platform/plugins/shared/data/common/constants.d.ts @@ -0,0 +1,7 @@ +export { UI_SETTINGS } from '@kbn/data-service/src/constants'; +export declare const DEFAULT_QUERY_LANGUAGE = "kuery"; +export declare const KIBANA_USER_QUERY_LANGUAGE_KEY = "kibana.userQueryLanguage"; +export type ValueSuggestionsMethod = 'terms_enum' | 'terms_agg'; +export declare const SAVED_QUERY_BASE_URL = "/internal/saved_query"; +export declare const KQL_TELEMETRY_ROUTE_LATEST_VERSION = "1"; +export declare const SCRIPT_LANGUAGES_ROUTE_LATEST_VERSION = "1"; diff --git a/src/platform/plugins/shared/data/common/datatable_utilities/datatable_utilities_service.d.ts b/src/platform/plugins/shared/data/common/datatable_utilities/datatable_utilities_service.d.ts new file mode 100644 index 0000000000000..1580c6e459060 --- /dev/null +++ b/src/platform/plugins/shared/data/common/datatable_utilities/datatable_utilities_service.d.ts @@ -0,0 +1,44 @@ +import type { DataView, DataViewsContract, DataViewField } from '@kbn/data-views-plugin/common'; +import type { Datatable, DatatableColumn } from '@kbn/expressions-plugin/common'; +import type { FieldFormatsStartCommon, FieldFormat } from '@kbn/field-formats-plugin/common'; +import type { AggsCommonStart, AggConfig } from '../search'; +import type { TimeRange } from '../types'; +interface DateHistogramMeta { + interval?: string; + timeZone?: string; + timeRange?: TimeRange; +} +export declare class DatatableUtilitiesService { + private aggs; + private dataViews; + private fieldFormats; + constructor(aggs: AggsCommonStart, dataViews: DataViewsContract, fieldFormats: FieldFormatsStartCommon); + clearField(column: DatatableColumn): void; + clearFieldFormat(column: DatatableColumn): void; + getAggConfig(column: DatatableColumn): Promise; + /** + * Helper function returning the used interval, used time zone and applied time filters for data table column created by the date_histogramm agg type. + * "auto" will get expanded to the actually used interval. + * If the column is not a column created by a date_histogram aggregation of the esaggs data source, + * this function will return undefined. + */ + getDateHistogramMeta(column: DatatableColumn, defaults?: Partial<{ + timeZone: string; + }>): DateHistogramMeta | undefined; + getDataView(column: DatatableColumn): Promise; + getField(column: DatatableColumn): Promise; + getFieldFormat(column: DatatableColumn): FieldFormat | undefined; + getInterval(column: DatatableColumn): string | undefined; + /** + * Helper function returning the used interval for data table column created by the histogramm agg type. + * "auto" will get expanded to the actually used interval. + * If the column is not a column created by a histogram aggregation of the esaggs data source, + * this function will return undefined. + */ + getNumberHistogramInterval(column: DatatableColumn): number | undefined; + getTotalCount(table: Datatable): number | undefined; + hasPrecisionError(column: DatatableColumn): import("@kbn/utility-types").Serializable; + isFilterable(column: DatatableColumn): boolean; + setFieldFormat(column: DatatableColumn, fieldFormat: FieldFormat): void; +} +export {}; diff --git a/src/platform/plugins/shared/data/common/datatable_utilities/index.d.ts b/src/platform/plugins/shared/data/common/datatable_utilities/index.d.ts new file mode 100644 index 0000000000000..e8662383edeb6 --- /dev/null +++ b/src/platform/plugins/shared/data/common/datatable_utilities/index.d.ts @@ -0,0 +1 @@ +export * from './datatable_utilities_service'; diff --git a/src/platform/plugins/shared/data/common/es_query/index.d.ts b/src/platform/plugins/shared/data/common/es_query/index.d.ts new file mode 100644 index 0000000000000..b473f5898f715 --- /dev/null +++ b/src/platform/plugins/shared/data/common/es_query/index.d.ts @@ -0,0 +1 @@ +export { getEsQueryConfig } from '@kbn/data-service/src/es_query'; diff --git a/src/platform/plugins/shared/data/common/exports/constants.d.ts b/src/platform/plugins/shared/data/common/exports/constants.d.ts new file mode 100644 index 0000000000000..1effe9e302726 --- /dev/null +++ b/src/platform/plugins/shared/data/common/exports/constants.d.ts @@ -0,0 +1,4 @@ +export declare const CSV_FORMULA_CHARS: string[]; +export declare const nonAlphaNumRE: RegExp; +export declare const allDoubleQuoteRE: RegExp; +export declare const commonQuotedDelimiters: Set; diff --git a/src/platform/plugins/shared/data/common/exports/escape_value.d.ts b/src/platform/plugins/shared/data/common/exports/escape_value.d.ts new file mode 100644 index 0000000000000..a2dc5af92751c --- /dev/null +++ b/src/platform/plugins/shared/data/common/exports/escape_value.d.ts @@ -0,0 +1,18 @@ +type RawValue = string | object | null | undefined; +/** + * Create a function that will escape CSV values like "=", "@" and "+" with a + * "'". This will also place CSV values in "" if contain non-alphanumeric chars. + * + * For example: + * + * Given: =1+1 + * Returns: "'=1+1" + * + * See OWASP: https://www.owasp.org/index.php/CSV_Injection. + */ +export declare function createEscapeValue({ separator, quoteValues, escapeFormulaValues, }: { + separator: string; + quoteValues: boolean; + escapeFormulaValues: boolean; +}): (val: RawValue) => string; +export {}; diff --git a/src/platform/plugins/shared/data/common/exports/export_csv.d.ts b/src/platform/plugins/shared/data/common/exports/export_csv.d.ts new file mode 100644 index 0000000000000..e49933e098b8e --- /dev/null +++ b/src/platform/plugins/shared/data/common/exports/export_csv.d.ts @@ -0,0 +1,13 @@ +import type { Datatable } from '@kbn/expressions-plugin/common'; +import type { FormatFactory } from '@kbn/field-formats-plugin/common'; +export declare const LINE_FEED_CHARACTER = "\r\n"; +export declare const CSV_MIME_TYPE = "text/plain;charset=utf-8"; +interface CSVOptions { + csvSeparator: string; + quoteValues: boolean; + escapeFormulaValues: boolean; + formatFactory: FormatFactory; + raw?: boolean; +} +export declare function datatableToCSV({ columns, rows }: Datatable, { csvSeparator, quoteValues, formatFactory, raw, escapeFormulaValues }: CSVOptions): string; +export {}; diff --git a/src/platform/plugins/shared/data/common/exports/formula_checks.d.ts b/src/platform/plugins/shared/data/common/exports/formula_checks.d.ts new file mode 100644 index 0000000000000..f932826f9ff85 --- /dev/null +++ b/src/platform/plugins/shared/data/common/exports/formula_checks.d.ts @@ -0,0 +1,3 @@ +import type { Datatable } from '@kbn/expressions-plugin/common'; +export declare const cellHasFormulas: (val: string) => boolean; +export declare const tableHasFormulas: (columns: Datatable["columns"], rows: Datatable["rows"]) => boolean; diff --git a/src/platform/plugins/shared/data/common/exports/index.d.ts b/src/platform/plugins/shared/data/common/exports/index.d.ts new file mode 100644 index 0000000000000..ffe232a0433c5 --- /dev/null +++ b/src/platform/plugins/shared/data/common/exports/index.d.ts @@ -0,0 +1,4 @@ +export { datatableToCSV, CSV_MIME_TYPE } from './export_csv'; +export { createEscapeValue } from './escape_value'; +export { CSV_FORMULA_CHARS } from './constants'; +export { cellHasFormulas, tableHasFormulas } from './formula_checks'; diff --git a/src/platform/plugins/shared/data/common/index.d.ts b/src/platform/plugins/shared/data/common/index.d.ts new file mode 100644 index 0000000000000..5f2444d33da69 --- /dev/null +++ b/src/platform/plugins/shared/data/common/index.d.ts @@ -0,0 +1,20 @@ +export type { RefreshInterval } from '@kbn/data-service-server'; +export { DEFAULT_QUERY_LANGUAGE, KIBANA_USER_QUERY_LANGUAGE_KEY, KQL_TELEMETRY_ROUTE_LATEST_VERSION, SAVED_QUERY_BASE_URL, SCRIPT_LANGUAGES_ROUTE_LATEST_VERSION, UI_SETTINGS, } from './constants'; +export type { RawValue } from './serializable_field'; +export { SerializableField } from './serializable_field'; +export type { SerializedField, SerializedValue } from './serialize_utils'; +export { SerializableType, deserializeField, serializeField } from './serialize_utils'; +export type { ValueSuggestionsMethod } from './constants'; +export { DatatableUtilitiesService } from './datatable_utilities'; +export { getEsQueryConfig } from './es_query'; +export { KbnFieldType } from './kbn_field_types'; +export { calculateBounds, getAbsoluteTimeRange, getRelativeTime, getTime, isQuery, isTimeRange, textBasedQueryStateToAstWithValidation, textBasedQueryStateToExpressionAst, } from './query'; +export type { QueryState } from './query'; +export type { AggConfigSerialized, AggConfigOptions, IAggConfig, AggConfigsOptions, CreateAggConfigParams, GenericBucket, IAggConfigs, AggGroupName, AggTypeConfig, IAggType, AggTypesDependencies, AggTypesRegistrySetup, AggTypesRegistryStart, AggsCommonSetupDependencies, AggsCommonStartDependencies, IBucketAggConfig, BucketAggParam, CalculateBoundsFn, IBucketDateHistogramAggConfig, AggParamsDateHistogram, AggParamsDateRange, AggParamsFilter, FiltersBucketAggDependencies, AggParamsFilters, AggParamsGeoTile, AutoBounds, HistogramBucketAggDependencies, IBucketHistogramAggConfig, AggParamsHistogram, AggParamsIpPrefix, AggParamsIpRange, CidrMaskIpRangeAggKey, RangeIpRangeAggKey, IpRangeKey, RangeBucketAggDependencies, AggParamsRange, AggParamsSignificantTerms, AggParamsSignificantText, CommonAggParamsTerms, AggParamsTermsSerialized, AggParamsTerms, AggParamsMultiTermsSerialized, AggParamsMultiTerms, AggParamsRareTerms, AggParamsSampler, AggParamsDiversifiedSampler, AggParamsTimeSeries, AggParamsAvg, AggParamsBucketAvgSerialized, AggParamsBucketAvg, AggParamsBucketMaxSerialized, AggParamsBucketMax, AggParamsBucketMinSerialized, AggParamsBucketMin, AggParamsBucketSumSerialized, AggParamsBucketSum, AggParamsFilteredMetricSerialized, AggParamsFilteredMetric, FiltersMetricAggDependencies, AggParamsCardinality, AggParamsValueCount, AggParamsCount, CommonAggParamsCumulativeSum, AggParamsCumulativeSumSerialized, AggParamsCumulativeSum, CommonAggParamsDerivative, AggParamsDerivativeSerialized, AggParamsDerivative, AggParamsGeoBounds, AggParamsGeoCentroid, AggParamsMax, AggParamsMedian, AggParamsSinglePercentile, IMetricAggConfig, MetricAggParam, IMetricAggType, AggParamsMin, CommonAggParamsMovingAvg, AggParamsMovingAvgSerialized, AggParamsMovingAvg, AggParamsPercentileRanks, IPercentileRanksAggConfig, PercentileRanksMetricAggDependencies, AggParamsPercentiles, IPercentileAggConfig, AggParamsRate, AggParamsSinglePercentileRank, CommonAggParamsSerialDiff, AggParamsSerialDiffSerialized, AggParamsSerialDiff, AggParamsStdDeviation, IStdDevAggConfig, AggParamsSum, BaseAggParamsTopHit, AggParamsTopHitSerialized, AggParamsTopHit, BaseAggParamsTopMetrics, AggParamsTopMetricsSerialized, AggParamsTopMetrics, FieldTypes, FilterFieldFn, IFieldParamType, OptionedValueProp, AggParam, AggParamOption, IpPrefixKey, AggsCommonSetup, AggsCommonStart, AggsStart, BaseAggParams, AggExpressionType, AggExpressionFunctionArgs, AggParamsMapping, AggFunctionsMapping, ParsedInterval, REASON_ID_TYPES, Cidr, CidrOutput, ExpressionFunctionCidr, DateRange, DateRangeOutput, ExpressionFunctionDateRange, ExtendedBounds, ExtendedBoundsOutput, ExpressionFunctionExtendedBounds, GeoBoundingBox, GeoBoundingBoxOutput, ExpressionFunctionGeoBoundingBox, GeoPoint, GeoPointOutput, ExpressionFunctionGeoPoint, IpPrefix, IpPrefixOutput, ExpressionFunctionIpPrefix, IpRange, IpRangeOutput, ExpressionFunctionIpRange, ExpressionFunctionKibana, ExpressionFunctionKibanaContext, ExpressionFunctionKql, ExpressionFunctionLucene, NumericalRange, NumericalRangeOutput, ExpressionFunctionNumericalRange, QueryFilter, QueryFilterOutput, ExpressionFunctionQueryFilter, ExpressionValueSearchContext, KibanaQueryOutput, KibanaFilter, KibanaField, KIBANA_CONTEXT_NAME, KibanaContext, EsaggsExpressionFunctionDefinition, EsaggsStartDependencies, RequestHandlerParams, KibanaRange, ExpressionFunctionRange, ExpressionFunctionField, ExpressionFunctionPhraseFilter, ExpressionFunctionExistsFilter, ExpressionFunctionRangeFilter, ExpressionFunctionRemoveFilter, ExpressionFunctionSelectFilter, ExpressionFunctionKibanaFilter, KibanaTimerangeOutput, ExpressionFunctionKibanaTimerange, EsRawResponse, EsRawResponseExpressionTypeDefinition, EqlRawResponse, SearchTypes, TotalValue, BaseHit, EqlSequence, EqlSearchResponse, EqlRawResponseExpressionTypeDefinition, EsdslExpressionFunctionDefinition, EqlExpressionFunctionDefinition, EsqlExpressionFunctionDefinition, SearchRequest, FetchHandlers, SearchError, SearchSourceDependencies, ISearchSource, ISearchStartSearchSource, SortDirectionFormat, SortDirectionNumeric, EsQuerySortValue, SearchFieldValue, SearchSourceFields, SerializedSearchSourceFields, SearchSourceOptions, IInspectorInfo, SearchSourceSearchOptions, SearchSessionSavedObjectAttributes, SearchSessionRequestInfo, SearchSessionRequestStatus, SearchSessionStatusResponse, SearchSessionStatusesResponse, SearchSessionsFindResponse, EqlRequestParams, EqlSearchStrategyRequest, EqlSearchStrategyResponse, IAsyncSearchOptions, SqlRequestParams, SqlSearchStrategyRequest, SqlSearchStrategyResponse, } from './search'; +export { AggConfig, AggConfigs, AggGroupNames, AggGroupLabels, AggType, getAggTypes, getAggTypesFunctions, AggTypesRegistry, aggsRequiredUiSettings, AggsCommonService, autoInterval, isAutoInterval, intervalOptions, BucketAggType, isBucketAggType, BUCKET_TYPES, aggDateHistogramFnName, aggDateHistogram, isDateHistogramBucketAggConfig, getDateHistogramBucketAgg, aggDateRangeFnName, aggDateRange, getDateRangeBucketAgg, aggFilterFnName, aggFilter, getFilterBucketAgg, aggFiltersFnName, aggFilters, getFiltersBucketAgg, aggGeoTileFnName, aggGeoTile, getGeoTitleBucketAgg, aggHistogramFnName, aggHistogram, getHistogramBucketAgg, aggIpPrefixFnName, aggIpPrefix, getIpPrefixBucketAgg, aggIpRangeFnName, aggIpRange, IP_RANGE_TYPES, getIpRangeBucketAgg, CidrMask, convertDateRangeToString, convertIPRangeToString, boundsDescendingRaw, calcAutoIntervalNear, calcAutoIntervalLessThan, TimeBuckets, isType, isNumberType, isStringType, isStringOrNumberType, migrateIncludeExcludeFormat, aggRangeFnName, aggRange, getRangeBucketAgg, aggSignificantTermsFnName, aggSignificantTerms, getSignificantTermsBucketAgg, aggSignificantTextFnName, aggSignificantText, getSignificantTextBucketAgg, aggTermsFnName, aggTerms, termsAggFilter, getTermsBucketAgg, MultiFieldKey, RangeKey, MULTI_FIELD_KEY_SEPARATOR, aggMultiTermsFnName, aggMultiTerms, getMultiTermsBucketAgg, aggRareTermsFnName, aggRareTerms, getRareTermsBucketAgg, aggSamplerFnName, aggSampler, SAMPLER_AGG_NAME, getSamplerBucketAgg, aggDiversifiedSamplerFnName, aggDiversifiedSampler, DIVERSIFIED_SAMPLER_AGG_NAME, getDiversifiedSamplerBucketAgg, getTimeSeriesBucketAgg, aggTimeSeriesFnName, aggTimeSeries, SHARD_DELAY_AGG_NAME, aggAvgFnName, aggAvg, getAvgMetricAgg, aggBucketAvgFnName, aggBucketAvg, getBucketAvgMetricAgg, aggBucketMaxFnName, aggBucketMax, getBucketMaxMetricAgg, aggBucketMinFnName, aggBucketMin, getBucketMinMetricAgg, aggBucketSumFnName, aggBucketSum, getBucketSumMetricAgg, aggFilteredMetricFnName, aggFilteredMetric, getFilteredMetricAgg, aggCardinalityFnName, aggCardinality, getCardinalityMetricAgg, aggValueCountFnName, aggValueCount, getValueCountMetricAgg, getCountMetricAgg, aggCountFnName, aggCount, aggCumulativeSumFnName, aggCumulativeSum, getCumulativeSumMetricAgg, aggDerivativeFnName, aggDerivative, getDerivativeMetricAgg, aggGeoBoundsFnName, aggGeoBounds, getGeoBoundsMetricAgg, aggGeoCentroidFnName, aggGeoCentroid, getGeoCentroidMetricAgg, parentPipelineType, parentPipelineAggHelper, siblingPipelineType, siblingPipelineAggHelper, aggMaxFnName, aggMax, getMaxMetricAgg, aggMedianFnName, aggMedian, getMedianMetricAgg, aggSinglePercentileFnName, aggSinglePercentile, getSinglePercentileMetricAgg, MetricAggType, isMetricAggType, METRIC_TYPES, aggMinFnName, aggMin, getMinMetricAgg, aggMovingAvgFnName, aggMovingAvg, getMovingAvgMetricAgg, aggPercentileRanksFnName, aggPercentileRanks, getPercentileRanksMetricAgg, aggPercentilesFnName, aggPercentiles, getPercentilesMetricAgg, aggRateFnName, aggRate, getRateMetricAgg, aggSinglePercentileRankFnName, aggSinglePercentileRank, getSinglePercentileRankMetricAgg, aggSerialDiffFnName, aggSerialDiff, getSerialDiffMetricAgg, aggStdDeviationFnName, aggStdDeviation, getStdDeviationMetricAgg, aggSumFnName, aggSum, getSumMetricAgg, aggTopHitFnName, aggTopHit, getTopHitMetricAgg, getTopMetricsMetricAgg, aggTopMetricsFnName, aggTopMetrics, AggParamType, BaseParamType, FieldParamType, JsonParamType, OptionedParamType, StringParamType, getCalculateAutoTimeExpression, dateHistogramInterval, InvalidEsCalendarIntervalError, InvalidEsIntervalFormatError, isValidEsInterval, isValidInterval, splitStringInterval, parseInterval, parseEsInterval, toAbsoluteDates, getAggsFormats, IpAddress, propFilter, inferTimeZone, parseTimeShift, isAbsoluteTimeShift, REASON_IDS, parseAbsoluteTimeShift, validateAbsoluteTimeShift, cidrFunction, cidrToAst, dateRangeFunction, dateRangeToAst, extendedBoundsFunction, extendedBoundsToAst, geoBoundingBoxFunction, geoBoundingBoxToAst, geoPointFunction, geoPointToAst, ipPrefixFunction, ipPrefixToAst, ipRangeFunction, ipRangeToAst, kibana, kqlFunction, luceneFunction, numericalRangeFunction, numericalRangeToAst, queryFilterFunction, queryFilterToAst, queryToAst, aggregateQueryToAst, timerangeToAst, getEsaggsMeta, handleEsaggsRequest, functionWrapper, adaptToExpressionValueFilter, rangeFunction, fieldFunction, phraseFilterFunction, existsFilterFunction, rangeFilterFunction, removeFilterFunction, selectFilterFunction, kibanaFilterFunction, filtersToAst, kibanaTimerangeFunction, esRawResponse, eqlRawResponse, getEsdslFn, getEqlFn, getEsqlFn, createSearchSource, injectReferences, extractReferences, parseSearchSourceJSON, getResponseInspectorStats, getSearchParamsFromRequest, getEsPreference, RequestFailure, searchSourceRequiredUiSettings, SearchSource, SearchSourceService, SortDirection, isSerializedSearchSource, queryToFields, tabifyDocs, flattenHit, tabifyAggResponse, tabifyGetColumns, isAbortResponse, isRunningResponse, getUserTimeZone, strategyToString, SearchSessionStatus, SearchStatus, SEARCH_SESSION_TYPE, SEARCH_SESSIONS_TABLE_ID, pollSearch, ES_SEARCH_STRATEGY, getTotalLoaded, shimHitsTotal, EQL_SEARCH_STRATEGY, ENHANCED_ES_SEARCH_STRATEGY, SQL_SEARCH_STRATEGY, ESQL_SEARCH_STRATEGY, ESQL_ASYNC_SEARCH_STRATEGY, ESQL_TABLE_TYPE, getQueryLanguage, getQueryString, getQueryStringCharCount, getQueryStringLineCount, } from './search'; +export type { TimeRangeBounds, TimeRange, GetConfigFn, SavedQuery, SavedQueryAttributes, SavedQueryTimeFilter, KbnFieldTypeOptions, Query, } from './types'; +export { KBN_FIELD_TYPES, ES_FIELD_TYPES } from './types'; +export { createEscapeValue, tableHasFormulas, datatableToCSV, cellHasFormulas, CSV_FORMULA_CHARS, CSV_MIME_TYPE, } from './exports'; +export type { DataViewAttributes, FieldAttrs, FieldAttrSet, UiSettingsCommon, GetFieldsOptions, IDataViewsApiClient, SavedObject, AggregationRestrictions, TypeMeta, FieldSpecConflictDescriptions, FieldSpec, DataViewFieldMap, DataViewSpec, SourceFilter, IndexPatternExpressionType, IndexPatternLoadStartDependencies, IndexPatternLoadExpressionFunctionDefinition, } from '@kbn/data-views-plugin/common'; +export type { DataViewsContract, DataViewListItem } from '@kbn/data-views-plugin/common'; +export { RUNTIME_FIELD_TYPES, DEFAULT_ASSETS_TO_IGNORE, META_FIELDS, DATA_VIEW_SAVED_OBJECT_TYPE, isFilterable, fieldList, DataViewField, DataViewType, DataViewsService, DataView, DuplicateDataViewError, DataViewSavedObjectConflictError, getIndexPatternLoadMeta, isNestedField, isMultiField, getFieldSubtypeMulti, getFieldSubtypeNested, } from '@kbn/data-views-plugin/common'; diff --git a/src/platform/plugins/shared/data/common/kbn_field_types/index.d.ts b/src/platform/plugins/shared/data/common/kbn_field_types/index.d.ts new file mode 100644 index 0000000000000..86056ad9624ec --- /dev/null +++ b/src/platform/plugins/shared/data/common/kbn_field_types/index.d.ts @@ -0,0 +1,2 @@ +import { KbnFieldType } from '@kbn/field-types'; +export { KbnFieldType }; diff --git a/src/platform/plugins/shared/data/common/kbn_field_types/types.d.ts b/src/platform/plugins/shared/data/common/kbn_field_types/types.d.ts new file mode 100644 index 0000000000000..22b272326efd9 --- /dev/null +++ b/src/platform/plugins/shared/data/common/kbn_field_types/types.d.ts @@ -0,0 +1,4 @@ +import type { KbnFieldTypeOptions } from '@kbn/field-types'; +import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; +export type { KbnFieldTypeOptions }; +export { ES_FIELD_TYPES, KBN_FIELD_TYPES }; diff --git a/src/platform/plugins/shared/data/common/query/filters/persistable_state.d.ts b/src/platform/plugins/shared/data/common/query/filters/persistable_state.d.ts new file mode 100644 index 0000000000000..4bb7dd894f305 --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/filters/persistable_state.d.ts @@ -0,0 +1,11 @@ +import type { Filter } from '@kbn/es-query'; +import type { SavedObjectReference } from '@kbn/core/types'; +import type { MigrateFunctionsObject, VersionedState } from '@kbn/kibana-utils-plugin/common'; +export declare const extract: (filters: Filter[]) => { + state: Filter[]; + references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; +}; +export declare const inject: (filters: Filter[], references: SavedObjectReference[]) => Filter[]; +export declare const telemetry: (filters: Filter[], collector: unknown) => {}; +export declare const migrateToLatest: (filters: VersionedState) => Filter[]; +export declare const getAllMigrations: () => MigrateFunctionsObject; diff --git a/src/platform/plugins/shared/data/common/query/index.d.ts b/src/platform/plugins/shared/data/common/query/index.d.ts new file mode 100644 index 0000000000000..731c2f9be1c29 --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/index.d.ts @@ -0,0 +1,6 @@ +export * from './timefilter'; +export type * from './types'; +export * from './is_query'; +export type * from './query_state'; +export { textBasedQueryStateToAstWithValidation } from './text_based_query_state_to_ast_with_validation'; +export { textBasedQueryStateToExpressionAst } from './text_based_query_state_to_ast'; diff --git a/src/platform/plugins/shared/data/common/query/is_query.d.ts b/src/platform/plugins/shared/data/common/query/is_query.d.ts new file mode 100644 index 0000000000000..7d5bb97c34af7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/is_query.d.ts @@ -0,0 +1,2 @@ +import type { Query } from './types'; +export declare const isQuery: (x: unknown) => x is Query; diff --git a/src/platform/plugins/shared/data/common/query/persistable_state.d.ts b/src/platform/plugins/shared/data/common/query/persistable_state.d.ts new file mode 100644 index 0000000000000..a096ce72aac81 --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/persistable_state.d.ts @@ -0,0 +1,26 @@ +import type { SavedObjectReference } from '@kbn/core/types'; +import type { MigrateFunctionsObject, VersionedState } from '@kbn/kibana-utils-plugin/common'; +import type { QueryState } from './query_state'; +export declare const extract: (queryState: QueryState) => { + state: { + filters: import("@kbn/es-query").Filter[]; + time?: import("./types").TimeRange; + refreshInterval?: import("@kbn/data-service-server").RefreshInterval; + query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; + }; + references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; +}; +export declare const inject: (queryState: QueryState, references: SavedObjectReference[]) => { + filters: import("@kbn/es-query").Filter[]; + time?: import("./types").TimeRange; + refreshInterval?: import("@kbn/data-service-server").RefreshInterval; + query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; +}; +export declare const telemetry: (queryState: QueryState, collector: unknown) => {}; +export declare const migrateToLatest: ({ state, version }: VersionedState) => { + filters: import("@kbn/es-query").Filter[]; + time?: import("./types").TimeRange; + refreshInterval?: import("@kbn/data-service-server").RefreshInterval; + query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; +}; +export declare const getAllMigrations: () => MigrateFunctionsObject; diff --git a/src/platform/plugins/shared/data/common/query/query_state.d.ts b/src/platform/plugins/shared/data/common/query/query_state.d.ts new file mode 100644 index 0000000000000..de9c1a20b70ea --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/query_state.d.ts @@ -0,0 +1,17 @@ +import type { Filter } from '@kbn/es-query'; +import type { RefreshInterval } from '@kbn/data-service-server'; +import type { TimeRange } from './timefilter/types'; +import type { Query, AggregateQuery } from './types'; +/** + * All query state service state + * + * @remark + * `type` instead of `interface` to make it compatible with PersistableState utils + * + */ +export type QueryState = { + time?: TimeRange; + refreshInterval?: RefreshInterval; + filters?: Filter[]; + query?: Query | AggregateQuery; +}; diff --git a/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast.d.ts b/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast.d.ts new file mode 100644 index 0000000000000..13c622745e3ac --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast.d.ts @@ -0,0 +1,21 @@ +import type { Query } from '@kbn/es-query'; +import type { QueryState } from '..'; +interface Args extends QueryState { + timeFieldName?: string; + inputQuery?: Query; + titleForInspector?: string; + descriptionForInspector?: string; + ignoreGlobalFilters?: boolean; +} +/** + * Converts QueryState to expression AST + * @param filters array of kibana filters + * @param query kibana query or aggregate query + * @param inputQuery + * @param time kibana time range + * @param dataView + * @param titleForInspector + * @param descriptionForInspector + */ +export declare function textBasedQueryStateToExpressionAst({ filters, query, inputQuery, time, timeFieldName, titleForInspector, descriptionForInspector, ignoreGlobalFilters, }: Args): import("@kbn/expressions-plugin/common").ExpressionAstExpression; +export {}; diff --git a/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast_with_validation.d.ts b/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast_with_validation.d.ts new file mode 100644 index 0000000000000..0801d49b60313 --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast_with_validation.d.ts @@ -0,0 +1,20 @@ +import type { Query } from '@kbn/es-query'; +import type { QueryState } from '..'; +interface Args extends QueryState { + inputQuery?: Query; + timeFieldName?: string; + titleForInspector?: string; + descriptionForInspector?: string; +} +/** + * Converts QueryState to expression AST + * @param filters array of kibana filters + * @param query kibana query or aggregate query + * @param inputQuery + * @param time kibana time range + * @param timeFieldName + * @param titleForInspector + * @param descriptionForInspector + */ +export declare function textBasedQueryStateToAstWithValidation({ filters, query, inputQuery, time, timeFieldName, titleForInspector, descriptionForInspector, }: Args): Promise; +export {}; diff --git a/src/platform/plugins/shared/data/common/query/timefilter/get_time.d.ts b/src/platform/plugins/shared/data/common/query/timefilter/get_time.d.ts new file mode 100644 index 0000000000000..dffb8ea2753b5 --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/timefilter/get_time.d.ts @@ -0,0 +1,18 @@ +import type { TimeRange } from '@kbn/es-query'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { TimeRangeBounds } from '../..'; +export interface CalculateBoundsOptions { + forceNow?: Date; +} +export declare function calculateBounds(timeRange: TimeRange, options?: CalculateBoundsOptions): TimeRangeBounds; +export declare function getAbsoluteTimeRange(timeRange: TimeRange, { forceNow }?: { + forceNow?: Date; +}): TimeRange; +export declare function getTime(indexPattern: DataView | undefined, timeRange: TimeRange, options?: { + forceNow?: Date; + fieldName?: string; +}): import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter | undefined; +export declare function getRelativeTime(indexPattern: DataView | undefined, timeRange: TimeRange, options?: { + forceNow?: Date; + fieldName?: string; +}): import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter | undefined; diff --git a/src/platform/plugins/shared/data/common/query/timefilter/index.d.ts b/src/platform/plugins/shared/data/common/query/timefilter/index.d.ts new file mode 100644 index 0000000000000..72d2c0aab770b --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/timefilter/index.d.ts @@ -0,0 +1,2 @@ +export * from './get_time'; +export * from './is_time_range'; diff --git a/src/platform/plugins/shared/data/common/query/timefilter/is_time_range.d.ts b/src/platform/plugins/shared/data/common/query/timefilter/is_time_range.d.ts new file mode 100644 index 0000000000000..07a4ec1d2233b --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/timefilter/is_time_range.d.ts @@ -0,0 +1,2 @@ +import type { TimeRange } from './types'; +export declare const isTimeRange: (x: unknown) => x is TimeRange; diff --git a/src/platform/plugins/shared/data/common/query/timefilter/types.d.ts b/src/platform/plugins/shared/data/common/query/timefilter/types.d.ts new file mode 100644 index 0000000000000..978b085ef628d --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/timefilter/types.d.ts @@ -0,0 +1,10 @@ +import type { Moment } from 'moment'; +export type TimeRange = { + from: string; + to: string; + mode?: 'absolute' | 'relative'; +}; +export interface TimeRangeBounds { + min: Moment | undefined; + max: Moment | undefined; +} diff --git a/src/platform/plugins/shared/data/common/query/types.d.ts b/src/platform/plugins/shared/data/common/query/types.d.ts new file mode 100644 index 0000000000000..301e53f6ea0cd --- /dev/null +++ b/src/platform/plugins/shared/data/common/query/types.d.ts @@ -0,0 +1,21 @@ +import type { Query, Filter } from '@kbn/es-query'; +import type { RefreshInterval } from '@kbn/data-service-server'; +import type { TimeRange } from './timefilter/types'; +export type { TimeRange, TimeRangeBounds } from './timefilter/types'; +export type { Query, AggregateQuery } from '@kbn/es-query'; +export type { RefreshInterval } from '@kbn/data-service-server'; +export type SavedQueryTimeFilter = TimeRange & { + refreshInterval: RefreshInterval; +}; +export interface SavedQuery { + id: string; + attributes: SavedQueryAttributes; + namespaces: string[]; +} +export interface SavedQueryAttributes { + title: string; + description: string; + query: Query; + filters?: Filter[]; + timefilter?: SavedQueryTimeFilter; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_config.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_config.d.ts new file mode 100644 index 0000000000000..e119c241dffc2 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/agg_config.d.ts @@ -0,0 +1,129 @@ +import moment from 'moment'; +import type { SerializableRecord } from '@kbn/utility-types'; +import type { Assign, Ensure } from '@kbn/utility-types'; +import type { ExpressionAstExpression } from '@kbn/expressions-plugin/common'; +import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; +import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; +import type { ISearchOptions } from '@kbn/search-types'; +import type { ISearchSource } from '../../../public'; +import type { IAggType } from './agg_type'; +import type { IAggConfigs } from './agg_configs'; +/** @public **/ +export type AggConfigSerialized = Ensure<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | SerializableRecord; + schema?: string; +}, SerializableRecord>; +export type AggConfigOptions = Assign; +/** + * @name AggConfig + * + * @description This class represents an aggregation, which is displayed in the left-hand nav of + * the Visualize app. + */ +export type IAggConfig = AggConfig; +export declare class AggConfig { + /** + * Ensure that all of the objects in the list have ids, the objects + * and list are modified by reference. + * + * @param {array[object]} list - a list of objects, objects can be anything really + * @return {array} - the list that was passed in + */ + static ensureIds(list: any[]): any[]; + /** + * Calculate the next id based on the ids in this list + * + * @return {array} list - a list of objects with id properties + */ + static nextId(list: IAggConfig[]): number; + aggConfigs: IAggConfigs; + id: string; + enabled: boolean; + params: any; + parent?: IAggConfigs; + brandNew?: boolean; + schema?: string; + private __type; + private __typeDecorations; + private subAggs; + constructor(aggConfigs: IAggConfigs, opts: AggConfigOptions); + /** + * Write the current values to this.params, filling in the defaults as we go + * + * @param {object} [from] - optional object to read values from, + * used when initializing + * @return {undefined} + */ + setParams(from: any): void; + getParam(key: string): any; + hasTimeShift(): boolean; + getTimeShift(): undefined | moment.Duration; + write(aggs?: IAggConfigs): Record; + isFilterable(): boolean; + createFilter(key: string, params?: {}): any; + /** + * Hook for pre-flight logic, see AggType#onSearchRequestStart + * @param {SearchSource} searchSource + * @param {ISearchOptions} options + * @return {Promise} + */ + onSearchRequestStart(searchSource: ISearchSource, options?: ISearchOptions): Promise | Promise; + /** + * Convert this aggConfig to its dsl syntax. + * + * Adds params and adhoc subaggs to a pojo, then returns it + * + * @param {AggConfigs} aggConfigs - the config object to convert + * @return {void|Object} - if the config has a dsl representation, it is + * returned, else undefined is returned + */ + toDsl(aggConfigs?: IAggConfigs): any; + /** + * @returns Returns a serialized representation of an AggConfig. + */ + serialize(): AggConfigSerialized; + /** + * @deprecated Use serialize() instead. + * @removeBy 8.1 + */ + toJSON(): AggConfigSerialized; + /** + * Returns a serialized field format for the field used in this agg. + * This can be passed to fieldFormats.deserialize to get the field + * format instance. + * + * @public + */ + toSerializedFieldFormat(): SerializedFieldFormat; + /** + * @returns Returns an ExpressionAst representing the this agg type. + */ + toExpressionAst(): ExpressionAstExpression | undefined; + getAggParams(): import("./param_types/agg").AggParamType[]; + getRequestAggs(): AggConfig[]; + getResponseAggs(): AggConfig[]; + getValue(bucket: any): any; + getResponseId(): string; + getKey(bucket: any, key?: string): any; + getFieldDisplayName(): any; + getField(): any; + /** + * Returns the bucket path containing the main value the agg will produce + * (e.g. for sum of bytes it will point to the sum, for median it will point + * to the 50 percentile in the percentile multi value bucket) + */ + getValueBucketPath(): string; + makeLabel(percentageMode?: boolean): any; + getIndexPattern(): import("../..").DataView; + getTimeRange(): import("@kbn/es-query").TimeRange | undefined; + fieldName(): any; + fieldIsTimeField(): boolean; + get type(): IAggType; + set type(type: IAggType); + setType(type: IAggType): void; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_configs.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_configs.d.ts new file mode 100644 index 0000000000000..91403b214bd44 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/agg_configs.d.ts @@ -0,0 +1,143 @@ +import moment from 'moment-timezone'; +import type { Assign } from '@kbn/utility-types'; +import type { TimeRange, RangeFilter } from '@kbn/es-query'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { estypes } from '@elastic/elasticsearch'; +import type { ISearchOptions, IEsSearchResponse } from '@kbn/search-types'; +import type { ISearchSource } from '../../../public'; +import type { AggConfigSerialized, IAggConfig } from './agg_config'; +import { AggConfig } from './agg_config'; +import type { IAggType } from './agg_type'; +import type { AggTypesRegistryStart } from './agg_types_registry'; +import type { AggTypesDependencies, GetConfigFn } from '../..'; +export interface AggConfigsOptions { + typesRegistry: AggTypesRegistryStart; + hierarchical?: boolean; + aggExecutionContext?: AggTypesDependencies['aggExecutionContext']; + partialRows?: boolean; + probability?: number; + samplerSeed?: number; +} +export type CreateAggConfigParams = Assign; +export type GenericBucket = estypes.AggregationsBuckets & { + [property: string]: estypes.AggregationsAggregate; +}; +/** + * @name AggConfigs + * + * @description A "data structure"-like class with methods for indexing and + * accessing instances of AggConfig. This should never be instantiated directly + * outside of this plugin. Rather, downstream plugins should do this via + * `createAggConfigs()` + * + * @internal + */ +export type IAggConfigs = AggConfigs; +export declare class AggConfigs { + indexPattern: DataView; + private opts; + private getConfig; + timeRange?: TimeRange; + timeFields?: string[]; + forceNow?: Date; + aggs: IAggConfig[]; + readonly timeZone: string; + constructor(indexPattern: DataView, configStates: CreateAggConfigParams[] | undefined, opts: AggConfigsOptions, getConfig: GetConfigFn); + get hierarchical(): boolean; + get partialRows(): boolean; + get samplerConfig(): { + probability: number; + seed: number | undefined; + }; + isSamplingEnabled(): boolean; + setTimeFields(timeFields: string[] | undefined): void; + setForceNow(now: Date | undefined): void; + setTimeRange(timeRange: TimeRange): void; + /** + * Returns the current time range as moment instance (date math will get resolved using the current "now" value or system time if not set) + * @returns Current time range as resolved date. + */ + getResolvedTimeRange(): import("../..").TimeRangeBounds | undefined; + clone({ enabledOnly, opts, }?: { + enabledOnly?: boolean; + opts?: Partial; + }): AggConfigs; + createAggConfig: (params: CreateAggConfigParams, { addToAggConfigs }?: { + addToAggConfigs?: boolean | undefined; + }) => T; + /** + * Data-by-data comparison of this Aggregation + * Ignores the non-array indexes + * @param aggConfigs an AggConfigs instance + */ + jsonDataEquals(aggConfigs: AggConfig[]): boolean; + toDsl(): Record; + getAll(): AggConfig[]; + byIndex(index: number): AggConfig; + byId(id: string): AggConfig | undefined; + byName(name: string): AggConfig[]; + byType(type: string): AggConfig[]; + byTypeName(type: string): AggConfig[]; + bySchemaName(schema: string): AggConfig[]; + getRequestAggs(): AggConfig[]; + getTimeShifts(): Record; + getTimeShiftInterval(): moment.Duration | undefined; + hasTimeShifts(): boolean; + getSearchSourceTimeFilter(forceNow?: Date): RangeFilter[] | { + meta: { + index: string | undefined; + params: {}; + alias: string; + disabled: boolean; + negate: boolean; + }; + query: { + bool: { + should: { + bool: { + filter: { + range: { + [x: string]: { + format: string; + gte: string; + lte: string; + }; + }; + }[]; + }; + }[]; + minimum_should_match: number; + }; + }; + }[]; + postFlightTransform(response: IEsSearchResponse): IEsSearchResponse; + getRequestAggById(id: string): AggConfig | undefined; + /** + * Gets the AggConfigs (and possibly ResponseAggConfigs) that + * represent the values that will be produced when all aggs + * are run. + * + * With multi-value metric aggs it is possible for a single agg + * request to result in multiple agg values, which is why the length + * of a vis' responseValuesAggs may be different than the vis' aggs + * + * @return {array[AggConfig]} + */ + getResponseAggs(): AggConfig[]; + /** + * Find a response agg by it's id. This may be an agg in the aggConfigs, or one + * created specifically for a response value + * + * @param {string} id - the id of the agg to find + * @return {AggConfig} + */ + getResponseAggById(id: string): AggConfig | undefined; + onSearchRequestStart(searchSource: ISearchSource, options?: ISearchOptions): Promise<(void | any[])[]>; + /** + * Generates an expression abstract syntax tree using the `esaggs` expression function. + * @returns The expression AST. + */ + toExpressionAst(): import("@kbn/expressions-plugin/common").ExpressionAstExpression; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_groups.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_groups.d.ts new file mode 100644 index 0000000000000..16d4b5f55a111 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/agg_groups.d.ts @@ -0,0 +1,12 @@ +import type { $Values } from '@kbn/utility-types'; +export declare const AggGroupNames: Readonly<{ + Buckets: "buckets"; + Metrics: "metrics"; + None: "none"; +}>; +export type AggGroupName = $Values; +export declare const AggGroupLabels: { + buckets: string; + metrics: string; + none: string; +}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_params.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_params.d.ts new file mode 100644 index 0000000000000..5a541a6762fb2 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/agg_params.d.ts @@ -0,0 +1,26 @@ +import { AggParamType } from './param_types/agg'; +import { BaseParamType } from './param_types/base'; +import type { AggConfig } from './agg_config'; +import type { IAggConfigs } from './agg_configs'; +export type AggParam = BaseParamType; +export interface AggParamOption { + val: string; + display: string; + enabled?(agg: AggConfig): boolean; +} +export declare const initParams: (params: TAggParam[]) => TAggParam[]; +/** + * Reads an aggConfigs + * + * @method write + * @param {AggConfig} aggConfig + * the AggConfig object who's type owns these aggParams and contains the param values for our param defs + * @param {object} [locals] + * an array of locals that will be available to the write function (can be used to enhance + * the quality of things like date_histogram's "auto" interval) + * @return {object} output + * output of the write calls, reduced into a single object. A `params: {}` property is exposed on the + * output object which is used to create the agg dsl for the search request. All other properties + * are dependent on the AggParam#write methods which should be studied for each AggType. + */ +export declare const writeParams: = AggParamType>(params: Array> | undefined, aggConfig: TAggConfig, aggs?: IAggConfigs, locals?: Record) => Record; diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_type.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_type.d.ts new file mode 100644 index 0000000000000..bd7fc4065de64 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/agg_type.d.ts @@ -0,0 +1,210 @@ +import type { DatatableColumnType } from '@kbn/expressions-plugin/common'; +import type { RequestAdapter } from '@kbn/inspector-plugin/common'; +import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; +import type { estypes } from '@elastic/elasticsearch'; +import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; +import type { ISearchSource } from '../../../public'; +import type { AggConfig } from './agg_config'; +import type { IAggConfigs } from './agg_configs'; +import type { AggParamType } from './param_types/agg'; +type PostFlightRequestFn = (resp: estypes.SearchResponse, aggConfigs: IAggConfigs, aggConfig: TAggConfig, searchSource: ISearchSource, inspectorRequestAdapter?: RequestAdapter, abortSignal?: AbortSignal, searchSessionId?: string, disableWarningToasts?: boolean) => Promise>; +export interface AggTypeConfig = AggParamType> { + name: string; + title: string; + createFilter?: (aggConfig: TAggConfig, key: any, params?: any) => any; + type?: string; + dslName?: string; + expressionName: string; + makeLabel?: ((aggConfig: TAggConfig) => string) | (() => string); + ordered?: any; + hasNoDsl?: boolean; + hasNoDslParams?: boolean; + params?: Array>; + getValueType?: (aggConfig: TAggConfig) => DatatableColumnType; + getRequestAggs?: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); + getResponseAggs?: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); + customLabels?: boolean; + json?: boolean; + decorateAggConfig?: () => any; + postFlightRequest?: PostFlightRequestFn; + hasPrecisionError?: (aggBucket: Record) => boolean; + getSerializedFormat?: (agg: TAggConfig) => SerializedFieldFormat; + getValue?: (agg: TAggConfig, bucket: any) => any; + getKey?: (bucket: any, key: any, agg: TAggConfig) => any; + getValueBucketPath?: (agg: TAggConfig) => string; + getResponseId?: (agg: TAggConfig) => string; +} +export type IAggType = AggType; +export declare class AggType = AggParamType> { + /** + * the unique, unchanging, name that we have assigned this aggType + * + * @property name + * @type {string} + */ + name: string; + type: string; + subtype?: string; + /** + * the name of the elasticsearch aggregation that this aggType represents. Usually just this.name + * + * @property name + * @type {string} + */ + dslName: string; + /** + * the name of the expression function that this aggType represents. + * + * @property name + * @type {string} + */ + expressionName: string; + /** + * the user friendly name that will be shown in the ui for this aggType + * + * @property title + * @type {string} + */ + title: string; + /** + * The type the values produced by this agg will have in the final data table. + * If not specified, the type of the field is used. + */ + getValueType?: (aggConfig: TAggConfig) => DatatableColumnType; + /** + * a function that will be called when this aggType is assigned to + * an aggConfig, and that aggConfig is being rendered (in a form, chart, etc.). + * + * @method makeLabel + * @param {AggConfig} aggConfig - an agg config of this type + * @returns {string} - label that can be used in the ui to describe the aggConfig + */ + makeLabel: ((aggConfig: TAggConfig) => string) | (() => string); + /** + * Describes if this aggType creates data that is ordered, and if that ordered data + * is some sort of time series. + * + * If the aggType does not create ordered data, set this to something "falsy". + * + * If this does create orderedData, then the value should be an object. + * + * If the orderdata is some sort of time series, `this.ordered` should be an object + * with the property `date: true` + * + * @property ordered + * @type {object|undefined} + */ + ordered: any; + /** + * Flag that prevents this aggregation from being included in the dsl. This is only + * used by the count aggregation (currently) since it doesn't really exist and it's output + * is available on every bucket. + * + * @type {Boolean} + */ + hasNoDsl: boolean; + /** + * Flag that prevents params from this aggregation from being included in the dsl. Sibling and parent aggs are still written. + * + * @type {Boolean} + */ + hasNoDslParams: boolean; + /** + * The method to create a filter representation of the bucket + * @param {object} aggConfig The instance of the aggConfig + * @param {mixed} key The key for the bucket + * @returns {object} The filter + */ + createFilter: ((aggConfig: TAggConfig, key: any, params?: any) => any) | undefined; + /** + * An instance of {{#crossLink "AggParams"}}{{/crossLink}}. + * + * @property params + * @type {AggParams} + */ + params: TParam[]; + /** + * Designed for multi-value metric aggs, this method can return a + * set of AggConfigs that should replace this aggConfig in requests + * + * @method getRequestAggs + * @returns {array[AggConfig]} - an array of aggConfig objects + * that should replace this one, + * or undefined + */ + getRequestAggs: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); + /** + * Designed for multi-value metric aggs, this method can return a + * set of AggConfigs that should replace this aggConfig in result sets + * that walk the AggConfig set. + * + * @method getResponseAggs + * @returns {array[AggConfig]|undefined} - an array of aggConfig objects + * that should replace this one, + * or undefined + */ + getResponseAggs: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); + /** + * A function that will be called each time an aggConfig of this type + * is created, giving the agg type a chance to modify the agg config + */ + decorateAggConfig: () => any; + hasPrecisionError?: (aggBucket: Record) => boolean; + /** + * A function that needs to be called after the main request has been made + * and should return an updated response + * @param aggConfigs - agg config array used to produce main request + * @param aggConfig - AggConfig that requested the post flight request + * @param searchSourceAggs - SearchSource aggregation configuration + * @param resp - Response to the main request + * @param nestedSearchSource - the new SearchSource that will be used to make post flight request + * @param abortSignal - `AbortSignal` to abort the request + * @param searchSessionId - searchSessionId to be used for grouping requests into a single search session + * @return {Promise} + */ + postFlightRequest: PostFlightRequestFn; + /** + * Get the serialized format for the values produced by this agg type, + * overridden by several metrics that always output a simple number. + * You can pass this output to fieldFormatters.deserialize to get + * the formatter instance. + * + * @param {agg} agg - the agg to pick a format for + * @return {SerializedFieldFormat} + */ + getSerializedFormat: (agg: TAggConfig) => SerializedFieldFormat; + getValue: (agg: TAggConfig, bucket: any) => any; + getKey?: (bucket: any, key: any, agg: TAggConfig) => any; + paramByName: (name: string) => TParam | undefined; + getValueBucketPath: (agg: TAggConfig) => string; + splitForTimeShift(agg: TAggConfig, aggs: IAggConfigs): boolean; + /** + * Returns the key of the object containing the results of the agg in the Elasticsearch response object. + * In most cases this returns the `agg.id` property, but in some cases the response object is structured differently. + * In the following example of a terms agg, `getResponseId` returns "myAgg": + * ``` + * { + * "aggregations": { + * "myAgg": { + * "doc_count_error_upper_bound": 0, + * "sum_other_doc_count": 0, + * "buckets": [ + * ... + * ``` + * + * @param {agg} agg - the agg to return the id in the ES reponse object for + * @return {string} + */ + getResponseId: (agg: TAggConfig) => string; + /** + * Generic AggType Constructor + * + * Used to create the values exposed by the agg_types module. + * + * @class AggType + * @internal + * @param {object} config - used to set the properties of the AggType + */ + constructor(config: AggTypeConfig); +} +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_types.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_types.d.ts new file mode 100644 index 0000000000000..9104148b2098f --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/agg_types.d.ts @@ -0,0 +1,408 @@ +import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; +import * as buckets from './buckets'; +import type { CalculateBoundsFn } from './buckets'; +import * as metrics from './metrics'; +export interface AggTypesDependencies { + calculateBounds: CalculateBoundsFn; + getConfig: (key: string) => T; + getFieldFormatsStart: () => Pick; + aggExecutionContext?: { + shouldDetectTimeZone?: boolean; + }; +} +/** @internal */ +export declare const getAggTypes: () => { + metrics: ({ + name: metrics.METRIC_TYPES; + fn: () => metrics.MetricAggType; + } | { + name: metrics.METRIC_TYPES; + fn: ({ getFieldFormatsStart, }: metrics.PercentileRanksMetricAggDependencies) => metrics.MetricAggType; + } | { + name: metrics.METRIC_TYPES; + fn: () => metrics.MetricAggType; + } | { + name: metrics.METRIC_TYPES; + fn: ({ getConfig }: metrics.FiltersMetricAggDependencies) => metrics.MetricAggType; + })[]; + buckets: ({ + name: buckets.BUCKET_TYPES; + fn: ({ calculateBounds, aggExecutionContext, getConfig, }: AggTypesDependencies) => buckets.BucketAggType; + } | { + name: buckets.BUCKET_TYPES; + fn: ({ getConfig, getFieldFormatsStart, }: buckets.HistogramBucketAggDependencies) => buckets.BucketAggType; + } | { + name: buckets.BUCKET_TYPES; + fn: ({ aggExecutionContext, getConfig }: AggTypesDependencies) => buckets.BucketAggType; + } | { + name: buckets.BUCKET_TYPES; + fn: () => buckets.BucketAggType; + })[]; +}; +/** @internal */ +export declare const getAggTypesFunctions: () => ((() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggDateHistogram", any, { + id?: string | undefined; + timeRange?: import("..").KibanaTimerangeOutput | undefined; + time_zone?: string | undefined; + customLabel?: string | undefined; + field?: (import("@kbn/es-query").DataViewFieldBase | string) | undefined; + enabled?: boolean | undefined; + format?: string | undefined; + extended_bounds?: import("..").ExtendedBoundsOutput | undefined; + schema?: string | undefined; + interval?: string | undefined; + scaleMetricValues?: boolean | undefined; + json?: string | undefined; + timeShift?: string | undefined; + useNormalizedEsInterval?: boolean | undefined; + used_interval?: string | undefined; + used_time_zone?: string | undefined; + drop_partials?: boolean | undefined; + min_doc_count?: number | undefined; + extendToTimeRange?: boolean | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggTimeSeries", any, import("./types").BaseAggParams & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSampler", any, buckets.AggParamsSampler & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggDiversifiedSampler", any, buckets.AggParamsDiversifiedSampler & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSignificantText", any, buckets.AggParamsSignificantText & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggTopMetrics", any, metrics.AggParamsTopMetricsSerialized & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggFilter", any, { + filter?: import("..").KibanaQueryOutput | undefined; + geo_bounding_box?: import("..").GeoBoundingBoxOutput | undefined; + id?: string | undefined; + customLabel?: string | undefined; + timeWindow?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggFilters", any, { + id?: string | undefined; + filters?: import("..").QueryFilterOutput[] | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSignificantTerms", any, buckets.AggParamsSignificantTerms & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggIpPrefix", any, { + id?: string | undefined; + customLabel?: string | undefined; + field: string; + enabled?: boolean | undefined; + ipPrefix?: import("..").IpPrefixOutput | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggIpRange", any, { + id?: string | undefined; + customLabel?: string | undefined; + field: string; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + ranges?: Array | undefined; + ipRangeType?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggDateRange", any, { + id?: string | undefined; + time_zone?: string | undefined; + customLabel?: string | undefined; + field?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + ranges?: import("..").DateRangeOutput[] | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggRange", any, { + id?: string | undefined; + customLabel?: string | undefined; + field: string; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + ranges?: import("..").NumericalRangeOutput[] | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggGeoTile", any, buckets.AggParamsGeoTile & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggHistogram", any, { + id?: string | undefined; + customLabel?: string | undefined; + field: string; + enabled?: boolean | undefined; + extended_bounds?: import("..").ExtendedBoundsOutput | undefined; + schema?: string | undefined; + interval: number | string; + json?: string | undefined; + timeShift?: string | undefined; + used_interval?: number | string | undefined; + min_doc_count?: boolean | undefined; + maxBars?: number | undefined; + intervalBase?: number | undefined; + has_extended_bounds?: boolean | undefined; + autoExtendBounds?: boolean | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggTerms", any, { + order?: "asc" | "desc" | undefined; + size?: number | undefined; + id?: string | undefined; + customLabel?: string | undefined; + field: string; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + otherBucketLabel?: string | undefined; + missingBucketLabel?: string | undefined; + include?: string[] | string | number[] | undefined; + exclude?: string[] | string | number[] | undefined; + timeShift?: string | undefined; + shardSize?: number | undefined; + orderAgg?: import("./types").AggExpressionType | undefined; + orderBy: string; + missingBucket?: boolean | undefined; + otherBucket?: boolean | undefined; + includeIsRegex?: boolean | undefined; + excludeIsRegex?: boolean | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMultiTerms", any, { + fields: string[]; + order?: "asc" | "desc" | undefined; + size?: number | undefined; + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + otherBucketLabel?: string | undefined; + timeShift?: string | undefined; + shardSize?: number | undefined; + orderAgg?: import("./types").AggExpressionType | undefined; + orderBy: string; + otherBucket?: boolean | undefined; + separatorLabel?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggRareTerms", any, buckets.AggParamsRareTerms & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggAvg", any, metrics.AggParamsAvg & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggBucketAvg", any, { + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customBucket?: import("./types").AggExpressionType | undefined; + customMetric?: import("./types").AggExpressionType | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggBucketMax", any, { + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customBucket?: import("./types").AggExpressionType | undefined; + customMetric?: import("./types").AggExpressionType | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggBucketMin", any, { + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customBucket?: import("./types").AggExpressionType | undefined; + customMetric?: import("./types").AggExpressionType | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggBucketSum", any, { + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customBucket?: import("./types").AggExpressionType | undefined; + customMetric?: import("./types").AggExpressionType | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggFilteredMetric", any, { + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customBucket?: import("./types").AggExpressionType | undefined; + customMetric?: import("./types").AggExpressionType | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggCardinality", any, metrics.AggParamsCardinality & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggValueCount", any, metrics.AggParamsValueCount & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggCount", any, metrics.AggParamsCount & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggCumulativeSum", any, { + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customMetric?: import("./types").AggExpressionType | undefined; + metricAgg?: string | undefined; + buckets_path?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggDerivative", any, { + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customMetric?: import("./types").AggExpressionType | undefined; + metricAgg?: string | undefined; + buckets_path?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggGeoBounds", any, metrics.AggParamsGeoBounds & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggGeoCentroid", any, metrics.AggParamsGeoCentroid & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMax", any, metrics.AggParamsMax & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMedian", any, metrics.AggParamsMedian & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSinglePercentile", any, metrics.AggParamsSinglePercentile & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSinglePercentileRank", any, metrics.AggParamsSinglePercentileRank & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMin", any, metrics.AggParamsMin & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMovingAvg", any, { + script?: string | undefined; + id?: string | undefined; + customLabel?: string | undefined; + window?: number | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customMetric?: import("./types").AggExpressionType | undefined; + metricAgg?: string | undefined; + buckets_path?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggPercentileRanks", any, metrics.AggParamsPercentileRanks & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggPercentiles", any, metrics.AggParamsPercentiles & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSerialDiff", any, { + id?: string | undefined; + customLabel?: string | undefined; + enabled?: boolean | undefined; + schema?: string | undefined; + json?: string | undefined; + timeShift?: string | undefined; + customMetric?: import("./types").AggExpressionType | undefined; + metricAgg?: string | undefined; + buckets_path?: string | undefined; +}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggStdDeviation", any, metrics.AggParamsStdDeviation & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSum", any, metrics.AggParamsSum & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggTopHit", any, metrics.AggParamsTopHitSerialized & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggRate", any, metrics.AggParamsRate & Pick<{ + type: string; + enabled?: boolean; + id?: string; + params?: {} | import("@kbn/utility-types").SerializableRecord; + schema?: string; +}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>))[]; diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_types_registry.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_types_registry.d.ts new file mode 100644 index 0000000000000..4118e7bd80c54 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/agg_types_registry.d.ts @@ -0,0 +1,22 @@ +import type { BucketAggType } from './buckets/bucket_agg_type'; +import type { MetricAggType } from './metrics/metric_agg_type'; +import type { AggTypesDependencies } from './agg_types'; +export type AggTypesRegistrySetup = ReturnType; +export type AggTypesRegistryStart = ReturnType; +export declare class AggTypesRegistry { + private readonly bucketAggs; + private readonly metricAggs; + private readonly legacyAggs; + setup: () => { + registerBucket: BucketAggType>(name: N, type: T) => void; + registerMetric: MetricAggType>(name: N, type: T) => void; + registerLegacy: BucketAggType | MetricAggType>(name: N, type: T) => void; + }; + start: (aggTypesDependencies: AggTypesDependencies) => { + get: (name: string) => BucketAggType | MetricAggType | undefined; + getAll: () => { + buckets: BucketAggType[]; + metrics: MetricAggType[]; + }; + }; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/aggs_service.d.ts b/src/platform/plugins/shared/data/common/search/aggs/aggs_service.d.ts new file mode 100644 index 0000000000000..cb1a5e56edde5 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/aggs_service.d.ts @@ -0,0 +1,29 @@ +import type { ExpressionsServiceSetup } from '@kbn/expressions-plugin/common'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; +import type { AggTypesDependencies } from '../..'; +import type { GetConfigFn } from '../../types'; +import type { AggsCommonSetup, AggsCommonStart } from './types'; +/** @internal */ +export declare const aggsRequiredUiSettings: string[]; +export interface AggsCommonSetupDependencies { + registerFunction: ExpressionsServiceSetup['registerFunction']; +} +export interface AggsCommonStartDependencies { + getIndexPattern(id: string): Promise; + getConfig: GetConfigFn; + fieldFormats: FieldFormatsStartCommon; + calculateBounds: AggTypesDependencies['calculateBounds']; +} +/** + * The aggs service provides a means of modeling and manipulating the various + * Elasticsearch aggregations supported by Kibana, providing the ability to + * output the correct DSL when you are ready to send your request to ES. + */ +export declare class AggsCommonService { + private aggExecutionContext?; + private readonly aggTypesRegistry; + constructor(aggExecutionContext?: AggTypesDependencies['aggExecutionContext']); + setup({ registerFunction }: AggsCommonSetupDependencies): AggsCommonSetup; + start({ getConfig, fieldFormats, calculateBounds, }: AggsCommonStartDependencies): AggsCommonStart; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/_interval_options.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/_interval_options.d.ts new file mode 100644 index 0000000000000..2ff221f069ea0 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/_interval_options.d.ts @@ -0,0 +1,12 @@ +import type { IBucketAggConfig } from './bucket_agg_type'; +export declare const autoInterval = "auto"; +export declare const isAutoInterval: (value: unknown) => value is "auto"; +export declare const intervalOptions: ({ + display: string; + val: string; + enabled(agg: IBucketAggConfig): boolean; +} | { + display: string; + val: string; + enabled?: undefined; +})[]; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_order_helper.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_order_helper.d.ts new file mode 100644 index 0000000000000..1e6a5745c1da8 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_order_helper.d.ts @@ -0,0 +1,3 @@ +import type { IBucketAggConfig, BucketAggParam } from './bucket_agg_type'; +export declare const termsAggFilter: string[]; +export declare const termsOrderAggParamDefinition: Partial>; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_other_bucket_helper.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_other_bucket_helper.d.ts new file mode 100644 index 0000000000000..710e0f2c0bcba --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_other_bucket_helper.d.ts @@ -0,0 +1,27 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { Filter } from '@kbn/es-query'; +import type { IAggConfigs } from '../agg_configs'; +import type { IAggConfig } from '../agg_config'; +export declare const OTHER_NESTED_BUCKET_SEPARATOR = "\u2570\u2504\u25BA"; +export declare const buildOtherBucketAgg: (aggConfigs: IAggConfigs, aggWithOtherBucket: IAggConfig, response: any) => false | (() => { + sampling: { + aggs: { + 'other-filter': { + aggs: any; + filters: any; + }; + }; + }; + 'other-filter'?: undefined; +} | { + 'other-filter': { + aggs: any; + filters: any; + }; + sampling?: undefined; +}); +export declare const mergeOtherBucketAggResponse: (aggsConfig: IAggConfigs, response: estypes.SearchResponse, otherResponse: any, otherAgg: IAggConfig, requestAgg: Record, otherFilterBuilder: (requestAgg: Record, key: string, otherAgg: IAggConfig) => Filter) => estypes.SearchResponse; +export declare const updateMissingBucket: (response: estypes.SearchResponse, aggConfigs: IAggConfigs, agg: IAggConfig) => estypes.SearchResponse>; +export declare function constructSingleTermOtherFilter(requestAgg: Record, key: string, otherAgg: IAggConfig): import("@kbn/es-query").PhrasesFilter; +export declare function constructMultiTermOtherFilter(requestAgg: Record, key: string): Filter; +export declare const createOtherBucketPostFlightRequest: (otherFilterBuilder: (requestAgg: Record, key: string, otherAgg: IAggConfig) => Filter) => (resp: estypes.SearchResponse, aggConfigs: IAggConfigs, aggConfig: import("../agg_config").AggConfig, searchSource: import("../..").ISearchSource, inspectorRequestAdapter?: import("../../../../../inspector/common").RequestAdapter, abortSignal?: AbortSignal, searchSessionId?: string, disableWarningToasts?: boolean) => Promise>; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_type.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_type.d.ts new file mode 100644 index 0000000000000..d8300d44926c1 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_type.d.ts @@ -0,0 +1,37 @@ +import type moment from 'moment'; +import type { IAggConfig } from '../agg_config'; +import type { FilterFieldFn, GenericBucket, IAggConfigs } from '../../..'; +import type { AggTypeConfig } from '../agg_type'; +import { AggType } from '../agg_type'; +import type { AggParamType } from '../param_types/agg'; +import type { FieldTypes } from '../param_types/field'; +export interface IBucketAggConfig extends IAggConfig { + type: InstanceType; +} +export interface BucketAggParam extends AggParamType { + scriptable?: boolean; + filterFieldTypes?: FieldTypes; + onlyAggregatable?: boolean; + /** + * Filter available fields by passing filter fn on a {@link DataViewField} + * If used, takes precedence over filterFieldTypes and other filter params + */ + filterField?: FilterFieldFn; +} +interface BucketAggTypeConfig extends AggTypeConfig> { + getKey?: (bucket: any, key: any, agg: IAggConfig) => any; + getShiftedKey?: (agg: TBucketAggConfig, key: string | number, timeShift: moment.Duration) => string | number; + orderBuckets?(agg: TBucketAggConfig, a: GenericBucket, b: GenericBucket): number; + splitForTimeShift?(agg: TBucketAggConfig, aggs: IAggConfigs): boolean; + getTimeShiftInterval?(agg: TBucketAggConfig): undefined | moment.Duration; +} +export declare class BucketAggType extends AggType> { + getKey: (bucket: any, key: any, agg: TBucketAggConfig) => any; + type: string; + getShiftedKey(agg: TBucketAggConfig, key: string | number, timeShift: moment.Duration): string | number; + getTimeShiftInterval(agg: TBucketAggConfig): undefined | moment.Duration; + orderBuckets(agg: TBucketAggConfig, a: GenericBucket, b: GenericBucket): number; + constructor(config: BucketAggTypeConfig); +} +export declare function isBucketAggType(aggConfig: any): aggConfig is BucketAggType; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_types.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_types.d.ts new file mode 100644 index 0000000000000..c0d77343537f2 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_types.d.ts @@ -0,0 +1,19 @@ +export declare enum BUCKET_TYPES { + FILTER = "filter", + FILTERS = "filters", + HISTOGRAM = "histogram", + IP_PREFIX = "ip_prefix", + IP_RANGE = "ip_range", + DATE_RANGE = "date_range", + RANGE = "range", + TERMS = "terms", + MULTI_TERMS = "multi_terms", + RARE_TERMS = "rare_terms", + SIGNIFICANT_TERMS = "significant_terms", + SIGNIFICANT_TEXT = "significant_text", + GEOTILE_GRID = "geotile_grid", + DATE_HISTOGRAM = "date_histogram", + SAMPLER = "sampler", + DIVERSIFIED_SAMPLER = "diversified_sampler", + TIME_SERIES = "time_series" +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_histogram.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_histogram.d.ts new file mode 100644 index 0000000000000..667474a2f4b63 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_histogram.d.ts @@ -0,0 +1,2 @@ +import type { IBucketDateHistogramAggConfig } from '../date_histogram'; +export declare const createFilterDateHistogram: (agg: IBucketDateHistogramAggConfig, key: string | number) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_range.d.ts new file mode 100644 index 0000000000000..9f8bb96b7cbb9 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_range.d.ts @@ -0,0 +1,3 @@ +import type { DateRange } from '../../../expressions'; +import type { IBucketAggConfig } from '../bucket_agg_type'; +export declare const createFilterDateRange: (agg: IBucketAggConfig, { from, to }: DateRange) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/filters.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/filters.d.ts new file mode 100644 index 0000000000000..dba91f5c1c94c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/filters.d.ts @@ -0,0 +1,22 @@ +import type { IBucketAggConfig } from '../bucket_agg_type'; +export declare const createFilterFilters: (aggConfig: IBucketAggConfig, key: string) => { + query: (Record & { + query_string?: { + query: string; + fields?: string[]; + }; + }) | undefined; + meta: { + alias: string | null; + disabled?: boolean; + negate?: boolean; + controlledBy?: string; + group?: string; + index: string; + isMultiIndex?: boolean; + type?: string; + key?: string; + params?: import("@kbn/es-query/src/filters/build_filters").FilterMetaParams; + value?: string | import("@kbn/es-query").RangeFilterParams | import("@kbn/es-query/src/filters/build_filters").PhraseFilterValue[]; + }; +} | undefined; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/histogram.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/histogram.d.ts new file mode 100644 index 0000000000000..70b02313fefd1 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/histogram.d.ts @@ -0,0 +1,4 @@ +import type { AggTypesDependencies } from '../../agg_types'; +import type { IBucketAggConfig } from '../bucket_agg_type'; +/** @internal */ +export declare const createFilterHistogram: (getFieldFormatsStart: AggTypesDependencies["getFieldFormatsStart"]) => (aggConfig: IBucketAggConfig, key: string) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_prefix.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_prefix.d.ts new file mode 100644 index 0000000000000..c8ec5484606b1 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_prefix.d.ts @@ -0,0 +1,3 @@ +import type { IBucketAggConfig } from '../bucket_agg_type'; +import type { IpPrefixKey } from '../lib/ip_prefix'; +export declare const createFilterIpPrefix: (aggConfig: IBucketAggConfig, key: IpPrefixKey) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_range.d.ts new file mode 100644 index 0000000000000..fbe16d6ccbba0 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_range.d.ts @@ -0,0 +1,3 @@ +import type { IBucketAggConfig } from '../bucket_agg_type'; +import type { IpRangeKey } from '../lib/ip_range'; +export declare const createFilterIpRange: (aggConfig: IBucketAggConfig, key: IpRangeKey) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/multi_terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/multi_terms.d.ts new file mode 100644 index 0000000000000..5a1e34708eb86 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/multi_terms.d.ts @@ -0,0 +1,6 @@ +import type { Filter } from '@kbn/es-query'; +import type { IBucketAggConfig } from '../bucket_agg_type'; +import type { MultiFieldKey } from '../multi_field_key'; +export declare const createFilterMultiTerms: (aggConfig: IBucketAggConfig, key: MultiFieldKey, params: { + terms: MultiFieldKey[]; +}) => Filter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/range.d.ts new file mode 100644 index 0000000000000..6af723fb61b24 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/range.d.ts @@ -0,0 +1,4 @@ +import type { AggTypesDependencies } from '../../agg_types'; +import type { IBucketAggConfig } from '../bucket_agg_type'; +/** @internal */ +export declare const createFilterRange: (getFieldFormatsStart: AggTypesDependencies["getFieldFormatsStart"]) => (aggConfig: IBucketAggConfig, { label, ...params }: any) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/terms.d.ts new file mode 100644 index 0000000000000..ff451a56c839d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/terms.d.ts @@ -0,0 +1,3 @@ +import type { Filter } from '@kbn/es-query'; +import type { IBucketAggConfig } from '../bucket_agg_type'; +export declare const createFilterTerms: (aggConfig: IBucketAggConfig, key: string, params: any) => Filter[] | import("@kbn/es-query").PhraseFilter | import("@kbn/es-query").ExistsFilter | import("@kbn/es-query").ScriptedPhraseFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram.d.ts new file mode 100644 index 0000000000000..8e2ea2c981b22 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram.d.ts @@ -0,0 +1,29 @@ +import type { DataViewFieldBase, TimeRange } from '@kbn/es-query'; +import type { AggTypesDependencies, TimeRangeBounds } from '../../..'; +import type { ExtendedBounds } from '../../expressions'; +import type { IBucketAggConfig } from './bucket_agg_type'; +import { BucketAggType } from './bucket_agg_type'; +import { TimeBuckets } from './lib/time_buckets'; +import type { BaseAggParams } from '../types'; +/** @internal */ +export type CalculateBoundsFn = (timeRange: TimeRange) => TimeRangeBounds; +export interface IBucketDateHistogramAggConfig extends IBucketAggConfig { + buckets: TimeBuckets; +} +export declare function isDateHistogramBucketAggConfig(agg: any): agg is IBucketDateHistogramAggConfig; +export interface AggParamsDateHistogram extends BaseAggParams { + field?: DataViewFieldBase | string; + timeRange?: TimeRange; + useNormalizedEsInterval?: boolean; + scaleMetricValues?: boolean; + interval?: string; + used_interval?: string; + time_zone?: string; + used_time_zone?: string; + drop_partials?: boolean; + format?: string; + min_doc_count?: number; + extended_bounds?: ExtendedBounds; + extendToTimeRange?: boolean; +} +export declare const getDateHistogramBucketAgg: ({ calculateBounds, aggExecutionContext, getConfig, }: AggTypesDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram_fn.d.ts new file mode 100644 index 0000000000000..7b2ada99c8ad8 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram_fn.d.ts @@ -0,0 +1,16 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { ExtendedBoundsOutput, KibanaTimerangeOutput } from '../../expressions'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggDateHistogramFnName = "aggDateHistogram"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggDateHistogram: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range.d.ts new file mode 100644 index 0000000000000..5983a413a3da2 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range.d.ts @@ -0,0 +1,11 @@ +import type { DateRange } from '../../expressions'; +import type { IBucketAggConfig } from './bucket_agg_type'; +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +import type { AggTypesDependencies } from '../agg_types'; +export interface AggParamsDateRange extends BaseAggParams { + field?: string; + ranges?: DateRange[]; + time_zone?: string; +} +export declare const getDateRangeBucketAgg: ({ aggExecutionContext, getConfig }: AggTypesDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range_fn.d.ts new file mode 100644 index 0000000000000..c98395444fec2 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { DateRangeOutput } from '../../expressions'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggDateRangeFnName = "aggDateRange"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggDateRange: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler.d.ts new file mode 100644 index 0000000000000..e4641be3702eb --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler.d.ts @@ -0,0 +1,22 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export declare const DIVERSIFIED_SAMPLER_AGG_NAME = "diversified_sampler"; +export interface AggParamsDiversifiedSampler extends BaseAggParams { + /** + * Is used to provide values used for de-duplication + */ + field: string; + /** + * Limits how many top-scoring documents are collected in the sample processed on each shard. + */ + shard_size?: number; + /** + * Limits how many documents are permitted per choice of de-duplicating value + */ + max_docs_per_value?: number; +} +/** + * Like the sampler aggregation this is a filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents. + * The diversified_sampler aggregation adds the ability to limit the number of matches that share a common value. + */ +export declare const getDiversifiedSamplerBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler_fn.d.ts new file mode 100644 index 0000000000000..56b3a3d8a2822 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler_fn.d.ts @@ -0,0 +1,9 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionFunctionArgs, AggExpressionType, BUCKET_TYPES } from '..'; +export declare const aggDiversifiedSamplerFnName = "aggDiversifiedSampler"; +type Input = any; +type Arguments = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggDiversifiedSampler: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/filter.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/filter.d.ts new file mode 100644 index 0000000000000..4d443a43a4214 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/filter.d.ts @@ -0,0 +1,13 @@ +import type { GeoBoundingBox, QueryFilter } from '../../expressions'; +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +import type { CalculateBoundsFn } from '.'; +export interface AggParamsFilter extends BaseAggParams { + geo_bounding_box?: GeoBoundingBox; + filter?: QueryFilter; + timeWindow?: string; +} +export declare const getFilterBucketAgg: ({ getConfig, calculateBounds, }: { + getConfig: (key: string) => T; + calculateBounds: CalculateBoundsFn; +}) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/filter_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/filter_fn.d.ts new file mode 100644 index 0000000000000..7d6cac5c7923c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/filter_fn.d.ts @@ -0,0 +1,16 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { GeoBoundingBoxOutput, KibanaQueryOutput } from '../../expressions'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggFilterFnName = "aggFilter"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggFilter: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/filters.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/filters.d.ts new file mode 100644 index 0000000000000..d5e11fb386187 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/filters.d.ts @@ -0,0 +1,10 @@ +import type { QueryFilter } from '../../expressions'; +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export interface FiltersBucketAggDependencies { + getConfig: (key: string) => any; +} +export interface AggParamsFilters extends Omit { + filters?: QueryFilter[]; +} +export declare const getFiltersBucketAgg: ({ getConfig }: FiltersBucketAggDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/filters_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/filters_fn.d.ts new file mode 100644 index 0000000000000..6f1c041d4c60d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/filters_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { QueryFilterOutput } from '../../expressions'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggFiltersFnName = "aggFilters"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggFilters: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile.d.ts new file mode 100644 index 0000000000000..177e5124959f4 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile.d.ts @@ -0,0 +1,8 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsGeoTile extends BaseAggParams { + field: string; + useGeocentroid?: boolean; + precision?: number; +} +export declare const getGeoTitleBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile_fn.d.ts new file mode 100644 index 0000000000000..18e4c3db91807 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggGeoTileFnName = "aggGeoTile"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggGeoTile: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram.d.ts new file mode 100644 index 0000000000000..aa9fdd7eedc2c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram.d.ts @@ -0,0 +1,29 @@ +import type { ExtendedBounds } from '../../expressions'; +import type { AggTypesDependencies } from '../agg_types'; +import type { BaseAggParams } from '../types'; +import type { IBucketAggConfig } from './bucket_agg_type'; +import { BucketAggType } from './bucket_agg_type'; +export interface AutoBounds { + min: number; + max: number; +} +export interface HistogramBucketAggDependencies { + getConfig: (key: string) => T; + getFieldFormatsStart: AggTypesDependencies['getFieldFormatsStart']; +} +export interface IBucketHistogramAggConfig extends IBucketAggConfig { + setAutoBounds: (bounds: AutoBounds) => void; + getAutoBounds: () => AutoBounds; +} +export interface AggParamsHistogram extends BaseAggParams { + field: string; + interval: number | string; + used_interval?: number | string; + maxBars?: number; + intervalBase?: number; + min_doc_count?: boolean; + has_extended_bounds?: boolean; + extended_bounds?: ExtendedBounds; + autoExtendBounds?: boolean; +} +export declare const getHistogramBucketAgg: ({ getConfig, getFieldFormatsStart, }: HistogramBucketAggDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram_fn.d.ts new file mode 100644 index 0000000000000..05b632cfdf24a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { ExtendedBoundsOutput } from '../../expressions'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggHistogramFnName = "aggHistogram"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggHistogram: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/index.d.ts new file mode 100644 index 0000000000000..d3af3af222346 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/index.d.ts @@ -0,0 +1,46 @@ +export * from './_interval_options'; +export * from './bucket_agg_type'; +export * from './bucket_agg_types'; +export * from './date_histogram_fn'; +export * from './date_histogram'; +export * from './date_range_fn'; +export * from './date_range'; +export * from './filter_fn'; +export * from './filter'; +export * from './filters_fn'; +export * from './filters'; +export * from './geo_tile_fn'; +export * from './geo_tile'; +export * from './histogram_fn'; +export * from './histogram'; +export * from './ip_prefix_fn'; +export * from './ip_prefix'; +export * from './ip_range_fn'; +export * from './ip_range'; +export * from './lib/cidr_mask'; +export * from './lib/date_range'; +export * from './lib/ip_range'; +export * from './lib/time_buckets/calc_auto_interval'; +export { TimeBuckets, convertDurationToNormalizedEsInterval } from './lib/time_buckets'; +export * from './migrate_include_exclude_format'; +export * from './range_fn'; +export * from './range'; +export * from './range_key'; +export * from './significant_terms_fn'; +export * from './significant_terms'; +export * from './significant_text_fn'; +export * from './significant_text'; +export * from './terms_fn'; +export * from './terms'; +export { MultiFieldKey, MULTI_FIELD_KEY_SEPARATOR } from './multi_field_key'; +export * from './multi_terms_fn'; +export * from './multi_terms'; +export * from './rare_terms_fn'; +export * from './rare_terms'; +export * from './sampler_fn'; +export * from './sampler'; +export * from './diversified_sampler_fn'; +export * from './diversified_sampler'; +export * from './time_series'; +export * from './time_series_fn'; +export { SHARD_DELAY_AGG_NAME } from './shard_delay'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix.d.ts new file mode 100644 index 0000000000000..56dfe9541b99a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix.d.ts @@ -0,0 +1,8 @@ +import type { IpPrefix } from '../../expressions'; +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsIpPrefix extends BaseAggParams { + field: string; + ipPrefix?: IpPrefix; +} +export declare const getIpPrefixBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix_fn.d.ts new file mode 100644 index 0000000000000..20cb8dcf14bf7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { IpPrefixOutput } from '../../expressions'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggIpPrefixFnName = "aggIpPrefix"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggIpPrefix: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range.d.ts new file mode 100644 index 0000000000000..eb9202ae37748 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range.d.ts @@ -0,0 +1,16 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { RangeIpRangeAggKey, CidrMaskIpRangeAggKey } from './lib/ip_range'; +import type { BaseAggParams } from '../types'; +export declare enum IP_RANGE_TYPES { + FROM_TO = "fromTo", + MASK = "mask" +} +export interface AggParamsIpRange extends BaseAggParams { + field: string; + ipRangeType?: IP_RANGE_TYPES; + ranges?: Partial<{ + [IP_RANGE_TYPES.FROM_TO]: RangeIpRangeAggKey[]; + [IP_RANGE_TYPES.MASK]: CidrMaskIpRangeAggKey[]; + }>; +} +export declare const getIpRangeBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range_fn.d.ts new file mode 100644 index 0000000000000..1b9ba1f07cd1c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range_fn.d.ts @@ -0,0 +1,16 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +import type { CidrOutput, IpRangeOutput } from '../../expressions'; +export declare const aggIpRangeFnName = "aggIpRange"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; + ipRangeType?: string; +}>; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggIpRange: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/cidr_mask.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/cidr_mask.d.ts new file mode 100644 index 0000000000000..dac521b78ac93 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/cidr_mask.d.ts @@ -0,0 +1,14 @@ +export declare class CidrMask { + private static getNetmask; + private address; + private netmask; + private prefix; + constructor(cidr: string); + private getBroadcastAddress; + private getNetworkAddress; + getRange(): { + from: string; + to: string; + }; + toString(): string; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/date_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/date_range.d.ts new file mode 100644 index 0000000000000..4083831f06300 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/date_range.d.ts @@ -0,0 +1,2 @@ +import type { DateRange } from '../../../expressions'; +export declare function convertDateRangeToString({ from, to }: DateRange, format: (val: any) => string): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/histogram_calculate_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/histogram_calculate_interval.d.ts new file mode 100644 index 0000000000000..6ebb6c41a032f --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/histogram_calculate_interval.d.ts @@ -0,0 +1,15 @@ +import { ES_FIELD_TYPES } from '../../../../types'; +interface IntervalValuesRange { + min: number; + max: number; +} +export interface CalculateHistogramIntervalParams { + interval: number | string; + maxBucketsUiSettings: number; + maxBucketsUserInput?: number | ''; + esTypes: ES_FIELD_TYPES[]; + intervalBase?: number; + values?: IntervalValuesRange; +} +export declare const calculateHistogramInterval: ({ interval, maxBucketsUiSettings, maxBucketsUserInput, intervalBase, values, esTypes, }: CalculateHistogramIntervalParams) => number; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_prefix.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_prefix.d.ts new file mode 100644 index 0000000000000..4dfed8370e423 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_prefix.d.ts @@ -0,0 +1,7 @@ +export interface IpPrefixAggKey { + type: 'ip_prefix'; + address: string; + prefix_length: number; +} +export type IpPrefixKey = IpPrefixAggKey; +export declare const convertIPPrefixToString: (cidr: IpPrefixKey, format: (val: any) => string) => string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_range.d.ts new file mode 100644 index 0000000000000..b69b6b7601df8 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_range.d.ts @@ -0,0 +1,11 @@ +export interface CidrMaskIpRangeAggKey { + type: 'mask'; + mask: string; +} +export interface RangeIpRangeAggKey { + type: 'range'; + from: string; + to: string; +} +export type IpRangeKey = CidrMaskIpRangeAggKey | RangeIpRangeAggKey; +export declare const convertIPRangeToString: (range: IpRangeKey, format: (val: any) => string) => string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.d.ts new file mode 100644 index 0000000000000..cf8c1fb8456ea --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.d.ts @@ -0,0 +1,28 @@ +import moment from 'moment'; +export declare const boundsDescendingRaw: ({ + bound: number; + interval: moment.Duration; + boundLabel: string; + intervalLabel: string; +} | { + bound: moment.Duration; + interval: moment.Duration; + boundLabel: string; + intervalLabel: string; +})[]; +/** + * Using some simple rules we pick a "pretty" interval that will + * produce around the number of buckets desired given a time range. + * + * @param targetBucketCount desired number of buckets + * @param duration time range the agg covers + */ +export declare function calcAutoIntervalNear(targetBucketCount: number, duration: number): moment.Duration; +/** + * Pick a "pretty" interval that produces no more than the maxBucketCount + * for the given time range. + * + * @param maxBucketCount maximum number of buckets to create + * @param duration amount of time covered by the agg + */ +export declare function calcAutoIntervalLessThan(maxBucketCount: number, duration: number): moment.Duration; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.d.ts new file mode 100644 index 0000000000000..77f0f3e8942af --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.d.ts @@ -0,0 +1,23 @@ +import moment from 'moment'; +import type { Unit } from '@kbn/datemath'; +export interface EsInterval { + expression: string; + unit: Unit; + value: number; +} +/** + * Convert a moment.duration into an es + * compatible expression, and provide + * associated metadata + * + * @param {moment.duration} duration + * @return {object} + */ +export declare function convertDurationToNormalizedEsInterval(duration: moment.Duration, targetUnit?: Unit): EsInterval; +export declare function convertIntervalToEsInterval(interval: string): EsInterval; +declare module 'moment' { + interface Locale { + _config: moment.LocaleSpecification; + } +} +export declare function getPreciseDurationDescription(intervalValue: number, unit: moment.unitOfTime.Base): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.d.ts new file mode 100644 index 0000000000000..06484c2bb1fdb --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.d.ts @@ -0,0 +1,8 @@ +export declare const dayLabel: (amount: number) => string; +export declare const hourLabel: (amount: number) => string; +export declare const yearLabel: () => string; +export declare const minuteLabel: (amount: number) => string; +export declare const secondLabel: (amount: number) => string; +export declare const millisecondLabel: (amount: number) => string; +export declare const infinityLabel: () => string; +export declare const monthLabel: () => string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/index.d.ts new file mode 100644 index 0000000000000..d6e8f4bea63bf --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/index.d.ts @@ -0,0 +1,2 @@ +export { TimeBuckets } from './time_buckets'; +export { convertDurationToNormalizedEsInterval } from './calc_es_interval'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.d.ts new file mode 100644 index 0000000000000..94d5c6f5826a0 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.d.ts @@ -0,0 +1,133 @@ +import moment from 'moment'; +import type { TimeRangeBounds } from '../../../../../query'; +import type { EsInterval } from './calc_es_interval'; +export interface TimeBucketsInterval extends moment.Duration { + description: string; + esValue: EsInterval['value']; + esUnit: EsInterval['unit']; + expression: EsInterval['expression']; + preScaled?: TimeBucketsInterval; + scale?: number; + scaled?: boolean; +} +export interface TimeBucketsConfig extends Record { + 'histogram:maxBars': number; + 'histogram:barTarget': number; + dateFormat: string; + 'dateFormat:scaled': string[][]; +} +/** + * Helper class for wrapping the concept of an "Interval", + * which describes a timespan that will separate moments. + * + * @param {state} object - one of "" + * @param {[type]} display [description] + */ +export declare class TimeBuckets { + private _timeBucketConfig; + private _lb; + private _ub; + private _originalInterval; + private _i?; + [key: string]: any; + constructor(timeBucketConfig: TimeBucketsConfig); + /** + * Get a moment duration object representing + * the distance between the bounds, if the bounds + * are set. + * + * @return {moment.duration|undefined} + */ + private getDuration; + /** + * Set the bounds that these buckets are expected to cover. + * This is required to support interval "auto" as well + * as interval scaling. + * + * @param {object} input - an object with properties min and max, + * representing the edges for the time span + * we should cover + * + * @returns {undefined} + */ + setBounds(input?: TimeRangeBounds | TimeRangeBounds[]): void; + /** + * Clear the stored bounds + * + * @return {undefined} + */ + clearBounds(): void; + /** + * Check to see if we have received bounds yet + * + * @return {Boolean} + */ + hasBounds(): boolean; + /** + * Return the current bounds, if we have any. + * + * THIS DOES NOT CLONE THE BOUNDS, so editing them + * may have unexpected side-effects. Always + * call bounds.min.clone() before editing + * + * @return {object|undefined} - If bounds are not defined, this + * returns undefined, else it returns the bounds + * for these buckets. This object has two props, + * min and max. Each property will be a moment() + * object + * + */ + getBounds(): TimeRangeBounds | undefined; + /** + * Update the interval at which buckets should be + * generated. + * + * Input can be one of the following: + * - Any object from src/legacy/ui/agg_types.js + * - "auto" + * - Pass a valid moment unit + * + * @param {object|string|moment.duration} input - see desc + */ + setInterval(input: null | string | Record): void; + /** + * Get the interval for the buckets. If the + * number of buckets created by the interval set + * is larger than config:histogram:maxBars then the + * interval will be scaled up. If the number of buckets + * created is less than one, the interval is scaled back. + * + * The interval object returned is a moment.duration + * object that has been decorated with the following + * properties. + * + * interval.description: a text description of the interval. + * designed to be used list "field per {{ desc }}". + * - "minute" + * - "10 days" + * - "3 years" + * + * interval.expression: the elasticsearch expression that creates this + * interval. If the interval does not properly form an elasticsearch + * expression it will be forced into one. + * + * interval.scaled: the interval was adjusted to + * accommodate the maxBars setting. + * + * interval.scale: the number that y-values should be + * multiplied by + */ + getInterval(useNormalizedEsInterval?: boolean): TimeBucketsInterval; + /** + * Get a date format string that will represent dates that + * progress at our interval. + * + * Since our interval can be as small as 1ms, the default + * date format is usually way too much. with `dateFormat:scaled` + * users can modify how dates are formatted within series + * produced by TimeBuckets + * + * @return {string} + */ + getScaledDateFormat(): string; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/migrate_include_exclude_format.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/migrate_include_exclude_format.d.ts new file mode 100644 index 0000000000000..e995223ac93b6 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/migrate_include_exclude_format.d.ts @@ -0,0 +1,7 @@ +import type { IBucketAggConfig, BucketAggParam } from './bucket_agg_type'; +import type { IAggConfig } from '../agg_config'; +export declare const isType: (...types: string[]) => (agg: IAggConfig) => boolean; +export declare const isNumberType: (agg: IAggConfig) => boolean; +export declare const isStringType: (agg: IAggConfig) => boolean; +export declare const isStringOrNumberType: (agg: IAggConfig) => boolean; +export declare const migrateIncludeExcludeFormat: Partial>; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_field_key.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_field_key.d.ts new file mode 100644 index 0000000000000..090e38e7990b3 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_field_key.d.ts @@ -0,0 +1,23 @@ +import { SerializableField } from '../../../serializable_field'; +import { SerializableType } from '../../../serialize_utils'; +/** + * Serialized form of {@link @kbn/data-plugin/common.MultiFieldKey} + */ +export interface SerializedMultiFieldKey { + type: typeof SerializableType.MultiFieldKey; + keys: string[]; +} +export declare class MultiFieldKey extends SerializableField { + static isInstance(field: unknown): field is MultiFieldKey; + static deserialize(value: SerializedMultiFieldKey): MultiFieldKey; + static idBucket(bucket: unknown): string; + keys: string[]; + constructor(bucket: unknown); + toString(): string; + serialize(): SerializedMultiFieldKey; +} +/** + * Multi-field key separator used in Visualizations (Lens, AggBased, TSVB). + * This differs from the separator used in the toString method of the MultiFieldKey + */ +export declare const MULTI_FIELD_KEY_SEPARATOR = " \u203A "; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms.d.ts new file mode 100644 index 0000000000000..5a12960c4a9de --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms.d.ts @@ -0,0 +1,20 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +interface CommonAggParamsMultiTerms extends BaseAggParams { + fields: string[]; + orderBy: string; + order?: 'asc' | 'desc'; + size?: number; + shardSize?: number; + otherBucket?: boolean; + otherBucketLabel?: string; + separatorLabel?: string; +} +export interface AggParamsMultiTermsSerialized extends CommonAggParamsMultiTerms { + orderAgg?: AggConfigSerialized; +} +export interface AggParamsMultiTerms extends CommonAggParamsMultiTerms { + orderAgg?: IAggConfig; +} +export declare const getMultiTermsBucketAgg: () => BucketAggType; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms_fn.d.ts new file mode 100644 index 0000000000000..6d4729140bab5 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms_fn.d.ts @@ -0,0 +1,14 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggMultiTermsFnName = "aggMultiTerms"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggMultiTerms: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/range.d.ts new file mode 100644 index 0000000000000..1008eb8a13440 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/range.d.ts @@ -0,0 +1,12 @@ +import type { NumericalRange } from '../../expressions'; +import type { AggTypesDependencies } from '../agg_types'; +import type { BaseAggParams } from '../types'; +import { BucketAggType } from './bucket_agg_type'; +export interface RangeBucketAggDependencies { + getFieldFormatsStart: AggTypesDependencies['getFieldFormatsStart']; +} +export interface AggParamsRange extends BaseAggParams { + field: string; + ranges?: NumericalRange[]; +} +export declare const getRangeBucketAgg: ({ getFieldFormatsStart }: RangeBucketAggDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/range_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/range_fn.d.ts new file mode 100644 index 0000000000000..5182e53d76452 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/range_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { NumericalRangeOutput } from '../../expressions'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggRangeFnName = "aggRange"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggRange: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/range_key.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/range_key.d.ts new file mode 100644 index 0000000000000..ae5c17fd91567 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/range_key.d.ts @@ -0,0 +1,35 @@ +import { SerializableField } from '../../../serializable_field'; +import { SerializableType } from '../../../serialize_utils'; +type Ranges = Array>; +/** + * Serialized form of {@link @kbn/data-plugin/common.RangeKey} + */ +export interface SerializedRangeKey { + type: typeof SerializableType.RangeKey; + from: string | number | null; + to: string | number | null; + ranges: Ranges; +} +export declare class RangeKey extends SerializableField { + static isInstance(field: unknown): field is RangeKey; + static deserialize(value: SerializedRangeKey): RangeKey; + static idBucket(bucket: unknown): string; + static isRangeKeyString(rangeKey: string): boolean; + /** + * Returns `RangeKey` from stringified form. Cannot extract labels from stringified form. + * + * Only supports numerical (non-string) values. + */ + static fromString(rangeKey: string): RangeKey; + gte: string | number; + lt: string | number; + label?: string; + constructor(bucket: unknown, allRanges?: Ranges); + toString(): string; + serialize(): SerializedRangeKey; +} +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms.d.ts new file mode 100644 index 0000000000000..4b924a959f9c6 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms.d.ts @@ -0,0 +1,7 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsRareTerms extends BaseAggParams { + field: string; + max_doc_count?: number; +} +export declare const getRareTermsBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms_fn.d.ts new file mode 100644 index 0000000000000..7c885ee392365 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggRareTermsFnName = "aggRareTerms"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggRareTerms: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler.d.ts new file mode 100644 index 0000000000000..89cf0662cfe20 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler.d.ts @@ -0,0 +1,13 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export declare const SAMPLER_AGG_NAME = "sampler"; +export interface AggParamsSampler extends BaseAggParams { + /** + * Limits how many top-scoring documents are collected in the sample processed on each shard. + */ + shard_size?: number; +} +/** + * A filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents. + */ +export declare const getSamplerBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler_fn.d.ts new file mode 100644 index 0000000000000..83bf242072a2e --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler_fn.d.ts @@ -0,0 +1,9 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionFunctionArgs, AggExpressionType, BUCKET_TYPES } from '..'; +export declare const aggSamplerFnName = "aggSampler"; +type Input = any; +type Arguments = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggSampler: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay.d.ts new file mode 100644 index 0000000000000..f881e71e1a9b1 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay.d.ts @@ -0,0 +1,7 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export declare const SHARD_DELAY_AGG_NAME = "shard_delay"; +export interface AggParamsShardDelay extends BaseAggParams { + delay?: string; +} +export declare const getShardDelayBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay_fn.d.ts new file mode 100644 index 0000000000000..7959d4a8271a1 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggConfigSerialized } from '..'; +import type { AggParamsShardDelay } from './shard_delay'; +export declare const aggShardDelayFnName = "aggShardDelay"; +type Input = any; +type Arguments = AggParamsShardDelay & Pick; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggShardDelay: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms.d.ts new file mode 100644 index 0000000000000..66e55f74e499c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms.d.ts @@ -0,0 +1,10 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsSignificantTerms extends BaseAggParams { + field: string; + size?: number; + shardSize?: number; + exclude?: string | string[]; + include?: string | string[]; +} +export declare const getSignificantTermsBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms_fn.d.ts new file mode 100644 index 0000000000000..0d8ea4f4668c3 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms_fn.d.ts @@ -0,0 +1,11 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggSignificantTermsFnName = "aggSignificantTerms"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = AggArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggSignificantTerms: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text.d.ts new file mode 100644 index 0000000000000..0f8f1e45156ab --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text.d.ts @@ -0,0 +1,11 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsSignificantText extends BaseAggParams { + field: string; + size?: number; + min_doc_count?: number; + filter_duplicate_text?: boolean; + exclude?: string; + include?: string; +} +export declare const getSignificantTextBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text_fn.d.ts new file mode 100644 index 0000000000000..9dc496bc52b2e --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text_fn.d.ts @@ -0,0 +1,11 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggSignificantTextFnName = "aggSignificantText"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = AggArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggSignificantText: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/terms.d.ts new file mode 100644 index 0000000000000..442a98b201820 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/terms.d.ts @@ -0,0 +1,29 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export { termsAggFilter } from './_terms_order_helper'; +export interface CommonAggParamsTerms extends BaseAggParams { + field: string; + orderBy: string; + size?: number; + shardSize?: number; + missingBucket?: boolean; + missingBucketLabel?: string; + otherBucket?: boolean; + otherBucketLabel?: string; + exclude?: string[] | string | number[]; + include?: string[] | string | number[]; + includeIsRegex?: boolean; + excludeIsRegex?: boolean; +} +export interface AggParamsTermsSerialized extends CommonAggParamsTerms { + orderAgg?: AggConfigSerialized; + order?: 'asc' | 'desc'; +} +export interface AggParamsTerms extends CommonAggParamsTerms { + orderAgg?: IAggConfig; + order?: { + value: 'asc' | 'desc'; + text: string; + }; +} +export declare const getTermsBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/terms_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/terms_fn.d.ts new file mode 100644 index 0000000000000..3bd2293c2c455 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/terms_fn.d.ts @@ -0,0 +1,14 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggTermsFnName = "aggTerms"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggTerms: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series.d.ts new file mode 100644 index 0000000000000..0946df23d112b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series.d.ts @@ -0,0 +1,5 @@ +import { BucketAggType } from './bucket_agg_type'; +import type { BaseAggParams } from '../types'; +export { termsAggFilter } from './_terms_order_helper'; +export type AggParamsTimeSeries = BaseAggParams; +export declare const getTimeSeriesBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series_fn.d.ts new file mode 100644 index 0000000000000..a7026f53e5783 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { BUCKET_TYPES } from '..'; +export declare const aggTimeSeriesFnName = "aggTimeSeries"; +type Input = any; +type Output = AggExpressionType; +type AggArgs = AggExpressionFunctionArgs; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggTimeSeries: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/index.d.ts new file mode 100644 index 0000000000000..adb703cfff039 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/index.d.ts @@ -0,0 +1,12 @@ +export * from './agg_config'; +export * from './agg_configs'; +export * from './agg_groups'; +export * from './agg_type'; +export * from './agg_types'; +export * from './agg_types_registry'; +export * from './aggs_service'; +export * from './buckets'; +export * from './metrics'; +export * from './param_types'; +export type * from './types'; +export * from './utils'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/avg.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/avg.d.ts new file mode 100644 index 0000000000000..4c3a77a46278b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/avg.d.ts @@ -0,0 +1,6 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsAvg extends BaseAggParams { + field: string; +} +export declare const getAvgMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/avg_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/avg_fn.d.ts new file mode 100644 index 0000000000000..a72f7318f508c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/avg_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggAvgFnName = "aggAvg"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggAvg: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg.d.ts new file mode 100644 index 0000000000000..299669e9072e7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg.d.ts @@ -0,0 +1,11 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface AggParamsBucketAvgSerialized extends BaseAggParams { + customMetric?: AggConfigSerialized; + customBucket?: AggConfigSerialized; +} +export interface AggParamsBucketAvg extends BaseAggParams { + customMetric?: IAggConfig; + customBucket?: IAggConfig; +} +export declare const getBucketAvgMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg_fn.d.ts new file mode 100644 index 0000000000000..b9f483703d569 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggBucketAvgFnName = "aggBucketAvg"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggBucketAvg: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max.d.ts new file mode 100644 index 0000000000000..4c36e99dbb64a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max.d.ts @@ -0,0 +1,11 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface AggParamsBucketMaxSerialized extends BaseAggParams { + customMetric?: AggConfigSerialized; + customBucket?: AggConfigSerialized; +} +export interface AggParamsBucketMax extends BaseAggParams { + customMetric?: IAggConfig; + customBucket?: IAggConfig; +} +export declare const getBucketMaxMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max_fn.d.ts new file mode 100644 index 0000000000000..7f3fb09db4abf --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggBucketMaxFnName = "aggBucketMax"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggBucketMax: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min.d.ts new file mode 100644 index 0000000000000..2c45aa779a7e0 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min.d.ts @@ -0,0 +1,11 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface AggParamsBucketMinSerialized extends BaseAggParams { + customMetric?: AggConfigSerialized; + customBucket?: AggConfigSerialized; +} +export interface AggParamsBucketMin extends BaseAggParams { + customMetric?: IAggConfig; + customBucket?: IAggConfig; +} +export declare const getBucketMinMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min_fn.d.ts new file mode 100644 index 0000000000000..52703fa376989 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggBucketMinFnName = "aggBucketMin"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggBucketMin: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum.d.ts new file mode 100644 index 0000000000000..a0be21ca025b5 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum.d.ts @@ -0,0 +1,11 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface AggParamsBucketSumSerialized extends BaseAggParams { + customMetric?: AggConfigSerialized; + customBucket?: AggConfigSerialized; +} +export interface AggParamsBucketSum extends BaseAggParams { + customMetric?: IAggConfig; + customBucket?: IAggConfig; +} +export declare const getBucketSumMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum_fn.d.ts new file mode 100644 index 0000000000000..366927a5c2f05 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggBucketSumFnName = "aggBucketSum"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggBucketSum: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality.d.ts new file mode 100644 index 0000000000000..55a1283632b81 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality.d.ts @@ -0,0 +1,8 @@ +import type { IMetricAggConfig } from './metric_agg_type'; +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsCardinality extends BaseAggParams { + field: string; + emptyAsNull?: boolean; +} +export declare const getCardinalityMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality_fn.d.ts new file mode 100644 index 0000000000000..31f6cb8476dce --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggCardinalityFnName = "aggCardinality"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggCardinality: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/count.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/count.d.ts new file mode 100644 index 0000000000000..29fab198e636c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/count.d.ts @@ -0,0 +1,6 @@ +import type { BaseAggParams } from '../types'; +import { MetricAggType } from './metric_agg_type'; +export interface AggParamsCount extends BaseAggParams { + emptyAsNull?: boolean; +} +export declare const getCountMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/count_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/count_fn.d.ts new file mode 100644 index 0000000000000..8f4a497aba786 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/count_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggCountFnName = "aggCount"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggCount: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum.d.ts new file mode 100644 index 0000000000000..217a9c6e1167c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum.d.ts @@ -0,0 +1,13 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface CommonAggParamsCumulativeSum extends BaseAggParams { + buckets_path?: string; + metricAgg?: string; +} +export interface AggParamsCumulativeSumSerialized extends CommonAggParamsCumulativeSum { + customMetric?: AggConfigSerialized; +} +export interface AggParamsCumulativeSum extends CommonAggParamsCumulativeSum { + customMetric?: IAggConfig; +} +export declare const getCumulativeSumMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum_fn.d.ts new file mode 100644 index 0000000000000..1cccdf598705c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum_fn.d.ts @@ -0,0 +1,14 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggCumulativeSumFnName = "aggCumulativeSum"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggCumulativeSum: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative.d.ts new file mode 100644 index 0000000000000..137449b6131d6 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative.d.ts @@ -0,0 +1,13 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface CommonAggParamsDerivative extends BaseAggParams { + buckets_path?: string; + metricAgg?: string; +} +export interface AggParamsDerivativeSerialized extends CommonAggParamsDerivative { + customMetric?: AggConfigSerialized; +} +export interface AggParamsDerivative extends CommonAggParamsDerivative { + customMetric?: IAggConfig; +} +export declare const getDerivativeMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative_fn.d.ts new file mode 100644 index 0000000000000..3d4820c7b8364 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative_fn.d.ts @@ -0,0 +1,14 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggDerivativeFnName = "aggDerivative"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggDerivative: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric.d.ts new file mode 100644 index 0000000000000..90884362de45f --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric.d.ts @@ -0,0 +1,14 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface AggParamsFilteredMetricSerialized extends BaseAggParams { + customMetric?: AggConfigSerialized; + customBucket?: AggConfigSerialized; +} +export interface AggParamsFilteredMetric extends BaseAggParams { + customMetric?: IAggConfig; + customBucket?: IAggConfig; +} +export interface FiltersMetricAggDependencies { + getConfig: (key: string) => T; +} +export declare const getFilteredMetricAgg: ({ getConfig }: FiltersMetricAggDependencies) => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric_fn.d.ts new file mode 100644 index 0000000000000..5eedad3fac3ef --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric_fn.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggFilteredMetricFnName = "aggFilteredMetric"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggFilteredMetric: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds.d.ts new file mode 100644 index 0000000000000..c03ef8a0e677e --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds.d.ts @@ -0,0 +1,6 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsGeoBounds extends BaseAggParams { + field: string; +} +export declare const getGeoBoundsMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds_fn.d.ts new file mode 100644 index 0000000000000..85f2341f2b935 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggGeoBoundsFnName = "aggGeoBounds"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggGeoBounds: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid.d.ts new file mode 100644 index 0000000000000..5454d39af2054 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid.d.ts @@ -0,0 +1,6 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsGeoCentroid extends BaseAggParams { + field: string; +} +export declare const getGeoCentroidMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid_fn.d.ts new file mode 100644 index 0000000000000..f22c1b90a4ed6 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggGeoCentroidFnName = "aggGeoCentroid"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggGeoCentroid: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/index.d.ts new file mode 100644 index 0000000000000..6931d32d34424 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/index.d.ts @@ -0,0 +1,58 @@ +export * from './avg_fn'; +export * from './avg'; +export * from './bucket_avg_fn'; +export * from './bucket_avg'; +export * from './bucket_max_fn'; +export * from './bucket_max'; +export * from './bucket_min_fn'; +export * from './bucket_min'; +export * from './bucket_sum_fn'; +export * from './bucket_sum'; +export * from './filtered_metric_fn'; +export * from './filtered_metric'; +export * from './cardinality_fn'; +export * from './cardinality'; +export * from './value_count_fn'; +export * from './value_count'; +export * from './count'; +export * from './count_fn'; +export * from './cumulative_sum_fn'; +export * from './cumulative_sum'; +export * from './derivative_fn'; +export * from './derivative'; +export * from './geo_bounds_fn'; +export * from './geo_bounds'; +export * from './geo_centroid_fn'; +export * from './geo_centroid'; +export * from './lib/parent_pipeline_agg_helper'; +export * from './lib/sibling_pipeline_agg_helper'; +export * from './max_fn'; +export * from './max'; +export * from './median_fn'; +export * from './median'; +export * from './single_percentile_fn'; +export * from './single_percentile'; +export * from './metric_agg_type'; +export * from './metric_agg_types'; +export * from './min_fn'; +export * from './min'; +export * from './moving_avg_fn'; +export * from './moving_avg'; +export * from './percentile_ranks_fn'; +export * from './percentile_ranks'; +export * from './percentiles_fn'; +export * from './percentiles'; +export * from './rate_fn'; +export * from './rate'; +export * from './single_percentile_rank_fn'; +export * from './single_percentile_rank'; +export * from './serial_diff_fn'; +export * from './serial_diff'; +export * from './std_deviation_fn'; +export * from './std_deviation'; +export * from './sum_fn'; +export * from './sum'; +export * from './top_hit_fn'; +export * from './top_hit'; +export * from './top_metrics'; +export * from './top_metrics_fn'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/create_filter.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/create_filter.d.ts new file mode 100644 index 0000000000000..0883a70e53a01 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/create_filter.d.ts @@ -0,0 +1,4 @@ +import type { AggConfig } from '../../agg_config'; +import type { IMetricAggConfig } from '../metric_agg_type'; +export declare const createMetricFilter: (aggConfig: TMetricAggConfig, key: string) => import("@kbn/es-query").ExistsFilter | undefined; +export declare const createTopHitFilter: (aggConfig: TMetricAggConfig, key: string) => import("@kbn/es-query").PhraseFilter | import("@kbn/es-query").CombinedFilter | import("@kbn/es-query").ScriptedPhraseFilter | undefined; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/get_response_agg_config_class.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/get_response_agg_config_class.d.ts new file mode 100644 index 0000000000000..dc3ee8b114c71 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/get_response_agg_config_class.d.ts @@ -0,0 +1,19 @@ +import type { IMetricAggConfig } from '../metric_agg_type'; +/** + * Get the ResponseAggConfig class for an aggConfig, + * which might be cached on the aggConfig or created. + * + * @param {AggConfig} agg - the AggConfig the VAC should inherit from + * @param {object} props - properties that the VAC should have + * @return {Constructor} - a constructor for VAC objects that will inherit the aggConfig + */ +export declare const getResponseAggConfigClass: (agg: any, props: Partial) => any; +export interface IResponseAggConfig extends IMetricAggConfig { + key: string | number; + parentId: IMetricAggConfig['id']; +} +export declare function getResponseAggId(parentId: string, key: string): string; +export declare const create: (parentAgg: IMetricAggConfig, props: Partial) => { + (this: IResponseAggConfig, key: string): void; + prototype: any; +}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/make_nested_label.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/make_nested_label.d.ts new file mode 100644 index 0000000000000..14f12e7fdd959 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/make_nested_label.d.ts @@ -0,0 +1,2 @@ +import type { IMetricAggConfig } from '../metric_agg_type'; +export declare const makeNestedLabel: (aggConfig: IMetricAggConfig, label: string) => any; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/nested_agg_helpers.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/nested_agg_helpers.d.ts new file mode 100644 index 0000000000000..240bd32e65413 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/nested_agg_helpers.d.ts @@ -0,0 +1,18 @@ +import type { IMetricAggConfig } from '../metric_agg_type'; +/** + * Forwards modifyAggConfigOnSearchRequestStart calls to a nested AggConfig. + * This must be used for each parameter, that accepts a nested aggregation, otherwise + * some parameters of the nested aggregation might not work properly (like auto interval + * on a nested date histogram). + * You should assign the return value of this function to the modifyAggConfigOnSearchRequestStart + * of the parameter that accepts a nested aggregation. Example: + * { + * name: 'customBucket', + * modifyAggConfigOnSearchRequestStart: forwardModifyAggConfigOnSearchRequestStart('customBucket') + * } + * + * @param {string} paramName - The name of the parameter, that this function should forward + * calls to. That should match the name of the parameter the function is called on. + * @returns {function} A function, that forwards the calls. + */ +export declare const forwardModifyAggConfigOnSearchRequestStart: (paramName: string) => (aggConfig: IMetricAggConfig, searchSource?: any, request?: any) => void; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/ordinal_suffix.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/ordinal_suffix.d.ts new file mode 100644 index 0000000000000..a19c85561040e --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/ordinal_suffix.d.ts @@ -0,0 +1 @@ +export declare function ordinalSuffix(num: any): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.d.ts new file mode 100644 index 0000000000000..64743bf0f9c93 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.d.ts @@ -0,0 +1,7 @@ +import type { IMetricAggConfig, MetricAggParam } from '../metric_agg_type'; +export declare const parentPipelineType: string; +export declare const parentPipelineAggHelper: { + subtype: string; + params(): Array>; + getSerializedFormat(agg: IMetricAggConfig): any; +}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_writer.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_writer.d.ts new file mode 100644 index 0000000000000..a35d660c75aa7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_writer.d.ts @@ -0,0 +1,3 @@ +import type { IAggConfigs } from '../../agg_configs'; +import type { IMetricAggConfig } from '../metric_agg_type'; +export declare const parentPipelineAggWriter: (agg: IMetricAggConfig, output: Record, aggConfigs?: IAggConfigs) => void; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.d.ts new file mode 100644 index 0000000000000..ae2f0f79d2581 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.d.ts @@ -0,0 +1,7 @@ +import type { IMetricAggConfig, MetricAggParam } from '../metric_agg_type'; +export declare const siblingPipelineType: string; +export declare const siblingPipelineAggHelper: { + subtype: string; + params(bucketFilter?: string[]): Array>; + getSerializedFormat(agg: IMetricAggConfig): any; +}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_writer.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_writer.d.ts new file mode 100644 index 0000000000000..61b6d2a59d6bd --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_writer.d.ts @@ -0,0 +1,2 @@ +import type { IMetricAggConfig } from '../metric_agg_type'; +export declare const siblingPipelineAggWriter: (agg: IMetricAggConfig, output: Record) => void; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/max.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/max.d.ts new file mode 100644 index 0000000000000..4e2915526ee23 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/max.d.ts @@ -0,0 +1,6 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsMax extends BaseAggParams { + field: string; +} +export declare const getMaxMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/max_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/max_fn.d.ts new file mode 100644 index 0000000000000..25dc959056be7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/max_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggMaxFnName = "aggMax"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggMax: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/median.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/median.d.ts new file mode 100644 index 0000000000000..74ab0f1d2a7cc --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/median.d.ts @@ -0,0 +1,6 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsMedian extends BaseAggParams { + field: string; +} +export declare const getMedianMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/median_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/median_fn.d.ts new file mode 100644 index 0000000000000..29680b70c8321 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/median_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggMedianFnName = "aggMedian"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggMedian: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_type.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_type.d.ts new file mode 100644 index 0000000000000..b67ac5e7bee47 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_type.d.ts @@ -0,0 +1,28 @@ +import type { AggTypeConfig } from '../agg_type'; +import { AggType } from '../agg_type'; +import type { AggParamType } from '../param_types/agg'; +import type { AggConfig } from '../agg_config'; +import type { FieldTypes } from '../param_types'; +export interface IMetricAggConfig extends AggConfig { + type: InstanceType; +} +export interface MetricAggParam extends AggParamType { + filterFieldTypes?: FieldTypes; + onlyAggregatable?: boolean; + scriptable?: boolean; +} +interface MetricAggTypeConfig extends AggTypeConfig> { + isScalable?: () => boolean; + subtype?: string; + enableEmptyAsNull?: boolean; +} +export type IMetricAggType = MetricAggType; +export declare class MetricAggType extends AggType> { + subtype: string; + isScalable: () => boolean; + type: string; + getKey: () => void; + constructor(config: MetricAggTypeConfig); +} +export declare function isMetricAggType(aggConfig: any): aggConfig is MetricAggType; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_types.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_types.d.ts new file mode 100644 index 0000000000000..97edd11582435 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_types.d.ts @@ -0,0 +1,29 @@ +export declare enum METRIC_TYPES { + AVG = "avg", + FILTERED_METRIC = "filtered_metric", + CARDINALITY = "cardinality", + VALUE_COUNT = "value_count", + AVG_BUCKET = "avg_bucket", + MAX_BUCKET = "max_bucket", + MIN_BUCKET = "min_bucket", + SUM_BUCKET = "sum_bucket", + COUNT = "count", + CUMULATIVE_SUM = "cumulative_sum", + DERIVATIVE = "derivative", + GEO_BOUNDS = "geo_bounds", + GEO_CENTROID = "geo_centroid", + MEDIAN = "median", + SINGLE_PERCENTILE = "single_percentile", + SINGLE_PERCENTILE_RANK = "single_percentile_rank", + MIN = "min", + MAX = "max", + MOVING_FN = "moving_avg", + SERIAL_DIFF = "serial_diff", + SUM = "sum", + TOP_HITS = "top_hits", + TOP_METRICS = "top_metrics", + PERCENTILES = "percentiles", + PERCENTILE_RANKS = "percentile_ranks", + RATE = "rate", + STD_DEV = "std_dev" +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/min.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/min.d.ts new file mode 100644 index 0000000000000..c7c8906132dcd --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/min.d.ts @@ -0,0 +1,6 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsMin extends BaseAggParams { + field: string; +} +export declare const getMinMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/min_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/min_fn.d.ts new file mode 100644 index 0000000000000..d029fcb6d4c8d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/min_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggMinFnName = "aggMin"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggMin: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg.d.ts new file mode 100644 index 0000000000000..fa387a6cfb1a7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg.d.ts @@ -0,0 +1,15 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface CommonAggParamsMovingAvg extends BaseAggParams { + buckets_path?: string; + window?: number; + script?: string; + metricAgg?: string; +} +export interface AggParamsMovingAvgSerialized extends CommonAggParamsMovingAvg { + customMetric?: AggConfigSerialized; +} +export interface AggParamsMovingAvg extends CommonAggParamsMovingAvg { + customMetric?: IAggConfig; +} +export declare const getMovingAvgMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg_fn.d.ts new file mode 100644 index 0000000000000..9d93c1d08d857 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg_fn.d.ts @@ -0,0 +1,14 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggMovingAvgFnName = "aggMovingAvg"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggMovingAvg: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks.d.ts new file mode 100644 index 0000000000000..ed80c8cf8518c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks.d.ts @@ -0,0 +1,13 @@ +import type { AggTypesDependencies } from '../agg_types'; +import type { BaseAggParams } from '../types'; +import { MetricAggType } from './metric_agg_type'; +import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; +export interface AggParamsPercentileRanks extends BaseAggParams { + field: string; + values?: number[]; +} +export type IPercentileRanksAggConfig = IResponseAggConfig; +export interface PercentileRanksMetricAggDependencies { + getFieldFormatsStart: AggTypesDependencies['getFieldFormatsStart']; +} +export declare const getPercentileRanksMetricAgg: ({ getFieldFormatsStart, }: PercentileRanksMetricAggDependencies) => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks_fn.d.ts new file mode 100644 index 0000000000000..6bf83263f735a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggPercentileRanksFnName = "aggPercentileRanks"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggPercentileRanks: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles.d.ts new file mode 100644 index 0000000000000..8ea0af22cb3ee --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles.d.ts @@ -0,0 +1,9 @@ +import { MetricAggType } from './metric_agg_type'; +import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; +import type { BaseAggParams } from '../types'; +export interface AggParamsPercentiles extends BaseAggParams { + field: string; + percents?: number[]; +} +export type IPercentileAggConfig = IResponseAggConfig; +export declare const getPercentilesMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_fn.d.ts new file mode 100644 index 0000000000000..ad84f2514130b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggPercentilesFnName = "aggPercentiles"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggPercentiles: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_get_value.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_get_value.d.ts new file mode 100644 index 0000000000000..2e185c609bb11 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_get_value.d.ts @@ -0,0 +1,2 @@ +import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; +export declare const getPercentileValue: (agg: TAggConfig, bucket: any) => any; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/rate.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/rate.d.ts new file mode 100644 index 0000000000000..38b66291430cd --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/rate.d.ts @@ -0,0 +1,7 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsRate extends BaseAggParams { + unit: string; + field?: string; +} +export declare const getRateMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/rate_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/rate_fn.d.ts new file mode 100644 index 0000000000000..bf76d88b648bf --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/rate_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggRateFnName = "aggRate"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggRate: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff.d.ts new file mode 100644 index 0000000000000..b4908f41191da --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff.d.ts @@ -0,0 +1,13 @@ +import { MetricAggType } from './metric_agg_type'; +import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; +export interface CommonAggParamsSerialDiff extends BaseAggParams { + buckets_path?: string; + metricAgg?: string; +} +export interface AggParamsSerialDiffSerialized extends CommonAggParamsSerialDiff { + customMetric?: AggConfigSerialized; +} +export interface AggParamsSerialDiff extends CommonAggParamsSerialDiff { + customMetric?: IAggConfig; +} +export declare const getSerialDiffMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff_fn.d.ts new file mode 100644 index 0000000000000..109567d72c7c3 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff_fn.d.ts @@ -0,0 +1,14 @@ +import type { Assign } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggSerialDiffFnName = "aggSerialDiff"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Arguments = Assign; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggSerialDiff: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile.d.ts new file mode 100644 index 0000000000000..54dec0889d56b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile.d.ts @@ -0,0 +1,7 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsSinglePercentile extends BaseAggParams { + field: string; + percentile: number; +} +export declare const getSinglePercentileMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_fn.d.ts new file mode 100644 index 0000000000000..0cfac84e4b70d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggSinglePercentileFnName = "aggSinglePercentile"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggSinglePercentile: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank.d.ts new file mode 100644 index 0000000000000..cd2c812833f47 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank.d.ts @@ -0,0 +1,8 @@ +import { MetricAggType } from './metric_agg_type'; +import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; +import type { BaseAggParams } from '../types'; +export interface AggParamsSinglePercentileRank extends BaseAggParams { + field: string; + value: number; +} +export declare const getSinglePercentileRankMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank_fn.d.ts new file mode 100644 index 0000000000000..1d01b6147e6cc --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggSinglePercentileRankFnName = "aggSinglePercentileRank"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggSinglePercentileRank: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation.d.ts new file mode 100644 index 0000000000000..80628d1150dca --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation.d.ts @@ -0,0 +1,17 @@ +import { MetricAggType } from './metric_agg_type'; +import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; +import type { BaseAggParams } from '../types'; +export interface AggParamsStdDeviation extends BaseAggParams { + field: string; + showBounds?: boolean; +} +interface ValProp { + valProp: string[]; + title: string; +} +export interface IStdDevAggConfig extends IResponseAggConfig { + keyedDetails: (customLabel: string, fieldDisplayName?: string) => Record; + valProp: () => string[]; +} +export declare const getStdDeviationMetricAgg: () => MetricAggType; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation_fn.d.ts new file mode 100644 index 0000000000000..04a8915adc7f7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggStdDeviationFnName = "aggStdDeviation"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggStdDeviation: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/sum.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/sum.d.ts new file mode 100644 index 0000000000000..0fe049235d603 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/sum.d.ts @@ -0,0 +1,7 @@ +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsSum extends BaseAggParams { + field: string; + emptyAsNull?: boolean; +} +export declare const getSumMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/sum_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/sum_fn.d.ts new file mode 100644 index 0000000000000..56766f4fad5dc --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/sum_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggSumFnName = "aggSum"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggSum: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit.d.ts new file mode 100644 index 0000000000000..b91baf376d6cd --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit.d.ts @@ -0,0 +1,20 @@ +import type { DataViewField } from '@kbn/data-views-plugin/common'; +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface BaseAggParamsTopHit extends BaseAggParams { + field: string; + aggregate: 'min' | 'max' | 'sum' | 'average' | 'concat'; + size?: number; +} +export interface AggParamsTopHitSerialized extends BaseAggParamsTopHit { + sortOrder?: 'desc' | 'asc'; + sortField?: string; +} +export interface AggParamsTopHit extends BaseAggParamsTopHit { + sortOrder?: { + value: 'desc' | 'asc'; + text: string; + }; + sortField?: DataViewField; +} +export declare const getTopHitMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit_fn.d.ts new file mode 100644 index 0000000000000..311918f420277 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggTopHitFnName = "aggTopHit"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggTopHit: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics.d.ts new file mode 100644 index 0000000000000..2ee0a4702df6b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics.d.ts @@ -0,0 +1,19 @@ +import { MetricAggType } from './metric_agg_type'; +import type { DataViewField } from '../../..'; +import type { BaseAggParams } from '../types'; +export interface BaseAggParamsTopMetrics extends BaseAggParams { + field: string; + size?: number; +} +export interface AggParamsTopMetricsSerialized extends BaseAggParamsTopMetrics { + sortOrder?: 'desc' | 'asc'; + sortField?: string; +} +export interface AggParamsTopMetrics extends BaseAggParamsTopMetrics { + sortOrder?: { + value: 'desc' | 'asc'; + text: string; + }; + sortField?: DataViewField; +} +export declare const getTopMetricsMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics_fn.d.ts new file mode 100644 index 0000000000000..81aa96cc22d4c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggTopMetricsFnName = "aggTopMetrics"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggTopMetrics: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count.d.ts new file mode 100644 index 0000000000000..af31af8c4cdc9 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count.d.ts @@ -0,0 +1,8 @@ +import type { IMetricAggConfig } from './metric_agg_type'; +import { MetricAggType } from './metric_agg_type'; +import type { BaseAggParams } from '../types'; +export interface AggParamsValueCount extends BaseAggParams { + field: string; + emptyAsNull?: boolean; +} +export declare const getValueCountMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count_fn.d.ts new file mode 100644 index 0000000000000..cff25254bc16b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count_fn.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; +import { METRIC_TYPES } from '..'; +export declare const aggValueCountFnName = "aggValueCount"; +type Input = any; +type AggArgs = AggExpressionFunctionArgs; +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition; +export declare const aggValueCount: () => FunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/agg.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/agg.d.ts new file mode 100644 index 0000000000000..8ca2336545845 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/param_types/agg.d.ts @@ -0,0 +1,7 @@ +import type { IAggConfig, AggConfigSerialized } from '../agg_config'; +import { BaseParamType } from './base'; +export declare class AggParamType extends BaseParamType { + makeAgg: (agg: TAggConfig, state?: AggConfigSerialized) => TAggConfig; + allowedAggs: string[]; + constructor(config: Record); +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/base.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/base.d.ts new file mode 100644 index 0000000000000..1e85e1791d7f1 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/param_types/base.d.ts @@ -0,0 +1,32 @@ +import type { ExpressionAstExpression } from '@kbn/expressions-plugin/common'; +import type { ISearchOptions } from '@kbn/search-types'; +import type { ISearchSource } from '../../../../public'; +import type { IAggConfigs } from '../agg_configs'; +import type { IAggConfig } from '../agg_config'; +export declare class BaseParamType { + name: string; + type: string; + displayName: string; + required: boolean; + advanced: boolean; + default: any; + write: (aggConfig: TAggConfig, output: Record, aggConfigs?: IAggConfigs, locals?: Record) => void; + serialize: (value: any, aggConfig?: TAggConfig) => any; + deserialize: (value: any, aggConfig?: TAggConfig) => any; + toExpressionAst?: (value: any) => ExpressionAstExpression[] | ExpressionAstExpression | undefined; + options: any[]; + getValueType: (aggConfig: IAggConfig) => any; + onChange?(agg: TAggConfig): void; + shouldShow?(agg: TAggConfig): boolean; + /** + * A function that will be called before an aggConfig is serialized and sent to ES. + * Allows aggConfig to retrieve values needed for serialization + * Example usage: an aggregation needs to know the min/max of a field to determine an appropriate interval + * + * @param {AggConfig} aggConfig + * @param {Courier.SearchSource} searchSource + * @returns {Promise|undefined} + */ + modifyAggConfigOnSearchRequestStart: (aggConfig: TAggConfig, searchSource?: ISearchSource, options?: ISearchOptions) => void; + constructor(config: Record); +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/field.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/field.d.ts new file mode 100644 index 0000000000000..741e954eab373 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/param_types/field.d.ts @@ -0,0 +1,23 @@ +import { DataViewField } from '@kbn/data-views-plugin/common'; +import type { IAggConfig } from '../agg_config'; +import { BaseParamType } from './base'; +import { KBN_FIELD_TYPES } from '../../../kbn_field_types/types'; +export type FieldTypes = KBN_FIELD_TYPES | KBN_FIELD_TYPES[] | '*'; +export type FilterFieldFn = (field: DataViewField) => boolean; +export type IFieldParamType = FieldParamType; +export declare class FieldParamType extends BaseParamType { + required: boolean; + scriptable: boolean; + filterFieldTypes: FieldTypes; + onlyAggregatable: boolean; + /** + * Filter available fields by passing filter fn on a {@link DataViewField} + * If used, takes precedence over filterFieldTypes and other filter params + */ + filterField?: FilterFieldFn; + constructor(config: Record); + /** + * filter the fields to the available ones + */ + getAvailableFields: (aggConfig: IAggConfig) => DataViewField[]; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/index.d.ts new file mode 100644 index 0000000000000..9c17532bf0a2d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/param_types/index.d.ts @@ -0,0 +1,6 @@ +export * from './agg'; +export * from './base'; +export * from './field'; +export * from './json'; +export * from './optioned'; +export * from './string'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/json.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/json.d.ts new file mode 100644 index 0000000000000..d6a716fd8766a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/param_types/json.d.ts @@ -0,0 +1,4 @@ +import { BaseParamType } from './base'; +export declare class JsonParamType extends BaseParamType { + constructor(config: Record); +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/optioned.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/optioned.d.ts new file mode 100644 index 0000000000000..ecc02be52368f --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/param_types/optioned.d.ts @@ -0,0 +1,12 @@ +import type { IAggConfig } from '../agg_config'; +import { BaseParamType } from './base'; +export interface OptionedValueProp { + value: string; + text: string; + disabled?: boolean; + isCompatible: (agg: IAggConfig) => boolean; +} +export declare class OptionedParamType extends BaseParamType { + options: OptionedValueProp[]; + constructor(config: Record); +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/string.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/string.d.ts new file mode 100644 index 0000000000000..4adbbeb54ae46 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/param_types/string.d.ts @@ -0,0 +1,4 @@ +import { BaseParamType } from './base'; +export declare class StringParamType extends BaseParamType { + constructor(config: Record); +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/types.d.ts b/src/platform/plugins/shared/data/common/search/aggs/types.d.ts new file mode 100644 index 0000000000000..6f1f0f57e4c2d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/types.d.ts @@ -0,0 +1,191 @@ +import type { Assign } from '@kbn/utility-types'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { aggTimeSeries } from './buckets/time_series_fn'; +import type { aggAvg, aggBucketAvg, aggBucketMax, aggBucketMin, aggBucketSum, aggCardinality, aggValueCount, AggConfigs, AggConfigSerialized, aggCount, aggCumulativeSum, aggDateHistogram, aggDateRange, aggDerivative, aggFilter, aggFilters, aggGeoBounds, aggGeoCentroid, aggGeoTile, aggHistogram, aggIpPrefix, aggIpRange, aggMax, aggMedian, aggMin, aggMovingAvg, aggRate, AggParamsAvg, AggParamsBucketAvg, AggParamsBucketAvgSerialized, AggParamsBucketMax, AggParamsBucketMaxSerialized, AggParamsBucketMin, AggParamsBucketMinSerialized, AggParamsBucketSum, AggParamsBucketSumSerialized, AggParamsFilteredMetric, AggParamsCardinality, AggParamsValueCount, AggParamsCumulativeSum, AggParamsCumulativeSumSerialized, AggParamsDateHistogram, AggParamsDateRange, AggParamsDerivative, AggParamsFilter, AggParamsFilters, AggParamsGeoBounds, AggParamsGeoCentroid, AggParamsGeoTile, AggParamsHistogram, AggParamsIpPrefix, AggParamsIpRange, AggParamsMax, AggParamsMedian, AggParamsSinglePercentile, AggParamsSinglePercentileRank, AggParamsMin, AggParamsMovingAvg, AggParamsPercentileRanks, AggParamsPercentiles, AggParamsRange, AggParamsRate, AggParamsSerialDiff, AggParamsSignificantTerms, AggParamsStdDeviation, AggParamsSum, AggParamsTerms, AggParamsTermsSerialized, AggParamsMultiTerms, AggParamsMultiTermsSerialized, AggParamsRareTerms, AggParamsTopHit, AggParamsTopMetrics, AggParamsTopMetricsSerialized, aggPercentileRanks, aggPercentiles, aggRange, aggSerialDiff, aggSignificantTerms, aggStdDeviation, aggSum, aggTerms, aggMultiTerms, aggRareTerms, aggTopHit, AggTypesRegistry, AggTypesRegistrySetup, AggTypesRegistryStart, BUCKET_TYPES, CreateAggConfigParams, getCalculateAutoTimeExpression, METRIC_TYPES, aggFilteredMetric, aggSinglePercentile, aggSinglePercentileRank, AggConfigsOptions, AggParamsCount, AggParamsDerivativeSerialized, AggParamsFilteredMetricSerialized, AggParamsMovingAvgSerialized, AggParamsSerialDiffSerialized, AggParamsTopHitSerialized, AggParamsTimeSeries } from '.'; +import type { AggParamsSampler } from './buckets/sampler'; +import type { AggParamsDiversifiedSampler } from './buckets/diversified_sampler'; +import type { AggParamsSignificantText } from './buckets/significant_text'; +import type { aggTopMetrics } from './metrics/top_metrics_fn'; +export type { IAggConfig, AggConfigSerialized } from './agg_config'; +export type { CreateAggConfigParams, IAggConfigs, AggConfigsOptions } from './agg_configs'; +export type { IAggType } from './agg_type'; +export type { AggParam, AggParamOption } from './agg_params'; +export type { IFieldParamType } from './param_types'; +export type { IMetricAggType } from './metrics/metric_agg_type'; +export type { IpPrefixKey } from './buckets/lib/ip_prefix'; +export type { IpRangeKey } from './buckets/lib/ip_range'; +export type { OptionedValueProp } from './param_types/optioned'; +export interface AggsCommonSetup { + types: AggTypesRegistrySetup; +} +export interface AggsCommonStart { + calculateAutoTimeExpression: ReturnType; + createAggConfigs: (indexPattern: DataView, configStates?: CreateAggConfigParams[], options?: Partial) => InstanceType; + types: ReturnType; +} +/** + * AggsStart represents the actual external contract as AggsCommonStart + * is only used internally. The difference is that AggsStart includes the + * typings for the registry with initialized agg types. + * + * @public + */ +export type AggsStart = Assign; +export interface BaseAggParams { + json?: string; + customLabel?: string; + timeShift?: string; +} +export interface AggExpressionType { + type: 'agg_type'; + value: AggConfigSerialized; +} +/** @internal */ +export type AggExpressionFunctionArgs = SerializedAggParamsMapping[Name] & Pick; +/** + * A global list of the param interfaces for each agg type. + * For now this is internal, but eventually we will probably + * want to make it public. + * + * @internal + */ +interface SerializedAggParamsMapping { + [BUCKET_TYPES.RANGE]: AggParamsRange; + [BUCKET_TYPES.IP_PREFIX]: AggParamsIpPrefix; + [BUCKET_TYPES.IP_RANGE]: AggParamsIpRange; + [BUCKET_TYPES.DATE_RANGE]: AggParamsDateRange; + [BUCKET_TYPES.FILTER]: AggParamsFilter; + [BUCKET_TYPES.FILTERS]: AggParamsFilters; + [BUCKET_TYPES.SIGNIFICANT_TERMS]: AggParamsSignificantTerms; + [BUCKET_TYPES.SIGNIFICANT_TEXT]: AggParamsSignificantText; + [BUCKET_TYPES.GEOTILE_GRID]: AggParamsGeoTile; + [BUCKET_TYPES.HISTOGRAM]: AggParamsHistogram; + [BUCKET_TYPES.DATE_HISTOGRAM]: AggParamsDateHistogram; + [BUCKET_TYPES.TERMS]: AggParamsTermsSerialized; + [BUCKET_TYPES.TIME_SERIES]: AggParamsTimeSeries; + [BUCKET_TYPES.MULTI_TERMS]: AggParamsMultiTermsSerialized; + [BUCKET_TYPES.RARE_TERMS]: AggParamsRareTerms; + [BUCKET_TYPES.SAMPLER]: AggParamsSampler; + [BUCKET_TYPES.DIVERSIFIED_SAMPLER]: AggParamsDiversifiedSampler; + [METRIC_TYPES.AVG]: AggParamsAvg; + [METRIC_TYPES.CARDINALITY]: AggParamsCardinality; + [METRIC_TYPES.COUNT]: AggParamsCount; + [METRIC_TYPES.VALUE_COUNT]: AggParamsValueCount; + [METRIC_TYPES.GEO_BOUNDS]: AggParamsGeoBounds; + [METRIC_TYPES.GEO_CENTROID]: AggParamsGeoCentroid; + [METRIC_TYPES.MAX]: AggParamsMax; + [METRIC_TYPES.MEDIAN]: AggParamsMedian; + [METRIC_TYPES.SINGLE_PERCENTILE]: AggParamsSinglePercentile; + [METRIC_TYPES.SINGLE_PERCENTILE_RANK]: AggParamsSinglePercentileRank; + [METRIC_TYPES.MIN]: AggParamsMin; + [METRIC_TYPES.STD_DEV]: AggParamsStdDeviation; + [METRIC_TYPES.SUM]: AggParamsSum; + [METRIC_TYPES.AVG_BUCKET]: AggParamsBucketAvgSerialized; + [METRIC_TYPES.MAX_BUCKET]: AggParamsBucketMaxSerialized; + [METRIC_TYPES.MIN_BUCKET]: AggParamsBucketMinSerialized; + [METRIC_TYPES.SUM_BUCKET]: AggParamsBucketSumSerialized; + [METRIC_TYPES.FILTERED_METRIC]: AggParamsFilteredMetricSerialized; + [METRIC_TYPES.CUMULATIVE_SUM]: AggParamsCumulativeSumSerialized; + [METRIC_TYPES.DERIVATIVE]: AggParamsDerivativeSerialized; + [METRIC_TYPES.MOVING_FN]: AggParamsMovingAvgSerialized; + [METRIC_TYPES.PERCENTILE_RANKS]: AggParamsPercentileRanks; + [METRIC_TYPES.PERCENTILES]: AggParamsPercentiles; + [METRIC_TYPES.RATE]: AggParamsRate; + [METRIC_TYPES.SERIAL_DIFF]: AggParamsSerialDiffSerialized; + [METRIC_TYPES.TOP_HITS]: AggParamsTopHitSerialized; + [METRIC_TYPES.TOP_METRICS]: AggParamsTopMetricsSerialized; +} +export interface AggParamsMapping { + [BUCKET_TYPES.RANGE]: AggParamsRange; + [BUCKET_TYPES.IP_PREFIX]: AggParamsIpPrefix; + [BUCKET_TYPES.IP_RANGE]: AggParamsIpRange; + [BUCKET_TYPES.DATE_RANGE]: AggParamsDateRange; + [BUCKET_TYPES.FILTER]: AggParamsFilter; + [BUCKET_TYPES.FILTERS]: AggParamsFilters; + [BUCKET_TYPES.SIGNIFICANT_TERMS]: AggParamsSignificantTerms; + [BUCKET_TYPES.SIGNIFICANT_TEXT]: AggParamsSignificantText; + [BUCKET_TYPES.GEOTILE_GRID]: AggParamsGeoTile; + [BUCKET_TYPES.HISTOGRAM]: AggParamsHistogram; + [BUCKET_TYPES.DATE_HISTOGRAM]: AggParamsDateHistogram; + [BUCKET_TYPES.TERMS]: AggParamsTerms; + [BUCKET_TYPES.TIME_SERIES]: AggParamsTimeSeries; + [BUCKET_TYPES.MULTI_TERMS]: AggParamsMultiTerms; + [BUCKET_TYPES.RARE_TERMS]: AggParamsRareTerms; + [BUCKET_TYPES.SAMPLER]: AggParamsSampler; + [BUCKET_TYPES.DIVERSIFIED_SAMPLER]: AggParamsDiversifiedSampler; + [METRIC_TYPES.AVG]: AggParamsAvg; + [METRIC_TYPES.CARDINALITY]: AggParamsCardinality; + [METRIC_TYPES.COUNT]: AggParamsCount; + [METRIC_TYPES.VALUE_COUNT]: AggParamsValueCount; + [METRIC_TYPES.GEO_BOUNDS]: AggParamsGeoBounds; + [METRIC_TYPES.GEO_CENTROID]: AggParamsGeoCentroid; + [METRIC_TYPES.MAX]: AggParamsMax; + [METRIC_TYPES.MEDIAN]: AggParamsMedian; + [METRIC_TYPES.SINGLE_PERCENTILE]: AggParamsSinglePercentile; + [METRIC_TYPES.SINGLE_PERCENTILE_RANK]: AggParamsSinglePercentileRank; + [METRIC_TYPES.MIN]: AggParamsMin; + [METRIC_TYPES.STD_DEV]: AggParamsStdDeviation; + [METRIC_TYPES.SUM]: AggParamsSum; + [METRIC_TYPES.AVG_BUCKET]: AggParamsBucketAvg; + [METRIC_TYPES.MAX_BUCKET]: AggParamsBucketMax; + [METRIC_TYPES.MIN_BUCKET]: AggParamsBucketMin; + [METRIC_TYPES.SUM_BUCKET]: AggParamsBucketSum; + [METRIC_TYPES.FILTERED_METRIC]: AggParamsFilteredMetric; + [METRIC_TYPES.CUMULATIVE_SUM]: AggParamsCumulativeSum; + [METRIC_TYPES.DERIVATIVE]: AggParamsDerivative; + [METRIC_TYPES.MOVING_FN]: AggParamsMovingAvg; + [METRIC_TYPES.PERCENTILE_RANKS]: AggParamsPercentileRanks; + [METRIC_TYPES.PERCENTILES]: AggParamsPercentiles; + [METRIC_TYPES.RATE]: AggParamsRate; + [METRIC_TYPES.SERIAL_DIFF]: AggParamsSerialDiff; + [METRIC_TYPES.TOP_HITS]: AggParamsTopHit; + [METRIC_TYPES.TOP_METRICS]: AggParamsTopMetrics; +} +/** + * A global list of the expression function definitions for each agg type function. + */ +export interface AggFunctionsMapping { + aggFilter: ReturnType; + aggFilters: ReturnType; + aggSignificantTerms: ReturnType; + aggIpPrefix: ReturnType; + aggIpRange: ReturnType; + aggDateRange: ReturnType; + aggRange: ReturnType; + aggGeoTile: ReturnType; + aggHistogram: ReturnType; + aggDateHistogram: ReturnType; + aggTerms: ReturnType; + aggTimeSeries: ReturnType; + aggMultiTerms: ReturnType; + aggRareTerms: ReturnType; + aggAvg: ReturnType; + aggBucketAvg: ReturnType; + aggBucketMax: ReturnType; + aggBucketMin: ReturnType; + aggBucketSum: ReturnType; + aggFilteredMetric: ReturnType; + aggCardinality: ReturnType; + aggValueCount: ReturnType; + aggCount: ReturnType; + aggCumulativeSum: ReturnType; + aggDerivative: ReturnType; + aggGeoBounds: ReturnType; + aggGeoCentroid: ReturnType; + aggMax: ReturnType; + aggMedian: ReturnType; + aggSinglePercentile: ReturnType; + aggSinglePercentileRank: ReturnType; + aggMin: ReturnType; + aggMovingAvg: ReturnType; + aggPercentileRanks: ReturnType; + aggPercentiles: ReturnType; + aggSerialDiff: ReturnType; + aggStdDeviation: ReturnType; + aggSum: ReturnType; + aggTopHit: ReturnType; + aggTopMetrics: ReturnType; + aggRate: ReturnType; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/calculate_auto_time_expression.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/calculate_auto_time_expression.d.ts new file mode 100644 index 0000000000000..d788875fb1806 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/calculate_auto_time_expression.d.ts @@ -0,0 +1,8 @@ +import type { TimeBucketsInterval } from '../buckets/lib/time_buckets/time_buckets'; +import type { TimeRange } from '../../../query'; +export declare function getCalculateAutoTimeExpression(getConfig: (key: string) => any): { + (range: TimeRange): string | undefined; + (range: TimeRange, interval: string, asExpression?: true): string | undefined; + (range: TimeRange, interval: string, asExpression: false): TimeBucketsInterval | undefined; + (range: TimeRange, interval?: string, asExpression?: boolean): string | TimeBucketsInterval | undefined; +}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.d.ts new file mode 100644 index 0000000000000..d24efdf2e02f9 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.d.ts @@ -0,0 +1,25 @@ +type Interval = { + fixed_interval: string; +} | { + calendar_interval: string; +}; +/** + * Checks whether a given Elasticsearch interval is a calendar or fixed interval + * and returns an object containing the appropriate date_histogram property for that + * interval. So it will return either an object containing the fixed_interval key for + * that interval or a calendar_interval. If the specified interval was not a valid Elasticsearch + * interval this method will throw an error. + * + * You can simply spread the returned value of this method into your date_histogram. + * @example + * const aggregation = { + * date_histogram: { + * field: 'date', + * ...dateHistogramInterval('24h'), + * } + * }; + * + * @param interval The interval string to return the appropriate date_histogram key for. + */ +export declare function dateHistogramInterval(interval: string, shouldForceFixed?: boolean): Interval; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/index.d.ts new file mode 100644 index 0000000000000..748ff6e8586f8 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/index.d.ts @@ -0,0 +1,8 @@ +export * from './date_histogram_interval'; +export * from './invalid_es_calendar_interval_error'; +export * from './invalid_es_interval_format_error'; +export * from './is_valid_es_interval'; +export * from './is_valid_interval'; +export * from './parse_interval'; +export * from './parse_es_interval'; +export * from './to_absolute_dates'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.d.ts new file mode 100644 index 0000000000000..f294bd09e1218 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.d.ts @@ -0,0 +1,8 @@ +import type { Unit } from '@kbn/datemath'; +export declare class InvalidEsCalendarIntervalError extends Error { + readonly interval: string; + readonly value: number; + readonly unit: Unit; + readonly type: string; + constructor(interval: string, value: number, unit: Unit, type: string); +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_interval_format_error.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_interval_format_error.d.ts new file mode 100644 index 0000000000000..22c427322d424 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_interval_format_error.d.ts @@ -0,0 +1,4 @@ +export declare class InvalidEsIntervalFormatError extends Error { + readonly interval: string; + constructor(interval: string); +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.d.ts new file mode 100644 index 0000000000000..a530a13428033 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.d.ts @@ -0,0 +1,10 @@ +/** + * Checks whether a given interval string (e.g. 1w, 24h, ...) is a valid Elasticsearch interval. + * Will return false if the interval is not valid in Elasticsearch, otherwise true. + * Invalid intervals might be: 2f, since there is no unit 'f'; 2w, since weeks and month intervals + * are only allowed with a value of 1, etc. + * + * @param interval The interval string like 1w, 24h + * @returns True if the interval is valid for Elasticsearch + */ +export declare function isValidEsInterval(interval: string): boolean; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.d.ts new file mode 100644 index 0000000000000..8cb0d144e15e5 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.d.ts @@ -0,0 +1 @@ +export declare function isValidInterval(value: string, baseInterval?: string): boolean; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_interval.d.ts new file mode 100644 index 0000000000000..554ec8c2a512a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_interval.d.ts @@ -0,0 +1,13 @@ +/** + * Finds the lowest common interval between two given ES date histogram intervals + * in the format of (value)(unit) + * + * - `ms` units are fixed-length intervals + * - `s, m, h, d` units are fixed-length intervals when value > 1 (i.e. 2m, 24h, 7d), + * but calendar interval when value === 1 + * - `w, M, q, y` units are calendar intervals and do not support multiple, aka + * value must === 1 + * + * @returns {string} + */ +export declare function leastCommonInterval(a: string, b: string): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_multiple.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_multiple.d.ts new file mode 100644 index 0000000000000..d4587693ebe03 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_multiple.d.ts @@ -0,0 +1,11 @@ +/** + * Calculates the least common multiple of two numbers. The least common multiple + * is the smallest positive integer number, that is divisible by both input parameters. + * + * Since this calculation suffers from rounding issues in decimal values, this method + * won't work for passing in fractional (non integer) numbers. It will return a value, + * but that value won't necessarily be the mathematical correct least common multiple. + * + * @internal + */ +export declare function leastCommonMultiple(a: number, b: number): number; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.d.ts new file mode 100644 index 0000000000000..3bc23bf972969 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.d.ts @@ -0,0 +1,26 @@ +import type { Unit } from '@kbn/datemath'; +export type ParsedInterval = ReturnType; +/** + * Extracts interval properties from an ES interval string. Disallows unrecognized interval formats + * and fractional values. Converts some intervals from "calendar" to "fixed" when the number of + * units is larger than 1, and throws an error for others. + * + * Conversion rules: + * + * | Interval | Single unit type | Multiple units type | + * | -------- | ---------------- | ------------------- | + * | ms | fixed | fixed | + * | s | fixed | fixed | + * | m | calendar | fixed | + * | h | calendar | fixed | + * | d | calendar | fixed | + * | w | calendar | N/A - disallowed | + * | M | calendar | N/A - disallowed | + * | y | calendar | N/A - disallowed | + * + */ +export declare function parseEsInterval(interval: string): { + value: number; + unit: Unit; + type: "fixed" | "calendar"; +}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_interval.d.ts new file mode 100644 index 0000000000000..6260bcd61dbca --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_interval.d.ts @@ -0,0 +1,7 @@ +import moment from 'moment'; +import type { Unit } from '@kbn/datemath'; +export declare const splitStringInterval: (interval: string) => { + value: number; + unit: Unit; +} | null; +export declare function parseInterval(interval: string): moment.Duration | null; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.d.ts new file mode 100644 index 0000000000000..a3d6727d3c40d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.d.ts @@ -0,0 +1,5 @@ +import type { TimeRange } from '@kbn/es-query'; +export declare function toAbsoluteDates(range: TimeRange): { + from: Date; + to: Date; +} | undefined; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/get_aggs_formats.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/get_aggs_formats.d.ts new file mode 100644 index 0000000000000..b4f0a1efcc91b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/get_aggs_formats.d.ts @@ -0,0 +1,15 @@ +import type { FieldFormatInstanceType, IFieldFormat, SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; +type GetFieldFormat = (mapping: SerializedFieldFormat) => IFieldFormat; +/** + * Certain aggs have custom field formats that have dependency on aggs code. + * This function creates such field formats types and then those are added to field formatters registry + * + * These formats can't be used from field format editor UI + * + * This function is internal to the data plugin, and only exists for use inside + * the field formats service. + * + * @internal + */ +export declare function getAggsFormats(getFieldFormat: GetFieldFormat): FieldFormatInstanceType[]; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/index.d.ts new file mode 100644 index 0000000000000..88cb369f4f70f --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/index.d.ts @@ -0,0 +1,7 @@ +export * from './calculate_auto_time_expression'; +export * from './date_interval_utils'; +export * from './get_aggs_formats'; +export * from './ip_address'; +export * from './prop_filter'; +export * from './infer_time_zone'; +export * from './parse_time_shift'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/infer_time_zone.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/infer_time_zone.d.ts new file mode 100644 index 0000000000000..e525145436c4e --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/infer_time_zone.d.ts @@ -0,0 +1,6 @@ +import type { DataView, DataViewField } from '@kbn/data-views-plugin/common'; +import type { AggTypesDependencies } from '../../..'; +export declare function inferTimeZone(params: { + field?: DataViewField | string; + time_zone?: string; +}, dataView: DataView, aggName: 'date_histogram' | 'date_range', getConfig: AggTypesDependencies['getConfig'], { shouldDetectTimeZone }?: AggTypesDependencies['aggExecutionContext']): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/ip_address.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/ip_address.d.ts new file mode 100644 index 0000000000000..389423f3bdda8 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/ip_address.d.ts @@ -0,0 +1,5 @@ +export declare class IpAddress { + private value; + constructor(ipAddress: string | number | number[]); + toString(): string; +} diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/parse_time_shift.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/parse_time_shift.d.ts new file mode 100644 index 0000000000000..95672924f6a20 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/parse_time_shift.d.ts @@ -0,0 +1,49 @@ +import moment from 'moment'; +import type { TimeRange } from '../../../types'; +declare const INVALID_DATE = "invalid"; +declare const PREVIOUS_DATE = "previous"; +type PreviousDateType = typeof PREVIOUS_DATE; +type InvalidDateType = typeof INVALID_DATE; +/** + * This method parses a string into a time shift duration. + * If parsing fails, 'invalid' is returned. + * Allowed values are the string 'previous' and an integer followed by the units s,m,h,d,w,M,y + * */ +export declare const parseTimeShift: (val: string) => moment.Duration | PreviousDateType | InvalidDateType; +/** + * Check function to detect an absolute time shift. + * The check is performed only on the string format and the timestamp is not validated: + * use the validateAbsoluteTimeShift fucntion to perform more in depth checks + * @param val the string to parse (it assumes it has been trimmed already) + * @returns true if an absolute time shift + */ +export declare const isAbsoluteTimeShift: (val?: string) => boolean; +export declare const REASON_IDS: { + readonly missingTimerange: "missingTimerange"; + readonly notAbsoluteTimeShift: "notAbsoluteTimeShift"; + readonly invalidDate: "invalidDate"; + readonly shiftAfterTimeRange: "shiftAfterTimeRange"; +}; +export type REASON_ID_TYPES = keyof typeof REASON_IDS; +/** + * Parses an absolute time shift string and returns its equivalent duration + * @param val the string to parse + * @param timeRange the current date histogram interval + * @returns + */ +export declare const parseAbsoluteTimeShift: (val: string, timeRange: TimeRange | undefined) => { + value: moment.Duration; + reason: null; +} | { + value: InvalidDateType; + reason: REASON_ID_TYPES; +}; +/** + * Relaxed version of the parsing validation + * This version of the validation applies the timeRange validation only when passed + * @param val + * @param timeRange + * @returns the reason id if the absolute shift is not valid, undefined otherwise + */ +export declare function validateAbsoluteTimeShift(val: string, timeRange?: TimeRange): REASON_ID_TYPES | undefined; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/prop_filter.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/prop_filter.d.ts new file mode 100644 index 0000000000000..4bfa08721e77b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/prop_filter.d.ts @@ -0,0 +1,10 @@ +type FilterFunc

= (item: T[P]) => boolean; +/** + * Filters out a list by a given filter. This is currently used to implement: + * - fieldType filters a list of fields by their type property + * - aggFilter filters a list of aggs by their name property + * + * @returns the filter function which can be registered with angular + */ +export declare function propFilter

(prop: P): (list: T[], filters?: string[] | string | FilterFunc) => T[]; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/sampler.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/sampler.d.ts new file mode 100644 index 0000000000000..910452e492d84 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/sampler.d.ts @@ -0,0 +1,12 @@ +export declare function createSamplerAgg({ type, probability, seed, }: { + type?: string; + probability: number; + seed?: number; +}): { + [type]: { + probability: number; + seed: number | undefined; + }; + aggs: {}; +}; +export declare function isSamplingEnabled(probability: number | undefined): boolean; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/time_splits.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/time_splits.d.ts new file mode 100644 index 0000000000000..e8f8d289b0f14 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/aggs/utils/time_splits.d.ts @@ -0,0 +1,251 @@ +import moment from 'moment-timezone'; +import type { estypes } from '@elastic/elasticsearch'; +import type { AggConfigs, AggConfig } from '../../..'; +/** + * This function will transform an ES response containg a time split (using a filters aggregation before the metrics or date histogram aggregation), + * merging together all branches for the different time ranges into a single response structure which can be tabified into a single table. + * + * If there is just a single time shift, there are no separate branches per time range - in this case only the date histogram keys are shifted by the + * configured amount of time. + * + * To do this, the following steps are taken: + * * Traverse the response tree, tracking the current agg config + * * Once the node which would contain the time split object is found, merge all separate time range buckets into a single layer of buckets of the parent agg + * * Recursively repeat this process for all nested sub-buckets + * + * Example input: + * ``` + * "aggregations" : { + "product" : { + "buckets" : [ + { + "key" : "Product A", + "doc_count" : 512, + "first_year" : { + "doc_count" : 418, + "overall_revenue" : { + "value" : 2163634.0 + } + }, + "time_offset_split" : { + "buckets" : { + "-1y" : { + "doc_count" : 420, + "year" : { + "buckets" : [ + { + "key_as_string" : "2018", + "doc_count" : 81, + "revenue" : { + "value" : 505124.0 + } + }, + { + "key_as_string" : "2019", + "doc_count" : 65, + "revenue" : { + "value" : 363058.0 + } + } + ] + } + }, + "regular" : { + "doc_count" : 418, + "year" : { + "buckets" : [ + { + "key_as_string" : "2019", + "doc_count" : 65, + "revenue" : { + "value" : 363058.0 + } + }, + { + "key_as_string" : "2020", + "doc_count" : 84, + "revenue" : { + "value" : 392924.0 + } + } + ] + } + } + } + } + }, + { + "key" : "Product B", + "doc_count" : 248, + "first_year" : { + "doc_count" : 215, + "overall_revenue" : { + "value" : 1315547.0 + } + }, + "time_offset_split" : { + "buckets" : { + "-1y" : { + "doc_count" : 211, + "year" : { + "buckets" : [ + { + "key_as_string" : "2018", + "key" : 1618963200000, + "doc_count" : 28, + "revenue" : { + "value" : 156543.0 + } + }, + // ... + * ``` + * + * Example output: + * ``` + * "aggregations" : { + "product" : { + "buckets" : [ + { + "key" : "Product A", + "doc_count" : 512, + "first_year" : { + "doc_count" : 418, + "overall_revenue" : { + "value" : 2163634.0 + } + }, + "year" : { + "buckets" : [ + { + "key_as_string" : "2019", + "doc_count" : 81, + "revenue_regular" : { + "value" : 505124.0 + }, + "revenue_-1y" : { + "value" : 302736.0 + } + }, + { + "key_as_string" : "2020", + "doc_count" : 78, + "revenue_regular" : { + "value" : 392924.0 + }, + "revenue_-1y" : { + "value" : 363058.0 + }, + } + // ... + * ``` + * + * + * @param aggConfigs The agg configs instance + * @param aggCursor The root aggregations object from the response which will be mutated in place + */ +export declare function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record): void; +/** + * Inserts a filters aggregation into the aggregation tree which splits buckets to fetch data for all time ranges + * configured in metric aggregations. + * + * The current agg config can implement `splitForTimeShift` to force insertion of the time split filters aggregation + * before the dsl of the agg config (date histogram and metrics aggregations do this) + * + * Example aggregation tree without time split: + * ``` + * "aggs": { + "product": { + "terms": { + "field": "product", + "size": 3, + "order": { "overall_revenue": "desc" } + }, + "aggs": { + "overall_revenue": { + "sum": { + "field": "sales" + } + }, + "year": { + "date_histogram": { + "field": "timestamp", + "interval": "year" + }, + "aggs": { + "revenue": { + "sum": { + "field": "sales" + } + } + } + // ... + * ``` + * + * Same aggregation tree with inserted time split: + * ``` + * "aggs": { + "product": { + "terms": { + "field": "product", + "size": 3, + "order": { "first_year>overall_revenue": "desc" } + }, + "aggs": { + "first_year": { + "filter": { + "range": { + "timestamp": { + "gte": "2019", + "lte": "2020" + } + } + }, + "aggs": { + "overall_revenue": { + "sum": { + "field": "sales" + } + } + } + }, + "time_offset_split": { + "filters": { + "filters": { + "regular": { + "range": { + "timestamp": { + "gte": "2019", + "lte": "2020" + } + } + }, + "-1y": { + "range": { + "timestamp": { + "gte": "2018", + "lte": "2019" + } + } + } + } + }, + "aggs": { + "year": { + "date_histogram": { + "field": "timestamp", + "interval": "year" + }, + "aggs": { + "revenue": { + "sum": { + "field": "sales" + } + } + } + } + } + } + } + * ``` + */ +export declare function insertTimeShiftSplit(aggConfigs: AggConfigs, config: AggConfig, timeShifts: Record, dslLvlCursor: Record, defaultTimeZone: string): any; diff --git a/src/platform/plugins/shared/data/common/search/expressions/aggregate_query_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/aggregate_query_to_ast.d.ts new file mode 100644 index 0000000000000..f5b150f3501c7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/aggregate_query_to_ast.d.ts @@ -0,0 +1,9 @@ +import type { ExpressionAstFunction } from '@kbn/expressions-plugin/common'; +import type { AggregateQuery } from '../../query'; +export declare const aggregateQueryToAst: ({ query, timeField, titleForInspector, descriptionForInspector, ignoreGlobalFilters, }: { + query: AggregateQuery; + timeField?: string; + titleForInspector?: string; + descriptionForInspector?: string; + ignoreGlobalFilters?: boolean; +}) => undefined | ExpressionAstFunction; diff --git a/src/platform/plugins/shared/data/common/search/expressions/cidr.d.ts b/src/platform/plugins/shared/data/common/search/expressions/cidr.d.ts new file mode 100644 index 0000000000000..3f5b7e4152a7b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/cidr.d.ts @@ -0,0 +1,7 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +export interface Cidr { + mask: string; +} +export type CidrOutput = ExpressionValueBoxed<'cidr', Cidr>; +export type ExpressionFunctionCidr = ExpressionFunctionDefinition<'cidr', null, Cidr, CidrOutput>; +export declare const cidrFunction: ExpressionFunctionCidr; diff --git a/src/platform/plugins/shared/data/common/search/expressions/cidr_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/cidr_to_ast.d.ts new file mode 100644 index 0000000000000..97c0784b04bf2 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/cidr_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { Cidr } from './cidr'; +export declare const cidrToAst: (cidr: Cidr) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/date_range.d.ts b/src/platform/plugins/shared/data/common/search/expressions/date_range.d.ts new file mode 100644 index 0000000000000..f08c974774793 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/date_range.d.ts @@ -0,0 +1,8 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +export interface DateRange { + from: number | string; + to: number | string; +} +export type DateRangeOutput = ExpressionValueBoxed<'date_range', DateRange>; +export type ExpressionFunctionDateRange = ExpressionFunctionDefinition<'dateRange', null, DateRange, DateRangeOutput>; +export declare const dateRangeFunction: ExpressionFunctionDateRange; diff --git a/src/platform/plugins/shared/data/common/search/expressions/date_range_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/date_range_to_ast.d.ts new file mode 100644 index 0000000000000..f3b45383f485c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/date_range_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { DateRange } from './date_range'; +export declare const dateRangeToAst: (dateRange: DateRange) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/eql.d.ts b/src/platform/plugins/shared/data/common/search/expressions/eql.d.ts new file mode 100644 index 0000000000000..633fc0f6621d8 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/eql.d.ts @@ -0,0 +1,24 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { ISearchGeneric } from '@kbn/search-types'; +import type { KibanaContext } from '..'; +import type { DataViewsContract, UiSettingsCommon } from '../..'; +import type { EqlRawResponse } from './eql_raw_response'; +declare const name = "eql"; +type Input = KibanaContext | null; +type Output = Promise; +interface Arguments { + query: string; + index: string; + size: number; + field: string[]; +} +export type EqlExpressionFunctionDefinition = ExpressionFunctionDefinition; +interface EqlStartDependencies { + search: ISearchGeneric; + uiSettingsClient: UiSettingsCommon; + dataViews: DataViewsContract; +} +export declare const getEqlFn: ({ getStartDependencies, }: { + getStartDependencies: (getKibanaRequest: any) => Promise; +}) => EqlExpressionFunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/eql_raw_response.d.ts b/src/platform/plugins/shared/data/common/search/expressions/eql_raw_response.d.ts new file mode 100644 index 0000000000000..2b15c3cbc653e --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/eql_raw_response.d.ts @@ -0,0 +1,36 @@ +import type { ExpressionTypeDefinition } from '@kbn/expressions-plugin/common'; +import type { EqlSearchStrategyResponse } from '..'; +declare const name = "eql_raw_response"; +export interface EqlRawResponse { + type: typeof name; + body: EqlSearchStrategyResponse['rawResponse']; +} +export type SearchTypes = string | string[] | number | number[] | boolean | boolean[] | object | object[] | undefined; +export interface TotalValue { + value: number; + relation: string; +} +export interface BaseHit { + _index: string; + _id: string; + _source: T; + fields?: Record; +} +export interface EqlSequence { + join_keys: SearchTypes[]; + events: Array>; +} +export interface EqlSearchResponse { + is_partial: boolean; + is_running: boolean; + took: number; + timed_out: boolean; + hits: { + total: TotalValue; + sequences?: Array>; + events?: Array>; + }; +} +export type EqlRawResponseExpressionTypeDefinition = ExpressionTypeDefinition; +export declare const eqlRawResponse: EqlRawResponseExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/es_raw_response.d.ts b/src/platform/plugins/shared/data/common/search/expressions/es_raw_response.d.ts new file mode 100644 index 0000000000000..4d6f0d51400b9 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/es_raw_response.d.ts @@ -0,0 +1,10 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { ExpressionTypeDefinition } from '@kbn/expressions-plugin/common'; +declare const name = "es_raw_response"; +export interface EsRawResponse { + type: typeof name; + body: estypes.SearchResponse; +} +export type EsRawResponseExpressionTypeDefinition = ExpressionTypeDefinition; +export declare const esRawResponse: EsRawResponseExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esaggs/esaggs_fn.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esaggs/esaggs_fn.d.ts new file mode 100644 index 0000000000000..4ca8a642fa6e7 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/esaggs/esaggs_fn.d.ts @@ -0,0 +1,32 @@ +import type { Observable } from 'rxjs'; +import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { IndexPatternExpressionType } from '@kbn/data-views-plugin/common/expressions'; +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { AggsStart, AggExpressionType } from '../../aggs'; +import type { ISearchStartSearchSource } from '../../search_source'; +import type { KibanaContext } from '../kibana_context_type'; +import { handleRequest } from './request_handler'; +type Input = KibanaContext | null; +type Output = Observable; +interface Arguments { + index: IndexPatternExpressionType; + aggs?: AggExpressionType[]; + metricsAtAllLevels?: boolean; + partialRows?: boolean; + timeFields?: string[]; + probability?: number; + samplerSeed?: number; + ignoreGlobalFilters?: boolean; +} +export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input, Arguments, Output>; +/** @internal */ +export interface EsaggsStartDependencies { + aggs: AggsStart; + dataViews: DataViewsContract; + searchSource: ISearchStartSearchSource; + getNow?: () => Date; +} +/** @internal */ +export declare const getEsaggsMeta: () => Omit; +export { handleRequest as handleEsaggsRequest }; +export type { RequestHandlerParams } from './request_handler'; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esaggs/index.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esaggs/index.d.ts new file mode 100644 index 0000000000000..4b83d1171776b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/esaggs/index.d.ts @@ -0,0 +1 @@ +export * from './esaggs_fn'; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esaggs/request_handler.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esaggs/request_handler.d.ts new file mode 100644 index 0000000000000..a30bc46be056a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/esaggs/request_handler.d.ts @@ -0,0 +1,26 @@ +import type { KibanaExecutionContext } from '@kbn/core/public'; +import type { Adapters } from '@kbn/inspector-plugin/common'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { Filter, ProjectRouting, TimeRange } from '@kbn/es-query'; +import type { Query } from '../../..'; +import type { IAggConfigs } from '../../aggs'; +import type { ISearchStartSearchSource } from '../../search_source'; +export interface RequestHandlerParams { + abortSignal?: AbortSignal; + aggs: IAggConfigs; + filters?: Filter[]; + indexPattern?: DataView; + inspectorAdapters: Adapters; + query?: Query; + searchSessionId?: string; + searchSourceService: ISearchStartSearchSource; + timeFields?: string[]; + timeRange?: TimeRange; + disableWarningToasts?: boolean; + getNow?: () => Date; + executionContext?: KibanaExecutionContext; + title?: string; + description?: string; + projectRouting?: ProjectRouting; +} +export declare const handleRequest: ({ abortSignal, aggs, filters, indexPattern, inspectorAdapters, query, searchSessionId, searchSourceService, timeFields, timeRange, disableWarningToasts, getNow, executionContext, title, description, projectRouting, }: RequestHandlerParams) => import("rxjs").Observable; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esdsl.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esdsl.d.ts new file mode 100644 index 0000000000000..5dc1bd97d76b1 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/esdsl.d.ts @@ -0,0 +1,22 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { ISearchGeneric } from '@kbn/search-types'; +import type { EsRawResponse } from './es_raw_response'; +import type { KibanaContext } from '..'; +import type { UiSettingsCommon } from '../..'; +declare const name = "esdsl"; +type Input = KibanaContext | null; +type Output = Promise; +interface Arguments { + dsl: string; + index: string; + size: number; +} +export type EsdslExpressionFunctionDefinition = ExpressionFunctionDefinition; +interface EsdslStartDependencies { + search: ISearchGeneric; + uiSettingsClient: UiSettingsCommon; +} +export declare const getEsdslFn: ({ getStartDependencies, }: { + getStartDependencies: (getKibanaRequest: any) => Promise; +}) => EsdslExpressionFunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esql.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esql.d.ts new file mode 100644 index 0000000000000..38d8ec83d1e3a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/esql.d.ts @@ -0,0 +1,37 @@ +import type { KibanaRequest } from '@kbn/core/server'; +import type { ISearchGeneric } from '@kbn/search-types'; +import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { Observable } from 'rxjs'; +import { type KibanaContext } from '..'; +import type { UiSettingsCommon } from '../..'; +declare global { + interface Window { + /** + * Debug setting to make requests complete slower than normal. Only available on snapshots where `error_query` is enabled in ES. + */ + ELASTIC_ESQL_DELAY_SECONDS?: number; + } +} +type Input = KibanaContext | null; +type Output = Observable; +interface Arguments { + query: string; + timeField?: string; + locale?: string; + /** + * Requests' meta for showing in Inspector + */ + titleForInspector?: string; + descriptionForInspector?: string; + ignoreGlobalFilters?: boolean; +} +export type EsqlExpressionFunctionDefinition = ExpressionFunctionDefinition<'esql', Input, Arguments, Output>; +interface EsqlFnArguments { + getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; +} +interface EsqlStartDependencies { + search: ISearchGeneric; + uiSettings: UiSettingsCommon; +} +export declare const getEsqlFn: ({ getStartDependencies }: EsqlFnArguments) => EsqlExpressionFunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/essql.d.ts b/src/platform/plugins/shared/data/common/search/expressions/essql.d.ts new file mode 100644 index 0000000000000..f7c1c4f3fc5a6 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/essql.d.ts @@ -0,0 +1,27 @@ +import type { KibanaRequest } from '@kbn/core/server'; +import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { Observable } from 'rxjs'; +import type { ISearchGeneric } from '@kbn/search-types'; +import type { NowProviderPublicContract } from '../../../public'; +import type { UiSettingsCommon } from '../..'; +import type { KibanaContext } from '..'; +type Input = KibanaContext | null; +type Output = Observable; +interface Arguments { + query: string; + parameter?: Array; + count?: number; + timezone?: string; + timeField?: string; +} +export type EssqlExpressionFunctionDefinition = ExpressionFunctionDefinition<'essql', Input, Arguments, Output>; +interface EssqlFnArguments { + getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; +} +interface EssqlStartDependencies { + nowProvider?: NowProviderPublicContract; + search: ISearchGeneric; + uiSettings: UiSettingsCommon; +} +export declare const getEssqlFn: ({ getStartDependencies }: EssqlFnArguments) => EssqlExpressionFunctionDefinition; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/exists_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/exists_filter.d.ts new file mode 100644 index 0000000000000..4d74ec66ac245 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/exists_filter.d.ts @@ -0,0 +1,9 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaField, KibanaFilter } from './kibana_context_type'; +interface Arguments { + field: KibanaField; + negate?: boolean; +} +export type ExpressionFunctionExistsFilter = ExpressionFunctionDefinition<'existsFilter', null, Arguments, KibanaFilter>; +export declare const existsFilterFunction: ExpressionFunctionExistsFilter; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/extended_bounds.d.ts b/src/platform/plugins/shared/data/common/search/expressions/extended_bounds.d.ts new file mode 100644 index 0000000000000..d7798b77d3753 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/extended_bounds.d.ts @@ -0,0 +1,8 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +export interface ExtendedBounds { + min?: number; + max?: number; +} +export type ExtendedBoundsOutput = ExpressionValueBoxed<'extended_bounds', ExtendedBounds>; +export type ExpressionFunctionExtendedBounds = ExpressionFunctionDefinition<'extendedBounds', null, ExtendedBounds, ExtendedBoundsOutput>; +export declare const extendedBoundsFunction: ExpressionFunctionExtendedBounds; diff --git a/src/platform/plugins/shared/data/common/search/expressions/extended_bounds_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/extended_bounds_to_ast.d.ts new file mode 100644 index 0000000000000..d93999fbb03e3 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/extended_bounds_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { ExtendedBounds } from './extended_bounds'; +export declare const extendedBoundsToAst: (extendedBounds: ExtendedBounds) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/field.d.ts b/src/platform/plugins/shared/data/common/search/expressions/field.d.ts new file mode 100644 index 0000000000000..ab1ebeb71fddf --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/field.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaField } from './kibana_context_type'; +interface Arguments { + name: string; + type: string; + script?: string; +} +export type ExpressionFunctionField = ExpressionFunctionDefinition<'field', null, Arguments, KibanaField>; +export declare const fieldFunction: ExpressionFunctionField; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/filters_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/filters_to_ast.d.ts new file mode 100644 index 0000000000000..6122fcff6f194 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/filters_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { Filter } from '@kbn/es-query'; +export declare const filtersToAst: (filters: Filter[] | Filter) => import("@kbn/expressions-plugin/common").ExpressionAstExpression[]; diff --git a/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box.d.ts b/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box.d.ts new file mode 100644 index 0000000000000..1997d48e44a95 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box.d.ts @@ -0,0 +1,72 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +import type { GeoPoint, GeoPointOutput } from './geo_point'; +type GeoBox = { + top: number; + left: number; + bottom: number; + right: number; +}; +type GeoPoints = { + top_left: GeoPoint; + bottom_right: GeoPoint; +} | { + top_right: GeoPoint; + bottom_left: GeoPoint; +}; +type WellKnownText = { + wkt: string; +}; +/** GeoBoundingBox Accepted Formats: + * Lat Lon As Properties: + * "top_left" : { + * "lat" : 40.73, "lon" : -74.1 + * }, + * "bottom_right" : { + * "lat" : 40.01, "lon" : -71.12 + * } + * + * Lat Lon As Array: + * { + * "top_left" : [-74.1, 40.73], + * "bottom_right" : [-71.12, 40.01] + * } + * + * Lat Lon As String: + * { + * "top_left" : "40.73, -74.1", + * "bottom_right" : "40.01, -71.12" + * } + * + * Bounding Box as Well-Known Text (WKT): + * { + * "wkt" : "BBOX (-74.1, -71.12, 40.73, 40.01)" + * } + * + * Geohash: + * { + * "top_right" : "dr5r9ydj2y73", + * "bottom_left" : "drj7teegpus6" + * } + * + * Vertices: + * { + * "top" : 40.73, + * "left" : -74.1, + * "bottom" : 40.01, + * "right" : -71.12 + * } + * + * **/ +export type GeoBoundingBox = GeoBox | GeoPoints | WellKnownText; +export type GeoBoundingBoxOutput = ExpressionValueBoxed<'geo_bounding_box', GeoBoundingBox>; +type GeoPointsArguments = { + topLeft: GeoPointOutput; + bottomRight: GeoPointOutput; +} | { + topRight: GeoPointOutput; + bottomLeft: GeoPointOutput; +}; +type GeoBoundingBoxArguments = GeoBox | GeoPointsArguments | WellKnownText; +export type ExpressionFunctionGeoBoundingBox = ExpressionFunctionDefinition<'geoBoundingBox', null, GeoBoundingBoxArguments, GeoBoundingBoxOutput>; +export declare const geoBoundingBoxFunction: ExpressionFunctionGeoBoundingBox; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box_to_ast.d.ts new file mode 100644 index 0000000000000..994e902227a1a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { GeoBoundingBox } from './geo_bounding_box'; +export declare const geoBoundingBoxToAst: (geoBoundingBox: GeoBoundingBox) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/geo_point.d.ts b/src/platform/plugins/shared/data/common/search/expressions/geo_point.d.ts new file mode 100644 index 0000000000000..eb59fa27e3259 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/geo_point.d.ts @@ -0,0 +1,15 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +interface Point { + lat: number; + lon: number; +} +export type GeoPoint = Point | string | [number, number]; +export type GeoPointOutput = ExpressionValueBoxed<'geo_point', { + value: GeoPoint; +}>; +interface GeoPointArguments extends Partial { + point?: Array; +} +export type ExpressionFunctionGeoPoint = ExpressionFunctionDefinition<'geoPoint', null, GeoPointArguments, GeoPointOutput>; +export declare const geoPointFunction: ExpressionFunctionGeoPoint; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/geo_point_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/geo_point_to_ast.d.ts new file mode 100644 index 0000000000000..9cb6ba5d9494a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/geo_point_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { GeoPoint } from './geo_point'; +export declare const geoPointToAst: (point: GeoPoint) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/index.d.ts b/src/platform/plugins/shared/data/common/search/expressions/index.d.ts new file mode 100644 index 0000000000000..04907302a1af2 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/index.d.ts @@ -0,0 +1,43 @@ +export * from './cidr'; +export * from './cidr_to_ast'; +export * from './date_range'; +export * from './date_range_to_ast'; +export * from './extended_bounds'; +export * from './extended_bounds_to_ast'; +export * from './geo_bounding_box'; +export * from './geo_bounding_box_to_ast'; +export * from './geo_point'; +export * from './geo_point_to_ast'; +export * from './ip_prefix'; +export * from './ip_prefix_to_ast'; +export * from './ip_range'; +export * from './ip_range_to_ast'; +export * from './kibana'; +export type * from './kibana_context'; +export * from './kql'; +export * from './lucene'; +export * from './numerical_range'; +export * from './numerical_range_to_ast'; +export * from './query_filter'; +export * from './query_filter_to_ast'; +export * from './query_to_ast'; +export * from './aggregate_query_to_ast'; +export * from './timerange_to_ast'; +export type * from './kibana_context_type'; +export * from './esaggs'; +export * from './utils'; +export * from './range'; +export * from './field'; +export * from './phrase_filter'; +export * from './exists_filter'; +export * from './range_filter'; +export * from './remove_filter'; +export * from './select_filter'; +export * from './kibana_filter'; +export * from './filters_to_ast'; +export * from './timerange'; +export * from './es_raw_response'; +export * from './eql_raw_response'; +export * from './esdsl'; +export * from './eql'; +export * from './esql'; diff --git a/src/platform/plugins/shared/data/common/search/expressions/ip_prefix.d.ts b/src/platform/plugins/shared/data/common/search/expressions/ip_prefix.d.ts new file mode 100644 index 0000000000000..5f41a25d64484 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/ip_prefix.d.ts @@ -0,0 +1,8 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +export interface IpPrefix { + prefixLength?: number; + isIpv6?: boolean; +} +export type IpPrefixOutput = ExpressionValueBoxed<'ip_prefix', IpPrefix>; +export type ExpressionFunctionIpPrefix = ExpressionFunctionDefinition<'ipPrefix', null, IpPrefix, IpPrefixOutput>; +export declare const ipPrefixFunction: ExpressionFunctionIpPrefix; diff --git a/src/platform/plugins/shared/data/common/search/expressions/ip_prefix_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/ip_prefix_to_ast.d.ts new file mode 100644 index 0000000000000..d3a564ab7c0c2 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/ip_prefix_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { IpPrefix } from './ip_prefix'; +export declare const ipPrefixToAst: (ipPrefix: IpPrefix) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/ip_range.d.ts b/src/platform/plugins/shared/data/common/search/expressions/ip_range.d.ts new file mode 100644 index 0000000000000..a61c4f222be5d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/ip_range.d.ts @@ -0,0 +1,8 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +export interface IpRange { + from: string; + to: string; +} +export type IpRangeOutput = ExpressionValueBoxed<'ip_range', IpRange>; +export type ExpressionFunctionIpRange = ExpressionFunctionDefinition<'ipRange', null, IpRange, IpRangeOutput>; +export declare const ipRangeFunction: ExpressionFunctionIpRange; diff --git a/src/platform/plugins/shared/data/common/search/expressions/ip_range_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/ip_range_to_ast.d.ts new file mode 100644 index 0000000000000..f96bcce87e1bd --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/ip_range_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { IpRange } from './ip_range'; +export declare const ipRangeToAst: (ipRange: IpRange) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kibana.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kibana.d.ts new file mode 100644 index 0000000000000..46655fe7fd49c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/kibana.d.ts @@ -0,0 +1,5 @@ +import type { ExecutionContext, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { Adapters } from '@kbn/inspector-plugin/common'; +import type { ExpressionValueSearchContext } from './kibana_context_type'; +export type ExpressionFunctionKibana = ExpressionFunctionDefinition<'kibana', ExpressionValueSearchContext | null, object, ExpressionValueSearchContext, ExecutionContext>; +export declare const kibana: ExpressionFunctionKibana; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kibana_context.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kibana_context.d.ts new file mode 100644 index 0000000000000..08bcf77082d0c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/kibana_context.d.ts @@ -0,0 +1,11 @@ +import type { ExpressionFunctionDefinition, ExecutionContext } from '@kbn/expressions-plugin/common'; +import type { Adapters } from '@kbn/inspector-plugin/common'; +import type { KibanaTimerangeOutput, KibanaContext, KibanaFilter, KibanaQueryOutput } from '../..'; +interface Arguments { + q?: KibanaQueryOutput[] | null; + filters?: KibanaFilter[] | null; + timeRange?: KibanaTimerangeOutput | null; + savedSearchId?: string | null; +} +export type ExpressionFunctionKibanaContext = ExpressionFunctionDefinition<'kibana_context', KibanaContext | null, Arguments, Promise, ExecutionContext>; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kibana_context_type.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kibana_context_type.d.ts new file mode 100644 index 0000000000000..ab650f15fcdc0 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/kibana_context_type.d.ts @@ -0,0 +1,10 @@ +import type { Filter, ExecutionContextSearch } from '@kbn/es-query'; +import type { ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +import type { Query } from '../../query'; +import type { DataViewField } from '../..'; +export type ExpressionValueSearchContext = ExpressionValueBoxed<'kibana_context', ExecutionContextSearch>; +export type KibanaQueryOutput = ExpressionValueBoxed<'kibana_query', Query>; +export type KibanaFilter = ExpressionValueBoxed<'kibana_filter', Filter>; +export type KibanaField = ExpressionValueBoxed<'kibana_field', DataViewField>; +export type KIBANA_CONTEXT_NAME = 'kibana_context'; +export type KibanaContext = ExpressionValueSearchContext; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kibana_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kibana_filter.d.ts new file mode 100644 index 0000000000000..aae324ffd8b6d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/kibana_filter.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaFilter } from './kibana_context_type'; +interface Arguments { + query: string; + negate?: boolean; + disabled?: boolean; +} +export type ExpressionFunctionKibanaFilter = ExpressionFunctionDefinition<'kibanaFilter', null, Arguments, KibanaFilter>; +export declare const kibanaFilterFunction: ExpressionFunctionKibanaFilter; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kql.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kql.d.ts new file mode 100644 index 0000000000000..9d2107d65289f --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/kql.d.ts @@ -0,0 +1,8 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaQueryOutput } from './kibana_context_type'; +interface Arguments { + q: string; +} +export type ExpressionFunctionKql = ExpressionFunctionDefinition<'kql', null, Arguments, KibanaQueryOutput>; +export declare const kqlFunction: ExpressionFunctionKql; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/lucene.d.ts b/src/platform/plugins/shared/data/common/search/expressions/lucene.d.ts new file mode 100644 index 0000000000000..af13121239df4 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/lucene.d.ts @@ -0,0 +1,8 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaQueryOutput } from './kibana_context_type'; +interface Arguments { + q: string; +} +export type ExpressionFunctionLucene = ExpressionFunctionDefinition<'lucene', null, Arguments, KibanaQueryOutput>; +export declare const luceneFunction: ExpressionFunctionLucene; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/numerical_range.d.ts b/src/platform/plugins/shared/data/common/search/expressions/numerical_range.d.ts new file mode 100644 index 0000000000000..9a24c1f3f731d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/numerical_range.d.ts @@ -0,0 +1,9 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +export interface NumericalRange { + from?: number; + to?: number; + label?: string; +} +export type NumericalRangeOutput = ExpressionValueBoxed<'numerical_range', NumericalRange>; +export type ExpressionFunctionNumericalRange = ExpressionFunctionDefinition<'numericalRange', null, NumericalRange, NumericalRangeOutput>; +export declare const numericalRangeFunction: ExpressionFunctionNumericalRange; diff --git a/src/platform/plugins/shared/data/common/search/expressions/numerical_range_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/numerical_range_to_ast.d.ts new file mode 100644 index 0000000000000..1d35532876708 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/numerical_range_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { NumericalRange } from './numerical_range'; +export declare const numericalRangeToAst: (numericalRange: NumericalRange) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/phrase_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/phrase_filter.d.ts new file mode 100644 index 0000000000000..f1657426feef8 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/phrase_filter.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaField, KibanaFilter } from './kibana_context_type'; +interface Arguments { + field: KibanaField; + phrase: string[]; + negate?: boolean; +} +export type ExpressionFunctionPhraseFilter = ExpressionFunctionDefinition<'phraseFilter', null, Arguments, KibanaFilter>; +export declare const phraseFilterFunction: ExpressionFunctionPhraseFilter; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/query_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/query_filter.d.ts new file mode 100644 index 0000000000000..2a55a021282f9 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/query_filter.d.ts @@ -0,0 +1,15 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +import type { Query } from '../../query'; +import type { KibanaQueryOutput } from './kibana_context_type'; +export interface QueryFilter { + input: Query; + label?: string; +} +export type QueryFilterOutput = ExpressionValueBoxed<'kibana_query_filter', QueryFilter>; +interface QueryFilterArguments { + input: KibanaQueryOutput; + label?: string; +} +export type ExpressionFunctionQueryFilter = ExpressionFunctionDefinition<'queryFilter', null, QueryFilterArguments, QueryFilterOutput>; +export declare const queryFilterFunction: ExpressionFunctionQueryFilter; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/query_filter_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/query_filter_to_ast.d.ts new file mode 100644 index 0000000000000..14d484bf01d92 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/query_filter_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { QueryFilter } from './query_filter'; +export declare const queryFilterToAst: ({ input, label }: QueryFilter) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/query_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/query_to_ast.d.ts new file mode 100644 index 0000000000000..2acc127265a5a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/query_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { Query } from '../../query'; +export declare const queryToAst: (query: Query) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/range.d.ts b/src/platform/plugins/shared/data/common/search/expressions/range.d.ts new file mode 100644 index 0000000000000..4197d89a26e9a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/range.d.ts @@ -0,0 +1,11 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +interface Arguments { + gt?: number | string; + lt?: number | string; + gte?: number | string; + lte?: number | string; +} +export type KibanaRange = ExpressionValueBoxed<'kibana_range', Arguments>; +export type ExpressionFunctionRange = ExpressionFunctionDefinition<'range', null, Arguments, KibanaRange>; +export declare const rangeFunction: ExpressionFunctionRange; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/range_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/range_filter.d.ts new file mode 100644 index 0000000000000..0f33a194af14e --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/range_filter.d.ts @@ -0,0 +1,11 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaField, KibanaFilter } from './kibana_context_type'; +import type { KibanaRange } from './range'; +interface Arguments { + field: KibanaField; + range: KibanaRange; + negate?: boolean; +} +export type ExpressionFunctionRangeFilter = ExpressionFunctionDefinition<'rangeFilter', null, Arguments, KibanaFilter>; +export declare const rangeFilterFunction: ExpressionFunctionRangeFilter; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/remove_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/remove_filter.d.ts new file mode 100644 index 0000000000000..a767bac6ea49d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/remove_filter.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaContext } from './kibana_context_type'; +interface Arguments { + group?: string; + from?: string; + ungrouped?: boolean; +} +export type ExpressionFunctionRemoveFilter = ExpressionFunctionDefinition<'removeFilter', KibanaContext, Arguments, KibanaContext>; +export declare const removeFilterFunction: ExpressionFunctionRemoveFilter; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/select_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/select_filter.d.ts new file mode 100644 index 0000000000000..92a9683b8e9a3 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/select_filter.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { KibanaContext } from './kibana_context_type'; +interface Arguments { + group: string[]; + from?: string; + ungrouped?: boolean; +} +export type ExpressionFunctionSelectFilter = ExpressionFunctionDefinition<'selectFilter', KibanaContext, Arguments, KibanaContext>; +export declare const selectFilterFunction: ExpressionFunctionSelectFilter; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/timerange.d.ts b/src/platform/plugins/shared/data/common/search/expressions/timerange.d.ts new file mode 100644 index 0000000000000..b76a5c21fa372 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/timerange.d.ts @@ -0,0 +1,5 @@ +import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; +import type { TimeRange } from '../../query'; +export type KibanaTimerangeOutput = ExpressionValueBoxed<'timerange', TimeRange>; +export type ExpressionFunctionKibanaTimerange = ExpressionFunctionDefinition<'timerange', null, TimeRange, KibanaTimerangeOutput>; +export declare const kibanaTimerangeFunction: ExpressionFunctionKibanaTimerange; diff --git a/src/platform/plugins/shared/data/common/search/expressions/timerange_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/timerange_to_ast.d.ts new file mode 100644 index 0000000000000..5ff192cdaafe4 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/timerange_to_ast.d.ts @@ -0,0 +1,2 @@ +import type { TimeRange } from '../../query'; +export declare const timerangeToAst: (timerange: TimeRange) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/utils/filters_adapter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/utils/filters_adapter.d.ts new file mode 100644 index 0000000000000..d9888e9f85416 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/utils/filters_adapter.d.ts @@ -0,0 +1,3 @@ +import type { Filter } from '@kbn/es-query'; +import type { ExpressionValueFilter } from '@kbn/expressions-plugin/common'; +export declare function adaptToExpressionValueFilter(filter: Filter): ExpressionValueFilter; diff --git a/src/platform/plugins/shared/data/common/search/expressions/utils/function_wrapper.d.ts b/src/platform/plugins/shared/data/common/search/expressions/utils/function_wrapper.d.ts new file mode 100644 index 0000000000000..eaa64e3bb4878 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/utils/function_wrapper.d.ts @@ -0,0 +1,6 @@ +import type { AnyExpressionFunctionDefinition, ExecutionContext } from '@kbn/expressions-plugin/common'; +/** + * Takes a function spec and passes in default args, + * overriding with any provided args. + */ +export declare const functionWrapper: (spec: AnyExpressionFunctionDefinition) => (context: object | null, args?: Record, handlers?: ExecutionContext) => any; diff --git a/src/platform/plugins/shared/data/common/search/expressions/utils/index.d.ts b/src/platform/plugins/shared/data/common/search/expressions/utils/index.d.ts new file mode 100644 index 0000000000000..717f8bed82dcd --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/utils/index.d.ts @@ -0,0 +1,3 @@ +export * from './function_wrapper'; +export { adaptToExpressionValueFilter } from './filters_adapter'; +export { getSideEffectFunction } from './requests_side_effects'; diff --git a/src/platform/plugins/shared/data/common/search/expressions/utils/requests_side_effects.d.ts b/src/platform/plugins/shared/data/common/search/expressions/utils/requests_side_effects.d.ts new file mode 100644 index 0000000000000..99a5d4157388b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/expressions/utils/requests_side_effects.d.ts @@ -0,0 +1,2 @@ +import type { Adapters } from '@kbn/inspector-plugin/common'; +export declare const getSideEffectFunction: (adapters: Adapters) => () => void; diff --git a/src/platform/plugins/shared/data/common/search/index.d.ts b/src/platform/plugins/shared/data/common/search/index.d.ts new file mode 100644 index 0000000000000..ef06457721385 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/index.d.ts @@ -0,0 +1,12 @@ +export * from './aggs'; +export * from './expressions'; +export * from './search_source'; +export * from './tabify'; +export * from './utils'; +export * from './session'; +export * from './poll_search'; +export * from './strategies/es_search'; +export * from './strategies/eql_search'; +export * from './strategies/ese_search'; +export * from './strategies/sql_search'; +export * from './strategies/esql_search'; diff --git a/src/platform/plugins/shared/data/common/search/poll_search.d.ts b/src/platform/plugins/shared/data/common/search/poll_search.d.ts new file mode 100644 index 0000000000000..57a53ac6f5fd4 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/poll_search.d.ts @@ -0,0 +1,4 @@ +import type { Observable } from 'rxjs'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { IAsyncSearchOptions } from '..'; +export declare const pollSearch: (search: () => Promise, cancel?: () => Promise, { pollInterval, abortSignal }?: IAsyncSearchOptions) => Observable; diff --git a/src/platform/plugins/shared/data/common/search/search_source/create_search_source.d.ts b/src/platform/plugins/shared/data/common/search/search_source/create_search_source.d.ts new file mode 100644 index 0000000000000..b9a84a53024a0 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/create_search_source.d.ts @@ -0,0 +1,22 @@ +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { SearchSourceDependencies } from './search_source'; +import { SearchSource } from './search_source'; +import type { SerializedSearchSourceFields } from '../..'; +/** + * Deserializes a json string and a set of referenced objects to a `SearchSource` instance. + * Use this method to re-create the search source serialized using `searchSource.serialize`. + * + * This function is a factory function that returns the actual utility when calling it with the + * required service dependency (index patterns contract). A pre-wired version is also exposed in + * the start contract of the data plugin as part of the search service + * + * @param indexPatterns The index patterns contract of the data plugin + * @param searchSourceDependencies + * + * @return Wired utility function taking two parameters `searchSourceJson`, the json string + * returned by `serializeSearchSource` and `references`, a list of references including the ones + * returned by `serializeSearchSource`. + * + * + * @public */ +export declare const createSearchSource: (indexPatterns: DataViewsContract, searchSourceDependencies: SearchSourceDependencies) => (searchSourceFields?: SerializedSearchSourceFields, useDataViewLazy?: boolean) => Promise; diff --git a/src/platform/plugins/shared/data/common/search/search_source/extract_references.d.ts b/src/platform/plugins/shared/data/common/search/search_source/extract_references.d.ts new file mode 100644 index 0000000000000..e50e9d7435f95 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/extract_references.d.ts @@ -0,0 +1,5 @@ +import type { SavedObjectReference } from '@kbn/core/server'; +import type { SerializedSearchSourceFields } from './types'; +export declare const extractReferences: (state: SerializedSearchSourceFields, options?: { + refNamePrefix?: string; +}) => [SerializedSearchSourceFields, SavedObjectReference[]]; diff --git a/src/platform/plugins/shared/data/common/search/search_source/fetch/get_search_params.d.ts b/src/platform/plugins/shared/data/common/search/search_source/fetch/get_search_params.d.ts new file mode 100644 index 0000000000000..7833b95aceb8c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/fetch/get_search_params.d.ts @@ -0,0 +1,8 @@ +import type { ISearchRequestParams } from '@kbn/search-types'; +import type { GetConfigFn } from '../../../types'; +import type { SearchRequest } from './types'; +export declare function getEsPreference(getConfigFn: GetConfigFn, sessionId?: string): SearchRequest['preference']; +/** @public */ +export declare function getSearchParamsFromRequest(searchRequest: SearchRequest, dependencies: { + getConfig: GetConfigFn; +}): ISearchRequestParams; diff --git a/src/platform/plugins/shared/data/common/search/search_source/fetch/index.d.ts b/src/platform/plugins/shared/data/common/search/search_source/fetch/index.d.ts new file mode 100644 index 0000000000000..0beb531e2996b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/fetch/index.d.ts @@ -0,0 +1,3 @@ +export { getSearchParamsFromRequest, getEsPreference } from './get_search_params'; +export { RequestFailure } from './request_error'; +export type * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/search_source/fetch/request_error.d.ts b/src/platform/plugins/shared/data/common/search/search_source/fetch/request_error.d.ts new file mode 100644 index 0000000000000..affaa0ae25cab --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/fetch/request_error.d.ts @@ -0,0 +1,12 @@ +import { KbnError } from '@kbn/kibana-utils-plugin/common'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { SearchError } from './types'; +/** + * Request Failure - When an entire multi request fails + * @param {Error} err - the Error that came back + * @param {Object} resp - optional HTTP response + */ +export declare class RequestFailure extends KbnError { + resp?: IKibanaSearchResponse; + constructor(err?: SearchError | null, resp?: IKibanaSearchResponse); +} diff --git a/src/platform/plugins/shared/data/common/search/search_source/fetch/types.d.ts b/src/platform/plugins/shared/data/common/search/search_source/fetch/types.d.ts new file mode 100644 index 0000000000000..f235504f2dd46 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/fetch/types.d.ts @@ -0,0 +1,34 @@ +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { AggregateQuery, Filter, Query } from '@kbn/es-query'; +import type { SearchSourceSearchOptions } from '../../..'; +import type { GetConfigFn } from '../../../types'; +/** + * @internal + * + * This type is used when flattenning a SearchSource and passing it down to legacy search. + * Once legacy search is removed, this type should become internal to `SearchSource`, + * where `ISearchRequestParams` is used externally instead. + * FIXME: replace with estypes.SearchRequest? + */ +export type SearchRequest = Record> = { + index?: DataView | string; + query?: Array; + filters?: Filter[] | (() => Filter[]); +} & Omit; +export interface FetchHandlers { + getConfig: GetConfigFn; + /** + * Callback which can be used to hook into responses, modify them, or perform + * side effects like displaying UI errors on the client. + */ + onResponse: (request: SearchRequest, response: IKibanaSearchResponse, options: SearchSourceSearchOptions) => IKibanaSearchResponse; +} +export interface SearchError { + name: string; + status: string; + title: string; + message: string; + path: string; + type: string; +} diff --git a/src/platform/plugins/shared/data/common/search/search_source/index.d.ts b/src/platform/plugins/shared/data/common/search/search_source/index.d.ts new file mode 100644 index 0000000000000..77326f52f6002 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/index.d.ts @@ -0,0 +1,10 @@ +export { createSearchSource } from './create_search_source'; +export { injectReferences } from './inject_references'; +export { extractReferences } from './extract_references'; +export { parseSearchSourceJSON } from './parse_json'; +export { getResponseInspectorStats } from './inspect'; +export * from './fetch'; +export * from './search_source'; +export * from './search_source_service'; +export * from './types'; +export * from './query_to_fields'; diff --git a/src/platform/plugins/shared/data/common/search/search_source/inject_references.d.ts b/src/platform/plugins/shared/data/common/search/search_source/inject_references.d.ts new file mode 100644 index 0000000000000..fcdf06be6d954 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/inject_references.d.ts @@ -0,0 +1,5 @@ +import type { SavedObjectReference } from '@kbn/core/server'; +import type { SerializedSearchSourceFields } from './types'; +export declare const injectReferences: (searchSourceFields: SerializedSearchSourceFields & { + indexRefName?: string; +}, references: SavedObjectReference[]) => SerializedSearchSourceFields; diff --git a/src/platform/plugins/shared/data/common/search/search_source/inspect/index.d.ts b/src/platform/plugins/shared/data/common/search/search_source/inspect/index.d.ts new file mode 100644 index 0000000000000..42ad2c986be0f --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/inspect/index.d.ts @@ -0,0 +1 @@ +export * from './inspector_stats'; diff --git a/src/platform/plugins/shared/data/common/search/search_source/inspect/inspector_stats.d.ts b/src/platform/plugins/shared/data/common/search/search_source/inspect/inspector_stats.d.ts new file mode 100644 index 0000000000000..81d20707c49b3 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/inspect/inspector_stats.d.ts @@ -0,0 +1,7 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { RequestStatistics } from '@kbn/inspector-plugin/common'; +import type { ISearchSource } from '../../../../public'; +/** @public */ +export declare function getRequestInspectorStats(searchSource: ISearchSource): RequestStatistics; +/** @public */ +export declare function getResponseInspectorStats(resp?: estypes.SearchResponse, searchSource?: ISearchSource): RequestStatistics; diff --git a/src/platform/plugins/shared/data/common/search/search_source/migrate_legacy_query.d.ts b/src/platform/plugins/shared/data/common/search/search_source/migrate_legacy_query.d.ts new file mode 100644 index 0000000000000..ed973f6b4a219 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/migrate_legacy_query.d.ts @@ -0,0 +1,10 @@ +import type { Query, AggregateQuery } from '@kbn/es-query'; +/** + * Creates a standardized query object from old queries that were either strings or pure ES query DSL + * + * @param query - a legacy query, what used to be stored in SearchSource's query property + * @return Object + */ +export declare function migrateLegacyQuery(query: Query | { + [key: string]: any; +} | string | AggregateQuery): Query | AggregateQuery; diff --git a/src/platform/plugins/shared/data/common/search/search_source/normalize_sort_request.d.ts b/src/platform/plugins/shared/data/common/search/search_source/normalize_sort_request.d.ts new file mode 100644 index 0000000000000..b9feb666185ee --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/normalize_sort_request.d.ts @@ -0,0 +1,53 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { EsQuerySortValue } from './types'; +type FieldSortOptions = estypes.FieldSort & estypes.ScoreSort & estypes.GeoDistanceSort & Omit & { + script?: estypes.ScriptSort['script']; +}; +export declare function normalizeSortRequest(sortObject: EsQuerySortValue | EsQuerySortValue[], indexPattern: DataView | string | undefined, defaultSortOptions?: FieldSortOptions | string): ({ + _script: { + order: import("./types").SortDirection; + numeric_type?: "double" | "long" | "date" | "date_nanos"; + script: { + source: string | undefined; + lang: string | undefined; + }; + type: string; + } | { + order: import("./types").SortDirection; + format?: string; + script: { + source: string | undefined; + lang: string | undefined; + }; + type: string; + }; +} | { + [x: string]: { + missing?: estypes.AggregationsMissing; + mode?: estypes.SortMode; + nested?: estypes.NestedSortValue; + order: import("./types").SortDirection | estypes.SortOrder; + numeric_type?: estypes.FieldSortNumericType | undefined; + format?: string; + distance_type?: estypes.GeoDistanceType; + ignore_unmapped?: boolean; + unit?: estypes.DistanceUnit; + type?: estypes.ScriptSortType | undefined; + script?: estypes.ScriptSort["script"]; + } | { + missing?: estypes.AggregationsMissing; + mode?: estypes.SortMode; + nested?: estypes.NestedSortValue; + order: import("./types").SortDirection | estypes.SortOrder; + numeric_type?: estypes.FieldSortNumericType; + format?: string; + distance_type?: estypes.GeoDistanceType; + ignore_unmapped?: boolean; + unit?: estypes.DistanceUnit; + type?: estypes.ScriptSortType | undefined; + script?: estypes.ScriptSort["script"]; + }; + _script?: undefined; +})[]; +export {}; diff --git a/src/platform/plugins/shared/data/common/search/search_source/parse_json.d.ts b/src/platform/plugins/shared/data/common/search/search_source/parse_json.d.ts new file mode 100644 index 0000000000000..12476fbfc6d7b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/parse_json.d.ts @@ -0,0 +1,2 @@ +import type { SerializedSearchSourceFields } from './types'; +export declare const parseSearchSourceJSON: (searchSourceJSON: string) => SerializedSearchSourceFields; diff --git a/src/platform/plugins/shared/data/common/search/search_source/query_to_fields.d.ts b/src/platform/plugins/shared/data/common/search/search_source/query_to_fields.d.ts new file mode 100644 index 0000000000000..001cd35132b01 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/query_to_fields.d.ts @@ -0,0 +1,8 @@ +import type { DataViewLazy } from '@kbn/data-views-plugin/common'; +import type { SearchRequest } from './fetch'; +import type { EsQuerySortValue } from '../..'; +export declare function queryToFields({ dataView, sort, request, }: { + dataView: DataViewLazy; + sort?: EsQuerySortValue | EsQuerySortValue[]; + request: SearchRequest; +}): Promise>; diff --git a/src/platform/plugins/shared/data/common/search/search_source/search_source.d.ts b/src/platform/plugins/shared/data/common/search/search_source/search_source.d.ts new file mode 100644 index 0000000000000..949909726fe30 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/search_source.d.ts @@ -0,0 +1,205 @@ +import { Observable } from 'rxjs'; +import type { estypes } from '@elastic/elasticsearch'; +import type { DataViewLazy, DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { ExpressionAstExpression } from '@kbn/expressions-plugin/common'; +import type { ISearchGeneric, IKibanaSearchResponse } from '@kbn/search-types'; +import type { DataViewField, SerializedSearchSourceFields } from '../..'; +import type { ISearchSource, SearchSourceFields, SearchSourceOptions, SearchSourceSearchOptions } from './types'; +import type { FetchHandlers, SearchRequest } from './fetch'; +import type { AggsStart } from '../aggs'; +/** @internal */ +export declare const searchSourceRequiredUiSettings: string[]; +export interface SearchSourceDependencies extends FetchHandlers { + aggs: AggsStart; + search: ISearchGeneric; + dataViews: DataViewsContract; + scriptedFieldsEnabled: boolean; +} +interface ExpressionAstOptions { + /** + * When truthy, it will include either `esaggs` or `esdsl` function to the expression chain. + * In this case, the expression will perform a search and return the `datatable` structure. + * @default true + */ + asDatatable?: boolean; +} +/** @public **/ +export declare class SearchSource { + private id; + private shouldOverwriteDataViewType; + private overwriteDataViewType?; + private parent?; + private requestStartHandlers; + private inheritOptions; + history: SearchRequest[]; + private fields; + private readonly dependencies; + constructor(fields: SearchSourceFields | undefined, dependencies: SearchSourceDependencies); + /** *** + * PUBLIC API + *****/ + /** + * Used to make the search source overwrite the actual data view type for the + * specific requests done. This should only be needed very rarely, since it means + * e.g. we'd be treating a rollup index pattern as a regular one. Be very sure + * you understand the consequences of using this method before using it. + * + * @param overwriteType If `false` is passed in it will disable the overwrite, otherwise + * the passed in value will be used as the data view type for this search source. + */ + setOverwriteDataViewType(overwriteType: string | undefined | false): void; + /** + * sets value to a single search source field + * @param field: field name + * @param value: value for the field + */ + setField(field: K, value: SearchSourceFields[K]): this; + /** + * remove field + * @param field: field name + */ + removeField(field: K): this; + /** + * Internal, do not use. Overrides all search source fields with the new field array. + * + * @internal + * @param newFields New field array. + */ + private setFields; + /** + * returns search source id + */ + getId(): string; + /** + * returns all search source fields + */ + getFields(): SearchSourceFields; + /** + * Gets a single field from the fields + */ + getField(field: K, recurse?: boolean): SearchSourceFields[K]; + getActiveIndexFilter(): any[]; + /** + * Get the field from our own fields, don't traverse up the chain + */ + getOwnField(field: K): SearchSourceFields[K]; + /** + * @deprecated Don't use. + */ + create(): SearchSource; + /** + * creates a copy of this search source (without its children) + */ + createCopy(): SearchSource; + /** + * creates a new child search source + * @param options + */ + createChild(options?: {}): SearchSource; + /** + * Set a searchSource that this source should inherit from + * @param {SearchSource} parent - the parent searchSource + * @param {SearchSourceOptions} options - the inherit options + */ + setParent(parent?: ISearchSource, options?: SearchSourceOptions): this; + /** + * Get the parent of this SearchSource + */ + getParent(): SearchSource | undefined; + /** + * Fetch this source from Elasticsearch, returning an observable over the response(s) + * @param options + */ + fetch$(options?: SearchSourceSearchOptions): Observable>>; + /** + * Fetch this source and reject the returned Promise on error + * @deprecated Use the `fetch$` method instead + */ + fetch(options?: SearchSourceSearchOptions): Promise>>; + /** + * Add a handler that will be notified whenever requests start + * @param {Function} handler + */ + onRequestStart(handler: (searchSource: SearchSource, options?: SearchSourceSearchOptions) => Promise): void; + /** + * Returns body contents of the search request, often referred as query DSL. + */ + getSearchRequestBody(): any; + /** + * Completely destroy the SearchSource. + */ + destroy(): void; + /** **** + * PRIVATE APIS + ******/ + private inspectSearch; + private hasPostFlightRequests; + private postFlightTransform; + private fetchOthers; + /** + * Run a search using the search service + */ + private fetchSearch$; + /** + * Called by requests of this search source when they are started + * @param options + */ + private requestIsStarting; + /** + * Used to merge properties into the data within ._flatten(). + * The data is passed in and modified by the function + * + * @param {object} data - the current merged data + * @param {*} val - the value at `key` + * @param {*} key - The key of `val` + */ + private mergeProp; + /** + * Walk the inheritance chain of a source and return its + * flat representation (taking into account merging rules) + * @resolved {Object|null} - the flat data of the SearchSource + */ + private mergeProps; + private getIndexType; + private getDataView; + private readonly getFieldName; + private getFieldsWithoutSourceFilters; + private getFieldFromDocValueFieldsOrIndexPattern; + loadDataViewFields(dataView: DataViewLazy): Promise>; + private flatten; + private getFieldFilter; + private getUniqueFieldNames; + private filterScriptFields; + private getBuiltEsQuery; + private getRemainingFields; + private getFieldsList; + private getUniqueFields; + /** + * serializes search source fields (which can later be passed to {@link ISearchStartSearchSource}) + */ + getSerializedFields(recurse?: boolean): SerializedSearchSourceFields; + /** + * Serializes the instance to a JSON string and a set of referenced objects. + * Use this method to get a representation of the search source which can be stored in a saved object. + * + * The references returned by this function can be mixed with other references in the same object, + * however make sure there are no name-collisions. The references will be named `kibanaSavedObjectMeta.searchSourceJSON.index` + * and `kibanaSavedObjectMeta.searchSourceJSON.filter[].meta.index`. + * + * Using `createSearchSource`, the instance can be re-created. + * @public */ + serialize(): { + searchSourceJSON: string; + references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; + }; + private getFilters; + /** + * Generates an expression abstract syntax tree using the fields set in the current search source and its ancestors. + * The produced expression from the returned AST will return the `datatable` structure. + * If the `asDatatable` option is truthy or omitted, the generator will use the `esdsl` function to perform the search. + * When the `aggs` field is present, it will use the `esaggs` function instead. + */ + toExpressionAst({ asDatatable }?: ExpressionAstOptions): ExpressionAstExpression; + parseActiveIndexPatternFromQueryString(queryString: string): string[]; +} +export {}; diff --git a/src/platform/plugins/shared/data/common/search/search_source/search_source_service.d.ts b/src/platform/plugins/shared/data/common/search/search_source/search_source_service.d.ts new file mode 100644 index 0000000000000..6a3e028763d78 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/search_source_service.d.ts @@ -0,0 +1,30 @@ +import type { MigrateFunctionsObject } from '@kbn/kibana-utils-plugin/common'; +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { SearchSourceDependencies, SerializedSearchSourceFields } from '.'; +import { SearchSource } from '.'; +export declare class SearchSourceService { + setup(): { + getAllMigrations: () => MigrateFunctionsObject; + }; + start(indexPatterns: DataViewsContract, dependencies: SearchSourceDependencies): { + /** + * creates searchsource based on serialized search source fields + */ + create: (searchSourceFields?: SerializedSearchSourceFields, useDataViewLazy?: boolean) => Promise; + createLazy: (searchSourceFields?: SerializedSearchSourceFields) => Promise; + /** + * creates an enpty search source + */ + createEmpty: () => SearchSource; + extract: (state: SerializedSearchSourceFields) => { + state: SerializedSearchSourceFields; + references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; + }; + inject: (searchSourceFields: SerializedSearchSourceFields & { + indexRefName?: string; + }, references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]) => SerializedSearchSourceFields; + getAllMigrations: () => MigrateFunctionsObject; + telemetry: () => {}; + }; + stop(): void; +} diff --git a/src/platform/plugins/shared/data/common/search/search_source/types.d.ts b/src/platform/plugins/shared/data/common/search/search_source/types.d.ts new file mode 100644 index 0000000000000..cd4e6e880eed5 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/search_source/types.d.ts @@ -0,0 +1,184 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { RequestAdapter } from '@kbn/inspector-plugin/common'; +import type { AggregateQuery, Filter, ProjectRouting, Query } from '@kbn/es-query'; +import type { Serializable, SerializableRecord } from '@kbn/utility-types'; +import type { PersistableStateService } from '@kbn/kibana-utils-plugin/common'; +import type { ISearchOptions } from '@kbn/search-types'; +import type { DataView, DataViewSpec } from '@kbn/data-views-plugin/common'; +import type { SearchField } from '@kbn/es-types'; +import type { AggConfigSerialized, IAggConfigs } from '../../../public'; +import type { SearchSource } from './search_source'; +/** + * search source interface + * @public + */ +export type ISearchSource = Pick; +/** + * high level search service + * @public + */ +export interface ISearchStartSearchSource extends PersistableStateService { + /** + * creates {@link SearchSource} based on provided serialized {@link SearchSourceFields} + * @param fields + */ + create: (fields?: SerializedSearchSourceFields) => Promise; + createLazy: (fields?: SerializedSearchSourceFields) => Promise; + /** + * creates empty {@link SearchSource} + */ + createEmpty: () => ISearchSource; +} +export declare enum SortDirection { + asc = "asc", + desc = "desc" +} +export type SortDirectionFormat = { + order: SortDirection; + format?: string; +}; +export type SortDirectionNumeric = { + order: SortDirection; + numeric_type?: 'double' | 'long' | 'date' | 'date_nanos'; +}; +export type EsQuerySortValue = Record; +export type SearchFieldValue = SearchField & Serializable; +/** + * search source fields + */ +export interface SearchSourceFields { + type?: string; + /** + * {@link Query} + */ + query?: Query | AggregateQuery; + /** + * {@link Filter} + */ + filter?: Filter[] | Filter | (() => Filter[] | Filter | undefined); + /** + * Filters that should not trigger highlighting. + * These filters will be included in the search query for document retrieval, + * but excluded from the highlight_query parameter in Elasticsearch. + * {@link Filter} + */ + nonHighlightingFilters?: Filter[]; + /** + * {@link EsQuerySortValue} + */ + sort?: EsQuerySortValue | EsQuerySortValue[]; + highlight?: any; + highlightAll?: boolean; + trackTotalHits?: boolean | number; + /** + * {@link AggConfigs} + */ + aggs?: object | IAggConfigs | (() => object); + from?: number; + size?: number; + source?: boolean | estypes.Fields; + version?: boolean; + /** + * Retrieve fields via the search Fields API + */ + fields?: SearchFieldValue[]; + /** + * Retreive fields directly from _source (legacy behavior) + * + * @deprecated It is recommended to use `fields` wherever possible. + */ + fieldsFromSource?: estypes.Fields; + /** + * {@link IndexPatternService} + */ + index?: DataView; + timeout?: string; + terminate_after?: number; + searchAfter?: estypes.SortResults; + /** + * Allow querying to use a point-in-time ID for paging results + */ + pit?: estypes.SearchPointInTimeReference; + /** + * {@link ProjectRouting} + */ + projectRouting?: ProjectRouting; + timezone?: string; + parent?: SearchSourceFields; +} +export type SerializedSearchSourceFields = { + type?: string; + /** + * {@link Query} + */ + query?: Query | AggregateQuery; + /** + * {@link Filter} + */ + filter?: Filter[]; + /** + * Filters that should not trigger highlighting. + * These filters will be included in the search query for document retrieval, + * but excluded from the highlight_query parameter in Elasticsearch. + * {@link Filter} + */ + nonHighlightingFilters?: Filter[]; + /** + * {@link EsQuerySortValue} + */ + sort?: EsQuerySortValue[]; + highlight?: SerializableRecord; + highlightAll?: boolean; + trackTotalHits?: boolean | number; + /** + * {@link AggConfigs} + */ + aggs?: AggConfigSerialized[]; + from?: number; + size?: number; + source?: boolean | estypes.Fields; + version?: boolean; + /** + * Retrieve fields via the search Fields API + */ + fields?: SearchFieldValue[]; + /** + * Retreive fields directly from _source (legacy behavior) + * + * @deprecated It is recommended to use `fields` wherever possible. + */ + fieldsFromSource?: estypes.Fields; + /** + * {@link IndexPatternService} + */ + index?: string | DataViewSpec; + searchAfter?: estypes.SortResults; + timeout?: string; + terminate_after?: number; + /** + * {@link ProjectRouting} + */ + projectRouting?: ProjectRouting; + timezone?: string; + parent?: SerializedSearchSourceFields; +}; +export interface SearchSourceOptions { + callParentStartHandlers?: boolean; +} +export declare function isSerializedSearchSource(maybeSerializedSearchSource: unknown): maybeSerializedSearchSource is SerializedSearchSourceFields; +export interface IInspectorInfo { + adapter?: RequestAdapter; + title: string; + id?: string; + description?: string; +} +export interface SearchSourceSearchOptions extends ISearchOptions { + /** + * Inspector integration options + */ + inspector?: IInspectorInfo; + /** + * Set to true to disable warning toasts and customize warning display + */ + disableWarningToasts?: boolean; +} diff --git a/src/platform/plugins/shared/data/common/search/session/ebt_utils.d.ts b/src/platform/plugins/shared/data/common/search/session/ebt_utils.d.ts new file mode 100644 index 0000000000000..dedd50509c7ef --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/session/ebt_utils.d.ts @@ -0,0 +1,5 @@ +import type { AggregateQuery, Query } from '@kbn/es-query'; +export declare function getQueryLanguage(query: Query | AggregateQuery | undefined): string; +export declare function getQueryString(query: Query | AggregateQuery | undefined): string; +export declare function getQueryStringCharCount(queryString: string): number; +export declare function getQueryStringLineCount(queryString: string): number; diff --git a/src/platform/plugins/shared/data/common/search/session/index.d.ts b/src/platform/plugins/shared/data/common/search/session/index.d.ts new file mode 100644 index 0000000000000..882cb38f014fc --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/session/index.d.ts @@ -0,0 +1,4 @@ +export * from './status'; +export * from './types'; +export * from './ebt_utils'; +export declare const SEARCH_SESSIONS_TABLE_ID = "searchSessionsMgmtUiTable"; diff --git a/src/platform/plugins/shared/data/common/search/session/status.d.ts b/src/platform/plugins/shared/data/common/search/session/status.d.ts new file mode 100644 index 0000000000000..3959b2d1eed40 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/session/status.d.ts @@ -0,0 +1,12 @@ +export declare enum SearchSessionStatus { + IN_PROGRESS = "in_progress", + ERROR = "error", + COMPLETE = "complete", + CANCELLED = "cancelled", + EXPIRED = "expired" +} +export declare enum SearchStatus { + IN_PROGRESS = "in_progress", + ERROR = "error", + COMPLETE = "complete" +} diff --git a/src/platform/plugins/shared/data/common/search/session/types.d.ts b/src/platform/plugins/shared/data/common/search/session/types.d.ts new file mode 100644 index 0000000000000..490f2a7fe2a70 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/session/types.d.ts @@ -0,0 +1,115 @@ +import type { SavedObjectsFindResponse } from '@kbn/core/server'; +import type { SerializableRecord } from '@kbn/utility-types'; +import type { SearchSessionStatus, SearchStatus } from './status'; +export declare const SEARCH_SESSION_TYPE = "search-session"; +export interface SearchSessionSavedObjectAttributes { + sessionId: string; + /** + * User-facing session name to be displayed in session management + */ + name?: string; + /** + * App that created the session. e.g 'discover' + */ + appId?: string; + /** + * Creation time of the session + */ + created: string; + /** + * Expiration time of the session. Expiration itself is managed by Elasticsearch. + */ + expires: string; + /** + * locatorId (see share.url.locators service) + */ + locatorId?: string; + /** + * The application state that was used to create the session. + * Should be used, for example, to re-load an expired search session. + */ + initialState?: SerializableRecord; + /** + * Application state that should be used to restore the session. + * For example, relative dates are conveted to absolute ones. + */ + restoreState?: SerializableRecord; + /** + * Mapping of search request hashes to their corresponsing info (async search id, etc.) + */ + idMapping: Record; + /** + * The realm type/name & username uniquely identifies the user who created this search session + */ + realmType?: string; + realmName?: string; + username?: string; + /** + * Version information to display warnings when trying to restore a session from a different version + */ + version: string; + /** + * `true` if session was cancelled + */ + isCanceled?: boolean; + /** + * Search status - used to avoid extra calls to ES when tracking search IDs + */ + status?: SearchSessionStatus; +} +export interface SearchSessionRequestInfo extends Omit { + /** + * ID of the async search request + */ + id: string; + /** + * Search strategy used to submit the search request + */ + strategy: string; + /** + * Search status - used to avoid extra calls to ES when tracking search IDs + */ + status?: SearchStatus; +} +export interface SearchSessionRequestStatus { + status: SearchStatus; + /** + * Optional start time. May be undefined if ES doesn't return it. + */ + startedAt?: string; + /** + * Optional completion time. May be undefined if the search is still in progress + */ + completedAt?: string; + /** + * An optional error. Set if status is set to error. + */ + error?: { + code: number; + message?: string; + }; +} +/** + * On-the-fly calculated search session status + */ +export interface SearchSessionStatusResponse { + status: SearchSessionStatus; + errors?: string[]; +} +export interface SearchSessionStatusesResponse { + /** + * When a session enters a completed state (success or error), we show a notification in the cliend side, but we need + * to know the minimal information to display the notification. + */ + sessions: Record>; + /** + * Map containing calculated statuses of search sessions + */ + statuses: Record; +} +/** + * List of search session objects with on-the-fly calculated search session statuses + */ +export type SearchSessionsFindResponse = SavedObjectsFindResponse & { + statuses: Record; +}; diff --git a/src/platform/plugins/shared/data/common/search/strategies/eql_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/eql_search/index.d.ts new file mode 100644 index 0000000000000..fcb073fefcd6b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/eql_search/index.d.ts @@ -0,0 +1 @@ +export * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/eql_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/eql_search/types.d.ts new file mode 100644 index 0000000000000..23f079ee12966 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/eql_search/types.d.ts @@ -0,0 +1,12 @@ +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; +import type { EqlSearchRequest } from '@elastic/elasticsearch/lib/api/types'; +import type { TransportRequestOptions } from '@elastic/elasticsearch'; +export declare const EQL_SEARCH_STRATEGY = "eql"; +export type EqlRequestParams = EqlSearchRequest; +export interface EqlSearchStrategyRequest extends IKibanaSearchRequest { + /** + * @deprecated: use IAsyncSearchOptions.transport instead. + */ + options?: TransportRequestOptions; +} +export type EqlSearchStrategyResponse = IKibanaSearchResponse; diff --git a/src/platform/plugins/shared/data/common/search/strategies/es_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/es_search/index.d.ts new file mode 100644 index 0000000000000..b3c378665aa1d --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/es_search/index.d.ts @@ -0,0 +1,2 @@ +export * from './types'; +export * from './response_utils'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/es_search/response_utils.d.ts b/src/platform/plugins/shared/data/common/search/strategies/es_search/response_utils.d.ts new file mode 100644 index 0000000000000..b6d8e15485a65 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/es_search/response_utils.d.ts @@ -0,0 +1,38 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { ISearchOptions } from '@kbn/search-types'; +/** + * Get the `total`/`loaded` for this response (see `IKibanaSearchResponse`). Note that `skipped` is + * not included as it is already included in `successful`. + * @internal + */ +export declare function getTotalLoaded(response: estypes.SearchResponse): { + total: number; + loaded: number; +}; +/** + * Temporary workaround until https://github.com/elastic/kibana/issues/26356 is addressed. + * Since we are setting `track_total_hits` in the request, `hits.total` will be an object + * containing the `value`. + * + * @internal + */ +export declare function shimHitsTotal(response: estypes.SearchResponse, { legacyHitsTotal }?: ISearchOptions): estypes.SearchResponse> | { + hits: { + total: any; + hits: estypes.SearchHit[]; + max_score?: estypes.double | null; + }; + took: estypes.long; + timed_out: boolean; + _shards: estypes.ShardStatistics; + aggregations?: Record | undefined; + _clusters?: estypes.ClusterStatistics; + fields?: Record; + max_score?: estypes.double; + num_reduce_phases?: estypes.long; + profile?: estypes.SearchProfile; + pit_id?: estypes.Id; + _scroll_id?: estypes.ScrollId; + suggest?: Record[]> | undefined; + terminated_early?: boolean; +}; diff --git a/src/platform/plugins/shared/data/common/search/strategies/es_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/es_search/types.d.ts new file mode 100644 index 0000000000000..786f4b28e8be0 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/es_search/types.d.ts @@ -0,0 +1 @@ +export declare const ES_SEARCH_STRATEGY = "es"; diff --git a/src/platform/plugins/shared/data/common/search/strategies/ese_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/ese_search/index.d.ts new file mode 100644 index 0000000000000..fcb073fefcd6b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/ese_search/index.d.ts @@ -0,0 +1 @@ +export * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/ese_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/ese_search/types.d.ts new file mode 100644 index 0000000000000..ce7dcdf3bba24 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/ese_search/types.d.ts @@ -0,0 +1,13 @@ +import type { SearchSourceSearchOptions } from '../../search_source/types'; +export declare const ENHANCED_ES_SEARCH_STRATEGY = "ese"; +export interface IAsyncSearchOptions extends SearchSourceSearchOptions { + /** + * The number of milliseconds to wait between receiving a response and sending another request + * If not provided, then it defaults to 0 (no wait time) + */ + pollInterval?: number; + /** + * The length of time to wait for results before initiating a new poll request. + */ + pollLength?: string; +} diff --git a/src/platform/plugins/shared/data/common/search/strategies/esql_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/esql_search/index.d.ts new file mode 100644 index 0000000000000..fcb073fefcd6b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/esql_search/index.d.ts @@ -0,0 +1 @@ +export * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/esql_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/esql_search/types.d.ts new file mode 100644 index 0000000000000..0545fd1ac8fcb --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/esql_search/types.d.ts @@ -0,0 +1,3 @@ +export declare const ESQL_SEARCH_STRATEGY = "esql"; +export declare const ESQL_ASYNC_SEARCH_STRATEGY = "esql_async"; +export declare const ESQL_TABLE_TYPE = "es_ql"; diff --git a/src/platform/plugins/shared/data/common/search/strategies/sql_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/sql_search/index.d.ts new file mode 100644 index 0000000000000..fcb073fefcd6b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/sql_search/index.d.ts @@ -0,0 +1 @@ +export * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/sql_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/sql_search/types.d.ts new file mode 100644 index 0000000000000..f8fa3fcaf5c89 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/strategies/sql_search/types.d.ts @@ -0,0 +1,16 @@ +import type { SqlGetAsyncRequest, SqlQueryRequest, SqlQueryResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; +export declare const SQL_SEARCH_STRATEGY = "sql"; +export type SqlRequestParams = (Omit | Omit) & { + /** + * Does not close the cursor on search completion. + */ + keep_cursor?: boolean; +}; +export type SqlSearchStrategyRequest = IKibanaSearchRequest; +export interface SqlSearchStrategyResponse extends IKibanaSearchResponse { + /** + * A metric showing how long did the search take. + */ + took: number; +} diff --git a/src/platform/plugins/shared/data/common/search/tabify/buckets.d.ts b/src/platform/plugins/shared/data/common/search/tabify/buckets.d.ts new file mode 100644 index 0000000000000..161ed3deb7718 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/tabify/buckets.d.ts @@ -0,0 +1,12 @@ +import type { IAggConfig } from '../aggs'; +import type { TimeRangeInformation } from './types'; +export declare class TabifyBuckets { + length: number; + objectMode: boolean; + buckets: any; + _keys: any[]; + constructor(aggResp: any, agg?: IAggConfig, timeRange?: TimeRangeInformation); + forEach(fn: (bucket: any, key: any) => void): void; + private orderBucketsAccordingToParams; + private dropPartials; +} diff --git a/src/platform/plugins/shared/data/common/search/tabify/get_columns.d.ts b/src/platform/plugins/shared/data/common/search/tabify/get_columns.d.ts new file mode 100644 index 0000000000000..d499e077e4d4c --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/tabify/get_columns.d.ts @@ -0,0 +1,9 @@ +import type { IAggConfig } from '../aggs'; +import type { TabbedAggColumn } from './types'; +/** + * Builds tabify columns. + * + * @param {AggConfigs} aggs - the agg configs object to which the aggregation response correlates + * @param {boolean} minimalColumns - setting to true will only return a column for the last bucket/metric instead of one for each level + */ +export declare function tabifyGetColumns(aggs: IAggConfig[], minimalColumns: boolean): TabbedAggColumn[]; diff --git a/src/platform/plugins/shared/data/common/search/tabify/index.d.ts b/src/platform/plugins/shared/data/common/search/tabify/index.d.ts new file mode 100644 index 0000000000000..2862fbb19ce1a --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/tabify/index.d.ts @@ -0,0 +1,3 @@ +export { tabifyDocs, flattenHit } from '@kbn/data-service/src/search/tabify'; +export { tabifyAggResponse } from './tabify'; +export { tabifyGetColumns } from './get_columns'; diff --git a/src/platform/plugins/shared/data/common/search/tabify/response_writer.d.ts b/src/platform/plugins/shared/data/common/search/tabify/response_writer.d.ts new file mode 100644 index 0000000000000..3f40e24ece3f8 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/tabify/response_writer.d.ts @@ -0,0 +1,31 @@ +import type { Datatable } from '@kbn/expressions-plugin/common/expression_types/specs'; +import type { IAggConfigs } from '../aggs'; +import type { TabbedResponseWriterOptions, TabbedAggColumn, TabbedAggRow } from './types'; +interface BufferColumn { + id: string; + value: string | number; +} +/** + * Writer class that collects information about an aggregation response and + * produces a table, or a series of tables. + */ +export declare class TabbedAggResponseWriter { + columns: TabbedAggColumn[]; + rows: TabbedAggRow[]; + bucketBuffer: BufferColumn[]; + metricBuffer: BufferColumn[]; + private readonly partialRows; + private readonly params; + /** + * @param {AggConfigs} aggs - the agg configs object to which the aggregation response correlates + * @param {boolean} metricsAtAllLevels - setting to true will produce metrics for every bucket + * @param {boolean} partialRows - setting to true will not remove rows with missing values + */ + constructor(aggs: IAggConfigs, params: Partial); + /** + * Create a new row by reading the row buffer and bucketBuffer + */ + row(): void; + response(): Datatable; +} +export {}; diff --git a/src/platform/plugins/shared/data/common/search/tabify/tabify.d.ts b/src/platform/plugins/shared/data/common/search/tabify/tabify.d.ts new file mode 100644 index 0000000000000..4253265f0c368 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/tabify/tabify.d.ts @@ -0,0 +1,7 @@ +import type { Datatable } from '@kbn/expressions-plugin/common'; +import type { TabbedResponseWriterOptions } from './types'; +import type { IAggConfigs } from '../aggs'; +/** + * Sets up the ResponseWriter and kicks off bucket collection. + */ +export declare function tabifyAggResponse(aggConfigs: IAggConfigs, esResponse: Record, respOpts?: Partial): Datatable; diff --git a/src/platform/plugins/shared/data/common/search/tabify/types.d.ts b/src/platform/plugins/shared/data/common/search/tabify/types.d.ts new file mode 100644 index 0000000000000..7e69a1cfcff88 --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/tabify/types.d.ts @@ -0,0 +1,33 @@ +import type { Moment } from 'moment'; +import type { RangeFilterParams } from '@kbn/es-query'; +import type { IAggConfig } from '../aggs'; +/** @internal **/ +export interface TabbedRangeFilterParams extends RangeFilterParams { + name: string; +} +/** @internal */ +export interface TimeRangeInformation { + from?: Moment; + to?: Moment; + timeFields: string[]; +} +export interface TabbedResponseWriterOptions { + metricsAtAllLevels: boolean; + partialRows: boolean; + timeRange?: TimeRangeInformation; +} +/** @internal */ +export interface AggResponseBucket { + key_as_string: string; + key: number; + doc_count: number; +} +/** @public **/ +export interface TabbedAggColumn { + aggConfig: IAggConfig; + id: string; + name: string; + hasPrecisionError?: boolean; +} +/** @public **/ +export type TabbedAggRow = Record; diff --git a/src/platform/plugins/shared/data/common/search/utils.d.ts b/src/platform/plugins/shared/data/common/search/utils.d.ts new file mode 100644 index 0000000000000..bf464b316e11b --- /dev/null +++ b/src/platform/plugins/shared/data/common/search/utils.d.ts @@ -0,0 +1,14 @@ +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { AggTypesDependencies } from '..'; +/** + * @returns true if response is abort + */ +export declare const isAbortResponse: (response?: IKibanaSearchResponse | { + response: IKibanaSearchResponse; +}) => response is undefined; +/** + * @returns true if request is still running + */ +export declare const isRunningResponse: (response?: IKibanaSearchResponse) => boolean; +export declare const getUserTimeZone: (getConfig: AggTypesDependencies["getConfig"], shouldDetectTimezone?: boolean) => string; +export declare function strategyToString(strategy?: string | symbol): string; diff --git a/src/platform/plugins/shared/data/common/serializable_field.d.ts b/src/platform/plugins/shared/data/common/serializable_field.d.ts new file mode 100644 index 0000000000000..69383f898aaed --- /dev/null +++ b/src/platform/plugins/shared/data/common/serializable_field.d.ts @@ -0,0 +1,23 @@ +/** + * Alias for unknown raw field value, could be instance of a field Class + */ +export type RawValue = number | string | unknown; +/** + * Class to extends that enabled serializing and deserializing instance values + */ +export declare abstract class SerializableField { + static isSerializable(field: RawValue): field is SerializableField; + /** + * Serializes the class instance to a known `SerializedValue` that can be used to instantiate a new instance + * + * Ideally this returns the same params as found in the constructor. + */ + abstract serialize(): S; + /** + * typescript forbids abstract static methods but this is a workaround to require it + * + * @param serializedValue type of `SerializedValue` + * @returns `instanceValue` should same type as instantiating class + */ + static deserialize(serializedValue: unknown): unknown; +} diff --git a/src/platform/plugins/shared/data/common/serialize_utils.d.ts b/src/platform/plugins/shared/data/common/serialize_utils.d.ts new file mode 100644 index 0000000000000..d42e6c73b499b --- /dev/null +++ b/src/platform/plugins/shared/data/common/serialize_utils.d.ts @@ -0,0 +1,27 @@ +import type { SerializedRangeKey } from './search'; +import type { SerializedMultiFieldKey } from './search/aggs/buckets/multi_field_key'; +import type { RawValue } from './serializable_field'; +/** + * All available serialized forms of complex/instance fields. Excludes non-complex/primitive fields. + * + * Use `SerializedValue` for all generalize serial values which includes non-complex/primitive fields. + * + * Currently includes: + * - `RangeKey` + * - `MultiFieldKey` + */ +export type SerializedField = SerializedMultiFieldKey | SerializedRangeKey; +/** + * Alias for unknown serialized value. This value is what we store in the SO and app state + * to persist the color assignment based on the raw row value. + * + * In most cases this is a `string` or `number` or plain `object`, in other cases this is an + * object serialized from an instance of a given field (i.e. `RangeKey` or `MultiFieldKey`). + */ +export type SerializedValue = number | string | SerializedField | unknown; +export declare const SerializableType: { + MultiFieldKey: "multiFieldKey"; + RangeKey: "rangeKey"; +}; +export declare function deserializeField(field: SerializedValue): unknown; +export declare function serializeField(field: RawValue): SerializedValue; diff --git a/src/platform/plugins/shared/data/common/types.d.ts b/src/platform/plugins/shared/data/common/types.d.ts new file mode 100644 index 0000000000000..19d55f41fad52 --- /dev/null +++ b/src/platform/plugins/shared/data/common/types.d.ts @@ -0,0 +1,4 @@ +export type { GetConfigFn } from '@kbn/data-service/src/types'; +export type { RefreshInterval } from '@kbn/data-service-server'; +export type * from './query/types'; +export * from './kbn_field_types/types'; diff --git a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_multi_value_click.d.ts b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_multi_value_click.d.ts new file mode 100644 index 0000000000000..45cae761c6c24 --- /dev/null +++ b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_multi_value_click.d.ts @@ -0,0 +1,7 @@ +import type { Filter } from '@kbn/es-query'; +import type { Truthy } from 'lodash'; +import type { MultiValueClickContext } from '../multi_value_click_action'; +export type MultiValueClickDataContext = MultiValueClickContext['data']; +export declare const truthy: (value: T) => value is Truthy; +/** @public */ +export declare const createFiltersFromMultiValueClickAction: ({ data, negate, }: MultiValueClickDataContext) => Promise; diff --git a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_range_select.d.ts b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_range_select.d.ts new file mode 100644 index 0000000000000..ca4c2b7833a19 --- /dev/null +++ b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_range_select.d.ts @@ -0,0 +1,10 @@ +import type { Datatable } from '@kbn/expressions-plugin/common'; +import { type AggregateQuery } from '@kbn/es-query'; +export interface RangeSelectDataContext { + table: Datatable; + column: number; + range: number[]; + timeFieldName?: string; + query?: AggregateQuery; +} +export declare function createFiltersFromRangeSelectAction(event: RangeSelectDataContext): Promise; diff --git a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_value_click.d.ts b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_value_click.d.ts new file mode 100644 index 0000000000000..3343fe1f68434 --- /dev/null +++ b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_value_click.d.ts @@ -0,0 +1,30 @@ +import type { Datatable } from '@kbn/expressions-plugin/public'; +import type { Filter } from '@kbn/es-query'; +import { type AggregateQuery } from '@kbn/es-query'; +export interface ValueClickDataContext { + data: Array<{ + table: Pick; + column: number; + row: number; + value: any; + }>; + timeFieldName?: string; + negate?: boolean; + query?: AggregateQuery; +} +/** + * Assembles the filters needed to apply filtering against a specific cell value, while accounting + * for cases like if the value is a terms agg in an `__other__` or `__missing__` bucket. + * + * @param {EventData['table']} table - tabified table data + * @param {number} columnIndex - current column index + * @param {number} rowIndex - current row index + * @param {string} cellValue - value of the current cell + * @return {Filter[]|undefined} - list of filters to provide to queryFilter.addFilters() + */ +export declare const createFilter: (table: Pick, columnIndex: number, rowIndex: number) => Promise; +export declare const createFilterESQL: (table: Pick, columnIndex: number, rowIndex: number) => Promise; +/** @public */ +export declare const createFiltersFromValueClickAction: ({ data, negate, }: ValueClickDataContext) => Promise; +/** @public */ +export declare const appendFilterToESQLQueryFromValueClickAction: ({ data, query, negate, }: ValueClickDataContext) => string | undefined; diff --git a/src/platform/plugins/shared/data/public/actions/filters/index.d.ts b/src/platform/plugins/shared/data/public/actions/filters/index.d.ts new file mode 100644 index 0000000000000..a660f7671e3ca --- /dev/null +++ b/src/platform/plugins/shared/data/public/actions/filters/index.d.ts @@ -0,0 +1,6 @@ +export type { MultiValueClickDataContext } from './create_filters_from_multi_value_click'; +export type { RangeSelectDataContext } from './create_filters_from_range_select'; +export type { ValueClickDataContext } from './create_filters_from_value_click'; +export { createFiltersFromValueClickAction, appendFilterToESQLQueryFromValueClickAction, } from './create_filters_from_value_click'; +export { createFiltersFromRangeSelectAction } from './create_filters_from_range_select'; +export { createFiltersFromMultiValueClickAction } from './create_filters_from_multi_value_click'; diff --git a/src/platform/plugins/shared/data/public/actions/index.d.ts b/src/platform/plugins/shared/data/public/actions/index.d.ts new file mode 100644 index 0000000000000..05f7ab9d6fd53 --- /dev/null +++ b/src/platform/plugins/shared/data/public/actions/index.d.ts @@ -0,0 +1,3 @@ +export * from './select_range_action'; +export * from './value_click_action'; +export * from './multi_value_click_action'; diff --git a/src/platform/plugins/shared/data/public/actions/multi_value_click_action.d.ts b/src/platform/plugins/shared/data/public/actions/multi_value_click_action.d.ts new file mode 100644 index 0000000000000..a21550726c52b --- /dev/null +++ b/src/platform/plugins/shared/data/public/actions/multi_value_click_action.d.ts @@ -0,0 +1,24 @@ +import type { Datatable } from '@kbn/expressions-plugin/public'; +import type { UiActionsActionDefinition } from '@kbn/ui-actions-plugin/public'; +import type { BooleanRelation } from '@kbn/es-query'; +import type { QueryStart } from '../query'; +export type MultiValueClickActionContext = MultiValueClickContext; +export declare const ACTION_MULTI_VALUE_CLICK = "ACTION_MULTI_VALUE_CLICK"; +export interface MultiValueClickContext { + embeddable?: unknown; + data: { + data: Array<{ + cells: Array<{ + column: number; + row: number; + }>; + table: Pick; + relation?: BooleanRelation; + }>; + timeFieldName?: string; + negate?: boolean; + }; +} +export declare function createMultiValueClickActionDefinition(getStartServices: () => { + query: QueryStart; +}): UiActionsActionDefinition; diff --git a/src/platform/plugins/shared/data/public/actions/select_range_action.d.ts b/src/platform/plugins/shared/data/public/actions/select_range_action.d.ts new file mode 100644 index 0000000000000..038730cb3bb85 --- /dev/null +++ b/src/platform/plugins/shared/data/public/actions/select_range_action.d.ts @@ -0,0 +1,17 @@ +import type { AggregateQuery } from '@kbn/es-query'; +import type { Datatable } from '@kbn/expressions-plugin/public'; +import type { UiActionsActionDefinition, UiActionsStart } from '@kbn/ui-actions-plugin/public'; +export interface SelectRangeActionContext { + embeddable?: unknown; + data: { + table: Datatable; + column: number; + range: number[]; + timeFieldName?: string; + query?: AggregateQuery; + }; +} +export declare const ACTION_SELECT_RANGE = "ACTION_SELECT_RANGE"; +export declare function createSelectRangeActionDefinition(getStartServices: () => { + uiActions: UiActionsStart; +}): UiActionsActionDefinition; diff --git a/src/platform/plugins/shared/data/public/actions/value_click_action.d.ts b/src/platform/plugins/shared/data/public/actions/value_click_action.d.ts new file mode 100644 index 0000000000000..0d736d32cadd8 --- /dev/null +++ b/src/platform/plugins/shared/data/public/actions/value_click_action.d.ts @@ -0,0 +1,22 @@ +import type { AggregateQuery } from '@kbn/es-query'; +import type { Datatable } from '@kbn/expressions-plugin/public'; +import type { UiActionsActionDefinition, UiActionsStart } from '@kbn/ui-actions-plugin/public'; +export type ValueClickActionContext = ValueClickContext; +export declare const ACTION_VALUE_CLICK = "ACTION_VALUE_CLICK"; +export interface ValueClickContext { + embeddable?: unknown; + data: { + data: Array<{ + table: Pick; + column: number; + row: number; + value: any; + }>; + timeFieldName?: string; + negate?: boolean; + query?: AggregateQuery; + }; +} +export declare function createValueClickActionDefinition(getStartServices: () => { + uiActions: UiActionsStart; +}): UiActionsActionDefinition; diff --git a/src/platform/plugins/shared/data/public/index.d.ts b/src/platform/plugins/shared/data/public/index.d.ts new file mode 100644 index 0000000000000..47b59814b7a84 --- /dev/null +++ b/src/platform/plugins/shared/data/public/index.d.ts @@ -0,0 +1,88 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import type { ConfigSchema } from '../server/config'; +export { getEsQueryConfig } from '../common'; +export { getDisplayValueFromFilter, getFieldDisplayValueFromFilter, generateFilters, getIndexPatternFromFilter, } from './query'; +export { convertIntervalToEsInterval } from '../common/search/aggs/buckets/lib/time_buckets/calc_es_interval'; +/** + * Exporters (CSV) + */ +import { datatableToCSV } from '../common'; +export declare const exporters: { + datatableToCSV: typeof datatableToCSV; + CSV_MIME_TYPE: string; + cellHasFormulas: (val: string) => boolean; + tableHasFormulas: (columns: import("../../expressions/common").Datatable["columns"], rows: import("../../expressions/common").Datatable["rows"]) => boolean; +}; +export type { AggregationRestrictions as IndexPatternAggRestrictions, IndexPatternLoadExpressionFunctionDefinition, GetFieldsOptions, AggregationRestrictions, DataViewListItem, } from '../common'; +export { ES_FIELD_TYPES, KBN_FIELD_TYPES, UI_SETTINGS, fieldList, DuplicateDataViewError, } from '../common'; +import { CidrMask, isDateHistogramBucketAggConfig, propFilter, dateHistogramInterval, InvalidEsCalendarIntervalError, InvalidEsIntervalFormatError, IpAddress, isValidEsInterval, isValidInterval, parseEsInterval, parseInterval, toAbsoluteDates, getResponseInspectorStats, calcAutoIntervalLessThan, tabifyAggResponse, tabifyGetColumns } from '../common'; +export { AggGroupLabels, AggGroupNames, METRIC_TYPES, BUCKET_TYPES } from '../common'; +export type { AggConfigSerialized, AggGroupName, AggFunctionsMapping, AggParam, AggParamOption, AggParamType, AggConfigOptions, EsaggsExpressionFunctionDefinition, IAggConfig, IAggConfigs, IAggType, IFieldParamType, IMetricAggType, OptionedParamType, OptionedValueProp, ParsedInterval, ExpressionFunctionKql, ExpressionFunctionLucene, ExpressionFunctionKibana, ExpressionFunctionKibanaContext, ExpressionValueSearchContext, KibanaContext, } from '../common'; +export type { AggConfigs, AggConfig } from '../common'; +export type { ES_SEARCH_STRATEGY, EsQuerySortValue, ISearchSetup, ISearchStart, ISearchStartSearchSource, ISearchSource, SearchRequest, SearchSourceFields, SerializedSearchSourceFields, WaitUntilNextSessionCompletesOptions, } from './search'; +export { parseSearchSourceJSON, injectSearchSourceReferences, extractSearchSourceReferences, getSearchParamsFromRequest, noSearchSessionStorageCapabilityMessage, SEARCH_SESSIONS_MANAGEMENT_ID, waitUntilNextSessionCompletes$, SearchSource, SearchSessionState, SortDirection, } from './search'; +export type { ISessionService, SearchSessionInfoProvider, ISessionsClient, SearchUsageCollector, } from './search'; +export { isRunningResponse } from '../common'; +export declare const search: { + aggs: { + CidrMask: typeof CidrMask; + dateHistogramInterval: typeof dateHistogramInterval; + intervalOptions: ({ + display: string; + val: string; + enabled(agg: import("../common").IBucketAggConfig): boolean; + } | { + display: string; + val: string; + enabled?: undefined; + })[]; + InvalidEsCalendarIntervalError: typeof InvalidEsCalendarIntervalError; + InvalidEsIntervalFormatError: typeof InvalidEsIntervalFormatError; + IpAddress: typeof IpAddress; + isDateHistogramBucketAggConfig: typeof isDateHistogramBucketAggConfig; + isNumberType: (agg: import("../common").IAggConfig) => boolean; + isStringType: (agg: import("../common").IAggConfig) => boolean; + isType: (...types: string[]) => (agg: import("../common").IAggConfig) => boolean; + isValidEsInterval: typeof isValidEsInterval; + isValidInterval: typeof isValidInterval; + parentPipelineType: string; + parseEsInterval: typeof parseEsInterval; + parseInterval: typeof parseInterval; + propFilter: typeof propFilter; + siblingPipelineType: string; + termsAggFilter: string[]; + toAbsoluteDates: typeof toAbsoluteDates; + boundsDescendingRaw: ({ + bound: number; + interval: import("moment").Duration; + boundLabel: string; + intervalLabel: string; + } | { + bound: import("moment").Duration; + interval: import("moment").Duration; + boundLabel: string; + intervalLabel: string; + })[]; + calcAutoIntervalLessThan: typeof calcAutoIntervalLessThan; + }; + getResponseInspectorStats: typeof getResponseInspectorStats; + tabifyAggResponse: typeof tabifyAggResponse; + tabifyGetColumns: typeof tabifyGetColumns; +}; +/** + * Types to be shared externally + * @public + */ +export type { RefreshInterval } from '../common'; +export { createSavedQueryService, connectToQueryState, syncQueryStateWithUrl, syncGlobalQueryStateWithUrl, getDefaultQuery, FilterManager, TimeHistory, getQueryLog, mapAndFlattenFilters, QueryService, } from './query'; +export { NowProvider } from './now_provider'; +export type { NowProviderInternalContract, NowProviderPublicContract } from './now_provider'; +export type { QueryState, QueryState$, SavedQuery, SavedQueryService, SavedQueryTimeFilter, TimefilterContract, TimeHistoryContract, QueryStateChange, QueryStart, AutoRefreshDoneFn, PersistedLog, QueryStringContract, QuerySetup, TimefilterSetup, GlobalQueryStateFromUrl, TimefilterHook, } from './query'; +export type { AggsStart } from './search/aggs'; +export { getTime } from '../common'; +export type { SavedObject } from '../common'; +export { isTimeRange, isQuery, flattenHit, calculateBounds, tabifyAggResponse } from '../common'; +import { DataPublicPlugin } from './plugin'; +export declare function plugin(initializerContext: PluginInitializerContext): DataPublicPlugin; +export type { DataPublicPluginSetup, DataPublicPluginStart, DataPublicPluginStartActions, } from './types'; +export type { DataPublicPlugin as DataPlugin }; diff --git a/src/platform/plugins/shared/data/public/now_provider/index.d.ts b/src/platform/plugins/shared/data/public/now_provider/index.d.ts new file mode 100644 index 0000000000000..5579772ffa9a2 --- /dev/null +++ b/src/platform/plugins/shared/data/public/now_provider/index.d.ts @@ -0,0 +1,2 @@ +export type { NowProviderInternalContract, NowProviderPublicContract } from './now_provider'; +export { NowProvider } from './now_provider'; diff --git a/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.d.ts b/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.d.ts new file mode 100644 index 0000000000000..f70406a03973b --- /dev/null +++ b/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.d.ts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function getForceNowFromUrl(): Date | undefined; diff --git a/src/platform/plugins/shared/data/public/now_provider/lib/index.d.ts b/src/platform/plugins/shared/data/public/now_provider/lib/index.d.ts new file mode 100644 index 0000000000000..2dcc88ddac453 --- /dev/null +++ b/src/platform/plugins/shared/data/public/now_provider/lib/index.d.ts @@ -0,0 +1 @@ +export { getForceNowFromUrl } from './get_force_now_from_url'; diff --git a/src/platform/plugins/shared/data/public/now_provider/now_provider.d.ts b/src/platform/plugins/shared/data/public/now_provider/now_provider.d.ts new file mode 100644 index 0000000000000..652c832d45bbc --- /dev/null +++ b/src/platform/plugins/shared/data/public/now_provider/now_provider.d.ts @@ -0,0 +1,14 @@ +import type { PublicMethodsOf } from '@kbn/utility-types'; +export type NowProviderInternalContract = PublicMethodsOf; +export type NowProviderPublicContract = Pick; +/** + * Used to synchronize time between parallel searches with relative time range that rely on `now`. + */ +export declare class NowProvider { + private readonly nowFromUrl; + private now?; + constructor(); + get(): Date; + set(now: Date): void; + reset(): void; +} diff --git a/src/platform/plugins/shared/data/public/plugin.d.ts b/src/platform/plugins/shared/data/public/plugin.d.ts new file mode 100644 index 0000000000000..0d4eab4681ed5 --- /dev/null +++ b/src/platform/plugins/shared/data/public/plugin.d.ts @@ -0,0 +1,13 @@ +import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import type { ConfigSchema } from '../server/config'; +import type { DataPublicPluginSetup, DataPublicPluginStart, DataSetupDependencies, DataStartDependencies } from './types'; +export declare class DataPublicPlugin implements Plugin { + private readonly searchService; + private readonly queryService; + private readonly storage; + private readonly nowProvider; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup, { expressions, uiActions, usageCollection, inspector, fieldFormats, management, }: DataSetupDependencies): DataPublicPluginSetup; + start(core: CoreStart, { uiActions, fieldFormats, dataViews, inspector, screenshotMode, share, cps, }: DataStartDependencies): DataPublicPluginStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/filter_manager.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/filter_manager.d.ts new file mode 100644 index 0000000000000..941a1016dda8a --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/filter_manager.d.ts @@ -0,0 +1,50 @@ +import type { IUiSettingsClient } from '@kbn/core/public'; +import { FilterStateStore } from '@kbn/es-query'; +import type { Filter } from '@kbn/es-query'; +import type { PersistableStateService } from '@kbn/kibana-utils-plugin/common/persistable_state'; +interface PartitionedFilters { + globalFilters: Filter[]; + appFilters: Filter[]; +} +export declare class FilterManager implements PersistableStateService { + private filters; + private updated$; + private fetch$; + private uiSettings; + constructor(uiSettings: IUiSettingsClient); + private mergeIncomingFilters; + private static mergeFilters; + private static partitionFilters; + private handleStateUpdate; + getFilters(): Filter[]; + getAppFilters(): Filter[]; + getGlobalFilters(): Filter[]; + getPartitionedFilters(): PartitionedFilters; + getUpdates$(): import("rxjs").Observable; + getFetches$(): import("rxjs").Observable; + addFilters(filters: Filter[] | Filter, pinFilterStatus?: boolean): void; + setFilters(newFilters: Filter[], pinFilterStatus?: boolean): void; + /** + * Sets new global filters and leaves app filters untouched, + * Removes app filters for which there is a duplicate within new global filters + * @param newGlobalFilters + */ + setGlobalFilters(newGlobalFilters: Filter[]): void; + /** + * Sets new app filters and leaves global filters untouched, + * Removes app filters for which there is a duplicate within new global filters + * @param newAppFilters + */ + setAppFilters(newAppFilters: Filter[]): void; + removeFilter(filter: Filter): void; + removeAll(): void; + static setFiltersStore(filters: Filter[], store: FilterStateStore, shouldOverrideStore?: boolean): void; + extract: (filters: Filter[]) => { + state: Filter[]; + references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; + }; + inject: (filters: Filter[], references: import("@kbn/core/public").SavedObjectReference[]) => Filter[]; + telemetry: (filters: Filter[], collector: unknown) => {}; + getAllMigrations: () => import("@kbn/kibana-utils-plugin/common/persistable_state").MigrateFunctionsObject; +} +export {}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/index.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/index.d.ts new file mode 100644 index 0000000000000..79a504a71a791 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/index.d.ts @@ -0,0 +1,5 @@ +export { FilterManager } from './filter_manager'; +export { mapAndFlattenFilters } from './lib/map_and_flatten_filters'; +export { generateFilters } from './lib/generate_filters'; +export { getDisplayValueFromFilter, getFieldDisplayValueFromFilter } from './lib/get_display_value'; +export { getIndexPatternFromFilter } from './lib/get_index_pattern_from_filter'; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_filters.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_filters.d.ts new file mode 100644 index 0000000000000..7864535a4e5f9 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_filters.d.ts @@ -0,0 +1,15 @@ +import type { Filter, DataViewFieldBase, DataViewBase } from '@kbn/es-query'; +import type { FilterManager } from '../filter_manager'; +/** + * Generate filter objects, as a result of triggering a filter action on a + * specific index pattern field. + * + * @param {FilterManager} filterManager - The active filter manager to lookup for existing filters + * @param {Field | string} field - The field for which filters should be generated + * @param {any} values - One or more values to filter for. + * @param {string} operation - "-" to create a negated filter + * @param {string} index - Index string to generate filters for + * + * @returns {object} An array of filters to be added back to filterManager + */ +export declare function generateFilters(filterManager: FilterManager, field: DataViewFieldBase | string, values: any, operation: string, index: DataViewBase): Filter[]; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_mapping_chain.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_mapping_chain.d.ts new file mode 100644 index 0000000000000..5b58037f7e56b --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_mapping_chain.d.ts @@ -0,0 +1,2 @@ +import type { Filter } from '@kbn/es-query'; +export declare const generateMappingChain: (fn: Function, next?: Function) => (filter: Filter) => any; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_display_value.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_display_value.d.ts new file mode 100644 index 0000000000000..8598d1ce05467 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_display_value.d.ts @@ -0,0 +1,4 @@ +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { Filter, DataViewBase } from '@kbn/es-query'; +export declare function getFieldDisplayValueFromFilter(filter: Filter, indexPatterns: DataView[] | DataViewBase[]): string; +export declare function getDisplayValueFromFilter(filter: Filter, indexPatterns: DataViewBase[]): string; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_index_pattern_from_filter.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_index_pattern_from_filter.d.ts new file mode 100644 index 0000000000000..22130265f3907 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_index_pattern_from_filter.d.ts @@ -0,0 +1,2 @@ +import type { Filter, DataViewBase } from '@kbn/es-query'; +export declare function getIndexPatternFromFilter(filter: Filter, indexPatterns: T[]): T | undefined; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_and_flatten_filters.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_and_flatten_filters.d.ts new file mode 100644 index 0000000000000..6ae6ea7020c77 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_and_flatten_filters.d.ts @@ -0,0 +1,2 @@ +import type { Filter } from '@kbn/es-query'; +export declare const mapAndFlattenFilters: (filters: Filter[]) => Filter[]; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_filter.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_filter.d.ts new file mode 100644 index 0000000000000..7cf5d585ed274 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_filter.d.ts @@ -0,0 +1,2 @@ +import type { Filter } from '@kbn/es-query'; +export declare function mapFilter(filter: Filter): Filter; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_combined.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_combined.d.ts new file mode 100644 index 0000000000000..edd0ba426ba12 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_combined.d.ts @@ -0,0 +1,6 @@ +import type { Filter } from '@kbn/es-query'; +export declare const mapCombined: (filter: Filter) => { + type: import("@kbn/es-query").FILTERS.COMBINED; + key: string | undefined; + params: Filter[]; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_default.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_default.d.ts new file mode 100644 index 0000000000000..b9278d0af73d8 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_default.d.ts @@ -0,0 +1,7 @@ +import type { Filter } from '@kbn/es-query'; +import { FILTERS } from '@kbn/es-query'; +export declare const mapDefault: (filter: Filter) => { + type: FILTERS; + key: string; + value: string; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_exists.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_exists.d.ts new file mode 100644 index 0000000000000..4d5d1583e4bba --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_exists.d.ts @@ -0,0 +1,7 @@ +import type { Filter } from '@kbn/es-query'; +import { FILTERS } from '@kbn/es-query'; +export declare const mapExists: (filter: Filter) => { + type: FILTERS; + value: FILTERS; + key: string | undefined; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_match_all.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_match_all.d.ts new file mode 100644 index 0000000000000..abb0486cce471 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_match_all.d.ts @@ -0,0 +1,7 @@ +import type { Filter } from '@kbn/es-query'; +import { FILTERS } from '@kbn/es-query'; +export declare const mapMatchAll: (filter: Filter) => { + type: FILTERS; + key: string; + value: string; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrase.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrase.d.ts new file mode 100644 index 0000000000000..3a5341e759573 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrase.d.ts @@ -0,0 +1,12 @@ +import type { Filter, PhraseFilter, ScriptedPhraseFilter } from '@kbn/es-query'; +import { FILTERS } from '@kbn/es-query'; +import type { FieldFormat } from '@kbn/field-formats-plugin/common'; +export declare function getPhraseDisplayValue(filter: PhraseFilter | ScriptedPhraseFilter, formatter?: FieldFormat, fieldType?: string): string; +export declare const isMapPhraseFilter: (filter: any) => filter is PhraseFilter; +export declare const mapPhrase: (filter: Filter) => { + key: string; + params: { + query: any; + }; + type: FILTERS; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.d.ts new file mode 100644 index 0000000000000..6927e6fe3c14f --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.d.ts @@ -0,0 +1,9 @@ +import type { Filter, PhrasesFilter } from '@kbn/es-query'; +import type { FieldFormat } from '@kbn/field-formats-plugin/common'; +export declare function getPhrasesDisplayValue(filter: PhrasesFilter, formatter?: FieldFormat): string; +export declare const mapPhrases: (filter: Filter) => { + type: string | undefined; + key: string | undefined; + value: (import("@kbn/es-query/src/filters/build_filters").FilterMetaParams | undefined) & import("@kbn/es-query/src/filters/build_filters").PhraseFilterValue[]; + params: (import("@kbn/es-query/src/filters/build_filters").FilterMetaParams | undefined) & import("@kbn/es-query/src/filters/build_filters").PhraseFilterValue[]; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_query_string.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_query_string.d.ts new file mode 100644 index 0000000000000..51a1935f88202 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_query_string.d.ts @@ -0,0 +1,7 @@ +import type { Filter } from '@kbn/es-query'; +import { FILTERS } from '@kbn/es-query'; +export declare const mapQueryString: (filter: Filter) => { + type: FILTERS; + key: string; + value: string | undefined; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.d.ts new file mode 100644 index 0000000000000..c79c3098c43d3 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.d.ts @@ -0,0 +1,11 @@ +import type { ScriptedRangeFilter, RangeFilter, Filter } from '@kbn/es-query'; +import { FILTERS } from '@kbn/es-query'; +import type { FieldFormat } from '@kbn/field-formats-plugin/common'; +export declare function getRangeDisplayValue({ meta: { params } }: RangeFilter | ScriptedRangeFilter, formatter?: FieldFormat): string; +export declare const isMapRangeFilter: (filter: any) => filter is RangeFilter; +export declare const mapRange: (filter: Filter) => { + type: FILTERS; + key: string; + value: any; + params: any; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_spatial_filter.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_spatial_filter.d.ts new file mode 100644 index 0000000000000..b190b9d990664 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_spatial_filter.d.ts @@ -0,0 +1,7 @@ +import type { Filter } from '@kbn/es-query'; +import { FILTERS } from '@kbn/es-query'; +export declare const mapSpatialFilter: (filter: Filter) => { + type: FILTERS; + key: undefined; + value: undefined; +}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/sort_filters.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/sort_filters.d.ts new file mode 100644 index 0000000000000..a9e3d3c1e5b0f --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/filter_manager/lib/sort_filters.d.ts @@ -0,0 +1,10 @@ +import type { Filter } from '@kbn/es-query'; +/** + * Sort filters according to their store - global filters go first + * + * @param {object} first The first filter to compare + * @param {object} second The second filter to compare + * + * @returns {number} Sorting order of filters + */ +export declare const sortFilters: ({ $state: a }: Filter, { $state: b }: Filter) => number; diff --git a/src/platform/plugins/shared/data/public/query/index.d.ts b/src/platform/plugins/shared/data/public/query/index.d.ts new file mode 100644 index 0000000000000..cc1e390f910d6 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/index.d.ts @@ -0,0 +1,9 @@ +export * from './lib'; +export * from './query_service'; +export * from './filter_manager'; +export * from './timefilter'; +export * from './saved_query'; +export * from './persisted_log'; +export * from './state_sync'; +export type { QueryStringContract } from './query_string'; +export type { QueryState } from './query_state'; diff --git a/src/platform/plugins/shared/data/public/query/lib/add_to_query_log.d.ts b/src/platform/plugins/shared/data/public/query/lib/add_to_query_log.d.ts new file mode 100644 index 0000000000000..82443bbb28662 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/lib/add_to_query_log.d.ts @@ -0,0 +1,9 @@ +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +import type { Query } from '../../../common'; +interface AddToQueryLogDependencies { + uiSettings: IUiSettingsClient; + storage: IStorageWrapper; +} +export declare function createAddToQueryLog({ storage, uiSettings }: AddToQueryLogDependencies): (appName: string, { language, query }: Query) => void; +export {}; diff --git a/src/platform/plugins/shared/data/public/query/lib/get_default_query.d.ts b/src/platform/plugins/shared/data/public/query/lib/get_default_query.d.ts new file mode 100644 index 0000000000000..144e6eb28a6bf --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/lib/get_default_query.d.ts @@ -0,0 +1,6 @@ +type QueryLanguage = 'kuery' | 'lucene'; +export declare function getDefaultQuery(language?: QueryLanguage): { + query: string; + language: QueryLanguage; +}; +export {}; diff --git a/src/platform/plugins/shared/data/public/query/lib/get_query_log.d.ts b/src/platform/plugins/shared/data/public/query/lib/get_query_log.d.ts new file mode 100644 index 0000000000000..3dc8d15c75245 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/lib/get_query_log.d.ts @@ -0,0 +1,5 @@ +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +import { PersistedLog } from '../persisted_log'; +/** @internal */ +export declare function getQueryLog(uiSettings: IUiSettingsClient, storage: IStorageWrapper, appName: string, language: string): PersistedLog; diff --git a/src/platform/plugins/shared/data/public/query/lib/index.d.ts b/src/platform/plugins/shared/data/public/query/lib/index.d.ts new file mode 100644 index 0000000000000..3db48ad68187b --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/lib/index.d.ts @@ -0,0 +1,3 @@ +export * from './add_to_query_log'; +export * from './get_default_query'; +export * from './get_query_log'; diff --git a/src/platform/plugins/shared/data/public/query/persisted_log/index.d.ts b/src/platform/plugins/shared/data/public/query/persisted_log/index.d.ts new file mode 100644 index 0000000000000..e63b333894bb5 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/persisted_log/index.d.ts @@ -0,0 +1 @@ +export * from './persisted_log'; diff --git a/src/platform/plugins/shared/data/public/query/persisted_log/persisted_log.d.ts b/src/platform/plugins/shared/data/public/query/persisted_log/persisted_log.d.ts new file mode 100644 index 0000000000000..30853b20fa1c5 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/persisted_log/persisted_log.d.ts @@ -0,0 +1,28 @@ +import type { Observable } from 'rxjs'; +import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +interface PersistedLogOptions { + maxLength?: number | string; + filterDuplicates?: boolean; + isDuplicate?: (oldItem: T, newItem: T) => boolean; + enableBrowserTabsSync?: boolean; +} +export declare class PersistedLog { + name: string; + maxLength?: number; + filterDuplicates?: boolean; + isDuplicate: (oldItem: T, newItem: T) => boolean; + storage: IStorageWrapper; + items: T[]; + private update$; + private storageEventListener?; + private enableBrowserTabsSync; + private subscriberCount; + constructor(name: string, options: PersistedLogOptions | undefined, storage: IStorageWrapper); + /** Keeps browser tabs in sync. */ + private addStorageEventListener; + private removeStorageEventListener; + add(val: any): T[]; + get(): T[]; + get$(): Observable; +} +export {}; diff --git a/src/platform/plugins/shared/data/public/query/query_service.d.ts b/src/platform/plugins/shared/data/public/query/query_service.d.ts new file mode 100644 index 0000000000000..eb92c0972e375 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/query_service.d.ts @@ -0,0 +1,83 @@ +import type { HttpStart, IUiSettingsClient } from '@kbn/core/public'; +import type { PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common'; +import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +import type { TimeRange } from '@kbn/es-query'; +import { buildEsQuery } from '@kbn/es-query'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import { FilterManager } from './filter_manager'; +import { createAddToQueryLog } from './lib'; +import type { TimefilterSetup } from './timefilter'; +import { createSavedQueryService } from './saved_query/saved_query_service'; +import type { QueryState$ } from './state_sync/create_query_state_observable'; +import type { QueryState } from './query_state'; +import type { QueryStringContract } from './query_string'; +import type { NowProviderInternalContract } from '../now_provider'; +interface QueryServiceSetupDependencies { + storage: IStorageWrapper; + uiSettings: IUiSettingsClient; + nowProvider: NowProviderInternalContract; + minRefreshInterval?: number; +} +interface QueryServiceStartDependencies { + storage: IStorageWrapper; + uiSettings: IUiSettingsClient; + http: HttpStart; +} +export interface QuerySetup extends PersistableStateService { + filterManager: FilterManager; + timefilter: TimefilterSetup; + queryString: QueryStringContract; + state$: QueryState$; + getState(): QueryState; +} +export interface QueryStart extends PersistableStateService { + filterManager: FilterManager; + timefilter: TimefilterSetup; + queryString: QueryStringContract; + state$: QueryState$; + getState(): QueryState; + addToQueryLog: ReturnType; + savedQueries: ReturnType; + getEsQuery(indexPattern: DataView, timeRange?: TimeRange): ReturnType; +} +/** + * Query Service + * @internal + */ +export declare class QueryService implements PersistableStateService { + private minRefreshInterval; + filterManager: FilterManager; + timefilter: TimefilterSetup; + queryStringManager: QueryStringContract; + state$: QueryState$; + constructor(minRefreshInterval?: number); + setup({ storage, uiSettings, nowProvider, minRefreshInterval, }: QueryServiceSetupDependencies): QuerySetup; + start({ storage, uiSettings, http }: QueryServiceStartDependencies): QueryStart; + stop(): void; + private getQueryState; + extract: (queryState: QueryState) => { + state: { + filters: import("@kbn/es-query").Filter[]; + time?: import("../../common").TimeRange; + refreshInterval?: import("@kbn/data-service-server/src/types").RefreshInterval; + query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; + }; + references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; + }; + inject: (queryState: QueryState, references: import("@kbn/core/public").SavedObjectReference[]) => { + filters: import("@kbn/es-query").Filter[]; + time?: import("../../common").TimeRange; + refreshInterval?: import("@kbn/data-service-server/src/types").RefreshInterval; + query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; + }; + telemetry: (queryState: QueryState, collector: unknown) => {}; + getAllMigrations: () => import("@kbn/kibana-utils-plugin/common").MigrateFunctionsObject; + migrateToLatest: (versionedState: VersionedState) => { + filters: import("@kbn/es-query").Filter[]; + time?: import("../../common").TimeRange; + refreshInterval?: import("@kbn/data-service-server/src/types").RefreshInterval; + query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; + }; + private getPersistableStateMethods; +} +export {}; diff --git a/src/platform/plugins/shared/data/public/query/query_state.d.ts b/src/platform/plugins/shared/data/public/query/query_state.d.ts new file mode 100644 index 0000000000000..528776aff907f --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/query_state.d.ts @@ -0,0 +1,10 @@ +import type { QueryState } from '../../common'; +import type { TimefilterSetup } from './timefilter'; +import type { FilterManager } from './filter_manager'; +import type { QueryStringContract } from './query_string'; +export type { QueryState }; +export declare function getQueryState({ timefilter: { timefilter }, filterManager, queryString, }: { + timefilter: TimefilterSetup; + filterManager: FilterManager; + queryString: QueryStringContract; +}): QueryState; diff --git a/src/platform/plugins/shared/data/public/query/query_string/index.d.ts b/src/platform/plugins/shared/data/public/query/query_string/index.d.ts new file mode 100644 index 0000000000000..9e4a7ad8396c2 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/query_string/index.d.ts @@ -0,0 +1,2 @@ +export type { QueryStringContract } from './query_string_manager'; +export { QueryStringManager } from './query_string_manager'; diff --git a/src/platform/plugins/shared/data/public/query/query_string/query_string_manager.d.ts b/src/platform/plugins/shared/data/public/query/query_string/query_string_manager.d.ts new file mode 100644 index 0000000000000..cc325dda0f4fb --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/query_string/query_string_manager.d.ts @@ -0,0 +1,28 @@ +import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { CoreStart } from '@kbn/core/public'; +import type { Query, AggregateQuery } from '@kbn/es-query'; +import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +export declare class QueryStringManager { + private readonly storage; + private readonly uiSettings; + private query$; + constructor(storage: IStorageWrapper, uiSettings: CoreStart['uiSettings']); + private getDefaultLanguage; + getDefaultQuery(): { + query: string; + language: any; + }; + formatQuery(query: Query | AggregateQuery | string | undefined): Query | AggregateQuery; + getUpdates$: () => import("rxjs").Observable; + getQuery: () => Query | AggregateQuery; + /** + * Updates the query. + * @param {Query | AggregateQuery} query + */ + setQuery: (query: Query | AggregateQuery) => void; + /** + * Resets the query to the default one. + */ + clearQuery: () => void; +} +export type QueryStringContract = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data/public/query/saved_query/index.d.ts b/src/platform/plugins/shared/data/public/query/saved_query/index.d.ts new file mode 100644 index 0000000000000..866db703b75d9 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/saved_query/index.d.ts @@ -0,0 +1,2 @@ +export type { SavedQuery, SavedQueryAttributes, SavedQueryService, SavedQueryTimeFilter, } from './types'; +export { createSavedQueryService } from './saved_query_service'; diff --git a/src/platform/plugins/shared/data/public/query/saved_query/saved_query_service.d.ts b/src/platform/plugins/shared/data/public/query/saved_query/saved_query_service.d.ts new file mode 100644 index 0000000000000..9deb81c84a694 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/saved_query/saved_query_service.d.ts @@ -0,0 +1,17 @@ +import type { HttpStart } from '@kbn/core/public'; +import type { SavedQuery } from './types'; +import type { SavedQueryAttributes } from '../../../common'; +export declare const createSavedQueryService: (http: HttpStart) => { + isDuplicateTitle: (title: string, id?: string) => Promise; + createQuery: (attributes: SavedQueryAttributes, { overwrite }?: { + overwrite?: boolean | undefined; + }) => Promise; + updateQuery: (id: string, attributes: SavedQueryAttributes) => Promise; + findSavedQueries: (search?: string, perPage?: number, page?: number) => Promise<{ + total: number; + queries: SavedQuery[]; + }>; + getSavedQuery: (id: string) => Promise; + deleteSavedQuery: (id: string) => Promise<{}>; + getSavedQueryCount: () => Promise; +}; diff --git a/src/platform/plugins/shared/data/public/query/saved_query/types.d.ts b/src/platform/plugins/shared/data/public/query/saved_query/types.d.ts new file mode 100644 index 0000000000000..987d8dc513aff --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/saved_query/types.d.ts @@ -0,0 +1,19 @@ +import type { TimeRange } from '@kbn/es-query'; +import type { RefreshInterval } from '@kbn/data-service-server'; +import type { SavedQuery, SavedQueryAttributes } from '../../../common/types'; +export type SavedQueryTimeFilter = TimeRange & { + refreshInterval: RefreshInterval; +}; +export type { SavedQuery, SavedQueryAttributes }; +export interface SavedQueryService { + isDuplicateTitle: (title: string, id?: string) => Promise; + createQuery: (attributes: SavedQueryAttributes) => Promise; + updateQuery: (id: string, attributes: SavedQueryAttributes) => Promise; + findSavedQueries: (searchText?: string, perPage?: number, activePage?: number) => Promise<{ + total: number; + queries: SavedQuery[]; + }>; + getSavedQuery: (id: string) => Promise; + deleteSavedQuery: (id: string) => Promise<{}>; + getSavedQueryCount: () => Promise; +} diff --git a/src/platform/plugins/shared/data/public/query/state_sync/connect_to_query_state.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/connect_to_query_state.d.ts new file mode 100644 index 0000000000000..a2553bb7ddefe --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/state_sync/connect_to_query_state.d.ts @@ -0,0 +1,15 @@ +import { FilterStateStore } from '@kbn/es-query'; +import type { BaseStateContainer } from '@kbn/kibana-utils-plugin/public'; +import type { QuerySetup, QueryStart } from '../query_service'; +import type { QueryState } from '../query_state'; +/** + * Helper to setup two-way syncing of global data and a state container + * @param QueryService: either setup or start + * @param stateContainer to use for syncing + */ +export declare const connectToQueryState: ({ timefilter: { timefilter }, filterManager, queryString, state$, }: Pick, stateContainer: BaseStateContainer, syncConfig: { + time?: boolean; + refreshInterval?: boolean; + filters?: FilterStateStore | boolean; + query?: boolean; +}) => () => void; diff --git a/src/platform/plugins/shared/data/public/query/state_sync/create_query_state_observable.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/create_query_state_observable.d.ts new file mode 100644 index 0000000000000..c3d0e71a80776 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/state_sync/create_query_state_observable.d.ts @@ -0,0 +1,15 @@ +import { Observable } from 'rxjs'; +import type { TimefilterSetup } from '../timefilter'; +import type { FilterManager } from '../filter_manager'; +import type { QueryState } from '../query_state'; +import type { QueryStateChange } from './types'; +import type { QueryStringContract } from '../query_string'; +export type QueryState$ = Observable<{ + changes: QueryStateChange; + state: QueryState; +}>; +export declare function createQueryStateObservable({ timefilter, filterManager, queryString, }: { + timefilter: TimefilterSetup; + filterManager: FilterManager; + queryString: QueryStringContract; +}): QueryState$; diff --git a/src/platform/plugins/shared/data/public/query/state_sync/index.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/index.d.ts new file mode 100644 index 0000000000000..54a356f4782df --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/state_sync/index.d.ts @@ -0,0 +1,4 @@ +export { connectToQueryState } from './connect_to_query_state'; +export { syncQueryStateWithUrl, syncGlobalQueryStateWithUrl } from './sync_state_with_url'; +export type { QueryStateChange, GlobalQueryStateFromUrl } from './types'; +export type { QueryState$ } from './create_query_state_observable'; diff --git a/src/platform/plugins/shared/data/public/query/state_sync/sync_state_with_url.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/sync_state_with_url.d.ts new file mode 100644 index 0000000000000..874abe4533667 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/state_sync/sync_state_with_url.d.ts @@ -0,0 +1,18 @@ +import type { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; +import type { QuerySetup, QueryStart } from '../query_service'; +/** + * Helper to sync global query state {@link GlobalQueryStateFromUrl} with the URL (`_g` query param that is preserved between apps) + * @param QueryService: either setup or start + * @param kbnUrlStateStorage to use for syncing + */ +export declare const syncGlobalQueryStateWithUrl: (query: Pick, kbnUrlStateStorage: IKbnUrlStateStorage) => { + stop: () => void; + hasInheritedQueryFromUrl: boolean; +}; +/** + * @deprecated use {@link syncGlobalQueryStateWithUrl} instead + */ +export declare const syncQueryStateWithUrl: (query: Pick, kbnUrlStateStorage: IKbnUrlStateStorage) => { + stop: () => void; + hasInheritedQueryFromUrl: boolean; +}; diff --git a/src/platform/plugins/shared/data/public/query/state_sync/types.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/types.d.ts new file mode 100644 index 0000000000000..a56a2b3649838 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/state_sync/types.d.ts @@ -0,0 +1,20 @@ +import type { Filter } from '@kbn/es-query'; +import type { RefreshInterval } from '@kbn/data-service-server'; +import type { QueryState } from '../query_state'; +import type { TimeRange } from '../../../common/types'; +type QueryStateChangePartial = { + [P in keyof QueryState]?: boolean; +}; +export interface QueryStateChange extends QueryStateChangePartial { + appFilters?: boolean; + globalFilters?: boolean; +} +/** + * Part of {@link QueryState} serialized in the `_g` portion of Url + */ +export interface GlobalQueryStateFromUrl { + time?: TimeRange; + refreshInterval?: RefreshInterval; + filters?: Filter[]; +} +export {}; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/index.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/index.d.ts new file mode 100644 index 0000000000000..be80859fa358b --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/index.d.ts @@ -0,0 +1,9 @@ +export type { TimefilterSetup } from './timefilter_service'; +export { TimefilterService } from './timefilter_service'; +export type * from './types'; +export type { TimefilterContract, AutoRefreshDoneFn } from './timefilter'; +export { Timefilter } from './timefilter'; +export type { TimeHistoryContract } from './time_history'; +export { TimeHistory } from './time_history'; +export { validateTimeRange } from './lib/validate_timerange'; +export type { TimefilterHook } from './use_timefilter'; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/lib/auto_refresh_loop.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/lib/auto_refresh_loop.d.ts new file mode 100644 index 0000000000000..dcc1bf7a11fc7 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/lib/auto_refresh_loop.d.ts @@ -0,0 +1,16 @@ +export type AutoRefreshDoneFn = () => void; +/** + * Creates a loop for timepicker's auto refresh + * It has a "confirmation" mechanism: + * When auto refresh loop emits, it won't continue automatically, + * until each subscriber calls received `done` function. + * + * Also, it will pause when the page is not visible. + * + * @internal + */ +export declare const createAutoRefreshLoop: () => { + stop: () => void; + start: (timeout: number) => void; + loop$: import("rxjs").Observable; +}; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/lib/diff_time_picker_vals.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/lib/diff_time_picker_vals.d.ts new file mode 100644 index 0000000000000..ce758e1baa46a --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/lib/diff_time_picker_vals.d.ts @@ -0,0 +1,4 @@ +import type { RefreshInterval } from '@kbn/data-service-server'; +import type { InputTimeRange } from '../types'; +export declare function areRefreshIntervalsDifferent(rangeA: RefreshInterval, rangeB: RefreshInterval): boolean; +export declare function areTimeRangesDifferent(rangeA: InputTimeRange, rangeB: InputTimeRange): boolean; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/lib/page_visibility.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/lib/page_visibility.d.ts new file mode 100644 index 0000000000000..a333da28bc25e --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/lib/page_visibility.d.ts @@ -0,0 +1,2 @@ +import type { Observable } from 'rxjs'; +export declare function createPageVisibility$(): Observable; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/lib/validate_timerange.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/lib/validate_timerange.d.ts new file mode 100644 index 0000000000000..34ed35add082c --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/lib/validate_timerange.d.ts @@ -0,0 +1,2 @@ +import type { TimeRange } from '@kbn/es-query'; +export declare function validateTimeRange(time?: TimeRange): boolean; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/time_history.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/time_history.d.ts new file mode 100644 index 0000000000000..2705c239f430e --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/time_history.d.ts @@ -0,0 +1,11 @@ +import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +import type { TimeRange } from '@kbn/es-query'; +export declare class TimeHistory { + private history; + constructor(storage: IStorageWrapper); + add(time: TimeRange): void; + get(): TimeRange[]; + get$(): import("rxjs").Observable; +} +export type TimeHistoryContract = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/timefilter.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/timefilter.d.ts new file mode 100644 index 0000000000000..6570a63829268 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/timefilter.d.ts @@ -0,0 +1,111 @@ +import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { TimeRange } from '@kbn/es-query'; +import type { RefreshInterval } from '@kbn/data-service-server'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { TimefilterConfig, InputTimeRange, TimeRangeBounds } from './types'; +import type { NowProviderInternalContract } from '../../now_provider'; +import type { TimeHistoryContract } from './time_history'; +import type { AutoRefreshDoneFn } from './lib/auto_refresh_loop'; +import type { TimefilterHook } from './use_timefilter'; +export type { AutoRefreshDoneFn }; +export declare class Timefilter { + private readonly nowProvider; + private enabledUpdated$; + private timeUpdate$; + private refreshIntervalUpdate$; + private fetch$; + private _time; + private _isTimeTouched; + private _refreshInterval; + private _minRefreshInterval; + private _isRefreshIntervalTouched; + private _history; + private _isTimeRangeSelectorEnabled; + private _isAutoRefreshSelectorEnabled; + private readonly timeDefaults; + private readonly refreshIntervalDefaults; + readonly useTimefilter: () => TimefilterHook; + private readonly autoRefreshLoop; + constructor(config: TimefilterConfig, timeHistory: TimeHistoryContract, nowProvider: NowProviderInternalContract); + isTimeRangeSelectorEnabled(): boolean; + isAutoRefreshSelectorEnabled(): boolean; + isTimeTouched(): boolean; + isRefreshIntervalTouched(): boolean; + getEnabledUpdated$: () => import("rxjs").Observable; + getTimeUpdate$: () => import("rxjs").Observable; + getRefreshIntervalUpdate$: () => import("rxjs").Observable; + /** + * Get an observable that emits when it is time to refetch data due to refresh interval + * Each subscription to this observable resets internal interval + * Emitted value is a callback {@link AutoRefreshDoneFn} that must be called to restart refresh interval loop + * Apps should use this callback to start next auto refresh loop when view finished updating + */ + getAutoRefreshFetch$: () => import("rxjs").Observable; + triggerFetch: () => void; + getFetch$: () => import("rxjs").Observable; + getTime: () => TimeRange; + /** + * Same as {@link getTime}, but also converts relative time range to absolute time range + */ + getAbsoluteTime(): TimeRange; + /** + * Updates timefilter time. + * Emits 'timeUpdate' and 'fetch' events when time changes + * @param {Object} time + * @property {string|moment} time.from + * @property {string|moment} time.to + */ + setTime: (time: InputTimeRange) => void; + getRefreshInterval: () => Readonly<{} & { + value: number; + pause: boolean; + }>; + getMinRefreshInterval: () => number; + /** + * Set timefilter refresh interval. + * @param {Object} refreshInterval + * @property {number} time.value Refresh interval in milliseconds. Positive integer + * @property {boolean} time.pause + */ + setRefreshInterval: (refreshInterval: Partial) => void; + /** + * Create a time filter that coerces all time values to absolute time. + * + * This is useful for creating a filter that ensures all ES queries will fetch the exact same data + * and leverages ES query cache for performance improvement. + * + * One use case is keeping different elements embedded in the same UI in sync. + */ + createFilter: (indexPattern: DataView, timeRange?: TimeRange) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter | undefined; + /** + * Create a time filter that converts only absolute time to ISO strings, it leaves relative time + * values unchanged (e.g. "now-1"). + * + * This is useful for sending datemath values to ES endpoints to generate reports over time. + * + * @note Consumers of this function need to ensure that the ES endpoint supports datemath. + */ + createRelativeFilter: (indexPattern: DataView, timeRange?: TimeRange) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter | undefined; + getBounds(): TimeRangeBounds; + calculateBounds(timeRange: TimeRange): TimeRangeBounds; + getActiveBounds(): TimeRangeBounds | undefined; + /** + * Show the time bounds selector part of the time filter + */ + enableTimeRangeSelector: () => void; + /** + * Hide the time bounds selector part of the time filter + */ + disableTimeRangeSelector: () => void; + /** + * Show the auto refresh part of the time filter + */ + enableAutoRefreshSelector: () => void; + /** + * Hide the auto refresh part of the time filter + */ + disableAutoRefreshSelector: () => void; + getTimeDefaults(): TimeRange; + getRefreshIntervalDefaults(): RefreshInterval; +} +export type TimefilterContract = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/timefilter_service.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/timefilter_service.d.ts new file mode 100644 index 0000000000000..795700b20604c --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/timefilter_service.d.ts @@ -0,0 +1,25 @@ +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +import type { TimeHistoryContract, TimefilterContract } from '.'; +import type { NowProviderInternalContract } from '../../now_provider'; +export interface TimeFilterServiceDependencies { + uiSettings: IUiSettingsClient; + storage: IStorageWrapper; + minRefreshInterval: number; +} +/** + * Filter Service + * @internal + */ +export declare class TimefilterService { + private readonly nowProvider; + constructor(nowProvider: NowProviderInternalContract); + setup({ uiSettings, storage, minRefreshInterval, }: TimeFilterServiceDependencies): TimefilterSetup; + start(): void; + stop(): void; +} +/** @public */ +export interface TimefilterSetup { + timefilter: TimefilterContract; + history: TimeHistoryContract; +} diff --git a/src/platform/plugins/shared/data/public/query/timefilter/types.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/types.d.ts new file mode 100644 index 0000000000000..94241ebb013d8 --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/types.d.ts @@ -0,0 +1,13 @@ +import type { Moment } from 'moment'; +import type { TimeRange } from '@kbn/es-query'; +import type { RefreshInterval } from '@kbn/data-service-server'; +export interface TimefilterConfig { + timeDefaults: TimeRange; + refreshIntervalDefaults: RefreshInterval; + minRefreshIntervalDefault: number; +} +export type InputTimeRange = TimeRange | { + from: Moment | string; + to: Moment | string; +}; +export type { TimeRangeBounds } from '../../../common'; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/use_timefilter.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/use_timefilter.d.ts new file mode 100644 index 0000000000000..3e68d0031e53e --- /dev/null +++ b/src/platform/plugins/shared/data/public/query/timefilter/use_timefilter.d.ts @@ -0,0 +1,38 @@ +import type { TimeState } from '@kbn/es-query'; +import type { Observable } from 'rxjs'; +import type { Timefilter } from './timefilter'; +import type { NowProviderInternalContract } from '../../now_provider'; +type TimeStateChange = 'initial' | 'shift' | 'override'; +export interface TimeStateUpdate { + timeState: TimeState; + kind: TimeStateChange; +} +export interface TimefilterHook { + timeState: TimeState; + refresh: () => void; + timeState$: Observable; +} +/** + * Creates a useTimefilter hook that can be used in applications. Here's + * how the hook works: any time fetch$ (from Timefilter) emits, it will + * materialize the input time range (where it converts possibly relative + * time ranges into an absolute time range). This is referred to as the + * TimeState. It's both returned as state, and an observable. It also + * exposes a refresh callback - it will simply refresh the current time + * range. While timeFilter.setTime is memoized, refresh() is not - that + * means that even if the time changes, timeState$ will emit a new + * value. Additionally, the kind of change is included: + * - 'initial' means that this is the first emitted value, based on + * timeFilter.getTime(). + * - 'shift' means that the absolute time has changed. + * - 'override' means that the absolute time did NOT change. + * + * The reason for 'override' is that quite often, consumers will use + * the absolute timestamps (in epoch or ISO) to determine whether + * their state needs to be recalculated (commonly an API request) - but + * these values will not change in this case. Subscribe to state$, and + * check for `kind == 'override'` to determine whether a manual refresh + * is needed. + */ +export declare function createUseTimefilterHook(timefilter: Timefilter, nowProvider: NowProviderInternalContract): () => TimefilterHook; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/aggs/aggs_service.d.ts b/src/platform/plugins/shared/data/public/search/aggs/aggs_service.d.ts new file mode 100644 index 0000000000000..a0828cba19c4c --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/aggs/aggs_service.d.ts @@ -0,0 +1,46 @@ +import type { Subscription } from 'rxjs'; +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { ExpressionsServiceSetup } from '@kbn/expressions-plugin/common'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { AggsCommonStartDependencies } from '../../../common/search/aggs'; +import type { AggsSetup, AggsStart } from './types'; +import type { NowProviderInternalContract } from '../../now_provider'; +/** + * Aggs needs synchronous access to specific uiSettings. Since settings can change + * without a page refresh, we create a cache that subscribes to changes from + * uiSettings.get$ and keeps everything up-to-date. + * + * @internal + */ +export declare function createGetConfig(uiSettings: IUiSettingsClient, requiredSettings: string[], subscriptions: Subscription[]): AggsCommonStartDependencies['getConfig']; +/** @internal */ +export interface AggsSetupDependencies { + uiSettings: IUiSettingsClient; + registerFunction: ExpressionsServiceSetup['registerFunction']; + nowProvider: NowProviderInternalContract; +} +/** @internal */ +export interface AggsStartDependencies { + fieldFormats: FieldFormatsStart; + dataViews: DataViewsContract; +} +/** + * The aggs service provides a means of modeling and manipulating the various + * Elasticsearch aggregations supported by Kibana, providing the ability to + * output the correct DSL when you are ready to send your request to ES. + */ +export declare class AggsService { + private readonly aggsCommonService; + private getConfig?; + private subscriptions; + private nowProvider; + /** + * NowGetter uses window.location, so we must have a separate implementation + * of calculateBounds on the client and the server. + */ + private calculateBounds; + setup({ registerFunction, uiSettings, nowProvider }: AggsSetupDependencies): AggsSetup; + start({ dataViews, fieldFormats }: AggsStartDependencies): AggsStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/data/public/search/aggs/index.d.ts b/src/platform/plugins/shared/data/public/search/aggs/index.d.ts new file mode 100644 index 0000000000000..2229ad24f5da5 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/aggs/index.d.ts @@ -0,0 +1,2 @@ +export * from './aggs_service'; +export type * from './types'; diff --git a/src/platform/plugins/shared/data/public/search/aggs/types.d.ts b/src/platform/plugins/shared/data/public/search/aggs/types.d.ts new file mode 100644 index 0000000000000..10b8423885b59 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/aggs/types.d.ts @@ -0,0 +1,3 @@ +import type { AggsCommonSetup } from '../../../common'; +export type AggsSetup = AggsCommonSetup; +export type { AggsStart } from '../../../common'; diff --git a/src/platform/plugins/shared/data/public/search/collectors/create_usage_collector.d.ts b/src/platform/plugins/shared/data/public/search/collectors/create_usage_collector.d.ts new file mode 100644 index 0000000000000..3d65cf7535ad3 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/collectors/create_usage_collector.d.ts @@ -0,0 +1,4 @@ +import type { StartServicesAccessor } from '@kbn/core/public'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import type { SearchUsageCollector } from './types'; +export declare const createUsageCollector: (getStartServices: StartServicesAccessor, usageCollection?: UsageCollectionSetup) => SearchUsageCollector; diff --git a/src/platform/plugins/shared/data/public/search/collectors/index.d.ts b/src/platform/plugins/shared/data/public/search/collectors/index.d.ts new file mode 100644 index 0000000000000..1a2c8447d39e6 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/collectors/index.d.ts @@ -0,0 +1,3 @@ +export { createUsageCollector } from './create_usage_collector'; +export type { SearchUsageCollector } from './types'; +export { SEARCH_EVENT_TYPE } from './types'; diff --git a/src/platform/plugins/shared/data/public/search/collectors/types.d.ts b/src/platform/plugins/shared/data/public/search/collectors/types.d.ts new file mode 100644 index 0000000000000..eb9b1c43c4411 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/collectors/types.d.ts @@ -0,0 +1,77 @@ +/** + * @internal + */ +export declare enum SEARCH_EVENT_TYPE { + /** + * A search reached the timeout configured in UI setting search:timeout + */ + QUERY_TIMED_OUT = "queryTimedOut", + /** + * The session indicator was automatically brought up because of a long running query + */ + SESSION_INDICATOR_TOUR_LOADING = "sessionIndicatorTourLoading", + /** + * The session indicator was automatically brought up because of a restored session + */ + SESSION_INDICATOR_TOUR_RESTORED = "sessionIndicatorTourRestored", + /** + * The session indicator was disabled because of a completion timeout + */ + SESSION_INDICATOR_SAVE_DISABLED = "sessionIndicatorSaveDisabled", + /** + * The user clicked to continue a session in the background (prior to results completing) + */ + SESSION_SENT_TO_BACKGROUND = "sessionSentToBackground", + /** + * The user clicked to save the session (after results completing) + */ + SESSION_SAVED_RESULTS = "sessionSavedResults", + /** + * The user clicked to view a completed session + */ + SESSION_VIEW_RESTORED = "sessionViewRestored", + /** + * The session was successfully restored upon a user navigating + */ + SESSION_IS_RESTORED = "sessionIsRestored", + /** + * The user clicked to reload an expired/cancelled session + */ + SESSION_RELOADED = "sessionReloaded", + /** + * The user clicked to extend the expiration of a session + */ + SESSION_EXTENDED = "sessionExtended", + /** + * The user clicked to cancel a session + */ + SESSION_CANCELLED = "sessionCancelled", + /** + * The user clicked to delete a session + */ + SESSION_DELETED = "sessionDeleted", + /** + * The user clicked a link to view the list of sessions + */ + SESSION_VIEW_LIST = "sessionViewList", + /** + * The user landed on the sessions management page + */ + SESSIONS_LIST_LOADED = "sessionsListLoaded" +} +export interface SearchUsageCollector { + trackQueryTimedOut: () => Promise; + trackSessionIndicatorTourLoading: () => Promise; + trackSessionIndicatorTourRestored: () => Promise; + trackSessionIndicatorSaveDisabled: () => Promise; + trackSessionSentToBackground: () => Promise; + trackSessionSavedResults: () => Promise; + trackSessionViewRestored: () => Promise; + trackSessionIsRestored: () => Promise; + trackSessionReloaded: () => Promise; + trackSessionExtended: () => Promise; + trackSessionCancelled: () => Promise; + trackSessionDeleted: () => Promise; + trackViewSessionsList: () => Promise; + trackSessionsListLoaded: () => Promise; +} diff --git a/src/platform/plugins/shared/data/public/search/constants.d.ts b/src/platform/plugins/shared/data/public/search/constants.d.ts new file mode 100644 index 0000000000000..3e8deed75e247 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/constants.d.ts @@ -0,0 +1,3 @@ +export declare const EVENT_TYPE_DATA_SEARCH_TIMEOUT = "data_search_timeout"; +export declare const EVENT_PROPERTY_SEARCH_TIMEOUT_MS = "timeout_ms"; +export declare const EVENT_PROPERTY_EXECUTION_CONTEXT = "execution_context"; diff --git a/src/platform/plugins/shared/data/public/search/expressions/eql.d.ts b/src/platform/plugins/shared/data/public/search/expressions/eql.d.ts new file mode 100644 index 0000000000000..521d8cb963187 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/expressions/eql.d.ts @@ -0,0 +1,19 @@ +import type { StartServicesAccessor } from '@kbn/core/public'; +import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; +/** + * This is some glue code that takes in `core.getStartServices`, extracts the dependencies + * needed for this function, and wraps them behind a `getStartDependencies` function that + * is then called at runtime. + * + * We do this so that we can be explicit about exactly which dependencies the function + * requires, without cluttering up the top-level `plugin.ts` with this logic. It also + * makes testing the expression function a bit easier since `getStartDependencies` is + * the only thing you should need to mock. + * + * @param getStartServices - core's StartServicesAccessor for this plugin + * + * @internal + */ +export declare function getEql({ getStartServices, }: { + getStartServices: StartServicesAccessor; +}): import("../../../common").EqlExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/esaggs.d.ts b/src/platform/plugins/shared/data/public/search/expressions/esaggs.d.ts new file mode 100644 index 0000000000000..92c26638fb801 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/expressions/esaggs.d.ts @@ -0,0 +1,35 @@ +import type { StartServicesAccessor } from '@kbn/core/public'; +import type { EsaggsExpressionFunctionDefinition, EsaggsStartDependencies } from '../../../common/search/expressions'; +import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; +/** + * Returns the expression function definition. Any stateful dependencies are accessed + * at runtime via the `getStartDependencies` param, which provides the specific services + * needed for this function to run. + * + * This function is an implementation detail of this module, and is exported separately + * only for testing purposes. + * + * @param getStartDependencies - async function that resolves with EsaggsStartDependencies + * + * @internal + */ +export declare function getFunctionDefinition({ getStartDependencies, }: { + getStartDependencies: () => Promise; +}): () => EsaggsExpressionFunctionDefinition; +/** + * This is some glue code that takes in `core.getStartServices`, extracts the dependencies + * needed for this function, and wraps them behind a `getStartDependencies` function that + * is then called at runtime. + * + * We do this so that we can be explicit about exactly which dependencies the function + * requires, without cluttering up the top-level `plugin.ts` with this logic. It also + * makes testing the expression function a bit easier since `getStartDependencies` is + * the only thing you should need to mock. + * + * @param getStartServices - core's StartServicesAccessor for this plugin + * + * @internal + */ +export declare function getEsaggs({ getStartServices, }: { + getStartServices: StartServicesAccessor; +}): () => EsaggsExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/esdsl.d.ts b/src/platform/plugins/shared/data/public/search/expressions/esdsl.d.ts new file mode 100644 index 0000000000000..1c351f6c277dc --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/expressions/esdsl.d.ts @@ -0,0 +1,19 @@ +import type { StartServicesAccessor } from '@kbn/core/public'; +import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; +/** + * This is some glue code that takes in `core.getStartServices`, extracts the dependencies + * needed for this function, and wraps them behind a `getStartDependencies` function that + * is then called at runtime. + * + * We do this so that we can be explicit about exactly which dependencies the function + * requires, without cluttering up the top-level `plugin.ts` with this logic. It also + * makes testing the expression function a bit easier since `getStartDependencies` is + * the only thing you should need to mock. + * + * @param getStartServices - core's StartServicesAccessor for this plugin + * + * @internal + */ +export declare function getEsdsl({ getStartServices, }: { + getStartServices: StartServicesAccessor; +}): import("../../../common").EsdslExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/esql.d.ts b/src/platform/plugins/shared/data/public/search/expressions/esql.d.ts new file mode 100644 index 0000000000000..afa0cbc865d1c --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/expressions/esql.d.ts @@ -0,0 +1,18 @@ +import type { StartServicesAccessor } from '@kbn/core/public'; +import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; +/** + * This is some glue code that takes in `core.getStartServices`, extracts the dependencies + * needed for this function, and wraps them behind a `getStartDependencies` function that + * is then called at runtime. + * + * We do this so that we can be explicit about exactly which dependencies the function + * requires, without cluttering up the top-level `plugin.ts` with this logic. It also + * makes testing the expression function a bit easier since `getStartDependencies` is + * the only thing you should need to mock. + * + * @param getStartServices - core's StartServicesAccessor for this plugin + * @internal + */ +export declare function getEsql({ getStartServices, }: { + getStartServices: StartServicesAccessor; +}): import("../../../common").EsqlExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/essql.d.ts b/src/platform/plugins/shared/data/public/search/expressions/essql.d.ts new file mode 100644 index 0000000000000..e91df4dede195 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/expressions/essql.d.ts @@ -0,0 +1,18 @@ +import type { StartServicesAccessor } from '@kbn/core/public'; +import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; +/** + * This is some glue code that takes in `core.getStartServices`, extracts the dependencies + * needed for this function, and wraps them behind a `getStartDependencies` function that + * is then called at runtime. + * + * We do this so that we can be explicit about exactly which dependencies the function + * requires, without cluttering up the top-level `plugin.ts` with this logic. It also + * makes testing the expression function a bit easier since `getStartDependencies` is + * the only thing you should need to mock. + * + * @param getStartServices - core's StartServicesAccessor for this plugin + * @internal + */ +export declare function getEssql({ getStartServices, }: { + getStartServices: StartServicesAccessor; +}): import("../../../common/search/expressions/essql").EssqlExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/index.d.ts b/src/platform/plugins/shared/data/public/search/expressions/index.d.ts new file mode 100644 index 0000000000000..348fffda3d4cb --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/expressions/index.d.ts @@ -0,0 +1,6 @@ +export * from './esaggs'; +export * from './esdsl'; +export * from './essql'; +export * from './esql'; +export * from '../../../common/search/expressions'; +export * from './eql'; diff --git a/src/platform/plugins/shared/data/public/search/index.d.ts b/src/platform/plugins/shared/data/public/search/index.d.ts new file mode 100644 index 0000000000000..49572690756af --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/index.d.ts @@ -0,0 +1,9 @@ +export * from './expressions'; +export type { ISearchSetup, ISearchStart, ISearchStartSearchSource, SearchUsageCollector, } from './types'; +export type { EsQuerySortValue, ISearchSource, SearchError, SearchRequest, SearchSourceDependencies, SearchSourceFields, SerializedSearchSourceFields, } from '../../common/search'; +export { ES_SEARCH_STRATEGY, extractReferences as extractSearchSourceReferences, getSearchParamsFromRequest, injectReferences as injectSearchSourceReferences, parseSearchSourceJSON, SearchSource, SortDirection, } from '../../common/search'; +export type { ISessionService, SearchSessionInfoProvider, ISessionsClient, WaitUntilNextSessionCompletesOptions, } from './session'; +export { SessionService, SearchSessionState, SessionsClient, noSearchSessionStorageCapabilityMessage, SEARCH_SESSIONS_MANAGEMENT_ID, waitUntilNextSessionCompletes$, } from './session'; +export type { SearchInterceptorDeps } from './search_interceptor'; +export { SearchInterceptor } from './search_interceptor'; +export { SearchService } from './search_service'; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/create_request_hash.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/create_request_hash.d.ts new file mode 100644 index 0000000000000..50ef1c0159150 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_interceptor/create_request_hash.d.ts @@ -0,0 +1,21 @@ +/** + * Generate the hash for this request. + * + * Ignores the `preference` parameter since it generally won't + * match from one request to another identical request. + * + * (Preference is used to ensure all queries go to the same set of shards and it doesn't need to be hashed + * https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shard-routing.html#shard-and-node-preference) + */ +declare function createRequestHash(keys: Record): string; +/** + * Generates the hash used as a key in the client-side request cache. + */ +export declare const createRequestHashForClientCache: typeof createRequestHash; +/** + * Generates the hash for associating requests with background searches stored on the server. + * + * Ignores sessionId for compatibility with background searches created before https://github.com/elastic/kibana/pull/237191 + */ +export declare const createRequestHashForBackgroundSearches: (keys: Record) => string; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/index.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/index.d.ts new file mode 100644 index 0000000000000..df8cb7c375f87 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_interceptor/index.d.ts @@ -0,0 +1,2 @@ +export type { ISearchInterceptor, SearchInterceptorDeps } from './search_interceptor'; +export { SearchInterceptor } from './search_interceptor'; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/search_abort_controller.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/search_abort_controller.d.ts new file mode 100644 index 0000000000000..1802f10cd466e --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_interceptor/search_abort_controller.d.ts @@ -0,0 +1,15 @@ +import { AbortReason } from '@kbn/kibana-utils-plugin/common'; +export declare class SearchAbortController { + private inputAbortSignals; + private abortController; + private timeoutSub?; + private destroyed; + constructor(timeout?: number); + private abortHandler; + cleanup(): void; + addAbortSignal(inputSignal: AbortSignal): void; + getSignal(): AbortSignal; + abort(reason?: AbortReason): void; + isTimeout(): boolean; + isCanceled(): boolean; +} diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.d.ts new file mode 100644 index 0000000000000..cd40ff5442dd2 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.d.ts @@ -0,0 +1,84 @@ +import type { Observable } from 'rxjs'; +import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { HttpSetup } from '@kbn/core-http-browser'; +import type { CoreStart, ExecutionContextSetup, IUiSettingsClient, ToastsSetup } from '@kbn/core/public'; +import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/search-types'; +import type { ICPSManager } from '@kbn/cps-utils'; +import type { IAsyncSearchOptions } from '../../../common'; +import type { SearchUsageCollector } from '../collectors'; +import type { ISessionService } from '../session'; +import type { SearchConfigSchema } from '../../../server/config'; +export interface SearchInterceptorDeps { + http: HttpSetup; + executionContext: ExecutionContextSetup; + uiSettings: IUiSettingsClient; + startServices: Promise<[CoreStart, object, unknown]>; + toasts: ToastsSetup; + usageCollector?: SearchUsageCollector; + session: ISessionService; + searchConfig: SearchConfigSchema; + getCPSManager?: () => ICPSManager | undefined; +} +export declare class SearchInterceptor { + private readonly deps; + private uiSettingsSubs; + private searchTimeout; + private readonly responseCache; + private protocolSupportsMultiplexing; + private performanceObserver?; + /** + * Observable that emits when the number of pending requests changes. + * @internal + */ + private pendingCount$; + /** + * @internal + */ + private application; + private docLinks; + private inspector; + private startRenderServices; + constructor(deps: SearchInterceptorDeps); + stop(): void; + private getTimeoutMode; + private createRequestHash$; + private handleSearchError; + private getSerializableOptions; + /** + * @internal + * Creates a new pollSearch that share replays its results + */ + private runSearch$; + /** + * @internal + * @throws `AbortError` | `ErrorLike` + */ + private runSearch; + /** + * @internal + * Creates a new search observable and a corresponding search abort controller + * If requestHash is defined, tries to return them first from cache. + */ + private getSearchResponse$; + /** + * Searches using the given `search` method. Overrides the `AbortSignal` with one that will abort + * either when the request times out, or when the original `AbortSignal` is aborted. Updates + * `pendingCount$` when the request is started/finalized. + * + * @param request + * @options + * @returns `Observable` emitting the search response or an error. + */ + search({ id, ...request }: IKibanaSearchRequest, options?: IAsyncSearchOptions): Observable>; + private showTimeoutErrorToast; + private showTimeoutErrorMemoized; + private showRestoreWarningToast; + private showRestoreWarning; + /** + * Show one error notification per session. + * @internal + */ + private showTimeoutError; + showError(e: Error): void; +} +export type ISearchInterceptor = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/search_response_cache.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/search_response_cache.d.ts new file mode 100644 index 0000000000000..fd24a465a8b52 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_interceptor/search_response_cache.d.ts @@ -0,0 +1,30 @@ +import type { Observable } from 'rxjs'; +import type { IKibanaSearchResponse } from '@kbn/search-types'; +import type { SearchAbortController } from './search_abort_controller'; +interface ResponseCacheItem { + response$: Observable; + searchAbortController: SearchAbortController; +} +export declare class SearchResponseCache { + private maxItems; + private maxCacheSizeMB; + private responseCache; + private cacheSize; + constructor(maxItems: number, maxCacheSizeMB: number); + private byteToMb; + private deleteItem; + private setItem; + clear(): void; + private shrink; + has(key: string): boolean; + /** + * + * @param key key to cache + * @param response$ + * @returns A ReplaySubject that mimics the behavior of the original observable + * @throws error if key already exists + */ + set(key: string, item: ResponseCacheItem): void; + get(key: string): ResponseCacheItem | undefined; +} +export {}; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/search_session_incomplete_warning.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/search_session_incomplete_warning.d.ts new file mode 100644 index 0000000000000..ef3d72302e1ad --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_interceptor/search_session_incomplete_warning.d.ts @@ -0,0 +1,3 @@ +import type { DocLinksStart } from '@kbn/core/public'; +import React from 'react'; +export declare const SearchSessionIncompleteWarning: (docLinks: DocLinksStart) => React.JSX.Element; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/timeout_error.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/timeout_error.d.ts new file mode 100644 index 0000000000000..9f4feb65663ec --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_interceptor/timeout_error.d.ts @@ -0,0 +1,19 @@ +import React from 'react'; +import type { ApplicationStart } from '@kbn/core/public'; +import { KbnError } from '@kbn/kibana-utils-plugin/common'; +export declare enum TimeoutErrorMode { + CONTACT = 0, + CHANGE = 1 +} +/** + * Request Failure - When an entire multi request fails + * @param {Error} err - the Error that came back + */ +export declare class SearchTimeoutError extends KbnError { + mode: TimeoutErrorMode; + constructor(err: Record, mode: TimeoutErrorMode); + private getMessage; + private getActionText; + private onClick; + getErrorMessage(application: ApplicationStart): React.JSX.Element; +} diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/to_partial_response.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/to_partial_response.d.ts new file mode 100644 index 0000000000000..ab942866e0215 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_interceptor/to_partial_response.d.ts @@ -0,0 +1,8 @@ +import type { IEsSearchResponse } from '@kbn/search-types'; +/** + * When we hit the advanced setting `search:timeout`, we cancel in-progress search requests. This method takes the + * active raw response from ES (status: "running") and returns a request in the format expected by our helper utilities + * (status: "partial") that display cluster info, warnings, & errors. + * @param response The raw ES response + */ +export declare function toPartialResponseAfterTimeout(response: IEsSearchResponse): IEsSearchResponse; diff --git a/src/platform/plugins/shared/data/public/search/search_service.d.ts b/src/platform/plugins/shared/data/public/search/search_service.d.ts new file mode 100644 index 0000000000000..89fc5121f354b --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/search_service.d.ts @@ -0,0 +1,46 @@ +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { CPSPluginStart } from '@kbn/cps/public'; +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { ExpressionsSetup } from '@kbn/expressions-plugin/public'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { ManagementSetup } from '@kbn/management-plugin/public'; +import type { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import type { Start as InspectorStartContract } from '@kbn/inspector-plugin/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { ConfigSchema } from '../../server/config'; +import type { NowProviderInternalContract } from '../now_provider'; +import type { ISearchSetup, ISearchStart } from './types'; +/** @internal */ +export interface SearchServiceSetupDependencies { + expressions: ExpressionsSetup; + usageCollection?: UsageCollectionSetup; + management: ManagementSetup; + nowProvider: NowProviderInternalContract; +} +/** @internal */ +export interface SearchServiceStartDependencies { + fieldFormats: FieldFormatsStart; + dataViews: DataViewsContract; + inspector: InspectorStartContract; + screenshotMode: ScreenshotModePluginStart; + share: SharePluginStart; + scriptedFieldsEnabled: boolean; + cps?: CPSPluginStart; +} +export declare class SearchService implements Plugin { + private initializerContext; + private readonly aggsService; + private readonly searchSourceService; + private searchInterceptor; + private usageCollector?; + private sessionService; + private sessionsClient; + private backgroundSearchNotifier; + private searchSessionEBTManager; + private cpsManager?; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup, { expressions, usageCollection, nowProvider, management }: SearchServiceSetupDependencies): ISearchSetup; + start(coreStart: CoreStart, { fieldFormats, dataViews, inspector, scriptedFieldsEnabled, share, cps, }: SearchServiceStartDependencies): ISearchStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/data/public/search/session/background_search_notifier.d.ts b/src/platform/plugins/shared/data/public/search/session/background_search_notifier.d.ts new file mode 100644 index 0000000000000..3b9951bf3de45 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/background_search_notifier.d.ts @@ -0,0 +1,17 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { ISessionsClient } from '../..'; +import type { LocatorsStart } from './sessions_mgmt/types'; +export declare class BackgroundSearchNotifier { + private sessionsClient; + private core; + private locators; + private pollingSubscription?; + constructor(sessionsClient: ISessionsClient, core: CoreStart, locators: LocatorsStart); + startPolling(interval: number): void; + stopPolling(): void; + private groupSessions; + private updateSessions; + private buildNotificationInfo; + private getDefaultSessionName; + private showNotifications; +} diff --git a/src/platform/plugins/shared/data/public/search/session/constants.d.ts b/src/platform/plugins/shared/data/public/search/session/constants.d.ts new file mode 100644 index 0000000000000..53484e2638666 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/constants.d.ts @@ -0,0 +1,2 @@ +export declare const SEARCH_SESSIONS_MANAGEMENT_ID = "search_sessions"; +export declare const BACKGROUND_SESSION_POLLING_INTERVAL = 5000; diff --git a/src/platform/plugins/shared/data/public/search/session/ebt_manager/constants.d.ts b/src/platform/plugins/shared/data/public/search/session/ebt_manager/constants.d.ts new file mode 100644 index 0000000000000..4376a9f4c88e7 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/ebt_manager/constants.d.ts @@ -0,0 +1,4 @@ +export declare const BG_SEARCH_START = "bg_search_start"; +export declare const BG_SEARCH_CANCEL = "bg_search_cancel"; +export declare const BG_SEARCH_OPEN = "bg_search_open"; +export declare const BG_SEARCH_LIST_VIEW = "bg_search_list_view"; diff --git a/src/platform/plugins/shared/data/public/search/session/ebt_manager/index.d.ts b/src/platform/plugins/shared/data/public/search/session/ebt_manager/index.d.ts new file mode 100644 index 0000000000000..47be97b452333 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/ebt_manager/index.d.ts @@ -0,0 +1,3 @@ +export type { ISearchSessionEBTManager } from './search_session_ebt_manager'; +export { SearchSessionEBTManager } from './search_session_ebt_manager'; +export { registerSearchSessionEBTManagerAnalytics } from './search_session_ebt_manager_registrations'; diff --git a/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager.d.ts b/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager.d.ts new file mode 100644 index 0000000000000..f711bb3c30c4c --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager.d.ts @@ -0,0 +1,30 @@ +import type { CoreSetup } from '@kbn/core/public'; +import type { PublicContract } from '@kbn/utility-types'; +import type { Logger } from '@kbn/logging'; +import type { SearchSessionSavedObject } from '../sessions_client'; +import type { UISession } from '../sessions_mgmt/types'; +export type ISearchSessionEBTManager = PublicContract; +export declare class SearchSessionEBTManager { + private reportEventCore; + private logger; + constructor({ core, logger }: { + core: CoreSetup; + logger: Logger; + }); + private reportEvent; + trackBgsStarted({ entryPoint, session, }: { + entryPoint: string; + session: SearchSessionSavedObject; + }): void; + trackBgsCancelled({ session, cancelSource, }: { + session: SearchSessionSavedObject; + cancelSource: string; + }): void; + trackBgsOpened({ session, resumeSource }: { + session: UISession; + resumeSource: string; + }): void; + trackBgsListView({ entryPoint }: { + entryPoint: string; + }): void; +} diff --git a/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager_registrations.d.ts b/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager_registrations.d.ts new file mode 100644 index 0000000000000..e51cb99dd6cb4 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager_registrations.d.ts @@ -0,0 +1,2 @@ +import type { CoreSetup } from '@kbn/core/public'; +export declare const registerSearchSessionEBTManagerAnalytics: (core: CoreSetup) => void; diff --git a/src/platform/plugins/shared/data/public/search/session/get_session_redirect_url.d.ts b/src/platform/plugins/shared/data/public/search/session/get_session_redirect_url.d.ts new file mode 100644 index 0000000000000..86c6d068fb1b7 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/get_session_redirect_url.d.ts @@ -0,0 +1,16 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { LocatorsStart } from './sessions_mgmt/types'; +interface GetRedirectUrlFromStateParams { + locators: LocatorsStart; + locatorId?: string; + state?: SerializableRecord; +} +export declare const getRedirectUrlFromState: ({ locators, locatorId, state, }: GetRedirectUrlFromStateParams) => string | undefined; +interface GetRestoreUrlParams { + locators: LocatorsStart; + locatorId?: string; + restoreState?: SerializableRecord; + sessionName?: string; +} +export declare const getRestoreUrl: ({ locators, locatorId, restoreState, sessionName, }: GetRestoreUrlParams) => string | undefined; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/i18n.d.ts b/src/platform/plugins/shared/data/public/search/session/i18n.d.ts new file mode 100644 index 0000000000000..bb1e793037555 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/i18n.d.ts @@ -0,0 +1,5 @@ +/** + * Message to display in case storing + * session session is disabled due to turned off capability + */ +export declare const noSearchSessionStorageCapabilityMessage: string; diff --git a/src/platform/plugins/shared/data/public/search/session/in_progress_session.d.ts b/src/platform/plugins/shared/data/public/search/session/in_progress_session.d.ts new file mode 100644 index 0000000000000..8e7d3e47995b5 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/in_progress_session.d.ts @@ -0,0 +1,4 @@ +export declare const IN_PROGRESS_SESSION_PREFIX = "in-progress-background-search"; +export declare function getInProgressSessionIds(): string[]; +export declare function addInProgressSessionId(sessionId: string): void; +export declare function setInProgressSessionIds(sessionIds: string[]): void; diff --git a/src/platform/plugins/shared/data/public/search/session/index.d.ts b/src/platform/plugins/shared/data/public/search/session/index.d.ts new file mode 100644 index 0000000000000..b14372c49aabd --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/index.d.ts @@ -0,0 +1,10 @@ +export type { ISessionService, SearchSessionInfoProvider } from './session_service'; +export { SessionService } from './session_service'; +export { SearchSessionState } from './search_session_state'; +export type { ISessionsClient } from './sessions_client'; +export { SessionsClient } from './sessions_client'; +export { noSearchSessionStorageCapabilityMessage } from './i18n'; +export { SEARCH_SESSIONS_MANAGEMENT_ID } from './constants'; +export type { WaitUntilNextSessionCompletesOptions } from './session_helpers'; +export { waitUntilNextSessionCompletes$ } from './session_helpers'; +export * from './ebt_manager'; diff --git a/src/platform/plugins/shared/data/public/search/session/lib/session_name_formatter.d.ts b/src/platform/plugins/shared/data/public/search/session/lib/session_name_formatter.d.ts new file mode 100644 index 0000000000000..d2f402af704d4 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/lib/session_name_formatter.d.ts @@ -0,0 +1,4 @@ +export declare function formatSessionName(sessionName: string, opts: { + sessionStartTime?: Date; + appendStartTime?: boolean; +}): string; diff --git a/src/platform/plugins/shared/data/public/search/session/search_session_state.d.ts b/src/platform/plugins/shared/data/public/search/session/search_session_state.d.ts new file mode 100644 index 0000000000000..1bff2ace5c280 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/search_session_state.d.ts @@ -0,0 +1,167 @@ +import type { Observable } from 'rxjs'; +import type { StateContainer } from '@kbn/kibana-utils-plugin/public'; +import type { SearchSessionSavedObject } from './sessions_client'; +/** + * Possible state that current session can be in + * + * @public + */ +export declare enum SearchSessionState { + /** + * Session is not active, e.g. didn't start + */ + None = "none", + /** + * Pending search request has not been sent to the background yet + */ + Loading = "loading", + /** + * No action was taken and the page completed loading without search session creation. + */ + Completed = "completed", + /** + * Search session was sent to the background. + * The page is loading in background. + */ + BackgroundLoading = "backgroundLoading", + /** + * Page load completed with search session created. + */ + BackgroundCompleted = "backgroundCompleted", + /** + * Revisiting the page after background completion + */ + Restored = "restored", + /** + * Current session requests where explicitly canceled by user + * Displaying none or partial results + */ + Canceled = "canceled" +} +/** + * State of the tracked search + */ +export declare enum TrackedSearchState { + InProgress = "inProgress", + Completed = "completed", + Errored = "errored" +} +export interface TrackedSearch { + state: TrackedSearchState; + searchDescriptor: SearchDescriptor; + searchMeta: SearchMeta; +} +/** + * Internal state of SessionService + * {@link SearchSessionState} is inferred from this state + * + * @internal + */ +export interface SessionStateInternal { + /** + * Current session Id + * Empty means there is no current active session. + */ + sessionId?: string; + /** + * App that created this session + */ + appName?: string; + /** + * Is the session in the process of being saved? + */ + isSaving: boolean; + /** + * Has the session already been stored (i.e. "sent to background")? + */ + isStored: boolean; + /** + * Saved object of a current search session + */ + searchSessionSavedObject?: SearchSessionSavedObject; + /** + * Is this session a restored session (have these requests already been made, and we're just + * looking to re-use the previous search IDs)? + */ + isRestore: boolean; + /** + * Set of all searches within a session and any info associated with them + */ + trackedSearches: Array>; + /** + * There was at least a single search in this session + */ + isStarted: boolean; + /** + * If user has explicitly canceled search requests + */ + isCanceled: boolean; + /** + * If session was continued from a different app, + * If session continued from a different app, then it is very likely that `trackedSearches` + * doesn't have all the search that were included into the session. + * Session that was continued can't be saved because we can't guarantee all the searches saved. + * This limitation should be fixed in https://github.com/elastic/kibana/issues/121543 + * + * @deprecated - https://github.com/elastic/kibana/issues/121543 + */ + isContinued: boolean; + /** + * Start time of the current session (from browser perspective) + */ + startTime?: Date; + /** + * Time when all the searches from the current session are completed (from browser perspective) + */ + completedTime?: Date; + /** + * Time when the session was canceled by user, by hitting "stop" + */ + canceledTime?: Date; +} +export interface SessionPureTransitions> { + start: (state: S) => ({ appName }: { + appName: string; + }) => S; + restore: (state: S) => (sessionId: string) => S; + clear: (state: S) => () => S; + save: (state: S) => () => S; + store: (state: S) => (searchSessionSavedObject: SearchSessionSavedObject) => S; + trackSearch: (state: S) => (search: SearchDescriptor, meta?: SearchMeta) => S; + removeSearch: (state: S) => (search: SearchDescriptor) => S; + completeSearch: (state: S) => (search: SearchDescriptor) => S; + errorSearch: (state: S) => (search: SearchDescriptor) => S; + updateSearchMeta: (state: S) => (search: SearchDescriptor, meta: Partial) => S; + cancel: (state: S) => () => S; + setSearchSessionSavedObject: (state: S) => (searchSessionSavedObject: SearchSessionSavedObject) => S; +} +export declare const sessionPureTransitions: SessionPureTransitions; +/** + * Consolidate meta info about current seach session + * Contains both deferred properties and plain properties from state + */ +export interface SessionMeta { + state: SearchSessionState; + name?: string; + startTime?: Date; + canceledTime?: Date; + completedTime?: Date; + /** + * @deprecated - see remarks in {@link SessionStateInternal} + */ + isContinued: boolean; +} +export interface SessionPureSelectors> { + getState: (state: S) => () => SearchSessionState; + getMeta: (state: S) => () => SessionMeta; + getSearch: (state: S) => (search: SearchDescriptor) => TrackedSearch | null; +} +export declare const sessionPureSelectors: SessionPureSelectors; +export type SessionStateContainer = StateContainer, SessionPureTransitions, SessionPureSelectors>; +export declare const createSessionStateContainer: ({ freeze }?: { + freeze: boolean; +}) => { + stateContainer: SessionStateContainer; + sessionState$: Observable; + sessionMeta$: Observable; +}; diff --git a/src/platform/plugins/shared/data/public/search/session/session_helpers.d.ts b/src/platform/plugins/shared/data/public/search/session/session_helpers.d.ts new file mode 100644 index 0000000000000..6ee104fc37d76 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/session_helpers.d.ts @@ -0,0 +1,19 @@ +import type { ISessionService } from './session_service'; +import { SearchSessionState } from './search_session_state'; +/** + * Options for {@link waitUntilNextSessionCompletes$} + */ +export interface WaitUntilNextSessionCompletesOptions { + /** + * For how long to wait between session state transitions before considering that session completed + */ + waitForIdle?: number; +} +/** + * Creates an observable that emits when next search session completes. + * This utility is helpful to use in the application to delay some tasks until next session completes. + * + * @param sessionService - {@link ISessionService} + * @param opts - {@link WaitUntilNextSessionCompletesOptions} + */ +export declare function waitUntilNextSessionCompletes$(sessionService: ISessionService, { waitForIdle }?: WaitUntilNextSessionCompletesOptions): import("rxjs").Observable; diff --git a/src/platform/plugins/shared/data/public/search/session/session_service.d.ts b/src/platform/plugins/shared/data/public/search/session/session_service.d.ts new file mode 100644 index 0000000000000..df14a7e05aa22 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/session_service.d.ts @@ -0,0 +1,243 @@ +import type { PublicContract, SerializableRecord } from '@kbn/utility-types'; +import { type Observable } from 'rxjs'; +import type { PluginInitializerContext, StartServicesAccessor } from '@kbn/core/public'; +import type { IKibanaSearchResponse, ISearchOptions } from '@kbn/search-types'; +import { AbortReason } from '@kbn/kibana-utils-plugin/common'; +import type { ConfigSchema } from '../../../server/config'; +import type { SessionMeta, SessionStateContainer } from './search_session_state'; +import { SearchSessionState } from './search_session_state'; +import type { ISessionsClient } from './sessions_client'; +import type { NowProviderInternalContract } from '../../now_provider'; +import type { ISearchSessionEBTManager } from './ebt_manager'; +export type ISessionService = PublicContract; +interface TrackSearchDescriptor { + /** + * Cancel the search + */ + abort: (reason: AbortReason) => void; + /** + * Used for polling after running in background (to ensure the search makes it into the background search saved + * object) and also to keep the search alive while other search requests in the session are still in progress + * @param abortSignal - signal that can be used to cancel the polling - otherwise the `searchAbortController.getSignal()` is used + */ + poll: (abortSignal?: AbortSignal) => Promise; + /** + * Notify search that session is being saved, could be used to restart the search with different params + * @deprecated - this is used as an escape hatch for TSVB/Timelion to restart a search with different params + */ + onSavingSession?: (options: Required>) => Promise; +} +interface TrackSearchMeta { + /** + * Time that indicates when last time this search was polled + */ + lastPollingTime: Date; + /** + * If the keep_alive of this search was extended up to saved session keep_alive + */ + isStored: boolean; +} +/** + * Api to manage tracked search + */ +interface TrackSearchHandler { + /** + * Transition search into "complete" status + */ + complete(response?: IKibanaSearchResponse): void; + /** + * Transition search into "error" status + */ + error(error?: Error): void; + /** + * Call to notify when search is about to be polled to get current search state to build `searchOptions` from (mainly isSearchStored), + * When poll completes or errors, call `afterPoll` callback and confirm is search was successfully stored + */ + beforePoll(): [ + currentSearchState: { + isSearchStored: boolean; + }, + afterPoll: (newSearchState: { + isSearchStored: boolean; + }) => void + ]; +} +/** + * Represents a search session state in {@link SessionService} in any given moment of time + */ +export type SessionSnapshot = SessionStateContainer; +/** + * Provide info about current search session to be stored in the Search Session saved object + */ +export interface SearchSessionInfoProvider

{ + /** + * User-facing name of the session. + * e.g. will be displayed in saved Search Sessions management list + */ + getName: () => Promise; + /** + * Append session start time to a session name, + * `true` by default + */ + appendSessionStartTimeToName?: boolean; + getLocatorData: () => Promise<{ + id: string; + initialState: P; + restoreState: P; + }>; +} +/** + * Configure a "Background search indicator" UI + */ +interface SearchSessionIndicatorUiConfig { + /** + * App controls if "Search session indicator" UI should be disabled. + * reasonText will appear in a tooltip. + * + * Could be used, for example, to disable "Search session indicator" UI + * in case user doesn't have permissions to store a search session + */ + isDisabled: () => { + disabled: true; + reasonText: string; + } | { + disabled: false; + }; +} +/** + * Responsible for tracking a current search session. Supports a single session at a time. + */ +export declare class SessionService { + private readonly sessionsClient; + private readonly nowProvider; + readonly state$: Observable; + private readonly state; + readonly sessionMeta$: Observable; + private searchSessionInfoProvider?; + private searchSessionIndicatorUiConfig?; + private subscription; + private currentApp?; + private hasAccessToSearchSessions; + private toastService?; + private searchSessionEBTManager?; + private sessionSnapshots; + private logger; + constructor(initializerContext: PluginInitializerContext, getStartServices: StartServicesAccessor, searchSessionEBTManager: ISearchSessionEBTManager, sessionsClient: ISessionsClient, nowProvider: NowProviderInternalContract, { freezeState }?: { + freezeState: boolean; + }); + /** + * If user has access to search sessions + * This resolves to `true` in case at least one app allows user to create search session + * In this case search session management is available + */ + hasAccess(): boolean; + /** + * Used to track searches within current session + * + * @param searchDescriptor - uniq object that will be used to as search identifier + * @returns {@link TrackSearchHandler} + */ + trackSearch(searchDescriptor: TrackSearchDescriptor): TrackSearchHandler; + destroy(): void; + /** + * Get current session id + */ + getSessionId(): string | undefined; + /** + * Get observable for current session id + */ + getSession$(): Observable; + /** + * Is current session in process of saving + */ + isSaving(state?: SessionStateContainer): boolean; + /** + * Is current session already saved as SO (send to background) + */ + isStored(state?: SessionStateContainer): boolean; + /** + * Is restoring the older saved searches + */ + isRestore(state?: SessionStateContainer): boolean; + /** + * Start a new search session + * @returns sessionId + */ + start(): string; + /** + * Restore previously saved search session + * @param sessionId + */ + restore(sessionId: string): Promise; + /** + * Continue previous search session + * Can be used to restore all the information of a previous search session after a new one has been started. It is useful + * to continue a session in different apps or across different discover tabs. + * + * This is different from {@link restore} as it reuses search session state and search results held in client memory instead of restoring search results from elasticsearch + * @param sessionId + * @param keepSearches indicates if restoring the session also restores the tracked searches or starts with an empty tracking list + */ + continue(sessionId: string, keepSearches?: boolean): void; + /** + * Resets the current search session state. + * Can be used to reset to a default state without clearing initialization info, such as when switching between discover tabs. + * + * This is different from {@link clear} as it does not reset initialization info set through {@link enableStorage}. + */ + reset(): void; + private storeSessionSnapshot; + /** + * Cleans up current state + */ + clear(): void; + /** + * Request a cancellation of on-going search requests within current session + */ + cancel({ source }: { + source: string; + }): Promise; + /** + * Save current session as SO to get back to results later + * (Send to background) + */ + save(trackingProps: { + entryPoint: string; + }): Promise; + /** + * Change user-facing name of a current session + * Doesn't throw in case of API error but presents a notification toast instead + * @param newName - new session name + */ + renameCurrentSession(newName: string): Promise; + /** + * Checks if passed sessionId is a current sessionId + * @param sessionId + */ + isCurrentSession(sessionId?: string): boolean; + /** + * Infers search session options for sessionId using current session state + * + * In case user doesn't has access to `search-session` SO returns null, + * meaning that sessionId and other session parameters shouldn't be used when doing searches + * + * @param sessionId + */ + getSearchOptions(sessionId?: string): Required> | null; + /** + * Provide an info about current session which is needed for storing a search session. + * To opt-into "Search session indicator" UI app has to call {@link enableStorage}. + * + * @param searchSessionInfoProvider - info provider for saving a search session + * @param searchSessionIndicatorUiConfig - config for "Search session indicator" UI + */ + enableStorage

(searchSessionInfoProvider: SearchSessionInfoProvider

{ + /** + * Function which reports telemetry information. This function is essentially + * a "reducer" - it receives the existing "stats" object and returns an + * updated version of the "stats" object. + * + * @param state The persistable state serializable state object. + * @param stats Stats object containing the stats which were already + * collected. This `stats` object shall not be mutated in-line. + * @returns A new stats object augmented with new telemetry information. + */ + telemetry: (state: P, stats: Record) => Record; + /** + * A function which receives state and a list of references and should return + * back the state with references injected. The default is an identity + * function. + * + * @param state The persistable state serializable state object. + * @param references List of saved object references. + * @returns Persistable state object with references injected. + */ + inject: (state: P, references: SavedObjectReference[]) => P; + /** + * A function which receives state and should return the state with references + * extracted and an array of the extracted references. The default case could + * simply return the same state with an empty array of references. + * + * @param state The persistable state serializable state object. + * @returns Persistable state object with references extracted and a list of + * references. + */ + extract: (state: P) => { + state: P; + references: SavedObjectReference[]; + }; + /** + * A list of migration functions, which migrate the persistable state + * serializable object to the next version. Migration functions should be + * keyed using semver, where the version indicates which version the state + * will be migrated to. + */ + migrations: MigrateFunctionsObject | GetMigrationFunctionObjectFn; +} +export type GetMigrationFunctionObjectFn = () => MigrateFunctionsObject; +/** + * Collection of migrations that a given type of persistable state object has + * accumulated over time. Migration functions are keyed using semver version + * of Kibana releases. + */ +export type MigrateFunctionsObject = { + [semver: string]: MigrateFunction; +}; +export type MigrateFunction = (state: FromVersion) => ToVersion; +/** + * migrate function runs the specified migration + * @param state + * @param version + */ +export type PersistableStateMigrateFn = (state: SerializableRecord, version: string) => SerializableRecord; +export type PersistableStateDefinition

= Partial>; +/** + * @todo Add description. + */ +export interface PersistableStateService

{ + /** + * Function which reports telemetry information. This function is essentially + * a "reducer" - it receives the existing "stats" object and returns an + * updated version of the "stats" object. + * + * @param state The persistable state serializable state object. + * @param stats Stats object containing the stats which were already + * collected. This `stats` object shall not be mutated in-line. + * @returns A new stats object augmented with new telemetry information. + */ + telemetry(state: P, collector: Record): Record; + /** + * A function which receives state and a list of references and should return + * back the state with references injected. The default is an identity + * function. + * + * @param state The persistable state serializable state object. + * @param references List of saved object references. + * @returns Persistable state object with references injected. + */ + inject(state: P, references: SavedObjectReference[]): P; + /** + * A function which receives state and should return the state with references + * extracted and an array of the extracted references. The default case could + * simply return the same state with an empty array of references. + * + * @param state The persistable state serializable state object. + * @returns Persistable state object with references extracted and a list of + * references. + */ + extract(state: P): { + state: P; + references: SavedObjectReference[]; + }; + /** + * A function which receives the state of an older object and version and + * should migrate the state of the object to the latest possible version using + * the `.migrations` dictionary provided on a {@link PersistableState} item. + * + * @param state The persistable state serializable state object. + * @param version Current semver version of the `state`. + * @returns A serializable state object migrated to the latest state. + */ + migrateToLatest?: (state: VersionedState

) => P; + /** + * returns all registered migrations + */ + getAllMigrations: () => MigrateFunctionsObject; +} diff --git a/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container.d.ts new file mode 100644 index 0000000000000..9fac937be7005 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container.d.ts @@ -0,0 +1,47 @@ +import type { ReduxLikeStateContainer, BaseState } from './types'; +export declare const defaultFreeze: (value: T) => T; +/** + * State container options + * @public + */ +export interface CreateStateContainerOptions { + /** + * Function to use when freezing state. Supply identity function. + * If not provided, default `deepFreeze` is used. + * + * @example + * If you expect that your state will be mutated externally an you cannot + * prevent that + * ```ts + * { + * freeze: state => state, + * } + * ``` + */ + freeze?: (state: T) => T; +} +/** + * Creates a state container without transitions and without selectors. + * @param defaultState - initial state + * @typeParam State - shape of state + * @public + */ +export declare function createStateContainer(defaultState: State): ReduxLikeStateContainer; +/** + * Creates a state container with transitions, but without selectors. + * @param defaultState - initial state + * @param pureTransitions - state transitions configuration object. Map of {@link PureTransition}. + * @typeParam State - shape of state + * @public + */ +export declare function createStateContainer(defaultState: State, pureTransitions: PureTransitions): ReduxLikeStateContainer; +/** + * Creates a state container with transitions and selectors. + * @param defaultState - initial state + * @param pureTransitions - state transitions configuration object. Map of {@link PureTransition}. + * @param pureSelectors - state selectors configuration object. Map of {@link PureSelectors}. + * @param options - state container options {@link CreateStateContainerOptions} + * @typeParam State - shape of state + * @public + */ +export declare function createStateContainer(defaultState: State, pureTransitions: PureTransitions, pureSelectors: PureSelectors, options?: CreateStateContainerOptions): ReduxLikeStateContainer; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container_react_helpers.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container_react_helpers.d.ts new file mode 100644 index 0000000000000..6bf07dbed85bb --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container_react_helpers.d.ts @@ -0,0 +1,38 @@ +import React from 'react'; +import type { Comparator, Connect, StateContainer, UnboxState } from './types'; +/** + * React hooks that returns the latest state of a {@link StateContainer}. + * + * @param container - {@link StateContainer} which state to track. + * @returns - latest {@link StateContainer} state + * @public + */ +export declare const useContainerState: >(container: Container) => UnboxState; +/** + * React hook to apply selector to state container to extract only needed information. Will + * re-render your component only when the section changes. + * + * @param container - {@link StateContainer} which state to track. + * @param selector - Function used to pick parts of state. + * @param comparator - {@link Comparator} function used to memoize previous result, to not + * re-render React component if state did not change. By default uses + * `fast-deep-equal` package. + * @returns - result of a selector(state) + * @public + */ +export declare const useContainerSelector: , Result>(container: Container, selector: (state: UnboxState) => Result, comparator?: Comparator) => Result; +/** + * Creates helpers for using {@link StateContainer | State Containers} with react + * Refer to {@link https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/kibana_utils/docs/state_containers/react.md | guide} for details + * @public + */ +export declare const createStateContainerReactHelpers: >() => { + Provider: React.Provider; + Consumer: React.Consumer; + context: React.Context; + useContainer: () => Container; + useState: () => UnboxState; + useTransitions: () => Container["transitions"]; + useSelector: (selector: (state: UnboxState) => Result, comparator?: Comparator) => Result; + connect: Connect>; +}; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_containers/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_containers/index.d.ts new file mode 100644 index 0000000000000..fd0fc1efbf2b8 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_containers/index.d.ts @@ -0,0 +1,10 @@ +/** + * State containers are Redux-store-like objects meant to help you manage state in your services or apps. + * Refer to {@link https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/kibana_utils/docs/state_containers | guides and examples} for more info + * + * @packageDocumentation + */ +export type { BaseState, BaseStateContainer, StateContainer, ReduxLikeStateContainer, Dispatch, Middleware, Selector, Comparator, MapStateToProps, Connect, Reducer, UnboxState, PureSelectorToSelector, PureSelectorsToSelectors, EnsurePureSelector, PureTransitionsToTransitions, PureTransitionToTransition, EnsurePureTransition, PureSelector, PureTransition, Transition, TransitionDescription, } from './types'; +export type { CreateStateContainerOptions } from './create_state_container'; +export { createStateContainer, defaultFreeze } from './create_state_container'; +export { createStateContainerReactHelpers, useContainerSelector, useContainerState, } from './create_state_container_react_helpers'; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_containers/types.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_containers/types.d.ts new file mode 100644 index 0000000000000..47f90fcf96115 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_containers/types.d.ts @@ -0,0 +1,148 @@ +import type { Observable } from 'rxjs'; +import type { Ensure } from '@kbn/utility-types'; +import type { FC, ComponentType } from 'react'; +/** + * Base {@link StateContainer} state shape + * @public + */ +export type BaseState = object; +/** + * @internal + */ +export interface TransitionDescription { + type: Type; + args: Args; +} +/** + * @internal + */ +export type Transition = (...args: Args) => State; +/** + * Given some state and an argument, transform the state and return a new version of the state. + * @public + */ +export type PureTransition = (state: State) => Transition; +/** + * @public + */ +export type EnsurePureTransition = Ensure>; +/** + * @internal + */ +export type PureTransitionToTransition> = ReturnType; +/** + * @internal + */ +export type PureTransitionsToTransitions = { + [K in keyof T]: PureTransitionToTransition>; +}; +/** + * Base state container shape without transitions or selectors + * @typeParam State - Shape of state in the container. Have to match {@link BaseState} constraint + * @public + */ +export interface BaseStateContainer { + /** + * Retrieves current state from the container + * @returns current state + * @public + */ + get: () => State; + /** + * Sets state into container + * @param state - new state to set + */ + set: (state: State) => void; + /** + * {@link Observable} of state + */ + state$: Observable; +} +/** + * Fully featured state container with {@link Selector | Selectors} and {@link Transition | Transitions}. Extends {@link BaseStateContainer}. + * @typeParam State - Shape of state in the container. Has to match {@link BaseState} constraint + * @typeParam PureTransitions - map of {@link PureTransition | transitions} to provide on state container + * @typeParam PureSelectors - map of {@link PureSelector | selectors} to provide on state container + * @public + */ +export interface StateContainer extends BaseStateContainer { + transitions: Readonly>; + selectors: Readonly>; +} +/** + * Fully featured state container which matches Redux store interface. Extends {@link StateContainer}. + * Allows to use state container with redux libraries. + * @public + */ +export interface ReduxLikeStateContainer extends StateContainer { + getState: () => State; + reducer: Reducer; + replaceReducer: (nextReducer: Reducer) => void; + dispatch: (action: TransitionDescription) => void; + addMiddleware: (middleware: Middleware) => void; + subscribe: (listener: (state: State) => void) => () => void; +} +/** + * Redux like dispatch + * @public + */ +export type Dispatch = (action: T) => void; +/** + * Redux like Middleware + * @public + */ +export type Middleware = (store: Pick, 'getState' | 'dispatch'>) => (next: (action: TransitionDescription) => TransitionDescription | any) => Dispatch; +/** + * Redux like Reducer + * @public + */ +export type Reducer = (state: State, action: TransitionDescription) => State; +/** + * Utility type for inferring state shape from {@link StateContainer} + * @public + */ +export type UnboxState> = Container extends StateContainer ? T : never; +/** + * Utility type for inferring transitions type from {@link StateContainer} + * @public + */ +export type UnboxTransitions> = Container extends StateContainer ? T : never; +/** + * @public + */ +export type Selector = (...args: Args) => Result; +/** + * @public + */ +export type PureSelector = (state: State) => Selector; +/** + * @public + */ +export type EnsurePureSelector = Ensure>; +/** + * @public + */ +export type PureSelectorToSelector> = ReturnType>; +/** + * @public + */ +export type PureSelectorsToSelectors = { + [K in keyof T]: PureSelectorToSelector>; +}; +/** + * Used to compare state, see {@link useContainerSelector}. + * @public + */ +export type Comparator = (previous: Result, current: Result) => boolean; +/** + * State container state to component props mapper. + * See {@link Connect} + * @public + */ +export type MapStateToProps = (state: State) => StateProps; +/** + * Similar to `connect` from react-redux, + * allows to map state from state container to component's props. + * @public + */ +export type Connect = (mapStateToProp: MapStateToProps>) => (component: ComponentType) => FC>; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/encode_state.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/encode_state.d.ts new file mode 100644 index 0000000000000..f93fc6aa3560b --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_management/encode_state.d.ts @@ -0,0 +1 @@ +export declare function encodeState(state: State, useHash: boolean, createHash: (rawState: State) => string): string; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/format.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/format.d.ts new file mode 100644 index 0000000000000..71c6709bef38a --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_management/format.d.ts @@ -0,0 +1,3 @@ +import type { ParsedQuery } from 'query-string'; +export declare function replaceUrlQuery(rawUrl: string, queryReplacer: (query: ParsedQuery) => ParsedQuery): string; +export declare function replaceUrlHashQuery(rawUrl: string, queryReplacer: (query: ParsedQuery) => ParsedQuery): string; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/parse.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/parse.d.ts new file mode 100644 index 0000000000000..9fe5da960b113 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_management/parse.d.ts @@ -0,0 +1,2 @@ +export declare const parseUrl: (url: string) => import("url").UrlWithParsedQuery; +export declare const parseUrlHash: (url: string) => import("url").UrlWithParsedQuery | null; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/set_state_to_kbn_url.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/set_state_to_kbn_url.d.ts new file mode 100644 index 0000000000000..b76bea5ce419a --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_management/set_state_to_kbn_url.d.ts @@ -0,0 +1,25 @@ +export type SetStateToKbnUrlHashOptions = { + useHash: boolean; + storeInHashQuery?: boolean; +}; +export declare function createSetStateToKbnUrl(createHash: (rawState: State) => string): (key: string, state: State, { useHash, storeInHashQuery }: SetStateToKbnUrlHashOptions | undefined, rawUrl: string) => string; +/** + * Common version of setStateToKbnUrl which doesn't use session storage. + * + * Sets state to the url by key and returns a new url string. + * + * e.g.: + * given a url: http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:indexedFields)&_b=(f:test,i:'',l:'') + * key: '_a' + * and state: {tab: 'other'} + * + * will return url: + * http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:other)&_b=(f:test,i:'',l:'') + * + * By default due to Kibana legacy reasons assumed that state is stored in a query inside a hash part of the URL: + * http://localhost:5601/oxf/app/kibana#/yourApp?_a={STATE} + * + * { storeInHashQuery: true } option should be used in you want to store you state in a main query (not in a hash): + * http://localhost:5601/oxf/app/kibana?_a={STATE}#/yourApp + */ +export declare function setStateToKbnUrl(key: string, state: State, hashOptions: SetStateToKbnUrlHashOptions, rawUrl: string): string; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/state_hash.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/state_hash.d.ts new file mode 100644 index 0000000000000..dbb6f01fa1409 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/state_management/state_hash.d.ts @@ -0,0 +1,2 @@ +export declare function isStateHash(str: string): boolean; +export declare function createStateHash(json: string, existingJsonProvider?: (hash: string) => string | null): string; diff --git a/src/platform/plugins/shared/kibana_utils/common/url/encode_uri_query.d.ts b/src/platform/plugins/shared/kibana_utils/common/url/encode_uri_query.d.ts new file mode 100644 index 0000000000000..f2e688f7347ad --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/url/encode_uri_query.d.ts @@ -0,0 +1,22 @@ +import type { ParsedQuery } from 'query-string'; +/** + * This method is intended for encoding *key* or *value* parts of query component. We need a custom + * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be + * encoded per http://tools.ietf.org/html/rfc3986: + * query = *( pchar / "/" / "?" ) + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * pct-encoded = "%" HEXDIG HEXDIG + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ +export declare function encodeUriQuery(val: string, pctEncodeSpaces?: boolean): string; +export declare const encodeQuery: (query: ParsedQuery, encodeFunction?: (val: string, pctEncodeSpaces?: boolean) => string, pctEncodeSpaces?: boolean) => ParsedQuery; +/** + * Method to help modify url query params. + * + * @param params + * @param key + * @param value + */ +export declare const addQueryParam: (params: string, key: string, value?: string) => string; diff --git a/src/platform/plugins/shared/kibana_utils/common/url/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/url/index.d.ts new file mode 100644 index 0000000000000..48968b138f2c6 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/url/index.d.ts @@ -0,0 +1,8 @@ +import { encodeUriQuery } from './encode_uri_query'; +import { validateUrl } from './validate_url'; +export declare const url: { + encodeQuery: (query: import("query-string").ParsedQuery, encodeFunction?: (val: string, pctEncodeSpaces?: boolean) => string, pctEncodeSpaces?: boolean) => import("query-string").ParsedQuery; + encodeUriQuery: typeof encodeUriQuery; + addQueryParam: (params: string, key: string, value?: string) => string; + validate: typeof validateUrl; +}; diff --git a/src/platform/plugins/shared/kibana_utils/common/url/validate_url.d.ts b/src/platform/plugins/shared/kibana_utils/common/url/validate_url.d.ts new file mode 100644 index 0000000000000..daee54ceb4ce5 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/url/validate_url.d.ts @@ -0,0 +1,5 @@ +export declare function validateUrl(url: string): { + isValid: boolean; + error?: string; + invalidUrl?: string; +}; diff --git a/src/platform/plugins/shared/kibana_utils/public/core/create_start_service_getter.d.ts b/src/platform/plugins/shared/kibana_utils/public/core/create_start_service_getter.d.ts new file mode 100644 index 0000000000000..8dc13ad2a1529 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/core/create_start_service_getter.d.ts @@ -0,0 +1,51 @@ +import type { CoreStart, StartServicesAccessor } from '@kbn/core/public'; +interface StartServices { + plugins: Plugins; + self: OwnContract; + core: Core; +} +export type StartServicesGetter = () => StartServices; +/** + * Use this utility to create a synchronous *start* service getter in *setup* + * life-cycle of your plugin. + * + * Below is a usage example in a Kibana plugin. + * + * ```ts + * export interface MyPluginStartDeps { + * data: DataPublicPluginStart; + * expressions: ExpressionsStart; + * inspector: InspectorStart; + * uiActions: UiActionsStart; + * } + * + * class MyPlugin implements Plugin { + * setup(core: CoreSetup, plugins) { + * const start = createStartServicesGetter(core.getStartServices); + * plugins.expressions.registerFunction(myExpressionFunction(start)); + * } + * + * start(core, plugins: MyPluginStartDeps) { + * + * } + * } + * ``` + * + * In `myExpressionFunction` you can make sure you are picking only the dependencies + * your function needs using the `Pick` type. + * + * ```ts + * const myExpressionFunction = + * (start: StartServicesGetter>) => { + * + * start().plugins.indexPatterns.something(123); + * } + * ``` + * + * @param accessor Asynchronous start service accessor provided by platform. + * @returns Returns a function which synchronously returns *start* core services + * and plugin contracts. If you call this function before the *start* life-cycle + * has started it will throw. + */ +export declare const createStartServicesGetter: (accessor: StartServicesAccessor) => StartServicesGetter; +export {}; diff --git a/src/platform/plugins/shared/kibana_utils/public/core/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/core/index.d.ts new file mode 100644 index 0000000000000..2a0f4db1724f9 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/core/index.d.ts @@ -0,0 +1,2 @@ +export type { StartServicesGetter } from './create_start_service_getter'; +export { createStartServicesGetter } from './create_start_service_getter'; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/get_query_params.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/get_query_params.d.ts new file mode 100644 index 0000000000000..694f5b8070f3f --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/history/get_query_params.d.ts @@ -0,0 +1,3 @@ +import type { ParsedQuery } from 'query-string'; +import type { Location } from 'history'; +export declare function getQueryParams(location: Location): ParsedQuery; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/history_observable.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/history_observable.d.ts new file mode 100644 index 0000000000000..262cb1a83aa37 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/history/history_observable.d.ts @@ -0,0 +1,23 @@ +import type { Action, History, Location } from 'history'; +import { Observable } from 'rxjs'; +import type { ParsedQuery } from 'query-string'; +/** + * Convert history.listen into an observable + * @param history - {@link History} instance + */ +export declare function createHistoryObservable(history: History): Observable<{ + location: Location; + action: Action; +}>; +/** + * Create an observable that emits every time any of query params change. + * Uses deepEqual check. + * @param history - {@link History} instance + */ +export declare function createQueryParamsObservable(history: History): Observable; +/** + * Create an observable that emits every time _paramKey_ changes + * @param history - {@link History} instance + * @param paramKey - query param key to observe + */ +export declare function createQueryParamObservable(history: History, paramKey: string): Observable; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/index.d.ts new file mode 100644 index 0000000000000..27161a4888346 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/history/index.d.ts @@ -0,0 +1,4 @@ +export { removeQueryParam } from './remove_query_param'; +export { redirectWhenMissing } from './redirect_when_missing'; +export { getQueryParams } from './get_query_params'; +export * from './history_observable'; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/redirect_when_missing.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/redirect_when_missing.d.ts new file mode 100644 index 0000000000000..42adde91c4a3a --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/history/redirect_when_missing.d.ts @@ -0,0 +1,36 @@ +import type { History } from 'history'; +import type { ApplicationStart, HttpStart, ToastsSetup } from '@kbn/core/public'; +import type { ThemeServiceStart } from '@kbn/core/public'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +import type { SavedObjectNotFound } from '..'; +interface Mapping { + [key: string]: string | { + app: string; + path: string; + }; +} +/** + * Creates an error handler that will redirect to a url when a SavedObjectNotFound + * error is thrown + */ +export declare function redirectWhenMissing({ history, navigateToApp, basePath, mapping, toastNotifications, onBeforeRedirect, theme, userProfile, }: { + history: History; + navigateToApp: ApplicationStart['navigateToApp']; + basePath: HttpStart['basePath']; + /** + * a mapping of url's to redirect to based on the saved object that + * couldn't be found, or just a string that will be used for all types + */ + mapping: string | Mapping; + /** + * Toast notifications service to show toasts in error cases. + */ + toastNotifications: ToastsSetup; + /** + * Optional callback invoked directly before a redirect is triggered + */ + onBeforeRedirect?: (error: SavedObjectNotFound) => void; + theme: ThemeServiceStart; + userProfile?: UserProfileService; +}): (error: SavedObjectNotFound) => void; +export {}; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/remove_query_param.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/remove_query_param.d.ts new file mode 100644 index 0000000000000..0622f02e76d2c --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/history/remove_query_param.d.ts @@ -0,0 +1,2 @@ +import type { History } from 'history'; +export declare function removeQueryParam(history: History, param: string, replace?: boolean): void; diff --git a/src/platform/plugins/shared/kibana_utils/public/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/index.d.ts new file mode 100644 index 0000000000000..f175129074161 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/index.d.ts @@ -0,0 +1,23 @@ +import { KibanaUtilsPublicPlugin } from './plugin'; +export type { Get, Set } from '../common'; +export { AbortError, abortSignalToPromise, calculateObjectHash, defer, Defer, fieldWildcardFilter, fieldWildcardMatcher, of, url, createGetterSetter, } from '../common'; +export type { StartServicesGetter } from './core'; +export { createStartServicesGetter } from './core'; +export type { KibanaServerError } from '../common/errors'; +export { KbnError, CharacterNotAllowedInField, SavedFieldNotFound, SavedObjectNotFound, SavedFieldTypeInvalidForAgg, InvalidJSONProperty, DuplicateField, } from '../common/errors'; +export { RenderCompleteDispatcher, dispatchRenderComplete, dispatchRenderStart, } from './render_complete'; +export { ResizeChecker } from './resize_checker'; +export type { BaseState, BaseStateContainer, StateContainer, ReduxLikeStateContainer, Dispatch, Middleware, Selector, Comparator, MapStateToProps, Connect, Reducer, UnboxState, PureSelectorToSelector, PureSelectorsToSelectors, EnsurePureSelector, EnsurePureTransition, PureSelector, PureTransition, CreateStateContainerOptions, } from '../common/state_containers'; +export { createStateContainerReactHelpers, useContainerSelector, useContainerState, createStateContainer, } from '../common/state_containers'; +export type { IStorageWrapper, IStorage } from './storage'; +export { Storage } from './storage'; +export { hashedItemStore, HashedItemStore } from './storage/hashed_item_store'; +export { persistState, retrieveState } from './state_management/state_hash'; +export { hashQuery, hashUrl, unhashUrl, unhashQuery, createUrlTracker, createKbnUrlTracker, createKbnUrlControls, getStateFromKbnUrl, getStatesFromKbnUrl, setStateToKbnUrl, withNotifyOnErrors, } from './state_management/url'; +export type { IStateStorage, IStateSyncConfig, ISyncStateRef, IKbnUrlStateStorage, INullableBaseStateContainer, ISessionStorageStateStorage, StartSyncStateFnType, StopSyncStateFnType, } from './state_sync'; +export { syncState, syncStates, createKbnUrlStateStorage, createSessionStorageStateStorage, } from './state_sync'; +export type { Configurable, CollectConfigProps } from './ui'; +export { removeQueryParam, redirectWhenMissing, getQueryParams, createQueryParamsObservable, createHistoryObservable, createQueryParamObservable, } from './history'; +export { applyDiff } from './state_management/utils/diff_object'; +export type { KibanaUtilsPublicSetup as KibanaUtilsSetup, KibanaUtilsPublicStart } from './plugin'; +export declare function plugin(): KibanaUtilsPublicPlugin; diff --git a/src/platform/plugins/shared/kibana_utils/public/plugin.d.ts b/src/platform/plugins/shared/kibana_utils/public/plugin.d.ts new file mode 100644 index 0000000000000..4153742ad6d8e --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/plugin.d.ts @@ -0,0 +1,12 @@ +import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +export type KibanaUtilsPublicSetup = undefined; +export type KibanaUtilsPublicStart = undefined; +export interface KibanaUtilsPublicSetupDependencies { +} +export interface KibanaUtilsPublicStartDependencies { +} +export declare class KibanaUtilsPublicPlugin implements Plugin { + setup(_core: CoreSetup): KibanaUtilsPublicSetup; + start(_core: CoreStart): KibanaUtilsPublicStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/render_complete/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/render_complete/index.d.ts new file mode 100644 index 0000000000000..a38356194d52a --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/render_complete/index.d.ts @@ -0,0 +1 @@ +export { dispatchRenderStart, dispatchRenderComplete, RenderCompleteDispatcher, } from './render_complete_dispatcher'; diff --git a/src/platform/plugins/shared/kibana_utils/public/render_complete/render_complete_dispatcher.d.ts b/src/platform/plugins/shared/kibana_utils/public/render_complete/render_complete_dispatcher.d.ts new file mode 100644 index 0000000000000..5706fc5fb0d01 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/render_complete/render_complete_dispatcher.d.ts @@ -0,0 +1,23 @@ +export declare function dispatchRenderComplete(el: HTMLElement): void; +export declare function dispatchRenderStart(el: HTMLElement): void; +/** + * Should call `dispatchComplete()` when UI block has finished loading its data and has + * completely rendered. Should `dispatchInProgress()` every time UI block + * starts loading data again. At the start it is assumed that UI block is loading + * so it dispatches "in progress" automatically, so you need to call `setRenderComplete` + * at least once. + * + * This is used for reporting to know that UI block is ready, so + * it can take a screenshot. It is also used in functional tests to know that + * page has stabilized. + */ +export declare class RenderCompleteDispatcher { + private count; + private el?; + constructor(el?: HTMLElement); + setEl(el?: HTMLElement): void; + dispatchInProgress(): void; + dispatchComplete(): void; + dispatchError(): void; + setTitle(title: string): void; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/resize_checker/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/resize_checker/index.d.ts new file mode 100644 index 0000000000000..4cb12e0ef31a2 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/resize_checker/index.d.ts @@ -0,0 +1 @@ +export { ResizeChecker } from './resize_checker'; diff --git a/src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.d.ts b/src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.d.ts new file mode 100644 index 0000000000000..7d970f0e2abc8 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.d.ts @@ -0,0 +1,26 @@ +import { EventEmitter } from 'events'; +/** + * ResizeChecker receives an element and emits a "resize" event every time it changes size. + */ +export declare class ResizeChecker extends EventEmitter { + private destroyed; + private el; + private observer; + private expectedSize; + constructor(el: HTMLElement, args?: { + disabled?: boolean; + }); + enable(): void; + /** + * Run a function and ignore all resizes that occur + * while it's running. + */ + modifySizeWithoutTriggeringResize(block: () => void): void; + /** + * Tell the ResizeChecker to shutdown, stop listenings, and never + * emit another resize event. + * + * Cleans up it's listeners and timers. + */ + destroy(): void; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/encode_decode_state.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/encode_decode_state.d.ts new file mode 100644 index 0000000000000..834cb0b1c7578 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/encode_decode_state.d.ts @@ -0,0 +1,3 @@ +export declare function decodeState(expandedOrHashedState: string): State; +export declare function hashedStateToExpandedState(expandedOrHashedState: string): string; +export declare function expandedStateToHashedState(expandedOrHashedState: string): string; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/index.d.ts new file mode 100644 index 0000000000000..87f0e58499741 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/index.d.ts @@ -0,0 +1 @@ +export { decodeState, expandedStateToHashedState, hashedStateToExpandedState, } from './encode_decode_state'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/index.d.ts new file mode 100644 index 0000000000000..8597c16c6fb35 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/index.d.ts @@ -0,0 +1 @@ +export { persistState, retrieveState } from './state_hash'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/state_hash.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/state_hash.d.ts new file mode 100644 index 0000000000000..3c6a8e310af5a --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/state_hash.d.ts @@ -0,0 +1,2 @@ +export declare function retrieveState(stateHash: string): State; +export declare function persistState(state: State): string; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/errors.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/errors.d.ts new file mode 100644 index 0000000000000..8d6513e095e89 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/url/errors.d.ts @@ -0,0 +1,20 @@ +import type { NotificationsStart } from '@kbn/core/public'; +export declare const restoreUrlErrorTitle: string; +export declare const saveStateInUrlErrorTitle: string; +export declare const flushNotifyOnErrors: () => void; +/** + * Helper for configuring {@link IKbnUrlStateStorage} to notify about inner errors + * + * @example + * ```ts + * const kbnUrlStateStorage = createKbnUrlStateStorage({ + * history, + * ...withNotifyOnErrors(core.notifications.toast)) + * } + * ``` + * @param toast - toastApi from core.notifications.toasts + */ +export declare const withNotifyOnErrors: (toasts: NotificationsStart["toasts"]) => { + onGetError: (e: Error) => void; + onSetError: (e: Error) => void; +}; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/hash_unhash_url.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/hash_unhash_url.d.ts new file mode 100644 index 0000000000000..301c3cf84177f --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/url/hash_unhash_url.d.ts @@ -0,0 +1,14 @@ +export type IParsedUrlQuery = Record; +interface IUrlQueryMapperOptions { + hashableParams: string[]; +} +export type IUrlQueryReplacerOptions = IUrlQueryMapperOptions; +export declare const unhashQuery: (query: IParsedUrlQuery, options?: IUrlQueryMapperOptions) => { + [k: string]: any; +}; +export declare const hashQuery: (query: IParsedUrlQuery, options?: IUrlQueryMapperOptions) => { + [k: string]: any; +}; +export declare const unhashUrl: (url: string) => string; +export declare const hashUrl: (url: string) => string; +export {}; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/index.d.ts new file mode 100644 index 0000000000000..c15bb97d0bd59 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/url/index.d.ts @@ -0,0 +1,6 @@ +export { hashUrl, hashQuery, unhashUrl, unhashQuery } from './hash_unhash_url'; +export type { IKbnUrlControls } from './kbn_url_storage'; +export { createKbnUrlControls, setStateToKbnUrl, getStateFromKbnUrl, getStatesFromKbnUrl, } from './kbn_url_storage'; +export { createKbnUrlTracker } from './kbn_url_tracker'; +export { createUrlTracker } from './url_tracker'; +export { withNotifyOnErrors, flushNotifyOnErrors, saveStateInUrlErrorTitle, restoreUrlErrorTitle, } from './errors'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_storage.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_storage.d.ts new file mode 100644 index 0000000000000..86a496bd8f4e2 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_storage.d.ts @@ -0,0 +1,115 @@ +import type { History } from 'history'; +import type { SetStateToKbnUrlHashOptions } from '../../../common/state_management/set_state_to_kbn_url'; +export declare const getCurrentUrl: (history: History) => string; +/** + * Parses a kibana url and retrieves all the states encoded into the URL, + * Handles both expanded rison state and hashed state (where the actual state stored in sessionStorage) + * e.g.: + * + * given an url: + * http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:indexedFields)&_b=(f:test,i:'',l:'') + * will return object: + * {_a: {tab: 'indexedFields'}, _b: {f: 'test', i: '', l: ''}}; + * + * + * By default due to Kibana legacy reasons assumed that state is stored in a query inside a hash part of the URL: + * http://localhost:5601/oxf/app/kibana#/yourApp?_a={STATE} + * + * { getFromHashQuery: false } option should be used in case state is stored in a main query (not in a hash): + * http://localhost:5601/oxf/app/kibana?_a={STATE}#/yourApp + * + */ +export declare function getStatesFromKbnUrl>(url?: string, keys?: Array, { getFromHashQuery }?: { + getFromHashQuery: boolean; +}): State; +/** + * Retrieves specific state from url by key + * e.g.: + * + * given an url: + * http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:indexedFields)&_b=(f:test,i:'',l:'') + * and key '_a' + * will return object: + * {tab: 'indexedFields'} + * + * + * By default due to Kibana legacy reasons assumed that state is stored in a query inside a hash part of the URL: + * http://localhost:5601/oxf/app/kibana#/yourApp?_a={STATE} + * + * { getFromHashQuery: false } option should be used in case state is stored in a main query (not in a hash): + * http://localhost:5601/oxf/app/kibana?_a={STATE}#/yourApp + */ +export declare function getStateFromKbnUrl(key: string, url?: string, { getFromHashQuery }?: { + getFromHashQuery: boolean; +}): State | null; +/** + * Sets state to the url by key and returns a new url string. + * Doesn't actually updates history + * + * e.g.: + * given a url: http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:indexedFields)&_b=(f:test,i:'',l:'') + * key: '_a' + * and state: {tab: 'other'} + * + * will return url: + * http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:other)&_b=(f:test,i:'',l:'') + * + * By default due to Kibana legacy reasons assumed that state is stored in a query inside a hash part of the URL: + * http://localhost:5601/oxf/app/kibana#/yourApp?_a={STATE} + * + * { storeInHashQuery: false } option should be used in you want to store your state in a main query (not in a hash): + * http://localhost:5601/oxf/app/kibana?_a={STATE}#/yourApp + */ +export declare function setStateToKbnUrl(key: string, state: State, { useHash, storeInHashQuery }?: SetStateToKbnUrlHashOptions, rawUrl?: string): string; +/** + * A tiny wrapper around history library to listen for url changes and update url + * History library handles a bunch of cross browser edge cases + */ +export interface IKbnUrlControls { + /** + * Listen for url changes + * @param cb - called when url has been changed + */ + listen: (cb: () => void) => () => void; + /** + * Updates url synchronously, if needed + * skips the update and returns undefined in case when trying to update to current url + * otherwise returns new url + * + * @param url - url to update to + * @param replace - use replace instead of push + */ + update: (url: string, replace: boolean) => string | undefined; + /** + * Schedules url update to next microtask, + * Useful to batch sync changes to url to cause only one browser history update + * @param updater - fn which receives current url and should return next url to update to + * @param replace - use replace instead of push + * + */ + updateAsync: (updater: UrlUpdaterFnType, replace?: boolean) => Promise; + /** + * If there is a pending url update - returns url that is scheduled for update + */ + getPendingUrl: () => string | undefined; + /** + * Synchronously flushes scheduled url updates. Returns new flushed url, if there was an update. Otherwise - undefined. + * @param replace - if replace passed in, then uses it instead of push. Otherwise push or replace is picked depending on updateQueue + */ + flush: (replace?: boolean) => string | undefined; + /** + * Cancels any pending url updates + */ + cancel: () => void; +} +export type UrlUpdaterFnType = (currentUrl: string) => string | undefined; +export declare const createKbnUrlControls: (history?: History) => IKbnUrlControls; +/** + * Depending on history configuration extracts relative path for history updates + * 4 possible cases (see tests): + * 1. Browser history with empty base path + * 2. Browser history with base path + * 3. Hash history with empty base path + * 4. Hash history with base path + */ +export declare function getRelativeToHistoryPath(absoluteUrl: string, history: History): History.Path; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.d.ts new file mode 100644 index 0000000000000..1cf085867a953 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.d.ts @@ -0,0 +1,93 @@ +import type { History } from 'history'; +import type { BehaviorSubject, Observable } from 'rxjs'; +import type { AppUpdater, ToastsSetup } from '@kbn/core/public'; +export interface KbnUrlTracker { + /** + * Callback to invoke when the app is mounted + */ + appMounted: () => void; + /** + * Callback to invoke when the app is unmounted + */ + appUnMounted: () => void; + /** + * Unregistering the url tracker. This won't reset the current state of the nav link + */ + stop: () => void; + setActiveUrl: (newUrl: string) => void; + getActiveUrl: () => string; + /** + * Resets internal state to the last active url, discarding the most recent change + */ + restorePreviousUrl: () => void; +} +/** + * Listens to history changes and optionally to global state changes and updates the nav link url of + * a given app to point to the last visited page within the app. + * + * This includes the following parts: + * * When the app is currently active, the nav link points to the configurable default url of the app. + * * When the app is not active the last visited url is set to the nav link. + * * When a provided observable emits a new value, the state parameter in the url of the nav link is updated + * as long as the app is not active. + */ +export declare function createKbnUrlTracker({ baseUrl, defaultSubUrl, storageKey, stateParams, navLinkUpdater$, toastNotifications, history, getHistory, storage, shouldTrackUrlUpdate, onBeforeNavLinkSaved, }: { + /** + * Base url of the current app. This will be used as a prefix for the + * nav link in the side bar + */ + baseUrl: string; + /** + * Default sub url for this app. If the app is currently active or no sub url is already stored in session storage and the app hasn't been visited yet, the nav link will be set to this url. + */ + defaultSubUrl: string; + /** + * List of URL mapped states that should get updated even when the app is not currently active + */ + stateParams: Array<{ + /** + * Key of the query parameter containing the state + */ + kbnUrlKey: string; + /** + * Observable providing updates to the state + */ + stateUpdate$: Observable; + }>; + /** + * Key used to store the current sub url in session storage. This key should only be used for one active url tracker at any given time. + */ + storageKey: string; + /** + * App updater subject passed into the application definition to change nav link url. + */ + navLinkUpdater$: BehaviorSubject; + /** + * Toast notifications service to show toasts in error cases. + */ + toastNotifications: ToastsSetup; + /** + * History object to use to track url changes. If this isn't provided, a local history instance will be created. + */ + history?: History; + /** + * Lazily retrieve history instance + */ + getHistory?: () => History; + /** + * Storage object to use to persist currently active url. If this isn't provided, the browser wide session storage instance will be used. + */ + storage?: Storage; + /** + * Checks if pathname belongs to current app. It's used in history listener to define whether it's necessary to set pathname as active url or not. + * The default implementation compares the app name to the first part of pathname. Consumers can override this function for more complex cases. + * + * @param {string} pathname A location's pathname which comes to history listener + */ + shouldTrackUrlUpdate?: (pathname: string) => boolean; + /** + * Called when current subpath is about to be saved to sessionStorage for subsequent use as a nav link. + * Use to mutate app's subpath before it is saved by returning a new subpath. + */ + onBeforeNavLinkSaved?: (newNavLink: string) => string; +}): KbnUrlTracker; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/url_tracker.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/url_tracker.d.ts new file mode 100644 index 0000000000000..0a13de39f0edd --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/url/url_tracker.d.ts @@ -0,0 +1,11 @@ +import type { History } from 'history'; +export interface IUrlTracker { + startTrackingUrl: (history?: History) => () => void; + getTrackedUrl: () => string | null; + trackUrl: (url: string) => void; +} +/** + * Replicates what src/legacy/ui/public/chrome/api/nav.ts did + * Persists the url in sessionStorage so it could be restored if navigated back to the app + */ +export declare function createUrlTracker(key: string, storage?: Storage): IUrlTracker; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/utils/diff_object.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/utils/diff_object.d.ts new file mode 100644 index 0000000000000..b8ba1bd81ef66 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_management/utils/diff_object.d.ts @@ -0,0 +1,7 @@ +export interface IDiffObject { + removed: string[]; + added: string[]; + changed: string[]; + keys: string[]; +} +export declare function applyDiff(target: Record, source: Record): IDiffObject; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/index.d.ts new file mode 100644 index 0000000000000..3c19ab8afa127 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_sync/index.d.ts @@ -0,0 +1,24 @@ +/** + * State syncing utilities are a set of helpers for syncing your application state + * with browser URL or browser storage. + * + * They are designed to work together with {@link https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/kibana_utils/docs/state_containers | state containers}. But state containers are not required. + * + * State syncing utilities include: + * + * *{@link syncState} util which: + * * Subscribes to state changes and pushes them to state storage. + * * Optionally subscribes to state storage changes and pushes them to state. + * * Two types of storages compatible with `syncState`: + * * {@link IKbnUrlStateStorage} - Serializes state and persists it to URL's query param in rison or hashed format. + * Listens for state updates in the URL and pushes them back to state. + * * {@link ISessionStorageStateStorage} - Serializes state and persists it to browser storage. + * + * Refer {@link https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/kibana_utils/docs/state_sync | here} for a complete guide and examples. + * @packageDocumentation + */ +export type { IKbnUrlStateStorage, ISessionStorageStateStorage, IStateStorage, } from './state_sync_state_storage'; +export { createSessionStorageStateStorage, createKbnUrlStateStorage, } from './state_sync_state_storage'; +export type { IStateSyncConfig, INullableBaseStateContainer } from './types'; +export type { StopSyncStateFnType, StartSyncStateFnType, ISyncStateRef } from './state_sync'; +export { syncState, syncStates } from './state_sync'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync.d.ts new file mode 100644 index 0000000000000..d1ba2364703a8 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync.d.ts @@ -0,0 +1,111 @@ +import type { IStateSyncConfig } from './types'; +import type { IStateStorage } from './state_sync_state_storage'; +import type { BaseState } from '../../common/state_containers'; +/** + * @public + */ +export type StopSyncStateFnType = () => void; +/** + * @public + */ +export type StartSyncStateFnType = () => void; +/** + * @public + */ +export interface ISyncStateRef { + /** + * stop state syncing + */ + stop: StopSyncStateFnType; + /** + * start state syncing + */ + start: StartSyncStateFnType; +} +/** + * Utility for syncing application state wrapped in state container + * with some kind of storage (e.g. URL) + * + * Go {@link https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/kibana_utils/docs/state_sync | here} for a complete guide and examples. + * + * @example + * + * the simplest use case + * ```ts + * const stateStorage = createKbnUrlStateStorage(); + * syncState({ + * storageKey: '_s', + * stateContainer, + * stateStorage + * }); + * ``` + * + * @example + * conditionally configuring sync strategy + * ```ts + * const stateStorage = createKbnUrlStateStorage({useHash: config.get('state:stateContainerInSessionStorage')}) + * syncState({ + * storageKey: '_s', + * stateContainer, + * stateStorage + * }); + * ``` + * + * @example + * implementing custom sync strategy + * ```ts + * const localStorageStateStorage = { + * set: (storageKey, state) => localStorage.setItem(storageKey, JSON.stringify(state)), + * get: (storageKey) => localStorage.getItem(storageKey) ? JSON.parse(localStorage.getItem(storageKey)) : null + * }; + * syncState({ + * storageKey: '_s', + * stateContainer, + * stateStorage: localStorageStateStorage + * }); + * ``` + * + * @example + * transforming state before serialising + * Useful for: + * * Migration / backward compatibility + * * Syncing part of state + * * Providing default values + * ```ts + * const stateToStorage = (s) => ({ tab: s.tab }); + * syncState({ + * storageKey: '_s', + * stateContainer: { + * get: () => stateToStorage(stateContainer.get()), + * set: stateContainer.set(({ tab }) => ({ ...stateContainer.get(), tab }), + * state$: stateContainer.state$.pipe(map(stateToStorage)) + * }, + * stateStorage + * }); + * ``` + * + * @param - syncing config {@link IStateSyncConfig} + * @returns - {@link ISyncStateRef} + * @public + */ +export declare function syncState({ storageKey, stateStorage, stateContainer, }: IStateSyncConfig): ISyncStateRef; +/** + * @example + * sync multiple different sync configs + * ```ts + * syncStates([ + * { + * storageKey: '_s1', + * stateStorage: stateStorage1, + * stateContainer: stateContainer1, + * }, + * { + * storageKey: '_s2', + * stateStorage: stateStorage2, + * stateContainer: stateContainer2, + * }, + * ]); + * ``` + * @param stateSyncConfigs - Array of {@link IStateSyncConfig} to sync + */ +export declare function syncStates(stateSyncConfigs: Array>): ISyncStateRef; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.d.ts new file mode 100644 index 0000000000000..0fc030ea48ede --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.d.ts @@ -0,0 +1,44 @@ +import { Observable } from 'rxjs'; +import type { History } from 'history'; +import type { IStateStorage } from './types'; +import type { IKbnUrlControls } from '../../state_management/url'; +/** + * KbnUrlStateStorage is a state storage for {@link syncState} utility which: + * + * 1. Keeps state in sync with the URL. + * 2. Serializes data and stores it in the URL in one of the supported formats: + * * Rison encoded. + * * Hashed URL: In URL we store only the hash from the serialized state, but the state itself is stored in sessionStorage. See Kibana's `state:storeInSessionStorage` advanced option for more context. + * 3. Takes care of listening to the URL updates and notifies state about the updates. + * 4. Takes care of batching URL updates to prevent redundant browser history records. + * + * {@link https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/kibana_utils/docs/state_sync/storages/kbn_url_storage.md | Refer to this guide for more info} + * @public + */ +export interface IKbnUrlStateStorage extends IStateStorage { + set: (key: string, state: State, opts?: { + replace: boolean; + }) => Promise; + get: (key: string) => State | null; + change$: (key: string) => Observable; + /** + * Cancels any pending url updates + */ + cancel: () => void; + /** + * Lower level wrapper around history library that handles batching multiple URL updates into one history change + */ + kbnUrlControls: IKbnUrlControls; +} +/** + * Creates {@link IKbnUrlStateStorage} state storage + * @returns - {@link IKbnUrlStateStorage} + * @public + */ +export declare const createKbnUrlStateStorage: ({ useHash, useHashQuery, history, onGetError, onSetError, }?: { + useHash: boolean; + useHashQuery?: boolean; + history?: History; + onGetError?: (error: Error) => void; + onSetError?: (error: Error) => void; +}) => IKbnUrlStateStorage; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.d.ts new file mode 100644 index 0000000000000..74b364e6e568c --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.d.ts @@ -0,0 +1,18 @@ +import type { IStateStorage } from './types'; +/** + * {@link IStateStorage} for storing state in browser {@link Storage} + * {@link https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/kibana_utils/docs/state_sync/storages/session_storage.md | guide} + * @public + */ +export interface ISessionStorageStateStorage extends IStateStorage { + set: (key: string, state: State) => void; + get: (key: string) => State | null; +} +/** + * Creates {@link ISessionStorageStateStorage} + * {@link https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/kibana_utils/docs/state_sync/storages/session_storage.md | guide} + * @param storage - Option {@link Storage} to use for storing state. By default window.sessionStorage. + * @returns - {@link ISessionStorageStateStorage} + * @public + */ +export declare const createSessionStorageStateStorage: (storage?: Storage) => ISessionStorageStateStorage; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/index.d.ts new file mode 100644 index 0000000000000..8f5bb8d74c241 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/index.d.ts @@ -0,0 +1,5 @@ +export type { IStateStorage } from './types'; +export type { IKbnUrlStateStorage } from './create_kbn_url_state_storage'; +export { createKbnUrlStateStorage } from './create_kbn_url_state_storage'; +export type { ISessionStorageStateStorage } from './create_session_storage_state_storage'; +export { createSessionStorageStateStorage } from './create_session_storage_state_storage'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/types.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/types.d.ts new file mode 100644 index 0000000000000..eb651e1b81900 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/types.d.ts @@ -0,0 +1,29 @@ +import type { Observable } from 'rxjs'; +/** + * Any StateStorage have to implement IStateStorage interface + * StateStorage is responsible for: + * * state serialisation / deserialization + * * persisting to and retrieving from storage + * + * For an example take a look at already implemented {@link IKbnUrlStateStorage} and {@link ISessionStorageStateStorage} state storages + * @public + */ +export interface IStateStorage { + /** + * Take in a state object, should serialise and persist + */ + set: (key: string, state: State) => any; + /** + * Should retrieve state from the storage and deserialize it + */ + get: (key: string) => State | null; + /** + * Should notify when the stored state has changed + */ + change$?: (key: string) => Observable; + /** + * Optional method to cancel any pending activity + * {@link syncState} will call it during destroy, if it is provided by IStateStorage + */ + cancel?: () => void; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/types.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/types.d.ts new file mode 100644 index 0000000000000..4561ed1df4ecd --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/state_sync/types.d.ts @@ -0,0 +1,43 @@ +import type { BaseState, BaseStateContainer } from '../../common/state_containers/types'; +import type { IStateStorage } from './state_sync_state_storage'; +/** + * Extension of {@link BaseStateContainer} with one constraint: set state should handle `null` as incoming state + * @remarks + * State container for `stateSync()` have to accept `null` + * for example, `set()` implementation could handle null and fallback to some default state + * this is required to handle edge case, when state in storage becomes empty and syncing is in progress. + * State container will be notified about about storage becoming empty with null passed in. + * @public + */ +export interface INullableBaseStateContainer extends BaseStateContainer { + set: (state: State | null) => void; +} +/** + * Config for setting up state syncing with {@link stateSync} + * @typeParam State - State shape to sync to storage, has to extend {@link BaseState} + * @typeParam StateStorage - used state storage to sync state with + * @public + */ +export interface IStateSyncConfig { + /** + * Storage key to use for syncing, + * e.g. storageKey '_a' should sync state to ?_a query param + */ + storageKey: string; + /** + * State container to keep in sync with storage, have to implement {@link INullableBaseStateContainer} interface + * We encourage to use {@link BaseStateContainer} as a state container, + * but it is also possible to implement own custom container for advanced use cases + */ + stateContainer: INullableBaseStateContainer; + /** + * State storage to use, + * State storage is responsible for serialising / deserialising and persisting / retrieving stored state + * + * There are common strategies already implemented: + * see {@link IKbnUrlStateStorage} + * which replicate what State (AppState, GlobalState) in legacy world did + * + */ + stateStorage: StateStorage; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/hashed_item_store.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/hashed_item_store.d.ts new file mode 100644 index 0000000000000..88cfc71e35002 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/hashed_item_store.d.ts @@ -0,0 +1,22 @@ +import type { IStorage } from '../types'; +export declare class HashedItemStore implements IStorage { + static readonly PERSISTED_INDEX_KEY = "kbn.hashedItemsIndex.v1"; + private storage; + /** + * HashedItemStore uses objects called indexed items to refer to items that have been persisted + * in storage. An indexed item is shaped {hash, touched}. The touched date is when the item + * was last referenced by the browser history. + */ + constructor(storage: Storage); + setItem(hash: string, item: string): boolean; + getItem(hash: string): string | null; + removeItem(hash: string): string | null; + clear(): void; + private ensuredSorting; + private getIndexedItems; + private setIndexedItems; + private getIndexedItem; + private persistItem; + private removeOldestItem; + private touchHash; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/index.d.ts new file mode 100644 index 0000000000000..247f8be4b6c85 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/index.d.ts @@ -0,0 +1,3 @@ +import { HashedItemStore } from './hashed_item_store'; +export { HashedItemStore }; +export declare const hashedItemStore: HashedItemStore; diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/index.d.ts new file mode 100644 index 0000000000000..c19d070b06964 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/storage/index.d.ts @@ -0,0 +1,2 @@ +export { Storage } from './storage'; +export type { IStorage, IStorageWrapper } from './types'; diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/storage.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/storage.d.ts new file mode 100644 index 0000000000000..e103f73776f21 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/storage/storage.d.ts @@ -0,0 +1,9 @@ +import type { IStorage, IStorageWrapper } from './types'; +export declare class Storage implements IStorageWrapper { + store: IStorage; + constructor(store: IStorage); + get: (key: string) => any; + set: (key: string, value: any, includeUndefined?: boolean) => false | void; + remove: (key: string) => any; + clear: () => void; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/types.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/types.d.ts new file mode 100644 index 0000000000000..cde8661922f9c --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/storage/types.d.ts @@ -0,0 +1,12 @@ +export interface IStorageWrapper { + get: (key: string) => T | null; + set: (key: string, value: T) => S; + remove: (key: string) => T | null; + clear: () => void; +} +export interface IStorage { + getItem: (key: string) => T | null; + setItem: (key: string, value: T) => S; + removeItem: (key: string) => T | null; + clear: () => void; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/theme/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/theme/index.d.ts new file mode 100644 index 0000000000000..250a27019f94a --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/theme/index.d.ts @@ -0,0 +1 @@ +export { KibanaThemeProvider } from './kibana_theme_provider'; diff --git a/src/platform/plugins/shared/kibana_utils/public/theme/kibana_theme_provider.d.ts b/src/platform/plugins/shared/kibana_utils/public/theme/kibana_theme_provider.d.ts new file mode 100644 index 0000000000000..97b47444b2d7c --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/theme/kibana_theme_provider.d.ts @@ -0,0 +1,14 @@ +import type { FC, PropsWithChildren } from 'react'; +import React from 'react'; +import type { Observable } from 'rxjs'; +import type { EuiProviderProps } from '@elastic/eui'; +import type { CoreTheme } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +export interface KibanaThemeProviderProps { + theme$: Observable; + userProfile?: UserProfileService; + modify?: EuiProviderProps<{}>['modify']; + children: React.ReactNode; +} +/** @deprecated use `KibanaThemeProvider` from `@kbn/react-kibana-context-theme */ +export declare const KibanaThemeProvider: FC>; diff --git a/src/platform/plugins/shared/kibana_utils/public/ui/configurable.d.ts b/src/platform/plugins/shared/kibana_utils/public/ui/configurable.d.ts new file mode 100644 index 0000000000000..c6d80bae1e054 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/ui/configurable.d.ts @@ -0,0 +1,36 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { FC } from 'react'; +/** + * Represents something that can be configured by user using UI. + */ +export interface Configurable { + /** + * Create default config for this item, used when item is created for the first time. + */ + readonly createConfig: (context: Context) => Config; + /** + * Is this config valid. Used to validate user's input before saving. + */ + readonly isConfigValid: (config: Config, context: Context) => boolean; + /** + * Component to be rendered when collecting configuration for this item. + */ + readonly CollectConfig: FC>; +} +/** + * Props provided to `CollectConfig` component on every re-render. + */ +export interface CollectConfigProps { + /** + * Current (latest) config of the item. + */ + config: Config; + /** + * Callback called when user updates the config in UI. + */ + onConfig: (config: Config) => void; + /** + * Context information about where component is being rendered. + */ + context: Context; +} diff --git a/src/platform/plugins/shared/kibana_utils/public/ui/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/ui/index.d.ts new file mode 100644 index 0000000000000..620039ad5cdb9 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/public/ui/index.d.ts @@ -0,0 +1 @@ +export type * from './configurable'; diff --git a/src/platform/plugins/shared/management/common/contants.d.ts b/src/platform/plugins/shared/management/common/contants.d.ts new file mode 100644 index 0000000000000..cb1009c94e337 --- /dev/null +++ b/src/platform/plugins/shared/management/common/contants.d.ts @@ -0,0 +1 @@ +export declare const MANAGEMENT_APP_ID = "management"; diff --git a/src/platform/plugins/shared/management/common/locator.d.ts b/src/platform/plugins/shared/management/common/locator.d.ts new file mode 100644 index 0000000000000..2e2ca0113a9bb --- /dev/null +++ b/src/platform/plugins/shared/management/common/locator.d.ts @@ -0,0 +1,15 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/common'; +export interface ManagementAppLocatorParams extends SerializableRecord { + sectionId: string; + appId?: string; +} +export type ManagementAppLocator = LocatorPublic; +export declare class ManagementAppLocatorDefinition implements LocatorDefinition { + readonly id = "MANAGEMENT_APP_LOCATOR"; + readonly getLocation: (params: ManagementAppLocatorParams) => Promise<{ + app: string; + path: string; + state: {}; + }>; +} diff --git a/src/platform/plugins/shared/management/public/application.d.ts b/src/platform/plugins/shared/management/public/application.d.ts new file mode 100644 index 0000000000000..13c5fde9a158c --- /dev/null +++ b/src/platform/plugins/shared/management/public/application.d.ts @@ -0,0 +1,3 @@ +import type { AppMountParameters } from '@kbn/core/public'; +import type { ManagementAppDependencies } from './components/management_app'; +export declare const renderApp: ({ history, appBasePath, element, theme$ }: AppMountParameters, dependencies: ManagementAppDependencies) => Promise<() => boolean>; diff --git a/src/platform/plugins/shared/management/public/components/landing/classic_empty_prompt.d.ts b/src/platform/plugins/shared/management/public/components/landing/classic_empty_prompt.d.ts new file mode 100644 index 0000000000000..74aff18cf47e7 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/landing/classic_empty_prompt.d.ts @@ -0,0 +1,6 @@ +import { type FC } from 'react'; +interface Props { + kibanaVersion: string; +} +export declare const ClassicEmptyPrompt: FC; +export {}; diff --git a/src/platform/plugins/shared/management/public/components/landing/index.d.ts b/src/platform/plugins/shared/management/public/components/landing/index.d.ts new file mode 100644 index 0000000000000..d7309ad0c21c2 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/landing/index.d.ts @@ -0,0 +1 @@ +export { ManagementLandingPage } from './landing'; diff --git a/src/platform/plugins/shared/management/public/components/landing/landing.d.ts b/src/platform/plugins/shared/management/public/components/landing/landing.d.ts new file mode 100644 index 0000000000000..2198aaec34c1a --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/landing/landing.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +interface ManagementLandingPageProps { + onAppMounted: (id: string) => void; + setBreadcrumbs: () => void; +} +export declare const ManagementLandingPage: ({ setBreadcrumbs, onAppMounted, }: ManagementLandingPageProps) => React.JSX.Element | null; +export {}; diff --git a/src/platform/plugins/shared/management/public/components/landing/solution_empty_prompt.d.ts b/src/platform/plugins/shared/management/public/components/landing/solution_empty_prompt.d.ts new file mode 100644 index 0000000000000..2773479f50750 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/landing/solution_empty_prompt.d.ts @@ -0,0 +1,8 @@ +import { type FC } from 'react'; +import { type CoreStart } from '@kbn/core/public'; +interface Props { + kibanaVersion: string; + coreStart: CoreStart; +} +export declare const SolutionEmptyPrompt: FC; +export {}; diff --git a/src/platform/plugins/shared/management/public/components/management_app/index.d.ts b/src/platform/plugins/shared/management/public/components/management_app/index.d.ts new file mode 100644 index 0000000000000..3b39b4ec138e5 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/management_app/index.d.ts @@ -0,0 +1,2 @@ +export type { ManagementAppDependencies } from './management_app'; +export { ManagementApp } from './management_app'; diff --git a/src/platform/plugins/shared/management/public/components/management_app/management_app.d.ts b/src/platform/plugins/shared/management/public/components/management_app/management_app.d.ts new file mode 100644 index 0000000000000..e3d092bb063b1 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/management_app/management_app.d.ts @@ -0,0 +1,28 @@ +import React from 'react'; +import type { BehaviorSubject, Observable } from 'rxjs'; +import type { AppMountParameters, ChromeBreadcrumb } from '@kbn/core/public'; +import type { CoreStart } from '@kbn/core/public'; +import type { ChromeStyle } from '@kbn/core-chrome-browser'; +import type { SectionsServiceStart, NavigationCardsSubject, AutoOpsStatusHook } from '../../types'; +interface ManagementAppProps { + appBasePath: string; + history: AppMountParameters['history']; + dependencies: ManagementAppDependencies; +} +export interface ManagementAppDependencies { + sections: SectionsServiceStart; + kibanaVersion: string; + coreStart: CoreStart; + cloud?: { + isCloudEnabled: boolean; + baseUrl?: string; + }; + isAirGapped: boolean; + setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void; + isSidebarEnabled$: BehaviorSubject; + cardsNavigationConfig$: BehaviorSubject; + chromeStyle$: Observable; + getAutoOpsStatusHook: () => AutoOpsStatusHook; +} +export declare const ManagementApp: ({ dependencies, history, appBasePath }: ManagementAppProps) => React.JSX.Element | null; +export {}; diff --git a/src/platform/plugins/shared/management/public/components/management_app/management_context.d.ts b/src/platform/plugins/shared/management/public/components/management_app/management_context.d.ts new file mode 100644 index 0000000000000..4d426832d15d9 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/management_app/management_context.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import type { AppDependencies } from '../../types'; +export declare const AppContext: React.Context; +export declare const AppContextProvider: ({ children, value, }: { + children: React.ReactNode; + value: AppDependencies; +}) => React.JSX.Element; +export declare const useAppContext: () => AppDependencies; diff --git a/src/platform/plugins/shared/management/public/components/management_app/management_router.d.ts b/src/platform/plugins/shared/management/public/components/management_app/management_router.d.ts new file mode 100644 index 0000000000000..ed75718376f51 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/management_app/management_router.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import type { AnalyticsServiceStart, AppMountParameters, ChromeBreadcrumb, ScopedHistory, ThemeServiceStart } from '@kbn/core/public'; +import type { ManagementSection } from '../../utils'; +interface ManagementRouterProps { + history: AppMountParameters['history']; + theme: ThemeServiceStart; + setBreadcrumbs: (crumbs?: ChromeBreadcrumb[], appHistory?: ScopedHistory) => void; + onAppMounted: (id: string) => void; + sections: ManagementSection[]; + analytics: AnalyticsServiceStart; +} +export declare const ManagementRouter: React.MemoExoticComponent<({ history, setBreadcrumbs, onAppMounted, sections, theme, analytics, }: ManagementRouterProps) => React.JSX.Element>; +export {}; diff --git a/src/platform/plugins/shared/management/public/components/management_app_wrapper/index.d.ts b/src/platform/plugins/shared/management/public/components/management_app_wrapper/index.d.ts new file mode 100644 index 0000000000000..0181eb807c1a2 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/management_app_wrapper/index.d.ts @@ -0,0 +1 @@ +export { ManagementAppWrapper } from './management_app_wrapper'; diff --git a/src/platform/plugins/shared/management/public/components/management_app_wrapper/management_app_wrapper.d.ts b/src/platform/plugins/shared/management/public/components/management_app_wrapper/management_app_wrapper.d.ts new file mode 100644 index 0000000000000..14a46723455d3 --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/management_app_wrapper/management_app_wrapper.d.ts @@ -0,0 +1,22 @@ +import React, { Component } from 'react'; +import type { ChromeBreadcrumb, AppMountParameters, ScopedHistory, ThemeServiceStart } from '@kbn/core/public'; +import type { ManagementApp } from '../../utils'; +interface ManagementSectionWrapperProps { + app: ManagementApp; + setBreadcrumbs: (crumbs?: ChromeBreadcrumb[], history?: ScopedHistory) => void; + onAppMounted: (id: string) => void; + history: AppMountParameters['history']; + theme: ThemeServiceStart; +} +interface ManagementSectionWrapperState { + error: Error | null; +} +export declare class ManagementAppWrapper extends Component { + private unmount?; + private mountElementRef; + constructor(props: ManagementSectionWrapperProps); + componentDidMount(): void; + componentWillUnmount(): Promise; + render(): React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/management/public/components/management_sections.d.ts b/src/platform/plugins/shared/management/public/components/management_sections.d.ts new file mode 100644 index 0000000000000..5acc96ee665ef --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/management_sections.d.ts @@ -0,0 +1,69 @@ +import { ManagementSectionId } from '../types'; +export declare const IngestSection: { + id: ManagementSectionId; + title: string; + tip: string; + order: number; +}; +export declare const DataSection: { + id: ManagementSectionId; + title: string; + tip: string; + order: number; +}; +export declare const InsightsAndAlertingSection: { + id: ManagementSectionId; + title: string; + tip: string; + order: number; +}; +export declare const ClusterPerformanceSection: { + id: ManagementSectionId; + title: string; + order: number; +}; +export declare const MachineLearningSection: { + id: ManagementSectionId; + title: string; + tip: string; + order: number; +}; +export declare const ModelManagementSection: { + id: ManagementSectionId; + title: string; + tip: string; + order: number; +}; +export declare const SecuritySection: { + id: string; + title: string; + tip: string; + order: number; +}; +export declare const KibanaSection: { + id: ManagementSectionId; + title: string; + tip: string; + order: number; +}; +export declare const AISection: { + id: ManagementSectionId; + title: string; + order: number; +}; +export declare const StackSection: { + id: ManagementSectionId; + title: string; + tip: string; + order: number; +}; +export declare const managementSections: ({ + id: ManagementSectionId; + title: string; + order: number; +} | { + id: string; + title: string; + tip: string; + order: number; +})[]; diff --git a/src/platform/plugins/shared/management/public/components/management_sidebar_nav/management_sidebar_nav.d.ts b/src/platform/plugins/shared/management/public/components/management_sidebar_nav/management_sidebar_nav.d.ts new file mode 100644 index 0000000000000..daef53a47f70c --- /dev/null +++ b/src/platform/plugins/shared/management/public/components/management_sidebar_nav/management_sidebar_nav.d.ts @@ -0,0 +1,11 @@ +import type { EuiSideNavItemType } from '@elastic/eui'; +import type { AppMountParameters } from '@kbn/core/public'; +import type { ManagementSection } from '../../utils'; +interface ManagementSidebarNavProps { + sections: ManagementSection[]; + history: AppMountParameters['history']; + selectedId: string; +} +/** @internal **/ +export declare const managementSidebarNav: ({ selectedId, sections, history, }: ManagementSidebarNavProps) => EuiSideNavItemType[]; +export {}; diff --git a/src/platform/plugins/shared/management/public/index.d.ts b/src/platform/plugins/shared/management/public/index.d.ts new file mode 100644 index 0000000000000..84b675fbc645b --- /dev/null +++ b/src/platform/plugins/shared/management/public/index.d.ts @@ -0,0 +1,7 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import { ManagementPlugin } from './plugin'; +export declare function plugin(initializerContext: PluginInitializerContext): ManagementPlugin; +export type { RegisterManagementAppArgs } from './utils'; +export { ManagementSection, ManagementApp } from './utils'; +export type { ManagementAppMountParams, ManagementSetup, ManagementStart, DefinedSections, AutoOpsStatusHook, AutoOpsStatusResult, } from './types'; +export { MANAGEMENT_APP_ID } from '../common/contants'; diff --git a/src/platform/plugins/shared/management/public/management_sections_service.d.ts b/src/platform/plugins/shared/management/public/management_sections_service.d.ts new file mode 100644 index 0000000000000..1620e9aef5668 --- /dev/null +++ b/src/platform/plugins/shared/management/public/management_sections_service.d.ts @@ -0,0 +1,13 @@ +import { ManagementSection } from './utils'; +import type { SectionsServiceSetup, SectionsServiceStartDeps, DefinedSections, ManagementSectionsStartPrivate } from './types'; +declare const getSectionsServiceStartPrivate: import("@kbn/kibana-utils-plugin/public").Get; +export { getSectionsServiceStartPrivate }; +export declare class ManagementSectionsService { + definedSections: DefinedSections; + constructor(); + private sections; + getAllSections: () => ManagementSection[]; + private registerSection; + setup(): SectionsServiceSetup; + start({ capabilities }: SectionsServiceStartDeps): {}; +} diff --git a/src/platform/plugins/shared/management/public/plugin.d.ts b/src/platform/plugins/shared/management/public/plugin.d.ts new file mode 100644 index 0000000000000..4c112e41af524 --- /dev/null +++ b/src/platform/plugins/shared/management/public/plugin.d.ts @@ -0,0 +1,40 @@ +import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; +import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; +import type { ServerlessPluginStart } from '@kbn/serverless/public'; +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { ConfigSchema, ManagementSetup, ManagementStart, AutoOpsStatusHook } from './types'; +interface ManagementSetupDependencies { + home?: HomePublicPluginSetup; + share: SharePluginSetup; + cloud?: { + isCloudEnabled: boolean; + baseUrl?: string; + }; +} +interface ManagementStartDependencies { + share: SharePluginStart; + serverless?: ServerlessPluginStart; + cloud?: { + isCloudEnabled: boolean; + baseUrl?: string; + }; +} +export declare class ManagementPlugin implements Plugin { + private initializerContext; + private readonly managementSections; + private readonly appUpdater; + private hasAnyEnabledApps; + private isSidebarEnabled$; + private cardsNavigationConfig$; + private autoOpsStatusHook?; + constructor(initializerContext: PluginInitializerContext); + private registerAutoOpsStatusHook; + private getAutoOpsStatusHook; + setup(core: CoreSetup, { home, share, cloud }: ManagementSetupDependencies): { + sections: import("./types").SectionsServiceSetup; + locator: import("@kbn/share-plugin/public").LocatorPublic; + registerAutoOpsStatusHook: (hook: AutoOpsStatusHook) => void; + }; + start(core: CoreStart, plugins: ManagementStartDependencies): ManagementStart; +} +export {}; diff --git a/src/platform/plugins/shared/management/public/types.d.ts b/src/platform/plugins/shared/management/public/types.d.ts new file mode 100644 index 0000000000000..965307f52fe69 --- /dev/null +++ b/src/platform/plugins/shared/management/public/types.d.ts @@ -0,0 +1,110 @@ +import type { Observable } from 'rxjs'; +import type { ScopedHistory, Capabilities, ThemeServiceStart, CoreStart, ChromeBreadcrumb, CoreTheme, AppDeepLinkLocations } from '@kbn/core/public'; +import type { LocatorPublic } from '@kbn/share-plugin/common'; +import type { CardsNavigationComponentProps } from '@kbn/management-cards-navigation'; +import type { ChromeStyle } from '@kbn/core-chrome-browser'; +import type { ManagementSection, RegisterManagementSectionArgs } from './utils'; +import type { ManagementAppLocatorParams } from '../common/locator'; +/** @public */ +export interface AutoOpsStatusResult { + isCloudConnectAutoopsEnabled: boolean; + isLoading: boolean; +} +/** @public */ +export type AutoOpsStatusHook = () => AutoOpsStatusResult; +export interface ManagementSetup { + sections: SectionsServiceSetup; + locator: LocatorPublic; + /** + * Registers a hook that returns the AutoOps status. + * Used by the cloud_connect plugin to provide connection status to the management landing page. + */ + registerAutoOpsStatusHook: (hook: AutoOpsStatusHook) => void; +} +export interface DefinedSections { + ingest: ManagementSection; + data: ManagementSection; + insightsAndAlerting: ManagementSection; + machineLearning: ManagementSection; + modelManagement: ManagementSection; + security: ManagementSection; + kibana: ManagementSection; + stack: ManagementSection; + ai: ManagementSection; + clusterPerformance: ManagementSection; +} +export interface ManagementStart { + setupCardsNavigation: ({ enabled, hideLinksTo, extendCardNavDefinitions, }: NavigationCardsSubject) => void; +} +export interface ManagementSectionsStartPrivate { + getSectionsEnabled: () => ManagementSection[]; +} +export interface SectionsServiceStartDeps { + capabilities: Capabilities; +} +export interface SectionsServiceSetup { + register: (args: Omit) => ManagementSection; + section: DefinedSections; +} +export interface SectionsServiceStart { + getSectionsEnabled: () => ManagementSection[]; +} +export declare enum ManagementSectionId { + Ingest = "ingest", + Data = "data", + InsightsAndAlerting = "insightsAndAlerting", + MachineLearning = "ml", + ModelManagement = "modelManagement", + Security = "security", + Kibana = "kibana", + Stack = "stack", + AI = "ai", + ClusterPerformance = "clusterPerformance" +} +export type Unmount = () => Promise | void; +export type Mount = (params: ManagementAppMountParams) => Unmount | Promise; +export interface ManagementAppMountParams { + basePath: string; + element: HTMLElement; + setBreadcrumbs: (crumbs: ChromeBreadcrumb[]) => void; + history: ScopedHistory; + theme: ThemeServiceStart; + /** @deprecated - use `theme` **/ + theme$: Observable; +} +export interface CreateManagementItemArgs { + id: string; + title: string; + tip?: string; + order?: number; + euiIconType?: string; + icon?: string; + hideFromSidebar?: boolean; + hideFromGlobalSearch?: boolean; + visibleIn?: AppDeepLinkLocations[]; + capabilitiesId?: string; + redirectFrom?: string; +} +export interface NavigationCardsSubject extends Pick { + enabled: boolean; + extendCardNavDefinitions?: CardsNavigationComponentProps['extendedCardNavigationDefinitions']; +} +export interface AppDependencies { + appBasePath: string; + kibanaVersion: string; + sections: ManagementSection[]; + cardsNavigationConfig?: NavigationCardsSubject; + chromeStyle?: ChromeStyle; + coreStart: CoreStart; + cloud?: { + isCloudEnabled: boolean; + baseUrl?: string; + }; + isAirGapped: boolean; + getAutoOpsStatusHook: () => AutoOpsStatusHook; +} +export interface ConfigSchema { + deeplinks: { + navLinkStatus: 'default' | 'visible'; + }; +} diff --git a/src/platform/plugins/shared/management/public/utils/breadcrumbs.d.ts b/src/platform/plugins/shared/management/public/utils/breadcrumbs.d.ts new file mode 100644 index 0000000000000..8388a0d56433d --- /dev/null +++ b/src/platform/plugins/shared/management/public/utils/breadcrumbs.d.ts @@ -0,0 +1,7 @@ +export declare const MANAGEMENT_BREADCRUMB_NO_HREF: { + text: string; +}; +export declare const MANAGEMENT_BREADCRUMB: { + text: string; + href: string; +}; diff --git a/src/platform/plugins/shared/management/public/utils/index.d.ts b/src/platform/plugins/shared/management/public/utils/index.d.ts new file mode 100644 index 0000000000000..a743504ed2c36 --- /dev/null +++ b/src/platform/plugins/shared/management/public/utils/index.d.ts @@ -0,0 +1,5 @@ +export { MANAGEMENT_BREADCRUMB, MANAGEMENT_BREADCRUMB_NO_HREF } from './breadcrumbs'; +export type { RegisterManagementAppArgs } from './management_app'; +export { ManagementApp } from './management_app'; +export type { RegisterManagementSectionArgs } from './management_section'; +export { ManagementSection } from './management_section'; diff --git a/src/platform/plugins/shared/management/public/utils/management_app.d.ts b/src/platform/plugins/shared/management/public/utils/management_app.d.ts new file mode 100644 index 0000000000000..e0093c523cc8d --- /dev/null +++ b/src/platform/plugins/shared/management/public/utils/management_app.d.ts @@ -0,0 +1,13 @@ +import type { CreateManagementItemArgs, Mount } from '../types'; +import { ManagementItem } from './management_item'; +export interface RegisterManagementAppArgs extends CreateManagementItemArgs { + mount: Mount; + basePath: string; + keywords?: string[]; +} +export declare class ManagementApp extends ManagementItem { + readonly mount: Mount; + readonly basePath: string; + readonly keywords: string[]; + constructor(args: RegisterManagementAppArgs); +} diff --git a/src/platform/plugins/shared/management/public/utils/management_item.d.ts b/src/platform/plugins/shared/management/public/utils/management_item.d.ts new file mode 100644 index 0000000000000..d8b63f89db442 --- /dev/null +++ b/src/platform/plugins/shared/management/public/utils/management_item.d.ts @@ -0,0 +1,19 @@ +import type { AppDeepLinkLocations } from '@kbn/core/public'; +import type { CreateManagementItemArgs } from '../types'; +export declare class ManagementItem { + readonly id: string; + readonly title: string; + readonly tip?: string; + readonly order: number; + readonly hideFromSidebar?: boolean; + readonly hideFromGlobalSearch?: boolean; + readonly visibleIn?: AppDeepLinkLocations[]; + readonly euiIconType?: string; + readonly icon?: string; + readonly capabilitiesId?: string; + readonly redirectFrom?: string; + enabled: boolean; + constructor({ id, title, tip, order, hideFromSidebar, hideFromGlobalSearch, visibleIn, euiIconType, icon, capabilitiesId, redirectFrom, }: CreateManagementItemArgs); + disable(): void; + enable(): void; +} diff --git a/src/platform/plugins/shared/management/public/utils/management_section.d.ts b/src/platform/plugins/shared/management/public/utils/management_section.d.ts new file mode 100644 index 0000000000000..a4dc48f58e500 --- /dev/null +++ b/src/platform/plugins/shared/management/public/utils/management_section.d.ts @@ -0,0 +1,15 @@ +import type { Assign } from '@kbn/utility-types'; +import type { CreateManagementItemArgs, ManagementSectionId } from '../types'; +import { ManagementItem } from './management_item'; +import type { RegisterManagementAppArgs } from './management_app'; +import { ManagementApp } from './management_app'; +export type RegisterManagementSectionArgs = Assign; +export declare class ManagementSection extends ManagementItem { + readonly apps: ManagementApp[]; + constructor(args: RegisterManagementSectionArgs); + registerApp(args: Omit): ManagementApp; + getApp(id: ManagementApp['id']): ManagementApp | undefined; + getAppsEnabled(): ManagementApp[]; +} diff --git a/src/platform/plugins/shared/screenshot_mode/common/constants.d.ts b/src/platform/plugins/shared/screenshot_mode/common/constants.d.ts new file mode 100644 index 0000000000000..0a76f881cccca --- /dev/null +++ b/src/platform/plugins/shared/screenshot_mode/common/constants.d.ts @@ -0,0 +1 @@ +export declare const KBN_SCREENSHOT_MODE_HEADER: string; diff --git a/src/platform/plugins/shared/screenshot_mode/common/context.d.ts b/src/platform/plugins/shared/screenshot_mode/common/context.d.ts new file mode 100644 index 0000000000000..19ce7ea5816e4 --- /dev/null +++ b/src/platform/plugins/shared/screenshot_mode/common/context.d.ts @@ -0,0 +1,20 @@ +type Context = Record; +declare global { + interface Window { + __KBN_SCREENSHOT_CONTEXT__?: Context; + } +} +/** + * Stores a value in the screenshotting context. + * @param key Context key to set. + * @param value Value to set. + */ +export declare function setScreenshotContext(key: string, value: T): void; +/** + * Retrieves a value from the screenshotting context. + * @param key Context key to get. + * @param defaultValue Value to return if the key is not found. + * @return The value stored in the screenshotting context. + */ +export declare function getScreenshotContext(key: string, defaultValue?: T): T | undefined; +export {}; diff --git a/src/platform/plugins/shared/screenshot_mode/common/index.d.ts b/src/platform/plugins/shared/screenshot_mode/common/index.d.ts new file mode 100644 index 0000000000000..2052a8a232b25 --- /dev/null +++ b/src/platform/plugins/shared/screenshot_mode/common/index.d.ts @@ -0,0 +1,3 @@ +export { getScreenshotContext, setScreenshotContext } from './context'; +export { getScreenshotMode, setScreenshotModeEnabled, setScreenshotModeDisabled, KBN_SCREENSHOT_MODE_ENABLED_KEY, } from './mode'; +export { KBN_SCREENSHOT_MODE_HEADER } from './constants'; diff --git a/src/platform/plugins/shared/screenshot_mode/common/mode.d.ts b/src/platform/plugins/shared/screenshot_mode/common/mode.d.ts new file mode 100644 index 0000000000000..7fd7fda9d1534 --- /dev/null +++ b/src/platform/plugins/shared/screenshot_mode/common/mode.d.ts @@ -0,0 +1,26 @@ +export declare const KBN_SCREENSHOT_MODE_ENABLED_KEY = "__KBN_SCREENSHOT_MODE_ENABLED_KEY__"; +declare global { + interface Window { + [KBN_SCREENSHOT_MODE_ENABLED_KEY]?: boolean; + } +} +/** + * This function is responsible for detecting whether we are currently in screenshot mode. + * + * We check in the current window context whether screenshot mode is enabled, otherwise we check + * localStorage. The ability to set a value in localStorage enables more convenient development and testing + * in functionality that needs to detect screenshot mode. + */ +export declare const getScreenshotMode: () => boolean; +/** + * Use this function to set the current browser to screenshot mode. + * + * This function should be called as early as possible to ensure that screenshot mode is + * correctly detected for the first page load. It is not suitable for use inside any plugin + * code unless the plugin code is guaranteed to, somehow, load before any other code. + * + * Additionally, we don't know what environment this code will run in so we remove as many external + * references as possible to make it portable. For instance, running inside puppeteer. + */ +export declare const setScreenshotModeEnabled: () => void; +export declare const setScreenshotModeDisabled: () => void; diff --git a/src/platform/plugins/shared/screenshot_mode/public/index.d.ts b/src/platform/plugins/shared/screenshot_mode/public/index.d.ts new file mode 100644 index 0000000000000..9054ea5da6bd6 --- /dev/null +++ b/src/platform/plugins/shared/screenshot_mode/public/index.d.ts @@ -0,0 +1,4 @@ +import { ScreenshotModePlugin } from './plugin'; +export declare function plugin(): ScreenshotModePlugin; +export { KBN_SCREENSHOT_MODE_HEADER, setScreenshotModeEnabled, KBN_SCREENSHOT_MODE_ENABLED_KEY, } from '../common'; +export type { ScreenshotModePublicSetup as ScreenshotModePluginSetup, ScreenshotModePublicStart as ScreenshotModePluginStart, } from './types'; diff --git a/src/platform/plugins/shared/screenshot_mode/public/plugin.d.ts b/src/platform/plugins/shared/screenshot_mode/public/plugin.d.ts new file mode 100644 index 0000000000000..b0d2562a5a20b --- /dev/null +++ b/src/platform/plugins/shared/screenshot_mode/public/plugin.d.ts @@ -0,0 +1,8 @@ +import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import type { ScreenshotModePublicSetup, ScreenshotModePublicSetupDependencies, ScreenshotModePublicStart, ScreenshotModePublicStartDependencies } from './types'; +export declare class ScreenshotModePlugin implements Plugin { + private publicContract; + setup(_core: CoreSetup): ScreenshotModePublicSetup; + start(_core: CoreStart): ScreenshotModePublicStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/screenshot_mode/public/types.d.ts b/src/platform/plugins/shared/screenshot_mode/public/types.d.ts new file mode 100644 index 0000000000000..f20e03be960cb --- /dev/null +++ b/src/platform/plugins/shared/screenshot_mode/public/types.d.ts @@ -0,0 +1,19 @@ +export interface ScreenshotModePublicSetup { + /** + * Retrieves a value from the screenshotting context. + * @param key Context key to get. + * @param defaultValue Value to return if the key is not found. + * @return The value stored in the screenshotting context. + */ + getScreenshotContext(key: string, defaultValue?: T): T | undefined; + /** + * Returns a boolean indicating whether the current user agent (browser) would like to view UI optimized for + * screenshots or printing. + */ + isScreenshotMode(): boolean; +} +export type ScreenshotModePublicStart = ScreenshotModePublicSetup; +export interface ScreenshotModePublicSetupDependencies { +} +export interface ScreenshotModePublicStartDependencies { +} diff --git a/src/platform/plugins/shared/share/common/anonymous_access/index.d.ts b/src/platform/plugins/shared/share/common/anonymous_access/index.d.ts new file mode 100644 index 0000000000000..a83c10ecadad6 --- /dev/null +++ b/src/platform/plugins/shared/share/common/anonymous_access/index.d.ts @@ -0,0 +1 @@ +export type { AnonymousAccessServiceContract, AnonymousAccessState } from './types'; diff --git a/src/platform/plugins/shared/share/common/anonymous_access/types.d.ts b/src/platform/plugins/shared/share/common/anonymous_access/types.d.ts new file mode 100644 index 0000000000000..3329bf686e54e --- /dev/null +++ b/src/platform/plugins/shared/share/common/anonymous_access/types.d.ts @@ -0,0 +1,29 @@ +import type { Capabilities } from '@kbn/core/public'; +/** + * The contract that is used to check anonymous access for the purposes of sharing public links. The implementation is intended to be + * provided by the security plugin. + */ +export interface AnonymousAccessServiceContract { + /** + * This function returns the current state of anonymous access. + */ + getState: () => Promise; + /** + * This function returns the capabilities of the anonymous access user. + */ + getCapabilities: () => Promise; +} +/** + * The state of anonymous access. + */ +export interface AnonymousAccessState { + /** + * Whether anonymous access is enabled or not. + */ + isEnabled: boolean; + /** + * If anonymous access is enabled, this reflects what URL parameters need to be added to a Kibana link to make it publicly accessible. + * Note that if anonymous access is the only authentication method, this will be null. + */ + accessURLParameters: Record | null; +} diff --git a/src/platform/plugins/shared/share/common/constants.d.ts b/src/platform/plugins/shared/share/common/constants.d.ts new file mode 100644 index 0000000000000..14f61e2e7d2d7 --- /dev/null +++ b/src/platform/plugins/shared/share/common/constants.d.ts @@ -0,0 +1,2 @@ +export declare const CSV_SEPARATOR_SETTING = "csv:separator"; +export declare const CSV_QUOTE_VALUES_SETTING = "csv:quoteValues"; diff --git a/src/platform/plugins/shared/share/common/index.d.ts b/src/platform/plugins/shared/share/common/index.d.ts new file mode 100644 index 0000000000000..b1f66026fe42d --- /dev/null +++ b/src/platform/plugins/shared/share/common/index.d.ts @@ -0,0 +1,3 @@ +export type { LocatorDefinition, LocatorPublic } from './url_service'; +export { useLocatorUrl } from './url_service'; +export type { AnonymousAccessServiceContract, AnonymousAccessState } from './anonymous_access'; diff --git a/src/platform/plugins/shared/share/common/url_service/index.d.ts b/src/platform/plugins/shared/share/common/url_service/index.d.ts new file mode 100644 index 0000000000000..76012c40fd338 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/index.d.ts @@ -0,0 +1,3 @@ +export * from './url_service'; +export * from './locators'; +export type * from './short_urls'; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/index.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/index.d.ts new file mode 100644 index 0000000000000..eba4349a97365 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/index.d.ts @@ -0,0 +1,5 @@ +export type * from './types'; +export * from './locator'; +export * from './locator_client'; +export * from './redirect'; +export { useLocatorUrl } from './use_locator_url'; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/legacy_short_url_locator.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/legacy_short_url_locator.d.ts new file mode 100644 index 0000000000000..93d2e676f7854 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/legacy_short_url_locator.d.ts @@ -0,0 +1,10 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { KibanaLocation, LocatorDefinition } from '..'; +export declare const LEGACY_SHORT_URL_LOCATOR_ID = "LEGACY_SHORT_URL_LOCATOR"; +export interface LegacyShortUrlLocatorParams extends SerializableRecord { + url: string; +} +export declare class LegacyShortUrlLocatorDefinition implements LocatorDefinition { + readonly id = "LEGACY_SHORT_URL_LOCATOR"; + getLocation(params: LegacyShortUrlLocatorParams): Promise; +} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/locator.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/locator.d.ts new file mode 100644 index 0000000000000..cc4f60fdb4b71 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/locator.d.ts @@ -0,0 +1,39 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { DependencyList } from 'react'; +import type { PersistableState } from '@kbn/kibana-utils-plugin/common'; +import type { LocatorDefinition, LocatorPublic, KibanaLocation, LocatorNavigationParams, LocatorGetUrlParams } from './types'; +import type { GetRedirectUrlOptions } from './redirect'; +export interface LocatorDependencies { + /** + * Public URL of the Kibana server. + */ + baseUrl?: string; + /** + * Current version of Kibana, e.g. `7.0.0`. + */ + version?: string; + /** + * Navigate without reloading the page to a KibanaLocation. + */ + navigate: (location: KibanaLocation, params?: LocatorNavigationParams) => Promise; + /** + * Resolve a Kibana URL given KibanaLocation. + */ + getUrl: (location: KibanaLocation, getUrlParams: LocatorGetUrlParams) => Promise; +} +export declare class Locator

implements LocatorPublic

{ + readonly definition: LocatorDefinition

; + protected readonly deps: LocatorDependencies; + readonly id: string; + readonly migrations: PersistableState

['migrations']; + constructor(definition: LocatorDefinition

, deps: LocatorDependencies); + readonly telemetry: PersistableState

['telemetry']; + readonly inject: PersistableState

['inject']; + readonly extract: PersistableState

['extract']; + getLocation(params: P): Promise; + getUrl(params: P, { absolute }?: LocatorGetUrlParams): Promise; + getRedirectUrl(params: P, options?: GetRedirectUrlOptions): string; + navigate(params: P, { replace }?: LocatorNavigationParams): Promise; + navigateSync(locatorParams: P, navigationParams?: LocatorNavigationParams): void; + readonly useUrl: (params: P, getUrlParams?: LocatorGetUrlParams, deps?: DependencyList) => string; +} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/locator_client.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/locator_client.d.ts new file mode 100644 index 0000000000000..ad3fa21c5ec24 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/locator_client.d.ts @@ -0,0 +1,46 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { MigrateFunctionsObject } from '@kbn/kibana-utils-plugin/common'; +import type { SavedObjectReference } from '@kbn/core/server'; +import type { DependencyList } from 'react'; +import type { LocatorDependencies } from './locator'; +import type { LocatorDefinition, LocatorPublic, ILocatorClient, LocatorData, LocatorGetUrlParams } from './types'; +import { Locator } from './locator'; +import type { LocatorsMigrationMap } from '.'; +export type LocatorClientDependencies = LocatorDependencies; +export declare class LocatorClient implements ILocatorClient { + protected readonly deps: LocatorClientDependencies; + /** + * Collection of registered locators. + */ + protected locators: Map>; + constructor(deps: LocatorClientDependencies); + /** + * Creates and register a URL locator. + * + * @param definition A definition of URL locator. + * @returns A public interface of URL locator. + */ + create

(definition: LocatorDefinition

): LocatorPublic

; + /** + * Returns a previously registered URL locator. + * + * @param id ID of a URL locator. + * @returns A public interface of a registered URL locator. + */ + get

(id: string): undefined | LocatorPublic

; + readonly useUrl:

(params: () => { + id: string; + params: P; + }, deps?: DependencyList, getUrlParams?: LocatorGetUrlParams) => string | undefined; + protected getOrThrow

(id: string): LocatorPublic

; + migrations(): { + [locatorId: string]: MigrateFunctionsObject; + }; + telemetry(state: LocatorData, collector: Record): Record; + inject(state: LocatorData, references: SavedObjectReference[]): LocatorData; + extract(state: LocatorData): { + state: LocatorData; + references: SavedObjectReference[]; + }; + readonly getAllMigrations: () => LocatorsMigrationMap; +} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/format_search_params.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/format_search_params.d.ts new file mode 100644 index 0000000000000..48f445e5f0315 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/redirect/format_search_params.d.ts @@ -0,0 +1,5 @@ +import type { RedirectOptions } from './types'; +export interface FormatSearchParamsOptions { + lzCompress?: boolean; +} +export declare function formatSearchParams(opts: RedirectOptions, { lzCompress }?: FormatSearchParamsOptions): URLSearchParams; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/index.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/index.d.ts new file mode 100644 index 0000000000000..ea179fa712190 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/redirect/index.d.ts @@ -0,0 +1,4 @@ +export type * from './types'; +export * from './format_search_params'; +export * from './parse_search_params'; +export * from './space_url_parser'; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/parse_search_params.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/parse_search_params.d.ts new file mode 100644 index 0000000000000..35559cfac3694 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/redirect/parse_search_params.d.ts @@ -0,0 +1,14 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { RedirectOptions } from './types'; +/** + * Parses redirect endpoint URL path search parameters. Expects them in the + * following form: + * + * ``` + * /r?l=&v=&p= + * ``` + * + * @param urlSearch Search part of URL path. + * @returns Parsed out locator ID, version, and locator params. + */ +export declare function parseSearchParams

(urlSearch: string): RedirectOptions

; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/space_url_parser.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/space_url_parser.d.ts new file mode 100644 index 0000000000000..d974d553fe12d --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/redirect/space_url_parser.d.ts @@ -0,0 +1 @@ +export declare function addSpaceIdToPath(basePath?: string, spaceId?: string, requestedPath?: string): string; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/types.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/types.d.ts new file mode 100644 index 0000000000000..8109fa12945db --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/redirect/types.d.ts @@ -0,0 +1,27 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { FormatSearchParamsOptions } from './format_search_params'; +/** + * @public + * Serializable locator parameters that can be used by the redirect service to navigate to a + * location in Kibana. + * + * When passed to the public `share` plugin `.navigate()` function, locator params will also + * be migrated. + */ +export interface RedirectOptions

{ + /** Locator ID. */ + id: string; + /** Kibana version when locator params were generated. */ + version: string; + /** Locator params. */ + params: P; +} +export interface GetRedirectUrlOptions extends FormatSearchParamsOptions { + /** + * Optional space ID to use when generating the URL. + * If not provided: + * - on the client the current space ID will be used. + * - on the server the URL will be generated without a space ID. + */ + spaceId?: string; +} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/short_url_assert_valid.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/short_url_assert_valid.d.ts new file mode 100644 index 0000000000000..e1df30231aa95 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/short_url_assert_valid.d.ts @@ -0,0 +1 @@ +export declare function shortUrlAssertValid(url: string): void; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/short_url_redirect_locator.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/short_url_redirect_locator.d.ts new file mode 100644 index 0000000000000..2efaae88e2f81 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/short_url_redirect_locator.d.ts @@ -0,0 +1,13 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { KibanaLocation, LocatorDefinition } from '..'; +export declare const SHORT_URL_REDIRECT_LOCATOR = "SHORT_URL_REDIRECT_LOCATOR"; +export interface ShortUrlRedirectLocatorParams extends SerializableRecord { + slug: string; +} +/** + * Locator that points to a frontend short URL redirect app by slug. + */ +export declare class ShortUrlRedirectLocatorDefinition implements LocatorDefinition { + readonly id = "SHORT_URL_REDIRECT_LOCATOR"; + getLocation(params: ShortUrlRedirectLocatorParams): Promise; +} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/types.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/types.d.ts new file mode 100644 index 0000000000000..685cb1fb67af3 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/types.d.ts @@ -0,0 +1,143 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { DependencyList } from 'react'; +import type { MigrateFunction, PersistableState, PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common'; +import type { GetRedirectUrlOptions } from './redirect'; +/** + * URL locator registry. + */ +export interface ILocatorClient extends PersistableStateService { + /** + * Create and register a new locator. + * + * @param locatorDefinition Definition of the new locator. + */ + create

(locatorDefinition: LocatorDefinition

): LocatorPublic

; + /** + * Retrieve a previously registered locator. + * + * @param id Unique ID of the locator. + */ + get

(id: string): undefined | LocatorPublic

; +} +/** + * A convenience interface used to define and register a locator. + */ +export interface LocatorDefinition

extends Partial> { + /** + * Unique ID of the locator. Should be constant and unique across Kibana. + */ + id: string; + /** + * Returns a deep link, including location state, which can be used for + * navigation in Kibana. + * + * @param params Parameters from which to generate a Kibana location. + */ + getLocation(params: P): Promise; +} +/** + * Public interface of a registered locator. + */ +export interface LocatorPublic

extends PersistableState

{ + readonly id: string; + /** + * Returns a reference to a Kibana client-side location. + * + * @param params URL locator parameters. + */ + getLocation(params: P): Promise; + /** + * Returns a URL as a string. + * + * You may want to use `getRedirectUrl` instead. `getRedirectUrl` will + * preserve the location state, whereas the `getUrl` just returns the URL + * without the location state. Use this method if you know you don't need + * remember the location state and version of the URL locator. + * + * @param params URL locator parameters. + * @param getUrlParams URL construction parameters. + */ + getUrl(params: P, getUrlParams?: LocatorGetUrlParams): Promise; + /** + * Returns a URL to the redirect endpoint, which will redirect the user to + * the final destination. + * + * @param params URL locator parameters. + * @param options URL serialization options. + */ + getRedirectUrl(params: P, options?: GetRedirectUrlOptions): string; + /** + * Navigate using the `core.application.navigateToApp()` method to a Kibana + * location generated by this locator. This method is available only on the + * browser. + * + * @param params URL locator parameters. + * @param navigationParams Navigation parameters. + */ + navigate(params: P, navigationParams?: LocatorNavigationParams): Promise; + /** + * Synchronous fire-and-forget navigation method. Use it when you want to + * navigate without waiting for the navigation to complete and you don't + * care to process any async promise errors. + * + * @param params URL locator parameters. + * @param navigationParams Navigation parameters. + */ + navigateSync(params: P, navigationParams?: LocatorNavigationParams): void; + /** + * React hook which returns a URL string given locator parameters. Returns + * empty string if URL is being loaded or an error happened. + */ + useUrl: (params: P, getUrlParams?: LocatorGetUrlParams, deps?: DependencyList) => string; +} +/** + * Parameters used when navigating on client-side using browser history object. + */ +export interface LocatorNavigationParams { + /** + * Whether to replace a navigation entry in history queue or push a new entry. + */ + replace?: boolean; +} +/** + * Parameters used when constructing a string URL. + */ +export interface LocatorGetUrlParams { + /** + * Whether to return an absolute long URL or relative short URL. + */ + absolute?: boolean; +} +/** + * This interface represents a location in Kibana to which one can navigate + * using the `core.application.navigateToApp()` method. + */ +export interface KibanaLocation { + /** + * Kibana application ID. + */ + app: string; + /** + * A relative URL path within a Kibana application. + */ + path: string; + /** + * A serializable location state object, which the app can use to determine + * what should be displayed on the screen. + */ + state: S; +} +/** + * Represents a serializable state of a locator. Includes locator ID, version + * and its params. + */ +export interface LocatorData extends VersionedState, SerializableRecord { + /** + * Locator ID. + */ + id: string; +} +export interface LocatorsMigrationMap { + [semver: string]: LocatorMigrationFunction; +} +export type LocatorMigrationFunction = MigrateFunction; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/use_locator_url.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/use_locator_url.d.ts new file mode 100644 index 0000000000000..77cf9a7aa16f7 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/locators/use_locator_url.d.ts @@ -0,0 +1,4 @@ +import type { DependencyList } from 'react'; +import type { SerializableRecord } from '@kbn/utility-types'; +import type { LocatorGetUrlParams, LocatorPublic } from '..'; +export declare const useLocatorUrl:

(locator: LocatorPublic

| null | undefined, params: P, getUrlParams?: LocatorGetUrlParams, deps?: DependencyList) => string; diff --git a/src/platform/plugins/shared/share/common/url_service/short_urls/index.d.ts b/src/platform/plugins/shared/share/common/url_service/short_urls/index.d.ts new file mode 100644 index 0000000000000..a2dddad7107a4 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/short_urls/index.d.ts @@ -0,0 +1 @@ +export type * from './types'; diff --git a/src/platform/plugins/shared/share/common/url_service/short_urls/types.d.ts b/src/platform/plugins/shared/share/common/url_service/short_urls/types.d.ts new file mode 100644 index 0000000000000..d1f702b478163 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/short_urls/types.d.ts @@ -0,0 +1,103 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { LocatorPublic, ILocatorClient, LocatorData } from '../locators'; +/** + * A factory for Short URL Service. We need this factory as the dependency + * injection is different between the server and the client. On the server, + * the Short URL Service needs a saved object client scoped to the current + * request and the current Kibana version. On the client, the Short URL Service + * needs no dependencies. + */ +export interface IShortUrlClientFactory { + get(dependencies: D): Client; +} +export type IShortUrlClientFactoryProvider = (params: { + locators: ILocatorClient; +}) => IShortUrlClientFactory; +/** + * CRUD-like API for short URLs. + */ +export interface IShortUrlClient { + /** + * Create a new short URL. + * + * @param locator The locator for the URL. + * @param param The parameters for the URL. + * @returns The created short URL. + */ + create

(params: ShortUrlCreateParams

): Promise>; + /** + * Delete a short URL. + * + * @param slug The ID of the short URL. + */ + delete(id: string): Promise; + /** + * Fetch a short URL. + * + * @param id The ID of the short URL. + */ + get(id: string): Promise; + /** + * Fetch a short URL by its slug. + * + * @param slug The slug of the short URL. + */ + resolve(slug: string): Promise; +} +/** + * New short URL creation parameters. + */ +export interface ShortUrlCreateParams

{ + /** + * Locator which will be used to resolve the short URL. + */ + locator: LocatorPublic

; + /** + * Locator parameters which will be used to resolve the short URL. + */ + params: P; + /** + * Optional, short URL slug - the part that will be used to resolve the short + * URL. This part will be visible to the user, it can have user-friendly text. + */ + slug?: string; +} +/** + * A representation of a short URL. + */ +export interface ShortUrl { + /** + * Serializable state of the short URL, which is stored in Kibana. + */ + readonly data: ShortUrlData; +} +/** + * A representation of a short URL's data. + */ +export interface ShortUrlData { + /** + * Unique ID of the short URL. + */ + readonly id: string; + /** + * The slug of the short URL, the part after the `/` in the URL. + */ + readonly slug: string; + /** + * Number of times the short URL has been resolved. + */ + readonly accessCount: number; + /** + * The timestamp of the last time the short URL was resolved. + */ + readonly accessDate: number; + /** + * The timestamp when the short URL was created. + */ + readonly createDate: number; + /** + * The timestamp when the short URL was last modified. + */ + readonly locator: LocatorData; +} +export type { LocatorData }; diff --git a/src/platform/plugins/shared/share/common/url_service/url_service.d.ts b/src/platform/plugins/shared/share/common/url_service/url_service.d.ts new file mode 100644 index 0000000000000..c49ee541b1167 --- /dev/null +++ b/src/platform/plugins/shared/share/common/url_service/url_service.d.ts @@ -0,0 +1,18 @@ +import type { LocatorClientDependencies } from './locators'; +import { LocatorClient } from './locators'; +import type { IShortUrlClientFactoryProvider, IShortUrlClientFactory, IShortUrlClient } from './short_urls'; +export interface UrlServiceDependencies extends LocatorClientDependencies { + shortUrls: IShortUrlClientFactoryProvider; +} +/** + * Common URL Service client interface for server-side and client-side. + */ +export declare class UrlService { + protected readonly deps: UrlServiceDependencies; + /** + * Client to work with locators. + */ + readonly locators: LocatorClient; + readonly shortUrls: IShortUrlClientFactory; + constructor(deps: UrlServiceDependencies); +} diff --git a/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/draft_mode_callout.d.ts b/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/draft_mode_callout.d.ts new file mode 100644 index 0000000000000..2de78d376b3d9 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/draft_mode_callout.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; +import type { CommonProps } from '@elastic/eui'; +export interface SaveButtonProps extends CommonProps { + onSave: () => Promise; + label?: string; + isSaving?: boolean; +} +export interface DraftModeCalloutProps extends CommonProps { + message?: string; + saveButtonProps?: SaveButtonProps; +} +/** + * A warning callout to indicate the user has unsaved changes. + */ +export declare const DraftModeCallout: ({ message, ["data-test-subj"]: dataTestSubj, saveButtonProps, }: DraftModeCalloutProps) => React.JSX.Element; diff --git a/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/index.d.ts b/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/index.d.ts new file mode 100644 index 0000000000000..8bdccf2e1b99c --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/index.d.ts @@ -0,0 +1,2 @@ +export { DraftModeCallout } from './draft_mode_callout'; +export type { DraftModeCalloutProps } from './draft_mode_callout'; diff --git a/src/platform/plugins/shared/share/public/components/context/index.d.ts b/src/platform/plugins/shared/share/public/components/context/index.d.ts new file mode 100644 index 0000000000000..2f5e1bd28bba1 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/context/index.d.ts @@ -0,0 +1,146 @@ +import React, { type PropsWithChildren } from 'react'; +import type { ShareConfigs, ShareTypes, ShowShareMenuOptions } from '../../types'; +export interface IShareContext extends Omit { + onClose: () => void; + shareMenuItems: ShareConfigs[]; + isSaving?: boolean; +} +export declare const ShareProvider: ({ shareContext, children, }: PropsWithChildren<{ + shareContext: IShareContext; +}>) => React.JSX.Element; +export declare const useShareContext: () => IShareContext; +export declare const useShareTypeContext: , G extends T extends "integration" ? string : never>(shareType: T, groupId?: G) => { + objectTypeMeta: Omit; + export: { + [x: string]: { + draftModeCallOut?: boolean | import("../common/draft_mode_callout").DraftModeCalloutProps; + helpText?: React.ReactNode; + CTAButtonConfig?: { + id: string; + dataTestSubj: string; + label: string; + }; + disabled?: boolean; + }; + }; + }; + }>, "config"> & { + config: T extends "integration" ? NonNullable; + export: { + [x: string]: { + draftModeCallOut?: boolean | import("../common/draft_mode_callout").DraftModeCalloutProps; + helpText?: React.ReactNode; + CTAButtonConfig?: { + id: string; + dataTestSubj: string; + label: string; + }; + disabled?: boolean; + }; + }; + }; + }>>["integration"]>[G] | undefined : Exclude; + export: { + [x: string]: { + draftModeCallOut?: boolean | import("../common/draft_mode_callout").DraftModeCalloutProps; + helpText?: React.ReactNode; + CTAButtonConfig?: { + id: string; + dataTestSubj: string; + label: string; + }; + disabled?: boolean; + }; + }; + }; + }>>, "integration">[T]; + }; + shareMenuItems: T extends "integration" ? (Extract | Extract | Extract | Extract | Extract | Extract)[] : Extract | Extract | Extract | Extract | Extract | Extract; + onClose: () => void; + isSaving?: boolean; + onSave?: (() => Promise) | undefined; + objectType: string; + objectTypeAlias?: string | undefined; + objectId?: string | undefined; + shareableUrl?: string | undefined; + shareableUrlForSavedObject?: string | undefined; + shareableUrlLocatorParams?: { + locator: import("../..").LocatorPublic; + params: import("../../types").ShareableLocatorParams; + } | undefined; + sharingData: import("../../types").SharingData & Record; + isDirty: boolean; + anchorElement?: HTMLElement | undefined; + asExport?: boolean | undefined; + allowShortUrl: boolean; + publicAPIEnabled?: boolean | undefined; +}; diff --git a/src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.d.ts b/src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.d.ts new file mode 100644 index 0000000000000..e99bcafc0b27a --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.d.ts @@ -0,0 +1,24 @@ +import React, { type FC } from 'react'; +import type { InjectedIntl } from '@kbn/i18n-react'; +import { type IShareContext, useShareTypeContext } from '../context'; +import type { ExportShareConfig, ShareContext } from '../../types'; +export declare const ExportMenu: FC<{ + shareContext: IShareContext; +}>; +export interface ManagedExportFlyoutProps { + exportIntegration: ExportShareConfig; + intl: InjectedIntl; + isDirty: boolean; + onCloseFlyout: () => void; + publicAPIEnabled?: boolean; + shareObjectType: string; + shareObjectTypeAlias?: string; + shareObjectTypeMeta: ReturnType>['objectTypeMeta']; + onSave?: () => Promise; + isSaving?: boolean; + sharingData: { + [key: string]: unknown; + }; + shareableUrlLocatorParams?: ShareContext['shareableUrlLocatorParams']; +} +export declare function ManagedExportFlyout({ exportIntegration, intl, isDirty, onCloseFlyout, publicAPIEnabled, shareObjectTypeMeta, shareObjectType, shareObjectTypeAlias, onSave, isSaving, sharingData, }: ManagedExportFlyoutProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/share/public/components/export_integrations/index.d.ts b/src/platform/plugins/shared/share/public/components/export_integrations/index.d.ts new file mode 100644 index 0000000000000..0c08172b0c8b8 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/export_integrations/index.d.ts @@ -0,0 +1 @@ +export { ExportMenu, ManagedExportFlyout, type ManagedExportFlyoutProps, } from './export_integrations'; diff --git a/src/platform/plugins/shared/share/public/components/share_tabs.d.ts b/src/platform/plugins/shared/share/public/components/share_tabs.d.ts new file mode 100644 index 0000000000000..031f7868cef13 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/share_tabs.d.ts @@ -0,0 +1,6 @@ +import React, { type FC } from 'react'; +import { type IShareContext } from './context'; +export declare const ShareMenu: FC<{ + shareContext: IShareContext; +}>; +export declare const ShareMenuTabs: () => React.JSX.Element | null; diff --git a/src/platform/plugins/shared/share/public/components/tabs/embed/embed_content.d.ts b/src/platform/plugins/shared/share/public/components/tabs/embed/embed_content.d.ts new file mode 100644 index 0000000000000..2a1cca37dd9ba --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/tabs/embed/embed_content.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { type IShareContext } from '../../context'; +import type { EmbedShareConfig, EmbedShareUIConfig } from '../../../types'; +type EmbedProps = Pick & EmbedShareConfig['config'] & { + objectConfig?: EmbedShareUIConfig; +}; +export declare const EmbedContent: ({ shareableUrlForSavedObject, shareableUrl, shareableUrlLocatorParams, objectType, objectConfig, isDirty, allowShortUrl, shortUrlService, anonymousAccess, }: EmbedProps) => React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/share/public/components/tabs/embed/index.d.ts b/src/platform/plugins/shared/share/public/components/tabs/embed/index.d.ts new file mode 100644 index 0000000000000..5d7c69f209d18 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/tabs/embed/index.d.ts @@ -0,0 +1,7 @@ +import { type IModalTabDeclaration } from '@kbn/shared-ux-tabbed-modal'; +type IEmbedTab = IModalTabDeclaration<{ + url: string; + isNotSaved: boolean; +}>; +export declare const embedTab: IEmbedTab; +export {}; diff --git a/src/platform/plugins/shared/share/public/components/tabs/index.d.ts b/src/platform/plugins/shared/share/public/components/tabs/index.d.ts new file mode 100644 index 0000000000000..944ac113d8015 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/tabs/index.d.ts @@ -0,0 +1,2 @@ +export { linkTab } from './link'; +export { embedTab } from './embed'; diff --git a/src/platform/plugins/shared/share/public/components/tabs/link/index.d.ts b/src/platform/plugins/shared/share/public/components/tabs/link/index.d.ts new file mode 100644 index 0000000000000..514fdd6c70ad3 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/tabs/link/index.d.ts @@ -0,0 +1,8 @@ +import { type IModalTabDeclaration } from '@kbn/shared-ux-tabbed-modal'; +type ILinkTab = IModalTabDeclaration<{ + dashboardUrl: string; + isNotSaved: boolean; + setIsClicked: boolean; +}>; +export declare const linkTab: ILinkTab; +export {}; diff --git a/src/platform/plugins/shared/share/public/components/tabs/link/link_content.d.ts b/src/platform/plugins/shared/share/public/components/tabs/link/link_content.d.ts new file mode 100644 index 0000000000000..693f0474c08b1 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/tabs/link/link_content.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { type IShareContext } from '../../context'; +import type { LinkShareConfig, LinkShareUIConfig } from '../../../types'; +type LinkProps = Pick & LinkShareConfig['config'] & { + objectConfig?: LinkShareUIConfig; +}; +export declare const LinkContent: ({ isDirty, objectType, objectConfig, shareableUrl, shortUrlService, shareableUrlLocatorParams, allowShortUrl, }: LinkProps) => React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/share/public/components/tabs/link/time_type_section.d.ts b/src/platform/plugins/shared/share/public/components/tabs/link/time_type_section.d.ts new file mode 100644 index 0000000000000..d54e071325709 --- /dev/null +++ b/src/platform/plugins/shared/share/public/components/tabs/link/time_type_section.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +interface TimeRange { + from: string; + to: string; +} +interface Props { + timeRange?: TimeRange; + isAbsoluteTimeByDefault: boolean; + onTimeTypeChange?: (isAbsolute: boolean) => void; +} +export declare const TimeTypeSection: ({ timeRange, onTimeTypeChange, isAbsoluteTimeByDefault, }: Props) => React.JSX.Element | null; +export {}; diff --git a/src/platform/plugins/shared/share/public/index.d.ts b/src/platform/plugins/shared/share/public/index.d.ts new file mode 100644 index 0000000000000..0b648f9342cc9 --- /dev/null +++ b/src/platform/plugins/shared/share/public/index.d.ts @@ -0,0 +1,14 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +export type { ConfigSchema } from '../server/config'; +export { CSV_QUOTE_VALUES_SETTING, CSV_SEPARATOR_SETTING } from '../common/constants'; +export type { LocatorDefinition, LocatorPublic, KibanaLocation } from '../common/url_service'; +export type { SharePublicSetup as SharePluginSetup, SharePublicStart as SharePluginStart, } from './plugin'; +export type { ShareContext, ShareMenuItemLegacy, ShowShareMenuOptions, ShareContextMenuPanelItem, BrowserUrlService, ExportShare, ExportShareConfig, ExportShareDerivatives, ExportShareParameters, RegisterShareIntegrationArgs, ShareableLocatorParams, SharingData, ShareActionConfigArgs, } from './types'; +export type { RedirectOptions } from '../common/url_service'; +export { useLocatorUrl } from '../common/url_service/locators/use_locator_url'; +import { SharePlugin } from './plugin'; +export { downloadMultipleAs, downloadFileAs } from './lib/download_as'; +export type { DownloadableContent } from './lib/download_as'; +export { convertRelativeTimeStringToAbsoluteTimeString } from './lib/time_utils'; +export declare function plugin(ctx: PluginInitializerContext): SharePlugin; +export { useShareTypeContext } from './components/context'; diff --git a/src/platform/plugins/shared/share/public/lib/download_as.d.ts b/src/platform/plugins/shared/share/public/lib/download_as.d.ts new file mode 100644 index 0000000000000..dd25c903a62f0 --- /dev/null +++ b/src/platform/plugins/shared/share/public/lib/download_as.d.ts @@ -0,0 +1,21 @@ +export type DownloadableContent = { + content: string; + type: string; +} | Blob; +/** + * Convenient method to use for a single file download + * **Note**: for multiple files use the downloadMultipleAs method, do not iterate with this method here + * @param filename full name of the file + * @param payload either a Blob content, or a Record with a stringified content and type + * + * @returns a Promise that resolves when the download has been correctly started + */ +export declare function downloadFileAs(filename: string, payload: DownloadableContent): Promise; +/** + * Multiple files download method + * @param files a Record containing one entry per file: the key entry should be the filename + * and the value either a Blob content, or a Record with a stringified content and type + * + * @returns a Promise that resolves when all the downloads have been correctly started + */ +export declare function downloadMultipleAs(files: Record): Promise; diff --git a/src/platform/plugins/shared/share/public/lib/get_home_href.d.ts b/src/platform/plugins/shared/share/public/lib/get_home_href.d.ts new file mode 100644 index 0000000000000..b32c5e0b746bd --- /dev/null +++ b/src/platform/plugins/shared/share/public/lib/get_home_href.d.ts @@ -0,0 +1,2 @@ +import type { HttpSetup, IUiSettingsClient } from '@kbn/core/public'; +export declare function getHomeHref(http: HttpSetup, uiSettings: IUiSettingsClient): string; diff --git a/src/platform/plugins/shared/share/public/lib/registrations.d.ts b/src/platform/plugins/shared/share/public/lib/registrations.d.ts new file mode 100644 index 0000000000000..4d01e86bcd52f --- /dev/null +++ b/src/platform/plugins/shared/share/public/lib/registrations.d.ts @@ -0,0 +1,8 @@ +import type { AnalyticsServiceSetup } from '@kbn/core-analytics-browser'; +interface SetupDeps { + analytics: AnalyticsServiceSetup; +} +export declare const registrations: { + setup(deps: SetupDeps): void; +}; +export {}; diff --git a/src/platform/plugins/shared/share/public/lib/time_utils.d.ts b/src/platform/plugins/shared/share/public/lib/time_utils.d.ts new file mode 100644 index 0000000000000..381ce83839c20 --- /dev/null +++ b/src/platform/plugins/shared/share/public/lib/time_utils.d.ts @@ -0,0 +1,15 @@ +export declare const getRelativeTimeValueAndUnitFromTimeString: (dateString?: string) => { + value: number; + unit: string | undefined; + roundingUnit: string | undefined; +} | undefined; +export declare const convertRelativeTimeStringToAbsoluteTimeDate: (dateString?: string, options?: { + roundUp?: boolean; +}) => Date | undefined; +export declare const convertRelativeTimeStringToAbsoluteTimeString: (dateString?: string, options?: { + roundUp?: boolean; +}) => string | undefined; +export declare const isTimeRangeAbsoluteTime: (timeRange?: { + from: string; + to: string; +}) => boolean; diff --git a/src/platform/plugins/shared/share/public/plugin.d.ts b/src/platform/plugins/shared/share/public/plugin.d.ts new file mode 100644 index 0000000000000..e0d419643b20d --- /dev/null +++ b/src/platform/plugins/shared/share/public/plugin.d.ts @@ -0,0 +1,59 @@ +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; +import type { ShareMenuManagerStart } from './services'; +import type { ShareMenuRegistrySetup } from './services'; +import { ShareRegistry } from './services'; +import type { RedirectOptions } from '../common/url_service/locators/redirect'; +import type { AnonymousAccessServiceContract } from '../common'; +import type { BrowserUrlService } from './types'; +/** @public */ +export interface SharePublicSetup extends ShareMenuRegistrySetup { + /** + * Utilities to work with URL locators and short URLs. + */ + url: BrowserUrlService; + /** + * Accepts serialized values for extracting a locator, migrating state from a provided version against + * the locator, then using the locator to navigate. + */ + navigate(options: RedirectOptions): void; + /** + * Sets the provider for the anonymous access service; this is consumed by the Security plugin to avoid a circular dependency. + */ + setAnonymousAccessServiceProvider: (provider: () => AnonymousAccessServiceContract) => void; +} +/** @public */ +export type SharePublicStart = ShareMenuManagerStart & { + /** + * Utilities to work with URL locators and short URLs. + */ + url: BrowserUrlService; + /** + * Accepts serialized values for extracting a locator, migrating state from a provided version against + * the locator, then using the locator to navigate. + */ + navigate(options: RedirectOptions): void; + /** + * method to get all available integrations + */ + availableIntegrations: ShareRegistry['availableIntegrations']; +}; +export interface SharePublicSetupDependencies { +} +export interface SharePublicStartDependencies { +} +export declare class SharePlugin implements Plugin { + private readonly initializerContext; + private readonly shareRegistry; + private readonly shareContextMenu; + private redirectManager?; + private url?; + private anonymousAccessServiceProvider?; + private licenseSubscription?; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup): SharePublicSetup; + start(core: CoreStart, { licensing }: { + licensing?: LicensingPluginStart; + }): SharePublicStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/share/public/services/index.d.ts b/src/platform/plugins/shared/share/public/services/index.d.ts new file mode 100644 index 0000000000000..fdef4c71d793e --- /dev/null +++ b/src/platform/plugins/shared/share/public/services/index.d.ts @@ -0,0 +1,2 @@ +export * from './share_menu_registry'; +export * from './share_menu_manager'; diff --git a/src/platform/plugins/shared/share/public/services/share_menu_manager.d.ts b/src/platform/plugins/shared/share/public/services/share_menu_manager.d.ts new file mode 100644 index 0000000000000..bc93f5ed8db89 --- /dev/null +++ b/src/platform/plugins/shared/share/public/services/share_menu_manager.d.ts @@ -0,0 +1,38 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { InjectedIntl } from '@kbn/i18n-react'; +import type { ShowShareMenuOptions } from '../types'; +import type { ShareRegistry } from './share_menu_registry'; +interface ShareMenuManagerStartDeps { + core: CoreStart; + isServerless: boolean; + resolveShareItemsForShareContext: ShareRegistry['resolveShareItemsForShareContext']; +} +export declare class ShareMenuManager { + private isOpen; + private container; + start({ core, resolveShareItemsForShareContext, isServerless }: ShareMenuManagerStartDeps): { + /** + * Collects share menu items from registered providers and mounts the share context menu under + * the given `anchorElement`. If the context menu is already opened, a call to this method closes it. + * @param options + */ + toggleShareContextMenu: (options: ShowShareMenuOptions) => Promise; + /** + * Returns a handler to trigger a specific export integration by ID. + * For direct exports, executes immediately; otherwise opens a flyout. + */ + getExportHandler: (options: Omit, exportId: string, intl: InjectedIntl) => Promise<(() => Promise) | null>; + /** + * Returns a handler to trigger an export derivative by ID, opening its custom flyout. + */ + getExportDerivativeHandler: (options: Omit, derivativeId: string) => Promise<(() => Promise) | null>; + }; + /** + * Method for handling export operations flexibly. + */ + private createExportHandler; + private onClose; + private toggleShareContextMenu; +} +export type ShareMenuManagerStart = ReturnType; +export {}; diff --git a/src/platform/plugins/shared/share/public/services/share_menu_registry.d.ts b/src/platform/plugins/shared/share/public/services/share_menu_registry.d.ts new file mode 100644 index 0000000000000..cac9ebc59a9e5 --- /dev/null +++ b/src/platform/plugins/shared/share/public/services/share_menu_registry.d.ts @@ -0,0 +1,39 @@ +import type { ShareContext, ShareConfigs, ShareRegistryPublicApi, ShareActionIntents, ShareRegistryApiStart, ShareMenuProviderLegacy, RegisterShareIntegrationArgs } from '../types'; +export declare class ShareRegistry implements ShareRegistryPublicApi { + private urlService?; + private anonymousAccessServiceProvider?; + private capabilities?; + private getLicense?; + private readonly globalMarker; + constructor(); + private readonly shareOptionsStore; + setup(): { + /** + * @deprecated Use {@link registerShareIntegration} instead. + */ + register: (value: ShareMenuProviderLegacy) => void; + registerShareIntegration: (...args: [string, RegisterShareIntegrationArgs] | [RegisterShareIntegrationArgs]) => void; + }; + start({ urlService, anonymousAccessServiceProvider, capabilities, getLicense, }: ShareRegistryApiStart): { + availableIntegrations: (objectType: string, groupId?: string) => ShareActionIntents[]; + resolveShareItemsForShareContext: ({ objectType, isServerless, ...shareContext }: ShareContext & { + isServerless: boolean; + }) => Promise; + }; + private registerShareIntentAction; + private registerLinkShareAction; + private registerEmbedShareAction; + /** + * @description provides an escape hatch to support allowing legacy share menu items to be registered + */ + private register; + private registerShareIntegration; + private getShareConfigOptionsForObject; + /** + * Returns all share actions that are available for the given object type. + */ + private availableIntegrations; + private resolveShareItemsForShareContext; +} +export type ShareMenuRegistryStart = ReturnType; +export type ShareMenuRegistrySetup = ReturnType; diff --git a/src/platform/plugins/shared/share/public/types.d.ts b/src/platform/plugins/shared/share/public/types.d.ts new file mode 100644 index 0000000000000..f8e927f9fa1e6 --- /dev/null +++ b/src/platform/plugins/shared/share/public/types.d.ts @@ -0,0 +1,362 @@ +import type { ComponentType, ReactNode } from 'react'; +import type { InjectedIntl } from '@kbn/i18n-react'; +import type { EuiContextMenuPanelDescriptor } from '@elastic/eui'; +import { type EuiCodeProps, type EuiIconProps, type EuiFlyoutProps } from '@elastic/eui'; +import type { EuiContextMenuPanelItemDescriptorEntry } from '@elastic/eui/src/components/context_menu/context_menu'; +import type { ILicense } from '@kbn/licensing-types'; +import type { Capabilities } from '@kbn/core/public'; +import type { TimeRange } from '@kbn/es-query'; +import type { SerializableRecord } from '@kbn/utility-types'; +import type { UrlService, LocatorPublic } from '../common/url_service'; +import type { BrowserShortUrlClientFactoryCreateParams } from './url_service/short_urls/short_url_client_factory'; +import type { BrowserShortUrlClient } from './url_service/short_urls/short_url_client'; +import type { AnonymousAccessServiceContract } from '../common/anonymous_access'; +import type { DraftModeCalloutProps } from './components/common/draft_mode_callout'; +export interface ShareRegistryApiStart { + capabilities: Capabilities; + urlService: BrowserUrlService; + anonymousAccessServiceProvider?: () => AnonymousAccessServiceContract; + getLicense: () => ILicense | undefined; +} +export type ShareActionConfigArgs = ShareContext & Pick; +export type ShareTypes = 'link' | 'embed' | 'legacy' | 'integration'; +export type InternalShareActionIntent = Exclude; +type ShareActionUserInputBase = Record> = { + /** + * The draft mode callout content to be shown when there are unsaved changes. + * - `true`: Shows the default callout. + * - `false` or `undefined`: Shows no callout. + * - `DraftModeCalloutProps`: + * - `message`: callout message custom content + */ + draftModeCallOut?: boolean | DraftModeCalloutProps; + helpText?: ReactNode; + CTAButtonConfig?: { + id: string; + dataTestSubj: string; + label: string; + }; + disabled?: boolean; +} & E; +export interface ShareMenuProviderLegacy { + readonly id: string; + getShareMenuItemsLegacy: (context: ShareContext) => ShareMenuItemLegacy[]; +} +type ShareImplementationFactory, C extends Record = Record, S extends SharingData = SharingData> = T extends 'integration' ? { + id: string; + groupId?: string; + shareType: T; + /** + * Callback that yields the configured methods for the current share implementation as a promise, enables the possibility to dynamically fetch the share configuration + */ + config: (ctx: ShareActionConfigArgs) => Promise; + /** + * When provided, this method will be used to evaluate if this integration should be available, + * given the current license and capabilities of kibana + */ + prerequisiteCheck?: (args: { + capabilities: Capabilities; + objectType: ShareContext['objectType']; + license?: ILicense; + }) => boolean; +} : { + shareType: T; + config: (ctx: ShareActionConfigArgs) => C | null; +}; +type ShareImplementation = Omit & { + config: T extends ShareImplementationFactory ? R : never; +}; +/** + * @description implementation definition for creating a share action for sharing object links + */ +export type LinkShare = ShareImplementationFactory<'link', { + shortUrlService: ReturnType; +}>; +/** + * @description Implementation definition for creating a share action for sharing embed links + */ +export type EmbedShare = ShareImplementationFactory<'embed', { + anonymousAccess: AnonymousAccessServiceContract; + shortUrlService: ReturnType; +}>; +/** + * @description Skeleton definition for implementing a share action integration + */ +export type ShareIntegration = Record, S extends SharingData = SharingData> = ShareImplementationFactory<'integration', IntegrationParameters, S>; +/** + * @description Implementation definition to support legacy share implementation + */ +export interface ShareLegacy { + shareType: 'legacy'; + id: ShareMenuProviderLegacy['id']; + config: ShareMenuProviderLegacy['getShareMenuItemsLegacy']; +} +/** + * @description Share integration implementation definition for performing exports within kibana + */ +export interface ExportShare extends ShareIntegration<{ + /** + * @deprecated only kept around for legacy reasons + */ + name?: string; + icon?: EuiIconProps['type']; + sortOrder?: number; + /** + * @deprecated only kept around for legacy reasons + */ + toolTipContent?: string; + label: string; + exportType: string; + /** + * allows disabling the export action, for instance the current app has no data to export + */ + disabled?: boolean; + helpText?: ReactNode; + generateExportButtonLabel?: ReactNode; + generateAssetExport: (args: ExportGenerationOpts) => Promise; + renderCopyURIButton?: boolean; + warnings?: Array<{ + title: string; + message: string; + }>; + requiresSavedState?: boolean; + supportedLayoutOptions?: Array<'print'>; + renderLayoutOptionSwitch?: boolean; + /** + * indicates if the export integration supports generating it exports with absolute time ranges + */ + supportsAbsoluteTime?: boolean; + renderTotalHitsSizeWarning?: (totalHits?: number) => ReactNode | undefined; +} & ({ + generateAssetComponent?: never; + copyAssetURIConfig: { + headingText: string; + helpText?: string; + contentType: EuiCodeProps['language']; + generateAssetURIValue: (args: ExportGenerationOpts) => string | undefined; + }; +} | { + generateAssetComponent: ReactNode; + copyAssetURIConfig?: never; +} | { + generateAssetComponent?: never; + copyAssetURIConfig?: never; +}), S> { + groupId: 'export'; +} +export interface ExportShareParameters extends Record { + label: React.FC<{ + openFlyout: () => void; + }>; + toolTipContent?: ReactNode; + flyoutContent: React.FC<{ + closeFlyout: () => void; + flyoutRef: React.RefObject; + }>; + flyoutSizing?: Pick; + shouldRender: ({ availableExportItems, }: { + availableExportItems: ExportShareConfig[]; + }) => boolean; +} +/** + * @description Share integration implementation definition that build off exports within kibana, + * reach out to the shared ux team before settling on using this interface + */ +export interface ExportShareDerivatives extends ShareIntegration { + groupId: 'exportDerivatives'; +} +export type ShareActionIntents = LinkShare | EmbedShare | ShareLegacy | ShareIntegration; +export type LinkShareConfig = ShareImplementation; +export type EmbedShareConfig = ShareImplementation; +export type ExportShareConfig = ShareImplementation; +export type ExportShareDerivativesConfig = ShareImplementation; +export type ShareIntegrationConfig = ShareImplementation; +export type LegacyIntegrationConfig = Omit & { + config: ReturnType; +}; +export type ShareConfigs = LinkShareConfig | EmbedShareConfig | ShareIntegrationConfig | ExportShareConfig | ExportShareDerivativesConfig | LegacyIntegrationConfig; +export type LinkShareUIConfig = ShareActionUserInputBase<{ + /** + * + * @description allows a consumer to provide a custom method which when invoked + * handles providing a share url in the context of said consumer + */ + delegatedShareUrlHandler?: () => Promise; +}>; +export type EmbedShareUIConfig = ShareActionUserInputBase<{ + embedUrlParamExtensions?: UrlParamExtension[]; + computeAnonymousCapabilities?: (anonymousUserCapabilities: Capabilities) => boolean; + /** + * @deprecated use computeAnonymousCapabilities defined on objectTypeMeta config + */ + showPublicUrlSwitch?: (anonymousUserCapabilities: Capabilities) => boolean; +}>; +/** + * @description record of user config for each registered export integration + */ +type ExportShareUIConfig = Record>; +export interface ShareUIConfig { + link: LinkShareUIConfig; + embed: EmbedShareUIConfig; + integration: { + [key: string]: ShareActionUserInputBase; + export: ExportShareUIConfig; + }; +} +/** + * One locator (typical link/export flows) or several (e.g. CSV reporting). + */ +export type SharingDataLocatorParams

= { + id: string; + params: P; + version?: string; +} | Array<{ + id: string; + params: P; + version?: string; +}>; +export interface SharingData

extends Record { + title: string; + locatorParams: SharingDataLocatorParams

; +} +export type ShareIntegrationMapKey = `integration-${string}`; +/** + * Registration payload for a share integration. + * We infer sharing-data `S` from `I` instead of constraining `I extends ShareIntegration` (defaults on + * `ShareIntegration` use `SharingData`, and `config`'s `ctx` is contravariant in `S`, so + * `ExportShare` is not assignable to the default `ShareIntegration`). + */ +export type RegisterShareIntegrationArgs = I extends ShareIntegration ? P extends Record ? S extends SharingData ? Pick & { + getShareIntegrationConfig: (ctx: ShareActionConfigArgs) => ReturnType; +} : never : never : never; +export interface ShareRegistryInternalApi { + registerShareIntegration(shareObject: string, arg: RegisterShareIntegrationArgs): void; + registerShareIntegration(arg: RegisterShareIntegrationArgs): void; + resolveShareItemsForShareContext(args: ShareContext & { + isServerless: boolean; + }): Promise; +} +export declare abstract class ShareRegistryPublicApi { + abstract setup(): { + /** + * @description registers a share menu provider for a specific object type + */ + registerShareIntegration: ShareRegistryInternalApi['registerShareIntegration']; + }; + abstract start(args: ShareRegistryApiStart): { + resolveShareItemsForShareContext: ShareRegistryInternalApi['resolveShareItemsForShareContext']; + }; +} +export type BrowserUrlService = UrlService; +export type ShareableLocatorParams = SerializableRecord & { + timeRange: TimeRange | undefined; +}; +/** + * @public + * Properties of the current object to share. Registered share + * menu providers will provide suitable items which have to + * be rendered in an appropriate place by the caller. + * + * It is possible to use the static function `toggleShareContextMenu` + * to render the menu as a popover. + * */ +export interface ShareContext { + /** + * The type of the object to share. for example lens, dashboard, etc. + */ + objectType: string; + /** + * An alias of type of the object to share, that's more human friendly. + */ + objectTypeAlias?: string; + /** + * Allows for passing contextual information that each consumer can provide to customize the share menu + */ + objectTypeMeta: { + title: string; + config: Partial<{ + [T in Exclude]: ShareUIConfig[T]; + }>; + }; + /** + * Id of the object that's been attempted to be shared + */ + objectId?: string; + /** + * Current url for sharing. This can be set in cases where `window.location.href` + * does not contain a shareable URL (e.g. if using session storage to store the current + * app state is enabled). In these cases the property should contain the URL in a + * format which makes it possible to use it without having access to any other state + * like the current session. + * + * If not set it will default to `window.location.href` + */ + shareableUrl?: string; + /** + * @deprecated prefer {@link delegatedShareUrlHandler} + */ + shareableUrlForSavedObject?: string; + shareableUrlLocatorParams?: { + locator: LocatorPublic; + params: ShareableLocatorParams; + }; + sharingData: S; + isDirty: boolean; + onClose: () => void; +} +/** + * @public + * Eui context menu entry shown directly in the context menu. `sortOrder` is + * used to order the individual items in a flat list returned by all registered + * menu providers. + * */ +export interface ShareContextMenuPanelItem extends Omit { + name: string; + sortOrder?: number; +} +/** + * @public + * Definition of a menu item rendered in the share menu. In the redesign, the + * `shareMenuItem` is shown in a modal. However, Canvas + * uses the legacy panel implementation. + * */ +interface ShareMenuItemBase { + shareMenuItem?: ShareContextMenuPanelItem; +} +export interface ShareMenuItemLegacy extends ShareMenuItemBase { + panel?: EuiContextMenuPanelDescriptor; +} +export interface ExportGenerationOpts { + optimizedForPrinting?: boolean; + intl: InjectedIntl; +} +interface UrlParamExtensionProps { + setParamValue: (values: {}) => void; +} +export interface UrlParamExtension { + paramName: string; + component: ComponentType; +} +/** @public */ +export interface ShowShareMenuOptions< +/** + * Specifies the type of the locator params for the sharing data. + */ +P extends SerializableRecord = SerializableRecord, +/** + * Specifies the type of the sharing data. + */ +S extends Record = Record> extends Omit & S>, 'onClose'> { + asExport?: boolean; + anchorElement?: HTMLElement; + allowShortUrl: boolean; + onClose?: () => void; + publicAPIEnabled?: boolean; + onSave?: () => Promise; +} +export interface ClientConfigType { + new_version: { + enabled: boolean; + }; +} +export {}; diff --git a/src/platform/plugins/shared/share/public/url_service/index.d.ts b/src/platform/plugins/shared/share/public/url_service/index.d.ts new file mode 100644 index 0000000000000..f882b5de4dd31 --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/index.d.ts @@ -0,0 +1 @@ +export * from './redirect'; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/components/empty_prompt.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/components/empty_prompt.d.ts new file mode 100644 index 0000000000000..72117adfe207e --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/redirect/components/empty_prompt.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import type { ChromeDocTitle } from '@kbn/core-chrome-browser'; +export interface ErrorProps { + title?: string; + body?: string; + homeHref: string; + docTitle: ChromeDocTitle; + error: Error; +} +export declare const RedirectEmptyPrompt: React.FC; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/components/page.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/components/page.d.ts new file mode 100644 index 0000000000000..ba99db67d9b5d --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/redirect/components/page.d.ts @@ -0,0 +1,14 @@ +import * as React from 'react'; +import type { CustomBrandingSetup } from '@kbn/core-custom-branding-browser'; +import type { ChromeDocTitle, ThemeServiceSetup } from '@kbn/core/public'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +import type { RedirectManager } from '../redirect_manager'; +export interface PageProps { + homeHref: string; + docTitle: ChromeDocTitle; + customBranding: CustomBrandingSetup; + manager: Pick; + theme: ThemeServiceSetup; + userProfile: UserProfileService; +} +export declare const Page: React.FC; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/components/spinner.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/components/spinner.d.ts new file mode 100644 index 0000000000000..3c4803a8554f7 --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/redirect/components/spinner.d.ts @@ -0,0 +1,4 @@ +import * as React from 'react'; +export declare const Spinner: React.FC<{ + showPlainSpinner: boolean; +}>; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/index.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/index.d.ts new file mode 100644 index 0000000000000..1390f34c349e0 --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/redirect/index.d.ts @@ -0,0 +1 @@ +export * from './redirect_manager'; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/redirect_manager.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/redirect_manager.d.ts new file mode 100644 index 0000000000000..afa1dd56e8d51 --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/redirect/redirect_manager.d.ts @@ -0,0 +1,19 @@ +import type { CoreSetup } from '@kbn/core/public'; +import type { Location } from 'history'; +import { BehaviorSubject } from 'rxjs'; +import type { UrlService } from '../../../common/url_service'; +import type { RedirectOptions } from '../../../common/url_service/locators/redirect'; +export interface RedirectManagerDependencies { + url: UrlService; +} +export declare class RedirectManager { + readonly deps: RedirectManagerDependencies; + readonly error$: BehaviorSubject; + constructor(deps: RedirectManagerDependencies); + registerLocatorRedirectApp(core: CoreSetup): void; + registerLegacyShortUrlRedirectApp(core: CoreSetup): void; + onMount(location: Location, abortSignal?: AbortSignal): void; + private navigateToShortUrlBySlug; + navigate(options: RedirectOptions): void; + protected parseSearchParams(urlLocationSearch: string): RedirectOptions; +} diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/render.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/render.d.ts new file mode 100644 index 0000000000000..ab99a95cc05cf --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/redirect/render.d.ts @@ -0,0 +1,2 @@ +import type { PageProps } from './components/page'; +export declare const render: (container: HTMLElement, props: PageProps) => () => void; diff --git a/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client.d.ts b/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client.d.ts new file mode 100644 index 0000000000000..04e44a9a64727 --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client.d.ts @@ -0,0 +1,45 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { LegacyShortUrlLocatorParams } from '../../../common/url_service/locators/legacy_short_url_locator'; +import type { ShortUrlRedirectLocatorParams } from '../../../common/url_service/locators/short_url_redirect_locator'; +import type { IShortUrlClient, ShortUrl, ShortUrlCreateParams, ILocatorClient, LocatorPublic } from '../../../common/url_service'; +export interface BrowserShortUrlClientHttp { + basePath: { + get: () => string; + }; + fetch: (url: string, params: BrowserShortUrlClientHttpFetchParams) => Promise; +} +interface BrowserShortUrlClientHttpFetchParams { + method: 'GET' | 'POST' | 'DELETE'; + body?: string; +} +/** + * Dependencies of the Short URL Client. + */ +export interface BrowserShortUrlClientDependencies { + /** + * The locators service. + */ + locators: ILocatorClient; + /** + * HTTP client. + */ + http: BrowserShortUrlClientHttp; +} +export declare class BrowserShortUrlClient implements IShortUrlClient { + private readonly dependencies; + constructor(dependencies: BrowserShortUrlClientDependencies); + create

({ locator, params, slug, }: ShortUrlCreateParams

): Promise>; + createWithLocator

(params: ShortUrlCreateParams

, isAbsoluteTime?: boolean): Promise>; + createFromLongUrl(longUrl: string, isAbsoluteTime?: boolean): Promise; + get(id: string): Promise; + resolve(slug: string): Promise; + delete(id: string): Promise; +} +export interface ShortUrlCreateResponse extends ShortUrl { + locator: LocatorPublic; + params: ShortUrlRedirectLocatorParams; +} +export interface ShortUrlCreateFromLongUrlResponse extends ShortUrlCreateResponse { + url: string; +} +export {}; diff --git a/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client_factory.d.ts b/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client_factory.d.ts new file mode 100644 index 0000000000000..95bbfa6d0f174 --- /dev/null +++ b/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client_factory.d.ts @@ -0,0 +1,10 @@ +import type { IShortUrlClientFactory } from '../../../common/url_service'; +import type { BrowserShortUrlClientDependencies } from './short_url_client'; +import { BrowserShortUrlClient } from './short_url_client'; +export type BrowserShortUrlClientFactoryDependencies = BrowserShortUrlClientDependencies; +export type BrowserShortUrlClientFactoryCreateParams = null; +export declare class BrowserShortUrlClientFactory implements IShortUrlClientFactory { + private readonly dependencies; + constructor(dependencies: BrowserShortUrlClientFactoryDependencies); + get(params: BrowserShortUrlClientFactoryCreateParams): BrowserShortUrlClient; +} diff --git a/src/platform/plugins/shared/share/server/config.d.ts b/src/platform/plugins/shared/share/server/config.d.ts new file mode 100644 index 0000000000000..86ab29457193d --- /dev/null +++ b/src/platform/plugins/shared/share/server/config.d.ts @@ -0,0 +1,13 @@ +import type { TypeOf } from '@kbn/config-schema'; +export declare const configSchema: import("@kbn/config-schema").ObjectType<{ + new_version: import("@kbn/config-schema").ObjectType<{ + enabled: import("@kbn/config-schema").Type; + }>; + url_expiration: import("@kbn/config-schema").ObjectType<{ + enabled: import("@kbn/config-schema").Type; + duration: import("@kbn/config-schema").Type; + check_interval: import("@kbn/config-schema").Type; + url_limit: import("@kbn/config-schema").Type; + }>; +}>; +export type ConfigSchema = TypeOf; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/constants.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/constants.d.ts new file mode 100644 index 0000000000000..706e358c0c334 --- /dev/null +++ b/src/platform/plugins/shared/share/server/unused_urls_task/constants.d.ts @@ -0,0 +1,5 @@ +export declare const TASK_ID = "unusedUrlsCleanupTask"; +export declare const SAVED_OBJECT_TYPE = "url"; +export declare const DEFAULT_URL_LIMIT = 10000; +export declare const DEFAULT_URL_EXPIRATION_DURATION = "1y"; +export declare const DEFAULT_URL_EXPIRATION_CHECK_INTERVAL = "7d"; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/index.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/index.d.ts new file mode 100644 index 0000000000000..2c5551da5e77a --- /dev/null +++ b/src/platform/plugins/shared/share/server/unused_urls_task/index.d.ts @@ -0,0 +1,3 @@ +export * from './constants'; +export * from './task'; +export * from './register_unused_urls_task_routes'; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/register_delete_unused_urls_route.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/register_delete_unused_urls_route.d.ts new file mode 100644 index 0000000000000..8ab5ede23e7c5 --- /dev/null +++ b/src/platform/plugins/shared/share/server/unused_urls_task/register_delete_unused_urls_route.d.ts @@ -0,0 +1,11 @@ +import type { Duration } from 'moment'; +import type { IRouter, Logger } from '@kbn/core/server'; +import type { CoreSetup } from '@kbn/core/server'; +export declare const registerDeleteUnusedUrlsRoute: ({ router, core, urlExpirationDuration, urlLimit, logger, isEnabled, }: { + router: IRouter; + core: CoreSetup; + urlExpirationDuration: Duration; + urlLimit: number; + logger: Logger; + isEnabled: boolean; +}) => void; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/register_unused_urls_task_routes.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/register_unused_urls_task_routes.d.ts new file mode 100644 index 0000000000000..a5f3ecc5caf1b --- /dev/null +++ b/src/platform/plugins/shared/share/server/unused_urls_task/register_unused_urls_task_routes.d.ts @@ -0,0 +1,10 @@ +import type { Duration } from 'moment'; +import type { CoreSetup, IRouter, Logger } from '@kbn/core/server'; +export declare const registerUrlServiceRoutes: ({ router, core, urlExpirationDuration, urlLimit, logger, isEnabled, }: { + router: IRouter; + core: CoreSetup; + urlExpirationDuration: Duration; + urlLimit: number; + logger: Logger; + isEnabled: boolean; +}) => void; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/task.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/task.d.ts new file mode 100644 index 0000000000000..fa81925fc1cc5 --- /dev/null +++ b/src/platform/plugins/shared/share/server/unused_urls_task/task.d.ts @@ -0,0 +1,40 @@ +import type { Duration } from 'moment'; +import type { CoreSetup, ISavedObjectsRepository, SavedObjectsBulkDeleteObject } from '@kbn/core/server'; +import type { Logger } from '@kbn/logging'; +import type { TaskInstanceWithId } from '@kbn/task-manager-plugin/server/task'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +export declare const durationToSeconds: (duration: Duration) => string; +export declare const getDeleteUnusedUrlTaskInstance: (interval: Duration) => TaskInstanceWithId; +export declare const deleteUnusedUrls: ({ savedObjectsRepository, unusedUrls, namespace, logger, }: { + savedObjectsRepository: ISavedObjectsRepository; + unusedUrls: SavedObjectsBulkDeleteObject[]; + namespace: string; + logger: Logger; +}) => Promise; +export declare const fetchUnusedUrlsFromFirstNamespace: ({ savedObjectsRepository, urlExpirationDuration, urlLimit, }: { + savedObjectsRepository: ISavedObjectsRepository; + urlExpirationDuration: Duration; + urlLimit: number; +}) => Promise<{ + unusedUrls: { + id: string; + type: string; + }[]; + hasMore: boolean; + namespace: string; +}>; +export declare const runDeleteUnusedUrlsTask: ({ core, urlExpirationDuration, urlLimit, logger, isEnabled, }: { + core: CoreSetup; + urlExpirationDuration: Duration; + urlLimit: number; + logger: Logger; + isEnabled: boolean; +}) => Promise<{ + deletedCount: number; +}>; +export declare const scheduleUnusedUrlsCleanupTask: ({ taskManager, checkInterval, isEnabled, logger, }: { + taskManager: TaskManagerStartContract; + checkInterval: Duration; + isEnabled: boolean; + logger: Logger; +}) => Promise; diff --git a/src/platform/plugins/shared/ui_actions/common/trigger_ids.d.ts b/src/platform/plugins/shared/ui_actions/common/trigger_ids.d.ts new file mode 100644 index 0000000000000..0fe4f96f9a8ce --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/common/trigger_ids.d.ts @@ -0,0 +1,48 @@ +/** + * These triggers have been updated to use a more consistent naming schema that works with REST APIs. + * They are generic events which can apply to many interactions in Kibana. Try to use these first when + * building a new UI action. + */ +export declare const ON_CLICK_VALUE = "on_click_value"; +export declare const ON_CLICK_IMAGE = "on_click_image"; +export declare const ON_CLICK_ROW = "on_click_row"; +export declare const ON_SELECT_RANGE = "on_select_range"; +export declare const ON_APPLY_FILTER = "on_apply_filter"; +export declare const ON_OPEN_PANEL_MENU = "on_open_panel_menu"; +/** + * These triggers have not yet been updated, and may be removed or consolidated later. + */ +export declare const ADD_PANEL_TRIGGER = "ADD_PANEL_TRIGGER"; +export declare const ALERT_RULE_TRIGGER = "alertRule"; +export declare const VISUALIZE_FIELD_TRIGGER = "VISUALIZE_FIELD_TRIGGER"; +export declare const VISUALIZE_GEO_FIELD_TRIGGER = "VISUALIZE_GEO_FIELD_TRIGGER"; +export declare const CONTROL_HOVER_TRIGGER_ID = "CONTROL_HOVER_TRIGGER"; +export declare const CONTROL_MENU_TRIGGER = "CONTROL_MENU_TRIGGER"; +export declare const EDIT_LOOKUP_INDEX_CONTENT_TRIGGER_ID = "EDIT_LOOKUP_INDEX_CONTENT_TRIGGER_ID"; +export declare const SEARCH_EMBEDDABLE_CELL_ACTIONS_TRIGGER_ID = "SEARCH_EMBEDDABLE_CELL_ACTIONS_TRIGGER_ID"; +export declare const DISCOVER_CELL_ACTIONS_TRIGGER_ID = "DISCOVER_CELL_ACTIONS_TRIGGER_ID"; +export declare const PANEL_BADGE_TRIGGER = "PANEL_BADGE_TRIGGER"; +export declare const PANEL_NOTIFICATION_TRIGGER = "PANEL_NOTIFICATION_TRIGGER"; +export declare const MULTI_VALUE_CLICK_TRIGGER = "MULTI_VALUE_CLICK_TRIGGER"; +export declare const CELL_VALUE_TRIGGER = "CELL_VALUE_TRIGGER"; +export declare const ESQL_CONTROL_TRIGGER = "ESQL_CONTROL_TRIGGER"; +export declare const UPDATE_ESQL_QUERY_TRIGGER = "UPDATE_ESQL_QUERY_TRIGGER"; +export declare const UPDATE_FILTER_REFERENCES_TRIGGER = "UPDATE_FILTER_REFERENCES_TRIGGER"; +export declare const VISUALIZE_EDITOR_TRIGGER = "VISUALIZE_EDITOR_TRIGGER"; +export declare const AGG_BASED_VISUALIZATION_TRIGGER = "AGG_BASED_VISUALIZATION_TRIGGER"; +export declare const DASHBOARD_VISUALIZATION_PANEL_TRIGGER = "DASHBOARD_VISUALIZATION_PANEL_TRIGGER"; +export declare const ADD_CANVAS_ELEMENT_TRIGGER = "ADD_CANVAS_ELEMENT_TRIGGER"; +export declare const OPEN_FILE_UPLOAD_LITE_TRIGGER = "OPEN_FILE_UPLOAD_LITE_TRIGGER"; +export declare const CATEGORIZE_FIELD_TRIGGER = "CATEGORIZE_FIELD_TRIGGER"; +export declare const IN_APP_EMBEDDABLE_EDIT_TRIGGER = "IN_APP_EMBEDDABLE_EDIT_TRIGGER"; +export declare const CREATE_PATTERN_ANALYSIS_TO_ML_AD_JOB_TRIGGER = "CREATE_PATTERN_ANALYSIS_TO_ML_AD_JOB_TRIGGER"; +export declare const SWIM_LANE_SELECTION_TRIGGER = "SWIM_LANE_SELECTION_TRIGGER"; +export declare const EXPLORER_ENTITY_FIELD_SELECTION_TRIGGER = "EXPLORER_ENTITY_FIELD_SELECTION_TRIGGER"; +export declare const SINGLE_METRIC_VIEWER_ENTITY_FIELD_SELECTION_TRIGGER = "SINGLE_METRIC_VIEWER_ENTITY_FIELD_SELECTION_TRIGGER"; +export declare const O11Y_APM_TRANSACTION_CONTEXT_MENU_TRIGGER = "apmTransactionContextMenu"; +export declare const O11Y_APM_ERROR_CONTEXT_MENU_TRIGGER = "apmErrorContextMenu"; +export declare const SECURITY_ESQL_IN_TIMELINE_HISTOGRAM_TRIGGER = "security-discoverInTimeline-histogramTrigger"; +export declare const SECURITY_CELL_ACTIONS_DEFAULT = "security-default-cellActions"; +export declare const SECURITY_CELL_ACTIONS_DETAILS_FLYOUT = "security-detailsFlyout-cellActions"; +export declare const SECURITY_CELL_ACTIONS_ALERTS_COUNT = "security-alertsCount-cellActions"; +export declare const SECURITY_CELL_ACTIONS_CASE_EVENTS = "security-case-events-cellActions"; diff --git a/src/platform/plugins/shared/ui_actions/public/actions/action.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/action.d.ts new file mode 100644 index 0000000000000..41b1bdb47de62 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/actions/action.d.ts @@ -0,0 +1,161 @@ +import type { Presentable } from '@kbn/ui-actions-browser/src/types'; +import type { IconType } from '@elastic/eui'; +import type { Observable } from 'rxjs'; +import type { Trigger } from '../types'; +/** + * During action execution we can provide additional information, + * for example, trigger, that caused the action execution + */ +export interface ActionExecutionMeta { + /** + * Trigger that executed the action + */ + trigger: Trigger; + /** + * The event that caused the action to execute (e.g., mouse click, keyboard event) + */ + event?: React.MouseEvent; +} +/** + * Action methods are executed with Context from trigger + {@link ActionExecutionMeta} + */ +export type ActionExecutionContext = Context & ActionExecutionMeta; +/** + * Simplified action context for {@link ActionDefinition} + * When defining action consumer may use either it's own Context + * or an ActionExecutionContext to get access to {@link ActionExecutionMeta} params + */ +export type ActionDefinitionContext = Context | ActionExecutionContext; +export interface ActionMenuItemProps { + context: ActionExecutionContext; +} +export type FrequentCompatibilityChangeAction = Action & Required, 'getCompatibilityChangesSubject' | 'couldBecomeCompatible'>>; +export interface Action extends Partial>> { + /** + * Determined the order when there is more than one action matched to a trigger. + * Higher numbers are displayed first. + */ + order?: number; + /** + * A unique identifier for this action instance. + */ + id: string; + /** + * The action type is what determines the context shape. + */ + readonly type: string; + /** + * Optional EUI icon type that can be displayed along with the title. + */ + getIconType(context: ActionExecutionContext): IconType | undefined; + /** + * Returns a title to be displayed to the user. + * @param context + */ + getDisplayName(context: ActionExecutionContext): string; + /** + * Returns a promise that resolves to true if this action is compatible given the context, + * otherwise resolves to false. + */ + isCompatible(context: ActionExecutionContext): Promise; + /** + * Executes the action. + */ + execute(context: ActionExecutionContext): Promise; + /** + * This method should return a link if this item can be clicked on. The link + * is used to navigate user if user middle-clicks it or Ctrl + clicks or + * right-clicks and selects "Open in new tab". + */ + getHref?(context: ActionExecutionContext): Promise; + /** + * Determines if action should be executed automatically, + * without first showing up in context menu. + * false by default. + */ + shouldAutoExecute?(context: ActionExecutionContext): Promise; + /** + * @returns an Observable that emits when this action's compatibility changes. + */ + getCompatibilityChangesSubject?: (context: Context) => Observable | undefined; + /** + * Determines if action could become compatible given the context. If present, + * it should be much more lenient than `isCompatible` and return true if there + * is any chance that `isCompatible` could return true in the future. + */ + couldBecomeCompatible?: (context: Context) => boolean; + /** + * Determines if the action is disabled or not + */ + isDisabled?(context: ActionExecutionContext): boolean; + /** + * @returns an Observable that emits when this action's disabled state should be recalculated. + */ + getDisabledStateChangesSubject?: (context: Context) => Observable | undefined; + /** + * Determines if notification should be shown in menu for that action + * + */ + showNotification?: boolean; + extension?: ActionExtension; +} +/** + * A convenience interface used to register an action. + */ +export type ActionDefinition = Partial>> & { + extension?: ActionExtension; +} & { + /** + * ID of the action that uniquely identifies this action in the actions registry. + */ + readonly id: string; + /** + * ID of the factory for this action. Used to construct dynamic actions. + */ + readonly type?: string; + /** + * Returns a promise that resolves to true if this item is compatible given + * the context and should be displayed to user, otherwise resolves to false. + */ + isCompatible?(context: ActionDefinitionContext): Promise; + /** + * Executes the action. + */ + execute(context: ActionDefinitionContext): Promise; + /** + * Determines if action should be executed automatically, + * without first showing up in context menu. + * false by default. + */ + shouldAutoExecute?(context: ActionDefinitionContext): Promise; + /** + * This method should return a link if this item can be clicked on. The link + * is used to navigate user if user middle-clicks it or Ctrl + clicks or + * right-clicks and selects "Open in new tab". + */ + getHref?(context: ActionDefinitionContext): Promise; + /** + * Determines if the action is disabled or not + */ + isDisabled?(context: ActionDefinitionContext): boolean; + /** + * @returns an Observable that emits when this action's disabled state should be recalculated. + */ + getDisabledStateChangesSubject?: (context: Context) => Observable | undefined; + /** + * Determines if notification should be shown in menu for that action + * + */ + showNotification?: boolean; + /** + * @returns an Observable that emits when this action's compatibility should be recalculated. + */ + getCompatibilityChangesSubject?: (context: Context) => Observable | undefined; + /** + * Determines if action could become compatible given the context. If present, + * it should be much more lenient than `isCompatible` and return true if there + * is any chance that `isCompatible` could return true in the future. + */ + couldBecomeCompatible?: (context: Context) => boolean; +}; +export type ActionContext = A extends ActionDefinition ? Context : never; diff --git a/src/platform/plugins/shared/ui_actions/public/actions/action_internal.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/action_internal.d.ts new file mode 100644 index 0000000000000..8cdca56195257 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/actions/action_internal.d.ts @@ -0,0 +1,30 @@ +import type * as React from 'react'; +import type { Presentable, PresentableGrouping } from '@kbn/ui-actions-browser/src/types'; +import type { IconType } from '@elastic/eui'; +import type { Action, ActionDefinition, ActionMenuItemProps } from './action'; +/** + * @internal + */ +export declare class ActionInternal implements Action, Presentable { + readonly definition: ActionDefinition; + readonly id: string; + readonly type: string; + readonly order: number; + readonly MenuItem?: React.FC>; + readonly grouping?: PresentableGrouping; + readonly showNotification?: boolean; + readonly isDisabled: Action['isDisabled']; + readonly getDisabledStateChangesSubject?: Action['getDisabledStateChangesSubject']; + readonly getCompatibilityChangesSubject?: Action['getCompatibilityChangesSubject']; + readonly couldBecomeCompatible?: Action['couldBecomeCompatible']; + errorLogged?: boolean; + readonly extension?: ActionExtension; + constructor(definition: ActionDefinition); + execute(context: Context): Promise; + getIconType(context: Context): IconType | undefined; + getDisplayName(context: Context): string; + getDisplayNameTooltip(context: Context): string; + isCompatible(context: Context): Promise; + getHref(context: Context): Promise; + shouldAutoExecute(context: Context): Promise; +} diff --git a/src/platform/plugins/shared/ui_actions/public/actions/create_action.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/create_action.d.ts new file mode 100644 index 0000000000000..a00969b066783 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/actions/create_action.d.ts @@ -0,0 +1,2 @@ +import type { ActionDefinition, Action } from './action'; +export declare function createAction(action: ActionDefinition): Action; diff --git a/src/platform/plugins/shared/ui_actions/public/actions/incompatible_action_error.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/incompatible_action_error.d.ts new file mode 100644 index 0000000000000..9f561779d88e9 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/actions/incompatible_action_error.d.ts @@ -0,0 +1,4 @@ +export declare class IncompatibleActionError extends Error { + code: string; + constructor(); +} diff --git a/src/platform/plugins/shared/ui_actions/public/actions/index.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/index.d.ts new file mode 100644 index 0000000000000..cd6d1d4f494ef --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/actions/index.d.ts @@ -0,0 +1,4 @@ +export type * from './action'; +export * from './action_internal'; +export * from './create_action'; +export * from './incompatible_action_error'; diff --git a/src/platform/plugins/shared/ui_actions/public/context_menu/build_eui_context_menu_panels.d.ts b/src/platform/plugins/shared/ui_actions/public/context_menu/build_eui_context_menu_panels.d.ts new file mode 100644 index 0000000000000..e2765aa7fd2eb --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/context_menu/build_eui_context_menu_panels.d.ts @@ -0,0 +1,22 @@ +import type { EuiContextMenuPanelDescriptor } from '@elastic/eui'; +import type { Trigger } from '../types'; +import type { Action, ActionInternal } from '../actions'; +export declare const defaultTitle: string; +export declare const txtMore: string; +export interface ActionWithContext { + action: Action | ActionInternal; + context: Context; + /** + * Trigger that caused this action + */ + trigger: Trigger; +} +export interface BuildContextMenuParams { + actions: ActionWithContext[]; + title?: string; + closeMenu?: () => void; +} +/** + * Transforms an array of Actions to the shape EuiContextMenuPanel expects. + */ +export declare function buildContextMenuForActions({ actions, title, closeMenu, }: BuildContextMenuParams): Promise; diff --git a/src/platform/plugins/shared/ui_actions/public/context_menu/index.d.ts b/src/platform/plugins/shared/ui_actions/public/context_menu/index.d.ts new file mode 100644 index 0000000000000..0412fe6a547ea --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/context_menu/index.d.ts @@ -0,0 +1,2 @@ +export { buildContextMenuForActions } from './build_eui_context_menu_panels'; +export { openContextMenu } from './open_context_menu'; diff --git a/src/platform/plugins/shared/ui_actions/public/context_menu/open_context_menu.d.ts b/src/platform/plugins/shared/ui_actions/public/context_menu/open_context_menu.d.ts new file mode 100644 index 0000000000000..ed3a4f8f7b70f --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/context_menu/open_context_menu.d.ts @@ -0,0 +1,44 @@ +import type { EuiContextMenuPanelDescriptor } from '@elastic/eui'; +import { EventEmitter } from 'events'; +/** + * Tries to find best position for opening context menu using mousemove and click event + * Returned position is relative to document + */ +export declare function createInteractionPositionTracker(): { + resolveLastPosition: () => { + x: number; + y: number; + }; +}; +/** + * A FlyoutSession describes the session of one opened flyout panel. It offers + * methods to close the flyout panel again. If you open a flyout panel you should make + * sure you call {@link ContextMenuSession#close} when it should be closed. + * Since a flyout could also be closed without calling this method (e.g. because + * the user closes it), you must listen to the "closed" event on this instance. + * It will be emitted whenever the flyout will be closed and you should throw + * away your reference to this instance whenever you receive that event. + * @extends EventEmitter + */ +declare class ContextMenuSession extends EventEmitter { + /** + * Closes the opened flyout as long as it's still the open one. + * If this is not the active session, this method will do nothing. + * If this session was still active and a flyout was closed, the 'closed' + * event will be emitted on this FlyoutSession instance. + */ + close(): void; +} +/** + * Opens a flyout panel with the given component inside. You can use + * {@link ContextMenuSession#close} on the return value to close the flyout. + * + * @param flyoutChildren - Mounts the children inside a fly out panel + * @return {FlyoutSession} The session instance for the opened flyout panel. + */ +export declare function openContextMenu(panels: EuiContextMenuPanelDescriptor[], props?: { + closeButtonAriaLabel?: string; + onClose?: () => void; + 'data-test-subj'?: string; +}): ContextMenuSession; +export { ContextMenuSession }; diff --git a/src/platform/plugins/shared/ui_actions/public/index.d.ts b/src/platform/plugins/shared/ui_actions/public/index.d.ts new file mode 100644 index 0000000000000..cc08a54459520 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/index.d.ts @@ -0,0 +1,12 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import { UiActionsPlugin } from './plugin'; +export declare function plugin(initializerContext: PluginInitializerContext): UiActionsPlugin; +export type { UiActionsPublicSetup as UiActionsSetup, UiActionsPublicStart as UiActionsStart, } from './plugin'; +export type { Action, ActionDefinition as UiActionsActionDefinition } from './actions'; +export { ActionInternal, createAction, IncompatibleActionError } from './actions'; +export { buildContextMenuForActions } from './context_menu'; +export type { Presentable as UiActionsPresentable, PresentableGroup as UiActionsPresentableGroup, PresentableGrouping as UiActionsPresentableGrouping, } from '@kbn/ui-actions-browser/src/types'; +export type { Trigger, RowClickContext, VisualizeFieldContext } from './types'; +export { ACTION_VISUALIZE_FIELD, ACTION_VISUALIZE_GEO_FIELD, ACTION_VISUALIZE_LENS_FIELD, } from './types'; +export type { ActionExecutionContext, ActionExecutionMeta, ActionMenuItemProps, FrequentCompatibilityChangeAction, } from './actions'; +export { triggers } from './triggers'; diff --git a/src/platform/plugins/shared/ui_actions/public/plugin.d.ts b/src/platform/plugins/shared/ui_actions/public/plugin.d.ts new file mode 100644 index 0000000000000..f5f5c59d4e2fd --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/plugin.d.ts @@ -0,0 +1,16 @@ +import type { CoreStart, CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { PublicMethodsOf } from '@kbn/utility-types'; +import { UiActionsService } from './service'; +export type UiActionsPublicSetup = Pick; +export type UiActionsPublicStart = PublicMethodsOf; +export interface UiActionsPublicSetupDependencies { +} +export interface UiActionsPublicStartDependencies { +} +export declare class UiActionsPlugin implements Plugin { + private readonly service; + constructor(_initializerContext: PluginInitializerContext); + setup(_core: CoreSetup): UiActionsPublicSetup; + start(core: CoreStart): UiActionsPublicStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/ui_actions/public/service/index.d.ts b/src/platform/plugins/shared/ui_actions/public/service/index.d.ts new file mode 100644 index 0000000000000..1ed7801f9e4f2 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/service/index.d.ts @@ -0,0 +1 @@ +export * from './ui_actions_service'; diff --git a/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.d.ts b/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.d.ts new file mode 100644 index 0000000000000..a1a82ba55d016 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.d.ts @@ -0,0 +1,15 @@ +import type { Trigger } from '../types'; +import type { Action } from '../actions'; +export declare class UiActionsExecutionService { + private readonly batchingQueue; + private readonly pendingTasks; + constructor(); + execute({ action, context, trigger, }: { + action: Action; + context: object; + trigger: Trigger; + }, alwaysShowPopup?: boolean): Promise; + private scheduleFlush; + private executeSingleTask; + private showActionPopupMenu; +} diff --git a/src/platform/plugins/shared/ui_actions/public/service/ui_actions_service.d.ts b/src/platform/plugins/shared/ui_actions/public/service/ui_actions_service.d.ts new file mode 100644 index 0000000000000..53ba3f8149725 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/service/ui_actions_service.d.ts @@ -0,0 +1,42 @@ +import type { Trigger, ActionRegistry, TriggerToActionsRegistry } from '../types'; +import type { Action, ActionDefinition, FrequentCompatibilityChangeAction } from '../actions'; +import { UiActionsExecutionService } from './ui_actions_execution_service'; +export interface UiActionsServiceParams { + readonly actions?: ActionRegistry; + /** + * A 1-to-N mapping from `Trigger` to zero or more `Action`. + */ + readonly triggerToActions?: TriggerToActionsRegistry; +} +export declare class UiActionsService { + readonly executionService: UiActionsExecutionService; + protected readonly actions: ActionRegistry; + protected readonly triggerToActions: TriggerToActionsRegistry; + constructor({ actions, triggerToActions }?: UiActionsServiceParams); + readonly getTrigger: (triggerId: string) => Trigger; + readonly registerActionAsync: (id: string, getDefinition: () => Promise>) => void; + readonly unregisterAction: (actionId: string) => void; + readonly hasAction: (actionId: string) => boolean; + readonly attachAction: (triggerId: string, actionId: string) => void; + readonly detachAction: (triggerId: string, actionId: string) => void; + /** + * `addTriggerActionAsync` is similar to `attachAction` as it attaches action to a + * trigger, but it also registers the action, if it has not been registered, yet. + */ + readonly addTriggerActionAsync: (triggerId: string, actionId: string, getDefinition: () => Promise>) => void; + readonly getAction: (id: string) => Promise; + readonly getTriggerActions: (triggerId: string) => Promise; + readonly getTriggerCompatibleActions: (triggerId: string, context: object) => Promise; + readonly getFrequentlyChangingActionsForTrigger: (triggerId: string, context: object) => Promise; + readonly executeTriggerActions: (triggerId: string, context: object, alwaysShowPopup?: boolean) => Promise; + /** + * Removes all registered triggers and actions. + */ + readonly clear: () => void; + /** + * "Fork" a separate instance of `UiActionsService` that inherits all existing + * triggers and actions, but going forward all new triggers and actions added + * to this instance of `UiActionsService` are only available within this instance. + */ + readonly fork: () => UiActionsService; +} diff --git a/src/platform/plugins/shared/ui_actions/public/services.d.ts b/src/platform/plugins/shared/ui_actions/public/services.d.ts new file mode 100644 index 0000000000000..04b64a60f5552 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/services.d.ts @@ -0,0 +1,6 @@ +import type { AnalyticsServiceStart, I18nStart, ThemeServiceSetup, UserProfileService } from '@kbn/core/public'; +export declare const getAnalytics: import("@kbn/kibana-utils-plugin/public").Get, setAnalytics: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getI18n: import("@kbn/kibana-utils-plugin/public").Get, setI18n: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getNotifications: import("@kbn/kibana-utils-plugin/public").Get, setNotifications: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getTheme: import("@kbn/kibana-utils-plugin/public").Get, setTheme: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getUserProfile: import("@kbn/kibana-utils-plugin/public").Get, setUserProfile: import("@kbn/kibana-utils-plugin/public").Set; diff --git a/src/platform/plugins/shared/ui_actions/public/triggers.d.ts b/src/platform/plugins/shared/ui_actions/public/triggers.d.ts new file mode 100644 index 0000000000000..a766f5a602939 --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/triggers.d.ts @@ -0,0 +1,4 @@ +import type { Trigger } from './types'; +export declare const triggers: { + [key: string]: Trigger; +}; diff --git a/src/platform/plugins/shared/ui_actions/public/types.d.ts b/src/platform/plugins/shared/ui_actions/public/types.d.ts new file mode 100644 index 0000000000000..8ca85e9f6538e --- /dev/null +++ b/src/platform/plugins/shared/ui_actions/public/types.d.ts @@ -0,0 +1,47 @@ +import type { EmbeddableApiContext } from '@kbn/presentation-publishing'; +import type { Datatable } from '@kbn/expressions-plugin/common'; +import type { DatatableColumn } from '@kbn/expressions-plugin/common'; +import type { AggregateQuery } from '@kbn/es-query'; +import type { DataViewSpec } from '@kbn/data-views-plugin/public'; +import type { ActionInternal } from './actions/action_internal'; +export type ActionRegistry = Map Promise>; +export type TriggerToActionsRegistry = Map; +export interface VisualizeFieldContext { + fieldName: string; + dataViewSpec: DataViewSpec; + contextualFields?: string[]; + textBasedColumns?: DatatableColumn[]; + originatingApp?: string; + query?: AggregateQuery; +} +export declare const ACTION_VISUALIZE_FIELD = "ACTION_VISUALIZE_FIELD"; +export declare const ACTION_VISUALIZE_GEO_FIELD = "ACTION_VISUALIZE_GEO_FIELD"; +export declare const ACTION_VISUALIZE_LENS_FIELD = "ACTION_VISUALIZE_LENS_FIELD"; +export interface Trigger { + /** + * Unique name of the trigger as identified in `ui_actions` plugin trigger registry. + */ + id: string; + /** + * User friendly name of the trigger. + */ + title?: string; + /** + * A longer user friendly description of the trigger. + */ + description?: string; +} +export type RowClickContext = Partial & { + data: { + /** + * Row index, starting from 0, where user clicked. + */ + rowIndex: number; + table: Datatable; + /** + * Sorted list column IDs that were visible to the user. Useful when only + * a subset of datatable columns should be used. + */ + columns?: string[]; + }; +}; diff --git a/src/platform/plugins/shared/usage_collection/common/application_usage.d.ts b/src/platform/plugins/shared/usage_collection/common/application_usage.d.ts new file mode 100644 index 0000000000000..b4f75a88a7436 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/application_usage.d.ts @@ -0,0 +1,5 @@ +export declare const getDailyId: ({ appId, dayId, viewId, }: { + viewId: string; + appId: string; + dayId: string; +}) => string; diff --git a/src/platform/plugins/shared/usage_collection/common/constants.d.ts b/src/platform/plugins/shared/usage_collection/common/constants.d.ts new file mode 100644 index 0000000000000..54d5e50ed5c5c --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/constants.d.ts @@ -0,0 +1,4 @@ +export declare const KIBANA_STATS_TYPE = "kibana_stats"; +export declare const DEFAULT_MAXIMUM_WAIT_TIME_FOR_ALL_COLLECTORS_IN_S = 1; +export declare const MAIN_APP_DEFAULT_VIEW_ID = "main"; +export declare const USAGE_COUNTERS_BACKOFF_DELAY_IN_MS = 500; diff --git a/src/platform/plugins/shared/usage_collection/common/index.d.ts b/src/platform/plugins/shared/usage_collection/common/index.d.ts new file mode 100644 index 0000000000000..024bf28844abe --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/index.d.ts @@ -0,0 +1 @@ +export type { UsageCounters } from './types'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/index.d.ts b/src/platform/plugins/shared/usage_collection/common/types/index.d.ts new file mode 100644 index 0000000000000..c2219391768ee --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/index.d.ts @@ -0,0 +1,3 @@ +export type * as Stats from './stats'; +export type * as UiCounters from './ui_counters'; +export type * as UsageCounters from './usage_counters'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/stats/core_metrics.d.ts b/src/platform/plugins/shared/usage_collection/common/types/stats/core_metrics.d.ts new file mode 100644 index 0000000000000..2df967b5ece16 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/stats/core_metrics.d.ts @@ -0,0 +1,200 @@ +/** + * The types are exact duplicates of the ops metrics types declared in core needed for reporting in the stats api. + * We use a copy of these to detect changes in the ops metrics reported from core + * See src/core/packages/metrics/server/index.ts + */ +/** + * an IntervalHistogram object that samples and reports the event loop delay over time. + * The delays will be reported in milliseconds. + * See {@link IntervalHistogram} + * @public + */ +export interface IntervalHistogram { + fromTimestamp: string; + lastUpdatedAt: string; + min: number; + max: number; + mean: number; + exceeds: number; + stddev: number; + percentiles: { + 50: number; + 75: number; + 95: number; + 99: number; + }; +} +/** + * See {@link ElasticsearchClientProtocol} + * Protocol(s) used by the Elasticsearch Client + * @public + */ +export type ElasticsearchClientProtocol = 'none' | 'http' | 'https' | 'mixed'; +/** + * See {@link ElasticsearchClientsMetrics} + * Metrics related to the elasticsearch clients + * @public + */ +export interface ElasticsearchClientsMetrics { + /** Total number of active sockets (all nodes, all connections) */ + totalActiveSockets: number; + /** Total number of available sockets (alive but idle, all nodes, all connections) */ + totalIdleSockets: number; + /** Total number of queued requests (all nodes, all connections) */ + totalQueuedRequests: number; +} +/** + * See {@link OpsProcessMetrics} + * Process related metrics + * @public + */ +export interface OpsProcessMetrics { + /** pid of the kibana process */ + pid: number; + /** process memory usage */ + memory: { + /** heap memory usage */ + heap: { + /** total heap available */ + total_in_bytes: number; + /** used heap */ + used_in_bytes: number; + /** v8 heap size limit */ + size_limit: number; + }; + /** node rss */ + resident_set_size_in_bytes: number; + /** memory usage of C++ objects bound to JavaScript objects managed by V8 */ + external_in_bytes: number; + /** memory allocated for array buffers. This is also included in the external value*/ + array_buffers_in_bytes: number; + }; + /** max event loop delay since last collection */ + event_loop_delay: number; + /** node event loop delay histogram since last collection */ + event_loop_delay_histogram: IntervalHistogram; + /** uptime of the kibana process */ + uptime_in_millis: number; +} +/** + * See {@link OpsOsMetrics} + * OS related metrics + * @public + */ +export interface OpsOsMetrics { + /** The os platform */ + platform: NodeJS.Platform; + /** The os platform release, prefixed by the platform name */ + platformRelease: string; + /** The os distrib. Only present for linux platforms */ + distro?: string; + /** The os distrib release, prefixed by the os distrib. Only present for linux platforms */ + distroRelease?: string; + /** cpu load metrics */ + load: { + /** load for last minute */ + '1m': number; + /** load for last 5 minutes */ + '5m': number; + /** load for last 15 minutes */ + '15m': number; + }; + /** system memory usage metrics */ + memory: { + /** total memory available */ + total_in_bytes: number; + /** current free memory */ + free_in_bytes: number; + /** current used memory */ + used_in_bytes: number; + }; + /** the OS uptime */ + uptime_in_millis: number; + /** cpu accounting metrics, undefined when not running in a cgroup */ + cpuacct?: { + /** name of this process's cgroup */ + control_group: string; + /** cpu time used by this process's cgroup */ + usage_nanos: number; + }; + /** cpu cgroup metrics, undefined when not running in a cgroup */ + cpu?: { + /** name of this process's cgroup */ + control_group: string; + /** the length of the cfs period */ + cfs_period_micros: number; + /** total available run-time within a cfs period */ + cfs_quota_micros: number; + /** current stats on the cfs periods */ + stat: { + /** number of cfs periods that elapsed */ + number_of_elapsed_periods: number; + /** number of times the cgroup has been throttled */ + number_of_times_throttled: number; + /** total amount of time the cgroup has been throttled for */ + time_throttled_nanos: number; + }; + }; + /** memory cgroup metrics, undefined when not running in cgroup v2 */ + cgroup_memory?: { + /** The total amount of memory currently being used by the cgroup and its descendants. */ + current_in_bytes: number; + /** The total amount of swap currently being used by the cgroup and its descendants. */ + swap_current_in_bytes: number; + }; +} +/** + * {@link OpsServerMetrics} + * server related metrics + * @public + */ +export interface OpsServerMetrics { + /** server response time stats */ + response_times: { + /** average response time */ + avg_in_millis: number; + /** maximum response time */ + max_in_millis: number; + }; + /** server requests stats */ + requests: { + /** number of disconnected requests since startup */ + disconnects: number; + /** total number of requests handled since startup */ + total: number; + /** number of request handled per response status code */ + statusCodes: Record; + }; + /** number of current concurrent connections to the server */ + concurrent_connections: number; +} +/** + * {@link OpsMetrics} + * Regroups metrics gathered by all the collectors. + * This contains metrics about the os/runtime, the kibana process and the http server. + + * @public + */ +export interface OpsMetrics { + /** Time metrics were recorded at. */ + collected_at: Date; + /** + * Metrics related to the elasticsearch client + */ + elasticsearch_client: ElasticsearchClientsMetrics; + /** + * Process related metrics. + * @remarks processes field preferred + */ + process: OpsProcessMetrics; + /** Process related metrics. Reports an array of objects for each kibana pid.*/ + processes: OpsProcessMetrics[]; + /** OS related metrics */ + os: OpsOsMetrics; + /** server response time stats */ + response_times: OpsServerMetrics['response_times']; + /** server requests stats */ + requests: OpsServerMetrics['requests']; + /** number of current concurrent connections to the server */ + concurrent_connections: OpsServerMetrics['concurrent_connections']; +} diff --git a/src/platform/plugins/shared/usage_collection/common/types/stats/index.d.ts b/src/platform/plugins/shared/usage_collection/common/types/stats/index.d.ts new file mode 100644 index 0000000000000..291374f591a63 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/stats/index.d.ts @@ -0,0 +1,2 @@ +export type * as v1 from './v1'; +export type * from './latest'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/stats/latest.d.ts b/src/platform/plugins/shared/usage_collection/common/types/stats/latest.d.ts new file mode 100644 index 0000000000000..27ff62df5012c --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/stats/latest.d.ts @@ -0,0 +1,2 @@ +export type * as OpsMetricsCopy from './core_metrics'; +export type * from './v1'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/stats/v1.d.ts b/src/platform/plugins/shared/usage_collection/common/types/stats/v1.d.ts new file mode 100644 index 0000000000000..16bd1b8e920f8 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/stats/v1.d.ts @@ -0,0 +1,57 @@ +import type * as OpsMetricsCopy from './core_metrics'; +/** v1 types Start */ +/** + * stats query v1 + * @remarks exclude_usage is always interpreted as true. query param retained to prevent breaking changes to existing consumers. + */ +export interface StatsHTTPQuery { + extended?: boolean | ''; + legacy?: boolean | ''; + exclude_usage?: boolean | ''; +} +export interface UsageObject { + kibana?: UsageObject; + xpack?: UsageObject; + [key: string]: unknown | UsageObject; +} +export interface ClusterUuidLegacy { + clusterUuid?: string; +} +export interface ClusterUuid { + cluster_uuid?: string; +} +/** + * Extended usage stats. + * @remarks + * Legacy implementation used to conditionally include kibana usage metrics + * as of https://github.com/elastic/kibana/pull/151082, usage is no longer reported + * and set to an empty object to prevent breaking changes to existing consumers. + */ +export interface ExtendedStats { + [key: string]: unknown | UsageObject; + clusterUuid?: string; + cluster_uuid?: string; +} +/** + * OpsMetrics: aliased from a duplicate of core's OpsMetrics types + * @remarks the alternative to creating a local copy of the OpsMetrics types is to declare them as `unknown` and assume validation happens elsewhere. + * The disadvantage is that any changes made to the original OpsMetrics will be passed through without needing to update the API types. + */ +export type LastOpsMetrics = OpsMetricsCopy.OpsMetrics; +export type KibanaServiceStatus = Record; +/** explicitly typed stats for kibana */ +export interface KibanaStats { + kibana: { + uuid: string; + name: string; + index: string; + host: string; + locale: string; + transport_address: string; + version: string; + snapshot: boolean; + status: string; + }; +} +/** Stats response body */ +export type StatsHTTPBodyTyped = LastOpsMetrics | KibanaStats | ExtendedStats; diff --git a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/index.d.ts b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/index.d.ts new file mode 100644 index 0000000000000..291374f591a63 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/index.d.ts @@ -0,0 +1,2 @@ +export type * as v1 from './v1'; +export type * from './latest'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/latest.d.ts b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/latest.d.ts new file mode 100644 index 0000000000000..18944dc1d81e5 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/latest.d.ts @@ -0,0 +1 @@ +export type * as v1 from './v1'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/v1.d.ts b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/v1.d.ts new file mode 100644 index 0000000000000..793cc4270d263 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/v1.d.ts @@ -0,0 +1,36 @@ +/** + * ui_counters query v1 + * @remarks + */ +export interface UiCountersRequestBody { + report: { + reportVersion?: 3; + userAgent?: Record>; + uiCounter?: Record>; + application_usage?: Record>; + }; +} +/** explicit response type for store report success. The status value is hardcoded. */ +export interface UiCountersResponseOk { + status: 'ok'; +} +/** explicit response type for store report fail. The status value is hardcoded. */ +export interface UiCountersResponseFail { + status: 'fail'; +} diff --git a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/index.d.ts b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/index.d.ts new file mode 100644 index 0000000000000..291374f591a63 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/index.d.ts @@ -0,0 +1,2 @@ +export type * as v1 from './v1'; +export type * from './latest'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/latest.d.ts b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/latest.d.ts new file mode 100644 index 0000000000000..f2a121bd50e6a --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/latest.d.ts @@ -0,0 +1 @@ +export type * from './v1'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/v1.d.ts b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/v1.d.ts new file mode 100644 index 0000000000000..e4016363cd31d --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/v1.d.ts @@ -0,0 +1,32 @@ +export type CounterEventSource = 'server' | 'ui'; +export interface AbstractCounter { + /** The domainId used to create the Counter API */ + domainId: string; + /** The name of the counter */ + counterName: string; + /** The type of counter (defaults to 'count') */ + counterType: string; + /** The source of this counter: 'server' | 'ui' */ + source: CounterEventSource; + /** Namespace associated to this counter */ + namespace?: string; +} +export interface CounterMetric extends AbstractCounter { + /** Amount of units to increment this counter */ + incrementBy: number; +} +/** + * Details about the counter to be incremented + */ +export interface IncrementCounterParams { + /** The namespace to increment this counter on */ + namespace?: string; + /** The name of the counter **/ + counterName: string; + /** The counter type ("count" by default) **/ + counterType?: string; + /** The source of the event we are counting */ + source?: CounterEventSource; + /** Increment the counter by this number (1 if not specified) **/ + incrementBy?: number; +} diff --git a/src/platform/plugins/shared/usage_collection/public/components/index.d.ts b/src/platform/plugins/shared/usage_collection/public/components/index.d.ts new file mode 100644 index 0000000000000..395a70a5e754f --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/components/index.d.ts @@ -0,0 +1,2 @@ +export { TrackApplicationView } from './track_application_view'; +export type { TrackApplicationViewProps } from './track_application_view'; diff --git a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/index.d.ts b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/index.d.ts new file mode 100644 index 0000000000000..48bf0162eb73e --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/index.d.ts @@ -0,0 +1,2 @@ +export type { TrackApplicationViewProps } from './types'; +export { ApplicationUsageContext, TrackApplicationView } from './track_application_view'; diff --git a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view.d.ts b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view.d.ts new file mode 100644 index 0000000000000..0b1a8d3b897e9 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view.d.ts @@ -0,0 +1,11 @@ +import type { FC } from 'react'; +import React from 'react'; +import type { IApplicationUsageTracker } from '../../plugin'; +import type { TrackApplicationViewProps } from './types'; +export declare const ApplicationUsageContext: React.Context; +/** + * React component to track the number of clicks and minutes on screen of the children components. + * @param props {@link TrackApplicationViewProps} + * @constructor + */ +export declare const TrackApplicationView: FC; diff --git a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view_component.d.ts b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view_component.d.ts new file mode 100644 index 0000000000000..f9828df6e6148 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view_component.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; +import type { IApplicationUsageTracker } from '../../plugin'; +import type { TrackApplicationViewProps } from './types'; +interface Props extends TrackApplicationViewProps { + applicationUsageTracker?: IApplicationUsageTracker; +} +export declare class TrackApplicationViewComponent extends React.Component { + private parentNode; + onClick: (e: MouseEvent) => void; + componentDidMount(): void; + componentWillUnmount(): void; + render(): React.ReactNode; +} +export {}; diff --git a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/types.d.ts b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/types.d.ts new file mode 100644 index 0000000000000..fec891ee964f4 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/types.d.ts @@ -0,0 +1,17 @@ +import type { ReactNode } from 'react'; +/** + * Props to provide to the {@link TrackApplicationView} component. + * @public + */ +export interface TrackApplicationViewProps { + /** + * The name of the view to be tracked. The appId will be obtained automatically. + * @public + */ + viewId: string; + /** + * The React component to be tracked. + * @public + */ + children: ReactNode; +} diff --git a/src/platform/plugins/shared/usage_collection/public/index.d.ts b/src/platform/plugins/shared/usage_collection/public/index.d.ts new file mode 100644 index 0000000000000..8f93a62db9366 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/index.d.ts @@ -0,0 +1,6 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import { UsageCollectionPlugin } from './plugin'; +export type { UsageCollectionSetup, UsageCollectionStart } from './plugin'; +export { TrackApplicationView } from './components'; +export type { TrackApplicationViewProps } from './components'; +export declare function plugin(initializerContext: PluginInitializerContext): UsageCollectionPlugin; diff --git a/src/platform/plugins/shared/usage_collection/public/plugin.d.ts b/src/platform/plugins/shared/usage_collection/public/plugin.d.ts new file mode 100644 index 0000000000000..c84c0303d93a5 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/plugin.d.ts @@ -0,0 +1,77 @@ +import { ApplicationUsageTracker } from '@kbn/analytics'; +import type { UiCounterMetricType } from '@kbn/analytics'; +import type { FC, PropsWithChildren } from 'react'; +import type { PluginInitializerContext, Plugin, CoreSetup, CoreStart, HttpSetup } from '@kbn/core/public'; +import type { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; +export interface PublicConfigType { + uiCounters: { + enabled: boolean; + debug: boolean; + }; +} +export type IApplicationUsageTracker = Pick; +interface UsageCollectionStartDependencies { + screenshotMode: ScreenshotModePluginStart; +} +/** Public's setup APIs exposed by the UsageCollection Service **/ +export interface UsageCollectionSetup { + /** Component helpers to track usage collection in the UI **/ + components: { + /** + * The context provider to wrap the application if planning to use + * {@link TrackApplicationView} somewhere inside the app. + * + * @example + * ```typescript jsx + * class MyPlugin implements Plugin { + * ... + * public setup(core: CoreSetup, plugins: { usageCollection?: UsageCollectionSetup }) { + * const ApplicationUsageTrackingProvider = plugins.usageCollection?.components.ApplicationUsageTrackingProvider ?? React.Fragment; + * + * core.application.register({ + * id, + * title, + * ..., + * mount: async (params: AppMountParameters) => { + * ReactDOM.render( + * // Set the tracking context provider at the App level + * + * + * + * , + * element + * ); + * return () => ReactDOM.unmountComponentAtNode(element); + * }, + * }); + * } + * ... + * } + * ``` + */ + ApplicationUsageTrackingProvider: FC>; + }; + /** Report whenever a UI event occurs for UI counters to report it **/ + reportUiCounter: (appName: string, type: UiCounterMetricType, eventNames: string | string[], count?: number) => void; +} +/** Public's start APIs exposed by the UsageCollection Service **/ +export interface UsageCollectionStart { + /** Report whenever a UI event occurs for UI counters to report it **/ + reportUiCounter: (appName: string, type: UiCounterMetricType, eventNames: string | string[], count?: number) => void; +} +export declare function isUnauthenticated(http: HttpSetup): boolean; +export declare class UsageCollectionPlugin implements Plugin { + private readonly initContext; + private applicationUsageTracker?; + private subscriptions; + private reporter?; + private config; + constructor(initContext: PluginInitializerContext); + setup({ http }: CoreSetup): UsageCollectionSetup; + start({ http, application }: CoreStart, { screenshotMode }: UsageCollectionStartDependencies): { + reportUiCounter: (appName: string, type: string, eventNames: string | string[], count?: number) => void; + }; + stop(): void; + private getPublicApplicationUsageTracker; +} +export {}; diff --git a/src/platform/plugins/shared/usage_collection/public/services/application_usage.d.ts b/src/platform/plugins/shared/usage_collection/public/services/application_usage.d.ts new file mode 100644 index 0000000000000..6d53391f2e104 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/services/application_usage.d.ts @@ -0,0 +1,3 @@ +import type { Observable } from 'rxjs'; +import type { ApplicationUsageTracker } from '@kbn/analytics'; +export declare function trackApplicationUsageChange(currentAppId$: Observable, applicationUsageTracker: Pick): import("rxjs").Subscription[]; diff --git a/src/platform/plugins/shared/usage_collection/public/services/create_reporter.d.ts b/src/platform/plugins/shared/usage_collection/public/services/create_reporter.d.ts new file mode 100644 index 0000000000000..02b394404860e --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/services/create_reporter.d.ts @@ -0,0 +1,11 @@ +import type { Logger } from '@kbn/logging'; +import type { Storage } from '@kbn/analytics'; +import { Reporter } from '@kbn/analytics'; +import type { HttpSetup } from '@kbn/core/public'; +interface AnalyticsReporterConfig { + localStorage: Storage; + logger: Logger; + fetch: HttpSetup; +} +export declare function createReporter(config: AnalyticsReporterConfig): Reporter; +export {}; diff --git a/src/platform/plugins/shared/usage_collection/public/services/index.d.ts b/src/platform/plugins/shared/usage_collection/public/services/index.d.ts new file mode 100644 index 0000000000000..9f25d6654da01 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/public/services/index.d.ts @@ -0,0 +1,2 @@ +export { createReporter } from './create_reporter'; +export { trackApplicationUsageChange } from './application_usage'; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector.d.ts new file mode 100644 index 0000000000000..8c5121907589e --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/collector.d.ts @@ -0,0 +1,14 @@ +import type { Logger } from '@kbn/core/server'; +import type { CollectorFetchMethod, CollectorOptions, ICollector } from './types'; +export declare class Collector implements ICollector { + readonly log: Logger; + readonly type: CollectorOptions['type']; + readonly fetch: CollectorFetchMethod; + readonly isReady: CollectorOptions['isReady']; + /** + * @internal Constructor of a Collector. It should be called via the CollectorSet factory methods: `makeStatsCollector` and `makeUsageCollector` + * @param log {@link Logger} + * @param collectorDefinition {@link CollectorOptions} + */ + constructor(log: Logger, { type, fetch, isReady, ...options }: CollectorOptions); +} diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector_set.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector_set.d.ts new file mode 100644 index 0000000000000..ec315fd13c2d2 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/collector_set.d.ts @@ -0,0 +1,64 @@ +import type { Logger, ElasticsearchClient, SavedObjectsClientContract, ExecutionContextSetup } from '@kbn/core/server'; +import { Collector } from './collector'; +import type { ICollector, CollectorOptions, ICollectorSet } from './types'; +import { UsageCollector, type UsageCollectorOptions } from './usage_collector'; +type AnyCollector = ICollector; +export interface CollectorSetConfig { + logger: Logger; + executionContext: ExecutionContextSetup; + maximumWaitTimeForAllCollectorsInS?: number; + collectors?: AnyCollector[]; + maxCollectorConcurrency?: number; +} +export declare class CollectorSet implements ICollectorSet { + private readonly logger; + private readonly executionContext; + private readonly maximumWaitTimeForAllCollectorsInS; + private readonly collectors; + private readonly fetchingCollectors; + private readonly maxCollectorConcurrency; + constructor({ logger, executionContext, maximumWaitTimeForAllCollectorsInS, collectors, maxCollectorConcurrency, }: CollectorSetConfig); + /** + * Instantiates a stats collector with the definition provided in the options + * @param options Definition of the collector {@link CollectorOptions} + */ + makeStatsCollector: (options: CollectorOptions) => Collector; + /** + * Instantiates an usage collector with the definition provided in the options + * @param options Definition of the collector {@link CollectorOptions} + */ + makeUsageCollector: (options: UsageCollectorOptions) => UsageCollector; + /** + * Registers a collector to be used when collecting all the usage and stats data + * @param collector Collector to be added to the set (previously created via `makeUsageCollector` or `makeStatsCollector`) + */ + registerCollector: (collector: Collector) => void; + getCollectorByType: (type: string) => AnyCollector | undefined; + private getReadyCollectors; + private fetchCollector; + bulkFetch: (esClient: ElasticsearchClient, soClient: SavedObjectsClientContract, collectors?: Map) => Promise<{ + type: string; + result: unknown; + }[]>; + private getFilteredCollectorSet; + bulkFetchUsage: (esClient: ElasticsearchClient, savedObjectsClient: SavedObjectsClientContract) => Promise<{ + type: string; + result: unknown; + }[]>; + /** + * Convert an array of fetched stats results into key/object + * @param statsData Array of fetched stats results + */ + toObject: , T = unknown>(statsData?: Array<{ + type: string; + result: T; + }>) => Result; + /** + * Rename fields to use API conventions + * @param apiData Data to be normalized + */ + toApiFieldNames: (apiData: Record | unknown[]) => Record | unknown[]; + private getValueOrRecurse; + private makeCollectorSetFromArray; +} +export {}; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/index.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/index.d.ts new file mode 100644 index 0000000000000..ac1a55fa9c364 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/index.d.ts @@ -0,0 +1 @@ +export { usageCollectorsStatsCollector } from './usage_collector_stats_collector'; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/schema.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/schema.d.ts new file mode 100644 index 0000000000000..d9da8c1f7b471 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/schema.d.ts @@ -0,0 +1,3 @@ +import type { MakeSchemaFrom } from '../types'; +import type { CollectorsStats } from './usage_collector_stats_collector'; +export declare const collectorsStatsSchema: MakeSchemaFrom; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/usage_collector_stats_collector.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/usage_collector_stats_collector.d.ts new file mode 100644 index 0000000000000..f188d454a0899 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/usage_collector_stats_collector.d.ts @@ -0,0 +1,44 @@ +import type { ICollectorSet } from '../types'; +export interface CollectorsStats { + not_ready: { + count: number; + names: string[]; + }; + not_ready_timeout: { + count: number; + names: string[]; + }; + succeeded: { + count: number; + names: string[]; + }; + failed: { + count: number; + names: string[]; + }; + total_duration: number; + total_is_ready_duration: number; + total_fetch_duration: number; + is_ready_duration_breakdown: Array<{ + name: string; + duration: number; + }>; + fetch_duration_breakdown: Array<{ + name: string; + duration: number; + }>; +} +export interface CollectorsStatsCollectorParams { + nonReadyCollectorTypes: string[]; + timedOutCollectorsTypes: string[]; + isReadyExecutionDurationByType: Array<{ + duration: number; + type: string; + }>; + fetchExecutionDurationByType: Array<{ + duration: number; + type: string; + status: 'failed' | 'success'; + }>; +} +export declare const usageCollectorsStatsCollector: (usageCollection: Pick, { nonReadyCollectorTypes, timedOutCollectorsTypes, isReadyExecutionDurationByType, fetchExecutionDurationByType, }: CollectorsStatsCollectorParams) => import("../types").ICollector; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/index.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/index.d.ts new file mode 100644 index 0000000000000..d9ca823af4281 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/index.d.ts @@ -0,0 +1,4 @@ +export type { ICollectorSet } from './types'; +export { CollectorSet } from './collector_set'; +export type { AllowedSchemaTypes, AllowedSchemaNumberTypes, AllowedSchemaBooleanTypes, AllowedSchemaStringTypes, RecursiveMakeSchemaFrom, MakeSchemaFrom, CollectorOptions, CollectorFetchContext, CollectorFetchMethod, ICollector as Collector, } from './types'; +export type { UsageCollectorOptions } from './usage_collector'; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/measure_duration.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/measure_duration.d.ts new file mode 100644 index 0000000000000..18961c6a5dd3e --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/measure_duration.d.ts @@ -0,0 +1,10 @@ +export declare const createPerformanceObsHook: () => () => Record; +/** + * A wrapper around performance.timerify which defined the name of the returned + * wrapped function to help identify observed function types inside the `PerformanceObserver`. + * + * @param name name of the function used to track the performance of the function execution + * @param fn the function to be wrapped by the performance.timerify method. + * @returns + */ +export declare const perfTimerify: unknown>(name: string, fn: T) => T; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/types.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/types.d.ts new file mode 100644 index 0000000000000..346c09cb45535 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/types.d.ts @@ -0,0 +1,153 @@ +import type { ElasticsearchClient, SavedObjectsClientContract, Logger } from '@kbn/core/server'; +import type { PossibleSchemaTypes, SchemaMetaOptional } from '@elastic/ebt/client'; +export type { AllowedSchemaTypes, AllowedSchemaStringTypes, AllowedSchemaBooleanTypes, AllowedSchemaNumberTypes, PossibleSchemaTypes, } from '@elastic/ebt/client'; +import type { Collector, UsageCollectorOptions } from '.'; +/** + * Interface to register and manage Usage Collectors through a CollectorSet + */ +export interface ICollectorSet { + /** + * Creates a usage collector to collect plugin telemetry data. + * registerCollector must be called to connect the created collector with the service. + */ + makeUsageCollector: (options: UsageCollectorOptions) => Collector; + /** + * Register a usage collector or a stats collector. + * Used to connect the created collector to telemetry. + */ + registerCollector: (collector: Collector) => void; + /** + * Returns a usage collector by type + */ + getCollectorByType: (type: string) => Collector | undefined; + /** + * Fetches the collection from all the registered collectors + * @internal: telemetry use + */ + bulkFetch: (esClient: ElasticsearchClient, soClient: SavedObjectsClientContract, collectors?: Map>) => Promise>; + /** + * Converts an array of fetched stats results into key/object + * @internal: telemetry use + */ + toObject: , T = unknown>(statsData?: Array<{ + type: string; + result: T; + }>) => Result; + /** + * Rename fields to use API conventions + * @internal: monitoring use + */ + toApiFieldNames: (apiData: Record | unknown[]) => Record | unknown[]; + /** + * Creates a stats collector to collect plugin telemetry data. + * registerCollector must be called to connect the created collector with the service. + * @internal: telemetry and monitoring use + */ + makeStatsCollector: (options: CollectorOptions) => Collector; +} +/** + * Helper to find out whether to keep recursively looking or if we are on an end value + */ +export type RecursiveMakeSchemaFrom = U extends object ? Record extends U ? { + type: 'pass_through'; + _meta: { + description: string; + } & SchemaMetaOptional; +} | MakeSchemaFrom : MakeSchemaFrom : RequireMeta extends true ? { + type: PossibleSchemaTypes; + _meta: { + description: string; + }; +} : { + type: PossibleSchemaTypes; + _meta?: { + description: string; + }; +}; +/** + * The `schema` property in {@link CollectorOptions} must match the output of + * the `fetch` method. This type helps ensure that is correct + */ +export type MakeSchemaFrom = { + [Key in keyof Required]: Required[Key] extends Array ? { + type: 'array'; + items: RecursiveMakeSchemaFrom; + } : RecursiveMakeSchemaFrom[Key], RequireMeta>; +}; +/** + * The context for the `fetch` method: It includes the most commonly used clients in the collectors (ES and SO clients). + * Both are scoped based on the request and the context: + * - When users are requesting a sample of data, it is scoped to their role to avoid exposing data they shouldn't read + * - When building the telemetry data payload to report to the remote cluster, the requests are scoped to the `kibana` internal user + * + * @remark Bear in mind when testing your collector that your user has the same privileges as the Kibana Internal user to ensure the expected data is sent to the remote cluster. + */ +export interface CollectorFetchContext { + /** + * Request-scoped Elasticsearch client + * @remark Bear in mind when testing your collector that your user has the same privileges as the Kibana Internal user to ensure the expected data is sent to the remote cluster (more info: {@link CollectorFetchContext}) + */ + esClient: ElasticsearchClient; + /** + * Request-scoped Saved Objects client + * @remark Bear in mind when testing your collector that your user has the same privileges as the Kibana Internal user to ensure the expected data is sent to the remote cluster (more info: {@link CollectorFetchContext}) + */ + soClient: SavedObjectsClientContract; +} +/** + * The fetch method has the context of the Collector itself + * (this has access to all the properties of the collector like the logger) + * and the first parameter is {@link CollectorFetchContext}. + */ +export type CollectorFetchMethod = (this: ICollector & ExtraOptions, // Specify the context of `this` for this.log and others to become available +context: CollectorFetchContext) => Promise | TReturn; +/** + * Options to instantiate a collector + */ +export type CollectorOptions = { + /** + * Unique string identifier for the collector + */ + type: string; + /** + * Method to return `true`/`false` or Promise(`true`/`false`) to confirm if the collector is ready for the `fetch` method to be called. + */ + isReady: () => Promise | boolean; + /** + * Schema definition of the output of the `fetch` method. + */ + schema?: MakeSchemaFrom; + /** + * The method that will collect and return the data in the final format. + * @param collectorFetchContext {@link CollectorFetchContext} + */ + fetch: CollectorFetchMethod; +} & ExtraOptions; +/** + * Common interface for Usage and Stats Collectors + */ +export interface ICollector { + /** Logger **/ + readonly log: Logger; + /** The registered type (aka name) of the collector **/ + readonly type: CollectorOptions['type']; + /** + * The actual logic that reports the Usage collection. + * It will be called on every collection request. + * Whatever is returned in this method will be passed through as-is under + * the {@link ICollector.type} key. + * + * @example + * { + * [type]: await fetch(context) + * } + */ + readonly fetch: CollectorFetchMethod; + /** + * Should return `true` when it's safe to call the `fetch` method. + */ + readonly isReady: CollectorOptions['isReady']; +} diff --git a/src/platform/plugins/shared/usage_collection/server/collector/usage_collector.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/usage_collector.d.ts new file mode 100644 index 0000000000000..7cf20723b5fa1 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/collector/usage_collector.d.ts @@ -0,0 +1,13 @@ +import type { Logger } from '@kbn/core/server'; +import type { CollectorOptions } from './types'; +import { Collector } from './collector'; +/** + * Same as {@link CollectorOptions} but with the `schema` property enforced + */ +export type UsageCollectorOptions = CollectorOptions & Required, 'schema'>>; +/** + * @internal Only used in fixtures as a type + */ +export declare class UsageCollector extends Collector { + constructor(log: Logger, collectorOptions: UsageCollectorOptions); +} diff --git a/src/platform/plugins/shared/usage_collection/server/config.d.ts b/src/platform/plugins/shared/usage_collection/server/config.d.ts new file mode 100644 index 0000000000000..46e7f049df3f1 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/config.d.ts @@ -0,0 +1,17 @@ +import type { TypeOf } from '@kbn/config-schema'; +import type { PluginConfigDescriptor } from '@kbn/core/server'; +export declare const configSchema: import("@kbn/config-schema").ObjectType<{ + usageCounters: import("@kbn/config-schema").ObjectType<{ + enabled: import("@kbn/config-schema").Type; + retryCount: import("@kbn/config-schema").Type; + bufferDuration: import("@kbn/config-schema").Type; + }>; + uiCounters: import("@kbn/config-schema").ObjectType<{ + enabled: import("@kbn/config-schema").Type; + debug: import("@kbn/config-schema").Type; + }>; + maximumWaitTimeForAllCollectorsInS: import("@kbn/config-schema").Type; + maxCollectorConcurrency: import("@kbn/config-schema").Type; +}>; +export type ConfigType = TypeOf; +export declare const config: PluginConfigDescriptor; diff --git a/src/platform/plugins/shared/usage_collection/server/index.d.ts b/src/platform/plugins/shared/usage_collection/server/index.d.ts new file mode 100644 index 0000000000000..7dc150eeac4fd --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/index.d.ts @@ -0,0 +1,7 @@ +import type { PluginInitializerContext } from '@kbn/core/server'; +export type { Collector, ICollectorSet, AllowedSchemaTypes, MakeSchemaFrom, CollectorOptions, UsageCollectorOptions, CollectorFetchContext, CollectorFetchMethod, } from './collector'; +export type { UsageCountersSavedObject, UsageCountersSavedObjectAttributes, IncrementCounterParams, UsageCounter, } from './usage_counters'; +export { serializeCounterKey, USAGE_COUNTERS_SAVED_OBJECT_TYPE } from './usage_counters'; +export type { UsageCollectionSetup, UsageCollectionStart } from './plugin'; +export { config } from './config'; +export declare const plugin: (initializerContext: PluginInitializerContext) => Promise; diff --git a/src/platform/plugins/shared/usage_collection/server/plugin.d.ts b/src/platform/plugins/shared/usage_collection/server/plugin.d.ts new file mode 100644 index 0000000000000..eb67fb51bb640 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/plugin.d.ts @@ -0,0 +1,17 @@ +import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; +import type { ICollectorSet } from './collector/types'; +import type { UsageCountersServiceSetup, UsageCountersServiceStart } from './usage_counters/types'; +/** Plugin's setup API **/ +export type UsageCollectionSetup = ICollectorSet & UsageCountersServiceSetup; +/** Plugin's start API **/ +export type UsageCollectionStart = UsageCountersServiceStart; +export declare class UsageCollectionPlugin implements Plugin { + private readonly initializerContext; + private readonly logger; + private savedObjects?; + private usageCountersService?; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup): UsageCollectionSetup; + start({ savedObjects }: CoreStart): UsageCollectionStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/usage_collection/server/report/index.d.ts b/src/platform/plugins/shared/usage_collection/server/report/index.d.ts new file mode 100644 index 0000000000000..063f0f945af74 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/report/index.d.ts @@ -0,0 +1,2 @@ +export { storeUiReport } from './store_ui_report'; +export { reportSchema } from './schema'; diff --git a/src/platform/plugins/shared/usage_collection/server/report/schema.d.ts b/src/platform/plugins/shared/usage_collection/server/report/schema.d.ts new file mode 100644 index 0000000000000..8df3657ccabcf --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/report/schema.d.ts @@ -0,0 +1,34 @@ +import type { TypeOf } from '@kbn/config-schema'; +declare const applicationUsageReportSchema: import("@kbn/config-schema").ObjectType<{ + minutesOnScreen: import("@kbn/config-schema").Type; + numberOfClicks: import("@kbn/config-schema").Type; + appId: import("@kbn/config-schema").Type; + viewId: import("@kbn/config-schema").Type; +}>; +export declare const reportSchema: import("@kbn/config-schema").ObjectType<{ + reportVersion: import("@kbn/config-schema").Type<3 | undefined>; + userAgent: import("@kbn/config-schema").Type> | undefined>; + uiCounter: import("@kbn/config-schema").Type> | undefined>; + application_usage: import("@kbn/config-schema").Type> | undefined>; +}>; +export type ReportSchemaType = TypeOf; +export type ApplicationUsageReport = TypeOf; +export {}; diff --git a/src/platform/plugins/shared/usage_collection/server/report/store_application_usage.d.ts b/src/platform/plugins/shared/usage_collection/server/report/store_application_usage.d.ts new file mode 100644 index 0000000000000..f8045f9fdbc55 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/report/store_application_usage.d.ts @@ -0,0 +1,7 @@ +import type { ISavedObjectsRepository } from '@kbn/core/server'; +import type { ApplicationUsageReport } from './schema'; +export declare const storeApplicationUsage: (repository: ISavedObjectsRepository, appUsages: ApplicationUsageReport[], timestamp: Date) => Promise>[] | undefined>; diff --git a/src/platform/plugins/shared/usage_collection/server/report/store_ui_report.d.ts b/src/platform/plugins/shared/usage_collection/server/report/store_ui_report.d.ts new file mode 100644 index 0000000000000..3a237338bd789 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/report/store_ui_report.d.ts @@ -0,0 +1,10 @@ +import type { ISavedObjectsRepository } from '@kbn/core/server'; +import type { ReportSchemaType } from './schema'; +import { type UsageCountersServiceSetup } from '../usage_counters'; +export declare function storeUiReport(internalRepository: ISavedObjectsRepository, usageCounters: UsageCountersServiceSetup, report: ReportSchemaType): Promise<[...PromiseSettledResult | import("@kbn/core/packages/saved-objects/common").SavedObject>[], PromiseSettledResult>[] | undefined>]>; diff --git a/src/platform/plugins/shared/usage_collection/server/routes/index.d.ts b/src/platform/plugins/shared/usage_collection/server/routes/index.d.ts new file mode 100644 index 0000000000000..177824a421095 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/routes/index.d.ts @@ -0,0 +1,24 @@ +import type { IRouter, ISavedObjectsRepository, ServiceStatus } from '@kbn/core/server'; +import { type MetricsServiceSetup } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import type { ICollectorSet } from '../collector'; +import type { UsageCountersServiceSetup } from '../usage_counters'; +export declare function setupRoutes({ router, usageCounters, getSavedObjects, ...rest }: { + router: IRouter; + getSavedObjects: () => ISavedObjectsRepository | undefined; + usageCounters: UsageCountersServiceSetup; + config: { + allowAnonymous: boolean; + kibanaIndex: string; + kibanaVersion: string; + uuid: string; + server: { + name: string; + hostname: string; + port: number; + }; + }; + collectorSet: ICollectorSet; + metrics: MetricsServiceSetup; + overallStatus$: Observable; +}): void; diff --git a/src/platform/plugins/shared/usage_collection/server/routes/stats/index.d.ts b/src/platform/plugins/shared/usage_collection/server/routes/stats/index.d.ts new file mode 100644 index 0000000000000..d9fb90de65cd8 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/routes/stats/index.d.ts @@ -0,0 +1 @@ +export { registerStatsRoute } from './stats'; diff --git a/src/platform/plugins/shared/usage_collection/server/routes/stats/stats.d.ts b/src/platform/plugins/shared/usage_collection/server/routes/stats/stats.d.ts new file mode 100644 index 0000000000000..3ce446643028b --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/routes/stats/stats.d.ts @@ -0,0 +1,21 @@ +import type { Observable } from 'rxjs'; +import type { IRouter, ServiceStatus } from '@kbn/core/server'; +import { type MetricsServiceSetup } from '@kbn/core/server'; +import type { ICollectorSet } from '../../collector'; +export declare function registerStatsRoute({ router, config, collectorSet, metrics, overallStatus$, }: { + router: IRouter; + config: { + allowAnonymous: boolean; + kibanaIndex: string; + kibanaVersion: string; + uuid: string; + server: { + name: string; + hostname: string; + port: number; + }; + }; + collectorSet: ICollectorSet; + metrics: MetricsServiceSetup; + overallStatus$: Observable; +}): void; diff --git a/src/platform/plugins/shared/usage_collection/server/routes/ui_counters.d.ts b/src/platform/plugins/shared/usage_collection/server/routes/ui_counters.d.ts new file mode 100644 index 0000000000000..8f1aa905c0a73 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/routes/ui_counters.d.ts @@ -0,0 +1,3 @@ +import type { IRouter, ISavedObjectsRepository } from '@kbn/core/server'; +import type { UsageCountersServiceSetup } from '../usage_counters'; +export declare function registerUiCountersRoute(router: IRouter, getSavedObjects: () => ISavedObjectsRepository | undefined, usageCounters: UsageCountersServiceSetup): void; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/common/kuery_utils.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/common/kuery_utils.d.ts new file mode 100644 index 0000000000000..dc3471f56f249 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/common/kuery_utils.d.ts @@ -0,0 +1,3 @@ +import { type KueryNode } from '@kbn/es-query'; +import type { UsageCountersSearchFilters } from '../types'; +export declare function usageCountersSearchParamsToKueryFilter(params: Omit): KueryNode; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/index.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/index.d.ts new file mode 100644 index 0000000000000..0feb4c84da21b --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/index.d.ts @@ -0,0 +1,7 @@ +import type { UsageCounters } from '../../common'; +export type IncrementCounterParams = UsageCounters.v1.IncrementCounterParams; +export type { UsageCountersServiceSetup, UsageCountersServiceStart } from './types'; +export type { UsageCountersSavedObjectAttributes, UsageCountersSavedObject } from './saved_objects'; +export type { IUsageCounter as UsageCounter } from './usage_counter'; +export { UsageCountersService } from './usage_counters_service'; +export { serializeCounterKey, USAGE_COUNTERS_SAVED_OBJECT_TYPE } from './saved_objects'; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/constants.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/constants.d.ts new file mode 100644 index 0000000000000..3cf4bdb5adeba --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/constants.d.ts @@ -0,0 +1,12 @@ +/** + * Roll indices every hour + */ +export declare const ROLL_INDICES_INTERVAL = 3600000; +/** + * Start rolling indices after 5 minutes up + */ +export declare const ROLL_INDICES_START: number; +/** + * Number of days to keep the Usage counters saved object documents + */ +export declare const USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS = 5; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/index.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/index.d.ts new file mode 100644 index 0000000000000..e144d63725527 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/index.d.ts @@ -0,0 +1 @@ +export { registerUsageCountersRollups } from './register_rollups'; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/register_rollups.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/register_rollups.d.ts new file mode 100644 index 0000000000000..5f62696e1d1ea --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/register_rollups.d.ts @@ -0,0 +1,9 @@ +import { type Observable } from 'rxjs'; +import type { Logger, ISavedObjectsRepository } from '@kbn/core/server'; +import type { IUsageCounter } from '../usage_counter'; +export declare function registerUsageCountersRollups({ logger, getRegisteredUsageCounters, internalRepository, pluginStop$, }: { + logger: Logger; + getRegisteredUsageCounters: () => IUsageCounter[]; + internalRepository: ISavedObjectsRepository; + pluginStop$: Observable; +}): void; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/rollups.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/rollups.d.ts new file mode 100644 index 0000000000000..0ce297034ccdc --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/rollups.d.ts @@ -0,0 +1,9 @@ +import moment from 'moment'; +import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; +import type { IUsageCounter } from '../usage_counter'; +export declare function rollUsageCountersIndices({ logger, getRegisteredUsageCounters, internalRepository, now, }: { + logger: Logger; + getRegisteredUsageCounters: () => IUsageCounter[]; + internalRepository?: ISavedObjectsRepository; + now?: moment.Moment; +}): Promise; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/saved_objects.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/saved_objects.d.ts new file mode 100644 index 0000000000000..1996aee5d2bc8 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/saved_objects.d.ts @@ -0,0 +1,41 @@ +import moment from 'moment'; +import type { SavedObject, SavedObjectsRepository, SavedObjectsServiceSetup } from '@kbn/core/server'; +import type { UsageCounters } from '../../common'; +/** + * The attributes stored in the UsageCounters' SavedObjects + */ +export interface UsageCountersSavedObjectAttributes extends UsageCounters.v1.AbstractCounter { + /** Number of times the event has occurred **/ + count: number; +} +/** + * The structure of the SavedObjects of type "usage-counters" + */ +export type UsageCountersSavedObject = SavedObject; +/** The Saved Objects type for Usage Counters **/ +export declare const USAGE_COUNTERS_SAVED_OBJECT_TYPE = "usage-counter"; +export declare const registerUsageCountersSavedObjectTypes: (savedObjectsSetup: SavedObjectsServiceSetup) => void; +/** + * Parameters to the `serializeCounterKey` method + * @internal used in kibana_usage_collectors + */ +export interface SerializeCounterKeyParams extends UsageCounters.v1.AbstractCounter { + /** The date to which serialize the key (defaults to 'now') **/ + date?: moment.MomentInput; +} +/** + * Generates a key based on the UsageCounter details + * @internal used in kibana_usage_collectors + * @param opts {@link SerializeCounterKeyParams} + */ +export declare const serializeCounterKey: (params: SerializeCounterKeyParams) => string; +export interface StoreCounterParams { + metric: UsageCounters.v1.CounterMetric; + soRepository: Pick; +} +export declare const storeCounter: ({ metric, soRepository }: StoreCounterParams) => Promise>; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/search/index.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/search/index.d.ts new file mode 100644 index 0000000000000..3534d1da9c929 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/search/index.d.ts @@ -0,0 +1 @@ +export { searchUsageCounters } from './search'; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/search/search.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/search/search.d.ts new file mode 100644 index 0000000000000..6baf805bd665e --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/search/search.d.ts @@ -0,0 +1,3 @@ +import type { ISavedObjectsRepository } from '@kbn/core-saved-objects-api-server'; +import type { UsageCountersSearchParams, UsageCountersSearchResult } from '../types'; +export declare function searchUsageCounters(repository: ISavedObjectsRepository, params: UsageCountersSearchParams): Promise; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/types.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/types.d.ts new file mode 100644 index 0000000000000..88706760f7ff3 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/types.d.ts @@ -0,0 +1,81 @@ +import type { UsageCounters } from '../../common/types'; +import type { UsageCounter } from '.'; +export interface CreateUsageCounterParams { + /** + * Number of days a usage counter must be kept in the persistence layer. + * See USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS for default value. + */ + retentionPeriodDays?: number; +} +/** + * Provides the necessary tools to create and incremement Usage Counters + */ +export interface UsageCountersServiceSetup { + /** + * Returns a usage counter by domainId + */ + getUsageCounterByDomainId: (domainId: string) => UsageCounter | undefined; + /** + * Registers a usage counter to collect daily aggregated plugin counter events + */ + createUsageCounter: (domainId: string, params?: CreateUsageCounterParams) => UsageCounter; +} +export interface UsageCountersSearchParams { + /** A set of filters to limit the results of the search operation */ + filters: UsageCountersSearchFilters; + /** A set of options to modify the behavior of the search operation */ + options?: UsageCountersSearchOptions; +} +export interface UsageCountersSearchFilters { + /** The domainId used to create the Counter API */ + domainId: string; + /** The name of the counter. Optional, will return all counters in the same domainId that match the rest of filters if omitted */ + counterName?: string; + /** The type of counter. Optional, will return all counters in the same domainId that match the rest of filters if omitted */ + counterType?: string; + /** Namespace of the counter. Optional, counters of the 'default' namespace will be returned if omitted */ + namespace?: string; + /** ISO date string to limit search results: get counters that are more recent than the provided date (if specified) */ + from?: string; + /** ISO date string to limit search results: get counters that are older than the provided date (if specified) */ + to?: string; + /** Return counters from a given source only. Optional, both 'ui' and 'server' counters will be returned if omitted */ + source?: 'server' | 'ui'; +} +export interface UsageCountersSearchOptions { + /** Number of counters to retrieve per page, when querying ES (defaults to 100) */ + perPage?: number; +} +/** + * The result of a Usage Counters search operation + */ +export interface UsageCountersSearchResult { + /** + * The counters that matched the search criteria + */ + counters: UsageCounterSnapshot[]; +} +/** + * Represents the current state of a Usage Counter at a given point in time + */ +export interface UsageCounterSnapshot extends UsageCounters.v1.AbstractCounter { + /** List of daily records captured for this counter */ + records: UsageCounterRecord[]; + /** Number of events captured (adds up all records) */ + count: number; +} +/** + * Number of events counted on a given day + */ +export interface UsageCounterRecord { + /** Date where the counter was last updated */ + updatedAt: string; + /** Number of events captured on that day */ + count: number; +} +/** + * Interface to allow searching for persisted usage-counters + */ +export interface UsageCountersServiceStart { + search: (params: UsageCountersSearchParams) => Promise; +} diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counter.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counter.d.ts new file mode 100644 index 0000000000000..71b3db339a154 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counter.d.ts @@ -0,0 +1,36 @@ +import type * as Rx from 'rxjs'; +import type { UsageCounters } from '../../common'; +export interface UsageCounterParams { + domainId: string; + counter$: Rx.Subject; + retentionPeriodDays?: number; +} +/** + * Usage Counter allows to keep track of any events that occur. + * By calling {@link IUsageCounter.incrementCounter} devs can notify this + * API whenever the event happens. + */ +export interface IUsageCounter { + /** + * Defines a domainId (aka a namespace) under which multiple counters can be stored + */ + domainId: string; + /** + * Defines custom retention period for the counters under this domain. + * This is the number of days worth of counters that must be kept in the system indices. + * See USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS for default value + */ + retentionPeriodDays?: number; + /** + * Notifies the counter about a new event happening so it can increase the count internally. + * @param params {@link IncrementCounterParams} + */ + incrementCounter: (params: UsageCounters.v1.IncrementCounterParams) => void; +} +export declare class UsageCounter implements IUsageCounter { + readonly domainId: string; + private counter$; + readonly retentionPeriodDays?: number | undefined; + constructor({ domainId, counter$, retentionPeriodDays }: UsageCounterParams); + incrementCounter: (params: UsageCounters.v1.IncrementCounterParams) => void; +} diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counters_service.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counters_service.d.ts new file mode 100644 index 0000000000000..1628fae21f297 --- /dev/null +++ b/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counters_service.d.ts @@ -0,0 +1,36 @@ +import type { SavedObjectsServiceSetup, SavedObjectsServiceStart } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; +import type { UsageCountersServiceSetup, UsageCountersServiceStart } from './types'; +export interface UsageCountersServiceDeps { + logger: Logger; + retryCount: number; + bufferDurationMs: number; +} +export interface UsageCountersServiceSetupDeps { + savedObjects: SavedObjectsServiceSetup; +} +export interface UsageCountersServiceStartDeps { + savedObjects: SavedObjectsServiceStart; +} +export declare class UsageCountersService { + private readonly stop$; + private readonly retryCount; + private readonly bufferDurationMs; + private readonly counterSets; + private readonly source$; + private readonly counter$; + private readonly flushCache$; + private readonly stopCaching$; + private repository?; + private readonly logger; + constructor({ logger, retryCount, bufferDurationMs }: UsageCountersServiceDeps); + setup: ({ savedObjects }: UsageCountersServiceSetupDeps) => UsageCountersServiceSetup; + start: ({ savedObjects }: UsageCountersServiceStartDeps) => UsageCountersServiceStart; + stop: () => UsageCountersServiceStart; + private backoffDelay; + private storeDate$; + private createUsageCounter; + private getUsageCounterByDomainId; + private mergeCounters; + private search; +} diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/index.d.ts new file mode 100644 index 0000000000000..0d6787b122bb9 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/index.d.ts @@ -0,0 +1,7 @@ +export type { AlertInstanceContext } from './src/alert_instance'; +export type { TrackedLifecycleAlertState, WrappedLifecycleRuleState } from './src/lifecycle_state'; +export { wrappedStateRt } from './src/lifecycle_state'; +export type { RuleTaskParams } from './src/rule_task_instance'; +export { ActionsCompletion, ruleParamsSchema } from './src/rule_task_instance'; +export type { LatestTaskStateSchema as RuleTaskState, MutableLatestTaskStateSchema as MutableRuleTaskState, LatestRawAlertInstanceSchema as RawAlertInstance, LatestAlertInstanceMetaSchema as AlertInstanceMeta, MutableLatestAlertInstanceMetaSchema as MutableAlertInstanceMeta, LatestAlertInstanceStateSchema as AlertInstanceState, LatestThrottledActionSchema as ThrottledActions, LatestLastScheduledActionsSchema as LastScheduledActions, } from './src/task_state'; +export { stateSchemaByVersion, emptyState as emptyTaskState } from './src/task_state'; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/alert_instance.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/alert_instance.d.ts new file mode 100644 index 0000000000000..2e03968655114 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/alert_instance.d.ts @@ -0,0 +1,4 @@ +import * as t from 'io-ts'; +declare const contextSchema: t.RecordC; +export type AlertInstanceContext = t.TypeOf; +export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/lifecycle_state.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/lifecycle_state.d.ts new file mode 100644 index 0000000000000..fab9784f4bd50 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/lifecycle_state.d.ts @@ -0,0 +1,45 @@ +import * as t from 'io-ts'; +declare const trackedAlertStateRt: t.TypeC<{ + alertId: t.StringC; + alertUuid: t.StringC; + started: t.StringC; + flappingHistory: t.ArrayC; + flapping: t.BooleanC; + pendingRecoveredCount: t.NumberC; + activeCount: t.NumberC; +}>; +export type TrackedLifecycleAlertState = t.TypeOf; +type RuleTypeState = Record; +export declare const alertTypeStateRt: () => t.Type; +export declare const wrappedStateRt: () => t.TypeC<{ + wrapped: t.Type; + trackedAlerts: t.RecordC; + flapping: t.BooleanC; + pendingRecoveredCount: t.NumberC; + activeCount: t.NumberC; + }>>; + trackedAlertsRecovered: t.RecordC; + flapping: t.BooleanC; + pendingRecoveredCount: t.NumberC; + activeCount: t.NumberC; + }>>; +}>; +/** + * This is redefined instead of derived from above `wrappedStateRt` because + * there's no easy way to instantiate generic values such as the runtime type + * factory function. + */ +export type WrappedLifecycleRuleState = RuleTypeState & { + wrapped: State; + trackedAlerts: Record; + trackedAlertsRecovered: Record; +}; +export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/rule_task_instance.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/rule_task_instance.d.ts new file mode 100644 index 0000000000000..2ad4dcc885dc3 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/rule_task_instance.d.ts @@ -0,0 +1,11 @@ +import * as t from 'io-ts'; +export declare enum ActionsCompletion { + COMPLETE = "complete", + PARTIAL = "partial" +} +export declare const ruleParamsSchema: t.IntersectionC<[t.TypeC<{ + alertId: t.StringC; +}>, t.PartialC<{ + spaceId: t.StringC; +}>]>; +export type RuleTaskParams = t.TypeOf; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/index.d.ts new file mode 100644 index 0000000000000..271f0c6bf1c1c --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/index.d.ts @@ -0,0 +1,374 @@ +import { type TypeOf } from '@kbn/config-schema'; +import * as v3 from './v3'; +export declare const stateSchemaByVersion: { + 1: { + up: (state: Record) => Readonly<{ + alertTypeState?: Record | undefined; + alertInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + alertRecoveredInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + previousStartedAt?: string | null | undefined; + summaryActions?: Record> | undefined; + } & {}>; + schema: import("@kbn/config-schema").ObjectType<{ + alertTypeState: import("@kbn/config-schema").Type | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; + }>; + }; + 2: { + up: (state: Record) => Readonly<{ + alertTypeState?: Record | undefined; + alertInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + alertRecoveredInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + previousStartedAt?: string | null | undefined; + summaryActions?: Record> | undefined; + trackedExecutions?: string[] | undefined; + } & {}>; + schema: import("@kbn/config-schema").ObjectType | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; + }, "trackedExecutions"> & { + trackedExecutions: import("@kbn/config-schema").Type; + }>; + }; + 3: { + up: (state: Record) => Readonly<{ + alertTypeState?: Record | undefined; + alertInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + alertRecoveredInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + previousStartedAt?: string | null | undefined; + summaryActions?: Record> | undefined; + } & {}>; + schema: import("@kbn/config-schema").ObjectType<{ + alertTypeState: import("@kbn/config-schema").Type | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; + }>; + }; +}; +declare const latest: typeof v3; +/** + * WARNING: Do not modify the code below when doing a new version. + * Update the "latest" variable instead. + */ +declare const latestTaskStateSchema: import("@kbn/config-schema").ObjectType<{ + alertTypeState: import("@kbn/config-schema").Type | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; +}>; +export type LatestTaskStateSchema = TypeOf; +export type LatestRawAlertInstanceSchema = TypeOf; +export type LatestAlertInstanceMetaSchema = TypeOf; +export type LatestAlertInstanceStateSchema = TypeOf; +export type LatestThrottledActionSchema = TypeOf; +export type LatestLastScheduledActionsSchema = TypeOf; +export declare const emptyState: LatestTaskStateSchema; +type Mutable = { + -readonly [k in keyof T]: Mutable; +}; +export type MutableLatestTaskStateSchema = Mutable; +export type MutableLatestAlertInstanceMetaSchema = Mutable; +export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/lib/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/lib/index.d.ts new file mode 100644 index 0000000000000..22fca8c0446bb --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/lib/index.d.ts @@ -0,0 +1,6 @@ +export declare function isJSONObject(obj: unknown): obj is Record; +export declare function isString(value: unknown): value is string; +export declare function isBoolean(value: unknown): value is boolean; +export declare function isNumber(value: unknown): value is number; +export declare function isStringArray(value: unknown): value is string[]; +export declare function isBooleanArray(value: unknown): value is boolean[]; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/index.d.ts new file mode 100644 index 0000000000000..0727e379eb9a2 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/index.d.ts @@ -0,0 +1,101 @@ +export { versionSchema, throttledActionSchema, rawAlertInstanceSchema, metaSchema, alertStateSchema, lastScheduledActionsSchema, } from './schema'; +export declare const versionDefinition: { + up: (state: Record) => Readonly<{ + alertTypeState?: Record | undefined; + alertInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + alertRecoveredInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + previousStartedAt?: string | null | undefined; + summaryActions?: Record> | undefined; + } & {}>; + schema: import("@kbn/config-schema").ObjectType<{ + alertTypeState: import("@kbn/config-schema").Type | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; + }>; +}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/migration.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/migration.d.ts new file mode 100644 index 0000000000000..9834d60bf9db9 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/migration.d.ts @@ -0,0 +1,12 @@ +import { type TypeOf } from '@kbn/config-schema'; +import type { versionSchema, throttledActionSchema, rawAlertInstanceSchema, metaSchema, lastScheduledActionsSchema } from './schema'; +type VersionSchema = TypeOf; +type ThrottledActionsSchema = TypeOf; +type LastScheduledActionsSchema = TypeOf; +type RawAlertInstanceSchema = TypeOf; +export declare function migrateThrottledActions(throttledActions: unknown): ThrottledActionsSchema | undefined; +export declare function migrateLastScheduledActions(lastScheduledActions: unknown): LastScheduledActionsSchema | undefined; +export declare function migrateMeta(meta: unknown): TypeOf | undefined; +export declare function migrateAlertInstances(alertInstances: unknown): Record | undefined; +export declare const upMigration: (state: Record) => VersionSchema; +export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/schema.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/schema.d.ts new file mode 100644 index 0000000000000..219e73bcd3ef8 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/schema.d.ts @@ -0,0 +1,100 @@ +export declare const throttledActionSchema: import("@kbn/config-schema").Type>>; +export declare const alertStateSchema: import("@kbn/config-schema").Type>; +export declare const lastScheduledActionsSchema: import("@kbn/config-schema").ObjectType<{ + subgroup: import("@kbn/config-schema").Type; + group: import("@kbn/config-schema").Type; + date: import("@kbn/config-schema").Type; + actions: import("@kbn/config-schema").Type> | undefined>; +}>; +export declare const metaSchema: import("@kbn/config-schema").ObjectType<{ + lastScheduledActions: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined>; + flappingHistory: import("@kbn/config-schema").Type; + flapping: import("@kbn/config-schema").Type; + maintenanceWindowIds: import("@kbn/config-schema").Type; + maintenanceWindowNames: import("@kbn/config-schema").Type; + pendingRecoveredCount: import("@kbn/config-schema").Type; + uuid: import("@kbn/config-schema").Type; + activeCount: import("@kbn/config-schema").Type; +}>; +export declare const rawAlertInstanceSchema: import("@kbn/config-schema").ObjectType<{ + meta: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined>; + state: import("@kbn/config-schema").Type | undefined>; +}>; +export declare const versionSchema: import("@kbn/config-schema").ObjectType<{ + alertTypeState: import("@kbn/config-schema").Type | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; +}>; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/index.d.ts new file mode 100644 index 0000000000000..cd485d2f222cc --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/index.d.ts @@ -0,0 +1,104 @@ +export { versionSchema, throttledActionSchema, rawAlertInstanceSchema, metaSchema, alertStateSchema, lastScheduledActionsSchema, } from './schema'; +export declare const versionDefinition: { + up: (state: Record) => Readonly<{ + alertTypeState?: Record | undefined; + alertInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + alertRecoveredInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + previousStartedAt?: string | null | undefined; + summaryActions?: Record> | undefined; + trackedExecutions?: string[] | undefined; + } & {}>; + schema: import("@kbn/config-schema").ObjectType | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; + }, "trackedExecutions"> & { + trackedExecutions: import("@kbn/config-schema").Type; + }>; +}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/migration.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/migration.d.ts new file mode 100644 index 0000000000000..7a5874a96000a --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/migration.d.ts @@ -0,0 +1,5 @@ +import { type TypeOf } from '@kbn/config-schema'; +import type { versionSchema } from './schema'; +type VersionSchema = TypeOf; +export declare const upMigration: (state: Record) => VersionSchema; +export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/schema.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/schema.d.ts new file mode 100644 index 0000000000000..97081740921aa --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/schema.d.ts @@ -0,0 +1,52 @@ +export * from '../v1'; +export declare const versionSchema: import("@kbn/config-schema").ObjectType | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; +}, "trackedExecutions"> & { + trackedExecutions: import("@kbn/config-schema").Type; +}>; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/index.d.ts new file mode 100644 index 0000000000000..0727e379eb9a2 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/index.d.ts @@ -0,0 +1,101 @@ +export { versionSchema, throttledActionSchema, rawAlertInstanceSchema, metaSchema, alertStateSchema, lastScheduledActionsSchema, } from './schema'; +export declare const versionDefinition: { + up: (state: Record) => Readonly<{ + alertTypeState?: Record | undefined; + alertInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + alertRecoveredInstances?: Record> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined; + previousStartedAt?: string | null | undefined; + summaryActions?: Record> | undefined; + } & {}>; + schema: import("@kbn/config-schema").ObjectType<{ + alertTypeState: import("@kbn/config-schema").Type | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; + }>; +}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/migration.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/migration.d.ts new file mode 100644 index 0000000000000..7a5874a96000a --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/migration.d.ts @@ -0,0 +1,5 @@ +import { type TypeOf } from '@kbn/config-schema'; +import type { versionSchema } from './schema'; +type VersionSchema = TypeOf; +export declare const upMigration: (state: Record) => VersionSchema; +export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/schema.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/schema.d.ts new file mode 100644 index 0000000000000..35c47a820d88d --- /dev/null +++ b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/schema.d.ts @@ -0,0 +1,50 @@ +export * from '../v1'; +export declare const versionSchema: import("@kbn/config-schema").ObjectType<{ + alertTypeState: import("@kbn/config-schema").Type | undefined>; + alertInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; + } & { + date: string; + group: string; + }> | undefined; + maintenanceWindowIds?: string[] | undefined; + maintenanceWindowNames?: string[] | undefined; + uuid?: string | undefined; + } & {}> | undefined; + state?: Record | undefined; + } & {}>> | undefined>; + previousStartedAt: import("@kbn/config-schema").Type; + summaryActions: import("@kbn/config-schema").Type> | undefined>; +}>; diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/index.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/index.d.ts new file mode 100644 index 0000000000000..d3ef9127d2210 --- /dev/null +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/index.d.ts @@ -0,0 +1,5 @@ +export type * from './src/types'; +export * from './src/index_templates'; +export * from './src/home_sections'; +export type * from './src/services'; +export * from './src/constants'; diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/constants.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/constants.d.ts new file mode 100644 index 0000000000000..1e63a3ced7efd --- /dev/null +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/constants.d.ts @@ -0,0 +1,7 @@ +/** + * Locator ID used to navigate to the Index Management application. + * + * Kept in `@kbn/index-management-shared-types` so other plugins can reference it + * without depending on `@kbn/index-management-plugin`. + */ +export declare const INDEX_MANAGEMENT_LOCATOR_ID = "INDEX_MANAGEMENT_LOCATOR_ID"; diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/home_sections.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/home_sections.d.ts new file mode 100644 index 0000000000000..1739750a20af8 --- /dev/null +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/home_sections.d.ts @@ -0,0 +1,46 @@ +import type { FunctionComponent, ReactNode } from 'react'; +import type { ApplicationStart } from '@kbn/core-application-browser'; +import type { EuiBreadcrumb, EuiThemeComputed } from '@elastic/eui'; +import type { Index } from './types'; +export declare enum Section { + Indices = "indices", + DataStreams = "data_streams", + IndexTemplates = "templates", + ComponentTemplates = "component_templates", + EnrichPolicies = "enrich_policies" +} +export declare enum IndexDetailsSection { + Overview = "overview", + Mappings = "mappings", + Settings = "settings", + Stats = "stats" +} +export type IndexDetailsTabId = IndexDetailsSection | string; +export interface IndexDetailsTab { + id: IndexDetailsTabId; + name: ReactNode; + /** + * A function that renders the content of the tab. + * + * IMPORTANT: This expects an arrow function that returns JSX, NOT a component passed directly. + * + * @example + * // Correct - arrow function returning JSX: + * renderTabContent: ({ index, getUrlForApp }) => ( + * + * ) + * + * // Wrong - passing a component directly will break if it uses hooks: + * renderTabContent: MyTabComponent + */ + renderTabContent: (args: { + index: Index; + getUrlForApp: ApplicationStart['getUrlForApp']; + euiTheme: EuiThemeComputed; + }) => ReturnType; + order: number; + shouldRenderTab?: (args: { + index: Index; + }) => boolean; + breadcrumb?: EuiBreadcrumb; +} diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/index_templates.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/index_templates.d.ts new file mode 100644 index 0000000000000..5ba765ea780df --- /dev/null +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/index_templates.d.ts @@ -0,0 +1,56 @@ +export type TemplateType = 'default' | 'managed' | 'cloudManaged' | 'system'; +export declare const IndexMode: { + readonly standard: "standard"; + readonly logsdb: "logsdb"; + readonly time_series: "time_series"; + readonly lookup: "lookup"; +}; +export type IndexMode = (typeof IndexMode)[keyof typeof IndexMode]; +export interface DataRetention { + enabled: boolean; + infiniteDataRetention?: boolean; + value?: number; + unit?: string; +} +/** + * Interface for the template list returned by Index Management's + * `GET /api/index_management/index_templates` endpoint. + * + * This is a copy of the plugin's TemplateListItem interface with additional fields added during deserialization, + * kept here to allow cross-plugin consumption without creating cyclic dependencies. + */ +export interface TemplateListItem { + name: string; + indexPatterns: string[]; + version?: number; + order?: number; + priority?: number; + hasSettings: boolean; + hasAliases: boolean; + hasMappings: boolean; + deprecated?: boolean; + ilmPolicy?: { + name: string; + }; + composedOf?: string[]; + _kbnMeta: { + type: TemplateType; + hasDatastream: boolean; + isLegacy?: boolean; + }; + lifecycle?: DataRetention; + ignoreMissingComponentTemplates?: string[]; + allowAutoCreate: string; + indexMode?: IndexMode; + _meta?: { + [key: string]: any; + }; + dataStream?: { + hidden?: boolean; + [key: string]: any; + }; +} +export interface GetIndexTemplatesResponse { + templates: TemplateListItem[]; + legacyTemplates: TemplateListItem[]; +} diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/extensions_service.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/extensions_service.d.ts new file mode 100644 index 0000000000000..7dfbb7541dac6 --- /dev/null +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/extensions_service.d.ts @@ -0,0 +1,45 @@ +import type { FunctionComponent, ReactNode } from 'react'; +import type { ApplicationStart } from '@kbn/core-application-browser'; +import type { EuiBadgeProps } from '@elastic/eui'; +import type { IndexDetailsTab } from '../home_sections'; +import type { Index } from '../types'; +export interface IndexContent { + renderContent: (args: { + index: Index; + getUrlForApp: ApplicationStart['getUrlForApp']; + }) => ReturnType; +} +export interface IndexToggle { + matchIndex: (index: Index) => boolean; + label: string; + name: string; +} +export interface IndexBadge { + matchIndex: (index: Index) => boolean; + label: string; + filterExpression?: string; + color: EuiBadgeProps['color']; +} +export interface EmptyListContent { + renderContent: (args: { + createIndexButton: ReturnType; + }) => ReturnType; +} +export interface IndicesListColumn { + fieldName: string; + label: string; + order: number; + render?: (index: Index) => ReactNode; + sort?: (index: Index) => any; +} +export interface ExtensionsSetup { + addAction(action: any): void; + addBanner(banner: any): void; + addFilter(filter: any): void; + addBadge(badge: IndexBadge): void; + addToggle(toggle: IndexToggle): void; + addColumn(column: IndicesListColumn): void; + setEmptyListContent(content: EmptyListContent): void; + addIndexDetailsTab(tab: IndexDetailsTab): void; + setIndexOverviewContent(content: IndexContent): void; +} diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/index.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/index.d.ts new file mode 100644 index 0000000000000..e980193220c1d --- /dev/null +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/index.d.ts @@ -0,0 +1,2 @@ +export type * from './extensions_service'; +export type * from './public_api_service'; diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/public_api_service.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/public_api_service.d.ts new file mode 100644 index 0000000000000..58a42cab2bbce --- /dev/null +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/public_api_service.d.ts @@ -0,0 +1,31 @@ +import type { EnrichPolicyType, IndicesSimulateTemplateResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { SendRequestResponse } from '../types'; +import type { GetIndexTemplatesResponse } from '../index_templates'; +export interface SerializedEnrichPolicy { + type: EnrichPolicyType; + name: string; + sourceIndices: string[]; + matchField: string; + enrichFields: string[]; + query?: Record; +} +export type SimulateIndexTemplateResponse = IndicesSimulateTemplateResponse; +export interface PublicApiServiceSetup { + getAllEnrichPolicies(): Promise>; + /** + * Fetches composable and legacy index templates as returned by Index Management's + * `GET /api/index_management/index_templates` endpoint. + */ + getIndexTemplates(options?: { + signal?: AbortSignal; + }): Promise; + /** + * Simulates an index template by name using the + * `POST /api/index_management/index_templates/simulate/{templateName}` endpoint. + * Returns the resolved template configuration that would be applied to matching indices. + */ + simulateIndexTemplate(options: { + templateName: string; + signal?: AbortSignal; + }): Promise; +} diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.d.ts new file mode 100644 index 0000000000000..05759697d1fae --- /dev/null +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.d.ts @@ -0,0 +1,141 @@ +import type { IlmExplainLifecycleLifecycleExplain, HealthStatus, Uuid } from '@elastic/elasticsearch/lib/api/types'; +import type { ScopedHistory } from '@kbn/core-application-browser'; +import type { SerializableRecord } from '@kbn/utility-types'; +import type { LocatorPublic } from '@kbn/share-plugin/public'; +import type { ManagementAppMountParams } from '@kbn/management-plugin/public'; +import type { HttpSetup } from '@kbn/core/public'; +import type { ExtensionsSetup } from './services/extensions_service'; +import type { PublicApiServiceSetup } from './services/public_api_service'; +export interface EnricherResponse { + source: string; + indices?: Index[]; + error?: boolean; + /** + * Apply this enricher's updates to any index aliases + */ + applyToAliases?: boolean; +} +export interface Enricher { + name: string; + fn: (client: HttpSetup, signal: AbortSignal) => Promise; +} +export type IndexManagementLocatorParams = SerializableRecord & ({ + page: 'index_list'; + filter?: string; + includeHiddenIndices?: boolean; +} | { + page: 'data_stream_index_list'; + dataStreamName: string; +} | { + page: 'data_streams_details'; + dataStreamName?: string; +} | { + page: 'index_template'; + indexTemplate: string; +} | { + page: 'index_template_edit'; + indexTemplate: string; +} | { + page: 'index_template_clone'; + indexTemplate: string; +} | { + page: 'create_template'; +} | { + page: 'component_template'; + componentTemplate: string; +} | { + page: 'component_template_list'; + filter?: string; +} | { + page: 'edit_component_template'; + componentTemplate: string; +} | { + page: 'clone_component_template'; + componentTemplate: string; +} | { + page: 'create_component_template'; + componentTemplate: string; +} | { + page: 'index_details'; + indexName: string; + tab?: string; +}); +export type IndexManagementLocator = LocatorPublic; +export type IndexManagementAppMountParams = Pick & { + element: HTMLElement | null; +}; +export interface IndexManagementPluginSetup { + apiService: PublicApiServiceSetup; + extensionsService: ExtensionsSetup; + renderIndexManagementApp: (params: IndexManagementAppMountParams) => Promise<() => void>; + locator?: IndexManagementLocator; + indexDataEnricher: { + add: (enricher: Enricher) => void; + }; +} +export interface IndexManagementPluginStart { + apiService: PublicApiServiceSetup; + extensionsService: ExtensionsSetup; + getIndexMappingComponent: (deps: { + history: ScopedHistory; + }) => React.FC; + getIndexSettingsComponent: (deps: { + history: ScopedHistory; + }) => React.FC; + getComponentTemplateFlyoutComponent: (deps: { + history: ScopedHistory; + }) => React.FC; + getIndexTemplateFlyoutComponent: (deps: { + history: ScopedHistory; + }) => React.FC; + getDatastreamFlyoutComponent: (deps: { + history: ScopedHistory; + }) => React.FC; +} +export interface Index extends IndexAttributes { + name: string; +} +export interface IndexAttributes { + primary?: number | string; + replica?: number | string; + isFrozen?: boolean; + hidden?: boolean; + aliases?: string | string[]; + data_stream?: string; + mode?: string; + isRollupIndex?: boolean; + ilm?: IlmExplainLifecycleLifecycleExplain; + isFollowerIndex?: boolean; + health?: HealthStatus; + status?: string; + uuid?: Uuid; + documents?: number; + size?: number; + primary_size?: number; + documents_deleted?: number; +} +export interface ComponentTemplateFlyoutProps { + componentTemplateName: string; + onClose: () => void; +} +export interface IndexTemplateFlyoutProps { + indexTemplateName: string; + onClose: () => void; + reload: () => void; +} +export interface DatastreamFlyoutProps { + datastreamName: string; + onClose: () => void; +} +export interface IndexMappingProps { + index?: Index; + showAboutMappings?: boolean; +} +export interface IndexSettingProps { + indexName: string; + hasUpdateSettingsPrivilege?: boolean; +} +export interface SendRequestResponse { + data: D | null; + error: E | null; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/es_fields.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/es_fields.d.ts new file mode 100644 index 0000000000000..012caa1f72ccc --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/es_fields.d.ts @@ -0,0 +1,3 @@ +export * from './src/es_fields/apm'; +export * from './src/es_fields/otel'; +export * from './src/es_fields/common'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_raw.d.ts new file mode 100644 index 0000000000000..26f386679ed48 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_raw.d.ts @@ -0,0 +1,2 @@ +export type * from './src/es_schemas/raw'; +export type * from './src/es_schemas/raw/fields'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_ui.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_ui.d.ts new file mode 100644 index 0000000000000..6fceaaa803bbf --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_ui.d.ts @@ -0,0 +1,2 @@ +export type * from './src/es_schemas/ui'; +export type * from './src/es_schemas/ui/fields'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/index.d.ts new file mode 100644 index 0000000000000..6cd6f7e999ec2 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/index.d.ts @@ -0,0 +1,48 @@ +export * from './es_fields'; +export type * from './es_schemas_raw'; +export type * from './es_schemas_ui'; +export * from './src/agent_explorer'; +export * from './src/aggregation_type'; +export * from './src/annotations'; +export * from './src/anomaly_detector_type'; +export type * from './src/apm_event'; +export type * from './src/apm_ml_job'; +export type * from './src/apm_telemetry'; +export * from './src/apm_timeseries'; +export * from './src/connections'; +export type * from './src/container_type'; +export type * from './src/coordinate'; +export type * from './src/correlations'; +export * from './src/custom_dashboards'; +export * from './src/custom_link'; +export type * from './src/data_source'; +export type * from './src/diagnostics'; +export * from './src/document_type'; +export * from './src/downstream_dependencies'; +export * from './src/environment_filter_values'; +export * from './src/environment_rt'; +export type * from './src/errors'; +export type * from './src/focused_trace_waterfall'; +export type * from './src/full_trace_waterfall'; +export * from './src/ilm_types'; +export * from './src/instances'; +export * from './src/latency_aggregation_types'; +export type * from './src/latency_distribution'; +export * from './src/latency_distribution_chart_types'; +export * from './src/mobile_types'; +export * from './src/processor_event'; +export * from './src/rollup'; +export * from './src/serverless'; +export type * from './src/service_anomalies'; +export type * from './src/service_anomaly_stats'; +export type * from './src/service_anomaly_timeseries'; +export type * from './src/service_groups'; +export * from './src/service_health_status'; +export type * from './src/service_inventory'; +export type * from './src/service_map'; +export type * from './src/service_map_diagnostic_types'; +export type * from './src/span_links'; +export * from './src/storage_explorer_types'; +export type * from './src/time_range_metadata'; +export type * from './src/timeseries'; +export type * from './src/traces'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/agent_explorer.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/agent_explorer.d.ts new file mode 100644 index 0000000000000..c2a8a96a4fe24 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/agent_explorer.d.ts @@ -0,0 +1,16 @@ +export declare enum AgentExplorerFieldName { + ServiceName = "serviceName", + Environments = "environments", + AgentName = "agentName", + AgentVersion = "agentVersion", + AgentLastVersion = "agentLastVersion", + AgentDocsPageUrl = "agentDocsPageUrl", + Instances = "instances" +} +export interface ElasticApmAgentLatestVersion { + latest_version: string; +} +export interface OtelAgentLatestVersion { + sdk_latest_version: string; + auto_latest_version?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/aggregation_type.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/aggregation_type.d.ts new file mode 100644 index 0000000000000..aaedf9eb301a2 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/aggregation_type.d.ts @@ -0,0 +1,5 @@ +export declare enum AggregationType { + Avg = "avg", + P95 = "95th", + P99 = "99th" +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/annotations.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/annotations.d.ts new file mode 100644 index 0000000000000..adf9985d5854b --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/annotations.d.ts @@ -0,0 +1,9 @@ +export declare enum AnnotationType { + VERSION = "version" +} +export interface Annotation { + type: AnnotationType; + id: string; + '@timestamp': number; + text: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/anomaly_detector_type.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/anomaly_detector_type.d.ts new file mode 100644 index 0000000000000..0555a096ef03c --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/anomaly_detector_type.d.ts @@ -0,0 +1,5 @@ +export declare enum AnomalyDetectorType { + txLatency = "txLatency", + txThroughput = "txThroughput", + txFailureRate = "txFailureRate" +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_event.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_event.d.ts new file mode 100644 index 0000000000000..fc41cb00cbb5c --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_event.d.ts @@ -0,0 +1,11 @@ +export interface ApmEvent { + legacy?: boolean; + name: string; + kuery: string; + index: string[]; + docCount: number; + intervals?: Record; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_ml_job.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_ml_job.d.ts new file mode 100644 index 0000000000000..7b2b7bb4a1bf0 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_ml_job.d.ts @@ -0,0 +1,26 @@ +import type { Environment } from './environment_rt'; +declare enum JOB_STATE { + CLOSED = "closed", + CLOSING = "closing", + FAILED = "failed", + OPENED = "opened", + OPENING = "opening", + DELETED = "deleted" +} +declare enum DATAFEED_STATE { + STARTED = "started", + STARTING = "starting", + STOPPED = "stopped", + STOPPING = "stopping", + DELETED = "deleted" +} +export interface ApmMlJob { + environment: Environment; + version: number; + jobId: string; + jobState?: JOB_STATE; + datafeedId?: string; + datafeedState?: DATAFEED_STATE; + bucketSpan?: string; +} +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_telemetry.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_telemetry.d.ts new file mode 100644 index 0000000000000..82e3794bd0610 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_telemetry.d.ts @@ -0,0 +1,254 @@ +import type { DeepPartial } from 'utility-types'; +import type { AgentName } from '@kbn/elastic-agent-utils'; +import type { RollupInterval } from './rollup'; +export interface TimeframeMap { + '1d': number; + all: number; +} +export type TimeframeMap1d = Pick; +export type TimeframeMapAll = Pick; +export interface AggregatedTransactionsCounts { + expected_metric_document_count: number; + transaction_count: number; +} +export interface APMPerAgentConfigSettings { + agent_name: string; + has_error: boolean; + settings: string[]; + advanced_settings: string[]; +} +export interface APMPerService { + service_id: string; + timed_out: boolean; + num_service_nodes: number; + num_transaction_types: number; + cloud: { + availability_zones: string[]; + regions: string[]; + providers: string[]; + }; + faas: { + trigger: { + type: string[]; + }; + }; + agent: { + name: string; + version: string; + activation_method: string; + }; + service: { + language: { + name: string; + version: string; + }; + framework: { + name: string; + version: string; + }; + runtime: { + name: string; + version: string; + }; + }; + kubernetes: { + pod: { + name: string; + }; + }; + container: { + id: string; + }; +} +export interface APMUsage { + has_any_services_per_official_agent: boolean; + has_any_services: boolean; + services_per_agent: Record; + version: { + apm_server: { + minor: number; + major: number; + patch: number; + }; + }; + environments: { + services_without_environment: number; + services_with_multiple_environments: number; + top_environments: string[]; + }; + aggregated_transactions: { + current_implementation: AggregatedTransactionsCounts; + no_observer_name: AggregatedTransactionsCounts; + no_rum: AggregatedTransactionsCounts; + no_rum_no_observer_name: AggregatedTransactionsCounts; + only_rum: AggregatedTransactionsCounts; + only_rum_no_observer_name: AggregatedTransactionsCounts; + }; + cloud: { + availability_zone: string[]; + provider: string[]; + region: string[]; + }; + host: { + os: { + platform: string[]; + }; + }; + counts: { + transaction: TimeframeMap; + span: TimeframeMap; + error: TimeframeMap; + metric: TimeframeMap; + onboarding: TimeframeMap; + agent_configuration: TimeframeMapAll; + max_transaction_groups_per_service: TimeframeMap1d; + max_error_groups_per_service: TimeframeMap1d; + traces: TimeframeMap; + services: TimeframeMap1d; + environments: TimeframeMap1d; + span_destination_service_resource: TimeframeMap1d; + global_labels: TimeframeMap1d; + }; + cardinality: { + client: { + geo: { + country_iso_code: { + rum: TimeframeMap1d; + }; + }; + }; + user_agent: { + original: { + all_agents: TimeframeMap1d; + rum: TimeframeMap1d; + }; + }; + transaction: { + name: { + all_agents: TimeframeMap1d; + rum: TimeframeMap1d; + }; + }; + }; + retainment: Record<'span' | 'transaction' | 'error' | 'metric' | 'onboarding', { + ms: number; + }>; + integrations: { + ml: { + all_jobs_count: number; + }; + }; + agents: Record; + indices: { + traces: { + shards: { + total: number; + }; + all: { + total: { + docs: { + count: number; + }; + store: { + size_in_bytes: number; + }; + }; + }; + }; + metric: { + shards: { + total: number; + }; + all: { + total: { + docs: { + count: number; + }; + store: { + size_in_bytes: number; + }; + }; + }; + metricset: DataStreamStats; + }; + shards: { + total: number; + }; + all: { + total: { + docs: { + count: number; + }; + store: { + size_in_bytes: number; + }; + }; + }; + }; + service_groups: { + kuery_fields: string[]; + total: number; + }; + custom_dashboards: { + kuery_fields: string[]; + total: number; + }; + per_service: APMPerService[]; + per_agent_config_settings: APMPerAgentConfigSettings[]; + top_traces: { + max: number; + median: number; + }; + tasks: Record<'aggregated_transactions' | 'cloud' | 'host' | 'processor_events' | 'agent_configuration' | 'global_labels' | 'services' | 'versions' | 'groupings' | 'integrations' | 'agents' | 'indices_stats' | 'cardinality' | 'environments' | 'service_groups' | 'custom_dashboards' | 'per_service' | 'top_traces' | 'per_agent_config_settings', { + took: { + ms: number; + }; + }>; +} +export type MetricRollupIntervals = RollupInterval.OneMinute | RollupInterval.TenMinutes | RollupInterval.SixtyMinutes; +export type MetricSupportingRollUp = 'service_destination' | 'transaction' | 'service_summary' | 'service_transaction' | 'span_breakdown'; +export type MetricNotSupportingRollup = 'app'; +export type MetricTypes = MetricSupportingRollUp | MetricNotSupportingRollup; +export interface CapturedMetricStats { + total: { + shards: number; + docs: { + count: number; + }; + store: { + size_in_bytes: number; + }; + }; +} +export interface LastDayCount { + doc_count: number; +} +export interface DataStreamCombined { + all: CapturedMetricStats; + '1d': LastDayCount; +} +export type DataStreamStats = Record; +export type APMDataTelemetry = DeepPartial; +export type APMTelemetry = APMDataTelemetry; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_timeseries.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_timeseries.d.ts new file mode 100644 index 0000000000000..dc5c21192f46c --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_timeseries.d.ts @@ -0,0 +1,64 @@ +import * as t from 'io-ts'; +import type { ChangePointType } from '@kbn/es-types/src'; +import { LatencyAggregationType } from './latency_aggregation_types'; +export declare enum ApmTimeseriesType { + transactionThroughput = "transaction_throughput", + transactionLatency = "transaction_latency", + transactionFailureRate = "transaction_failure_rate", + exitSpanThroughput = "exit_span_throughput", + exitSpanLatency = "exit_span_latency", + exitSpanFailureRate = "exit_span_failure_rate", + errorEventRate = "error_event_rate" +} +export declare const getApmTimeseriesRt: t.TypeC<{ + stats: t.ArrayC, t.LiteralC]>; + }>, t.PartialC<{ + 'transaction.type': t.StringC; + 'transaction.name': t.StringC; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC]>; + }>, t.PartialC<{ + 'span.destination.service.resource': t.StringC; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.LiteralC; + function: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC]>; + }>, t.PartialC<{ + 'transaction.type': t.StringC; + 'transaction.name': t.StringC; + }>]>, t.TypeC<{ + name: t.LiteralC; + }>]>; + }>, t.PartialC<{ + filter: t.StringC; + offset: t.StringC; + 'service.environment': t.StringC; + }>]>>; + start: t.StringC; + end: t.StringC; +}>; +export interface TimeseriesChangePoint { + change_point?: number | undefined; + r_value?: number | undefined; + trend?: string | undefined; + p_value?: number; + date: string | undefined; + type: ChangePointType; +} +export interface ApmTimeseries { + stat: t.TypeOf['stats'][number]; + group: string; + id: string; + data: Array<{ + x: number; + y: number | null; + }>; + value: number | null; + start: number; + end: number; + unit: string; + changes: TimeseriesChangePoint[]; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/connections.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/connections.d.ts new file mode 100644 index 0000000000000..f49c7896450dc --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/connections.d.ts @@ -0,0 +1,56 @@ +import type { Coordinate } from './coordinate'; +import type { AgentName } from './es_schemas/ui/fields/agent'; +export declare enum NodeType { + service = "service", + dependency = "dependency" +} +interface NodeBase { + id: string; +} +export interface ServiceNode extends NodeBase { + type: NodeType.service; + serviceName: string; + agentName: AgentName; + environment: string; + dependencyName?: string; +} +export interface DependencyNode extends NodeBase { + type: NodeType.dependency; + dependencyName: string; + spanType: string; + spanSubtype: string; +} +export type Node = ServiceNode | DependencyNode; +export interface ConnectionStats { + latency: { + value: number | null; + timeseries?: Coordinate[]; + }; + throughput: { + value: number | null; + timeseries?: Coordinate[]; + }; + errorRate: { + value: number | null; + timeseries?: Coordinate[]; + }; + totalTime: { + value: number | null; + timeseries?: Coordinate[]; + }; +} +export interface ConnectionStatsItem { + location: Node; + stats: ConnectionStats; +} +export interface ConnectionStatsItemWithImpact extends ConnectionStatsItem { + stats: ConnectionStatsItem['stats'] & { + impact: number; + }; +} +export interface ConnectionStatsItemWithComparisonData { + location: Node; + currentStats: ConnectionStatsItemWithImpact['stats']; + previousStats: ConnectionStatsItemWithImpact['stats'] | null; +} +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/container_type.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/container_type.d.ts new file mode 100644 index 0000000000000..f109bc857fe19 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/container_type.d.ts @@ -0,0 +1 @@ +export type ContainerType = 'Kubernetes' | 'Docker' | undefined; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/coordinate.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/coordinate.d.ts new file mode 100644 index 0000000000000..f0d65390790ea --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/coordinate.d.ts @@ -0,0 +1,5 @@ +import type { Maybe } from '@kbn/apm-types-shared'; +export interface Coordinate { + x: number; + y: Maybe; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/correlations.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/correlations.d.ts new file mode 100644 index 0000000000000..ecb0a294486ac --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/correlations.d.ts @@ -0,0 +1,100 @@ +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { Environment } from './environment_rt'; +export interface FieldValuePair { + fieldName: string; + fieldValue: string | number; + isFallbackResult?: boolean; +} +export interface HistogramItem { + key: number; + doc_count: number; +} +export interface ResponseHitSource { + [s: string]: unknown; +} +export interface ResponseHit { + _source: ResponseHitSource; +} +export interface CommonCorrelationsQueryParams { + start: number; + end: number; + kuery: string; + environment: Environment; + query: QueryDslQueryContainer; +} +export type EntityType = 'transaction' | 'exit_span'; +export type MetricCorrelation = 'latency' | 'failure_rate'; +export interface UnifiedCorrelation { + fieldName: string; + fieldValue: string | number; + correlation?: number; + ksTest?: number; + pValue?: number | null; + score?: number; + normalizedScore?: number; + histogram?: HistogramItem[]; + isFallbackResult?: boolean; + doc_count?: number; + bg_count?: number; + failurePercentage?: number; + successPercentage?: number; +} +export interface CorrelationsResponse { + overallHistogram?: HistogramItem[]; + errorHistogram?: HistogramItem[]; + totalDocCount: number; + percentileThresholdValue?: number | null; + durationMin: number; + durationMax: number; + fieldCandidates: string[]; + correlations: UnifiedCorrelation[]; + ccsWarning: boolean; + fallbackResult?: UnifiedCorrelation; +} +export interface LatencyCorrelation extends FieldValuePair { + correlation: number; + histogram?: HistogramItem[]; + ksTest: number; + isFallbackResult?: boolean; +} +export interface LatencyCorrelationsResponse { + ccsWarning: boolean; + totalDocCount?: number; + overallHistogram?: HistogramItem[]; + percentileThresholdValue?: number | null; + latencyCorrelations?: LatencyCorrelation[]; +} +export interface FailedTransactionsCorrelation extends FieldValuePair { + doc_count: number; + bg_count: number; + score: number; + pValue: number | null; + normalizedScore: number; + failurePercentage: number; + successPercentage: number; + /** Present when histograms were requested (default for legacy p-values API). */ + histogram?: HistogramItem[]; +} +export type FailedTransactionsCorrelationsImpactThreshold = string; +export interface FailedTransactionsCorrelationsResponse { + ccsWarning: boolean; + failedTransactionsCorrelations?: FailedTransactionsCorrelation[]; + percentileThresholdValue?: number | null; + overallHistogram?: HistogramItem[]; + totalDocCount?: number; + errorHistogram?: HistogramItem[]; + fallbackResult?: FailedTransactionsCorrelation; +} +export interface TopValueBucket { + key: string | number; + doc_count: number; +} +export interface TopValuesStats { + count?: number; + fieldName: string; + topValues: TopValueBucket[]; + topValuesSampleSize: number; + isTopValuesSampled?: boolean; + topValuesSamplerShardSize?: number; +} +export type FieldValueFieldStats = TopValuesStats; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/custom_dashboards.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/custom_dashboards.d.ts new file mode 100644 index 0000000000000..5852284627ce8 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/custom_dashboards.d.ts @@ -0,0 +1,11 @@ +export declare const APM_CUSTOM_DASHBOARDS_SAVED_OBJECT_TYPE = "apm-custom-dashboards"; +export interface ApmCustomDashboard { + dashboardSavedObjectId: string; + serviceNameFilterEnabled: boolean; + serviceEnvironmentFilterEnabled: boolean; + kuery?: string; +} +export interface SavedApmCustomDashboard extends ApmCustomDashboard { + id: string; + updatedAt: number; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/custom_link.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/custom_link.d.ts new file mode 100644 index 0000000000000..42627c5f0dc85 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/custom_link.d.ts @@ -0,0 +1,25 @@ +import { SERVICE_NAME, SERVICE_ENVIRONMENT, TRANSACTION_NAME, TRANSACTION_TYPE } from '../es_fields'; +export declare const FILTER_OPTIONS: readonly ["service.name", "service.environment", "transaction.type", "transaction.name"]; +export type FilterKey = (typeof FILTER_OPTIONS)[number]; +export interface CustomLinkES { + id?: string; + '@timestamp'?: number; + label: string; + url: string; + [SERVICE_NAME]?: string[]; + [SERVICE_ENVIRONMENT]?: string[]; + [TRANSACTION_NAME]?: string[]; + [TRANSACTION_TYPE]?: string[]; +} +export interface Filter { + id?: string; + key: FilterKey | ''; + value: string; +} +export interface CustomLink { + id?: string; + '@timestamp'?: number; + label: string; + url: string; + filters?: Filter[]; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/data_source.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/data_source.d.ts new file mode 100644 index 0000000000000..7d0ab47b9d398 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/data_source.d.ts @@ -0,0 +1,12 @@ +import type { ApmDocumentType } from './document_type'; +import type { RollupInterval } from './rollup'; +type AnyApmDocumentType = ApmDocumentType.ServiceTransactionMetric | ApmDocumentType.TransactionMetric | ApmDocumentType.TransactionEvent | ApmDocumentType.ServiceDestinationMetric | ApmDocumentType.ServiceSummaryMetric | ApmDocumentType.ErrorEvent | ApmDocumentType.SpanEvent; +export interface ApmDataSource { + rollupInterval: RollupInterval; + documentType: TDocumentType; +} +export type ApmDataSourceWithSummary = ApmDataSource & { + hasDurationSummaryField: boolean; + hasDocs: boolean; +}; +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/diagnostics.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/diagnostics.d.ts new file mode 100644 index 0000000000000..0cc0cc6a37d66 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/diagnostics.d.ts @@ -0,0 +1,13 @@ +export interface IndiciesItem { + index: string; + fieldMappings: { + isValid: boolean; + invalidType?: string; + }; + ingestPipeline: { + isValid?: boolean; + id?: string; + }; + dataStream?: string; + isValid: boolean; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/document_type.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/document_type.d.ts new file mode 100644 index 0000000000000..744790a5b8e67 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/document_type.d.ts @@ -0,0 +1,11 @@ +export declare enum ApmDocumentType { + TransactionMetric = "transactionMetric", + ServiceTransactionMetric = "serviceTransactionMetric", + TransactionEvent = "transactionEvent", + ServiceDestinationMetric = "serviceDestinationMetric", + ServiceSummaryMetric = "serviceSummaryMetric", + ErrorEvent = "error", + SpanEvent = "span" +} +export type ApmServiceTransactionDocumentType = ApmDocumentType.ServiceTransactionMetric | ApmDocumentType.TransactionMetric | ApmDocumentType.TransactionEvent; +export type ApmTransactionDocumentType = ApmDocumentType.TransactionMetric | ApmDocumentType.TransactionEvent; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/downstream_dependencies.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/downstream_dependencies.d.ts new file mode 100644 index 0000000000000..b00698fd2bae6 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/downstream_dependencies.d.ts @@ -0,0 +1,17 @@ +import * as t from 'io-ts'; +export declare const downstreamDependenciesRouteRt: t.IntersectionC<[t.TypeC<{ + serviceName: t.StringC; + start: t.StringC; + end: t.StringC; +}>, t.PartialC<{ + serviceEnvironment: t.StringC; +}>]>; +export interface APMDownstreamDependency { + 'service.name'?: string; + 'span.destination.service.resource': string; + 'span.type'?: string; + 'span.subtype'?: string; + errorRate?: number; + latencyMs?: number; + throughputPerMin?: number; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/environment_filter_values.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/environment_filter_values.d.ts new file mode 100644 index 0000000000000..c21f6b1a955ab --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/environment_filter_values.d.ts @@ -0,0 +1,24 @@ +import type { Environment } from './environment_rt'; +export declare const ENVIRONMENT_ALL_VALUE: "ENVIRONMENT_ALL"; +export declare const ENVIRONMENT_NOT_DEFINED_VALUE: "ENVIRONMENT_NOT_DEFINED"; +export declare const allOptionText: string; +export declare function getEnvironmentLabel(environment: string): string; +export declare const ENVIRONMENT_ALL: { + value: "ENVIRONMENT_ALL"; + label: string; +}; +export declare const ENVIRONMENT_NOT_DEFINED: { + value: "ENVIRONMENT_NOT_DEFINED"; + label: string; +}; +export declare function isEnvironmentDefined(environment: string): boolean | ""; +export declare function getEnvironmentEsField(environment: string): { + "service.environment"?: undefined; +} | { + "service.environment": string; +}; +export declare function getEnvironmentKuery(environment: string): string | null; +export declare function getNextEnvironmentUrlParam({ requestedEnvironment, currentEnvironmentUrlParam, }: { + requestedEnvironment?: string; + currentEnvironmentUrlParam: Environment; +}): string; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/environment_rt.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/environment_rt.d.ts new file mode 100644 index 0000000000000..3d43ebc125568 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/environment_rt.d.ts @@ -0,0 +1,6 @@ +import * as t from 'io-ts'; +export declare const environmentStringRt: t.UnionC<[t.LiteralC<"ENVIRONMENT_NOT_DEFINED">, t.LiteralC<"ENVIRONMENT_ALL">, t.StringC, t.BrandC]>; +export declare const environmentRt: t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"ENVIRONMENT_NOT_DEFINED">, t.LiteralC<"ENVIRONMENT_ALL">, t.StringC, t.BrandC]>; +}>; +export type Environment = t.TypeOf['environment']; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/errors.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/errors.d.ts new file mode 100644 index 0000000000000..f194ac415ab5a --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/errors.d.ts @@ -0,0 +1,37 @@ +import type { TimestampUs } from '../es_schemas_raw'; +import type { Exception } from './es_schemas/raw/error_raw'; +export interface ErrorData { + exception?: Exception; + grouping_key?: string; + culprit?: string; + id?: string; + log?: { + message?: string; + }; +} +export interface Error { + id: string; + index?: string; + parent?: { + id?: string; + }; + trace?: { + id?: string; + }; + span?: { + id?: string; + }; + transaction?: { + id?: string; + }; + service: { + name: string; + }; + eventName?: string; + error: ErrorData; + timestamp: TimestampUs; +} +export interface ErrorsByTraceId { + traceErrors: Error[]; + source: 'apm' | 'unprocessedOtel'; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/apm.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/apm.d.ts new file mode 100644 index 0000000000000..4e664ea7386d3 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/apm.d.ts @@ -0,0 +1,193 @@ +export declare const ID = "_id"; +export declare const TIMESTAMP_US = "timestamp.us"; +export declare const AT_TIMESTAMP = "@timestamp"; +export declare const AGENT = "agent"; +export declare const AGENT_NAME = "agent.name"; +export declare const AGENT_VERSION = "agent.version"; +export declare const AGENT_ACTIVATION_METHOD = "agent.activation_method"; +export declare const DESTINATION_ADDRESS = "destination.address"; +export declare const CLOUD = "cloud"; +export declare const CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; +export declare const CLOUD_PROVIDER = "cloud.provider"; +export declare const CLOUD_REGION = "cloud.region"; +export declare const CLOUD_MACHINE_TYPE = "cloud.machine.type"; +export declare const CLOUD_ACCOUNT_ID = "cloud.account.id"; +export declare const CLOUD_ACCOUNT_NAME = "cloud.account.name"; +export declare const CLOUD_INSTANCE_ID = "cloud.instance.id"; +export declare const CLOUD_INSTANCE_NAME = "cloud.instance.name"; +export declare const CLOUD_SERVICE_NAME = "cloud.service.name"; +export declare const CLOUD_PROJECT_NAME = "cloud.project.name"; +export declare const EVENT_SUCCESS_COUNT = "event.success_count"; +export declare const SERVICE = "service"; +export declare const SERVICE_NAME = "service.name"; +export declare const SERVICE_ENVIRONMENT = "service.environment"; +export declare const SERVICE_FRAMEWORK_NAME = "service.framework.name"; +export declare const SERVICE_FRAMEWORK_VERSION = "service.framework.version"; +export declare const SERVICE_LANGUAGE_NAME = "service.language.name"; +export declare const SERVICE_LANGUAGE_VERSION = "service.language.version"; +export declare const SERVICE_RUNTIME_NAME = "service.runtime.name"; +export declare const SERVICE_RUNTIME_VERSION = "service.runtime.version"; +export declare const SERVICE_NODE_NAME = "service.node.name"; +export declare const SERVICE_VERSION = "service.version"; +export declare const SERVICE_TARGET_TYPE = "service.target.type"; +export declare const SERVICE_OVERFLOW_COUNT = "service_transaction.aggregation.overflow_count"; +export declare const URL_FULL = "url.full"; +export declare const HTTP_REQUEST_METHOD = "http.request.method"; +export declare const HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"; +export declare const USER_ID = "user.id"; +export declare const USER_AGENT_ORIGINAL = "user_agent.original"; +export declare const USER_AGENT_NAME = "user_agent.name"; +export declare const USER_AGENT_VERSION = "user_agent.version"; +export declare const OBSERVER_VERSION = "observer.version"; +export declare const OBSERVER_VERSION_MAJOR = "observer.version_major"; +export declare const OBSERVER_HOSTNAME = "observer.hostname"; +export declare const OBSERVER_LISTENING = "observer.listening"; +export declare const PROCESSOR_EVENT = "processor.event"; +export declare const PROCESSOR_NAME = "processor.name"; +export declare const TRANSACTION_MARKS_AGENT = "transaction.marks.agent"; +export declare const TRANSACTION_DURATION = "transaction.duration.us"; +export declare const TRANSACTION_DURATION_HISTOGRAM = "transaction.duration.histogram"; +export declare const TRANSACTION_DURATION_SUMMARY = "transaction.duration.summary"; +export declare const TRANSACTION_TYPE = "transaction.type"; +export declare const TRANSACTION_RESULT = "transaction.result"; +export declare const TRANSACTION_NAME = "transaction.name"; +export declare const TRANSACTION_ID = "transaction.id"; +export declare const TRANSACTION_SAMPLED = "transaction.sampled"; +export declare const TRANSACTION_PAGE_URL = "transaction.page.url"; +export declare const TRANSACTION_FAILURE_COUNT = "transaction.failure_count"; +export declare const TRANSACTION_SUCCESS_COUNT = "transaction.success_count"; +export declare const TRANSACTION_OVERFLOW_COUNT = "transaction.aggregation.overflow_count"; +export declare const TRANSACTION_ROOT = "transaction.root"; +export declare const TRANSACTION_PROFILER_STACK_TRACE_IDS = "transaction.profiler_stack_trace_ids"; +export declare const ELASTIC_PROFILER_STACK_TRACE_IDS = "elastic.profiler_stack_trace_ids"; +export declare const EVENT_OUTCOME = "event.outcome"; +export declare const TRACE_ID = "trace.id"; +export declare const SPAN_DURATION = "span.duration.us"; +export declare const SPAN_TYPE = "span.type"; +export declare const SPAN_SUBTYPE = "span.subtype"; +export declare const SPAN_SELF_TIME_SUM = "span.self_time.sum.us"; +export declare const SPAN_ACTION = "span.action"; +export declare const SPAN_NAME = "span.name"; +export declare const SPAN_ID = "span.id"; +export declare const SPAN_DESTINATION_SERVICE_RESOURCE = "span.destination.service.resource"; +export declare const SPAN_DESTINATION_SERVICE_RESPONSE_TIME_COUNT = "span.destination.service.response_time.count"; +export declare const SPAN_DESTINATION_SERVICE_RESPONSE_TIME_SUM = "span.destination.service.response_time.sum.us"; +export declare const SPAN_LINKS = "span.links"; +export declare const SPAN_LINKS_TRACE_ID = "span.links.trace.id"; +export declare const SPAN_LINKS_SPAN_ID = "span.links.span.id"; +export declare const SPAN_COMPOSITE_COUNT = "span.composite.count"; +export declare const SPAN_COMPOSITE_SUM = "span.composite.sum.us"; +export declare const SPAN_COMPOSITE_COMPRESSION_STRATEGY = "span.composite.compression_strategy"; +export declare const SPAN_SYNC = "span.sync"; +export declare const SPAN_STACKTRACE = "span.stacktrace"; +export declare const PARENT_ID = "parent.id"; +export declare const ERROR_ID = "error.id"; +export declare const ERROR_GROUP_ID = "error.grouping_key"; +export declare const ERROR_GROUP_NAME = "error.grouping_name"; +export declare const ERROR_CULPRIT = "error.culprit"; +export declare const ERROR_LOG_LEVEL = "error.log.level"; +export declare const ERROR_LOG_MESSAGE = "error.log.message"; +export declare const ERROR_EXCEPTION = "error.exception"; +export declare const ERROR_EXC_MESSAGE = "error.exception.message"; +export declare const ERROR_EXC_HANDLED = "error.exception.handled"; +export declare const ERROR_EXC_TYPE = "error.exception.type"; +export declare const ERROR_PAGE_URL = "error.page.url"; +export declare const ERROR_STACK_TRACE = "error.stack_trace"; +export declare const ERROR_TYPE = "error.type"; +export declare const ERROR_CODE = "error.code"; +export declare const ANOMALY_DETECTOR_TYPE = "anomaly.detector_type"; +export declare const METRIC_SYSTEM_FREE_MEMORY = "system.memory.actual.free"; +export declare const METRIC_SYSTEM_TOTAL_MEMORY = "system.memory.total"; +export declare const METRIC_SYSTEM_CPU_PERCENT = "system.cpu.total.norm.pct"; +export declare const METRIC_PROCESS_CPU_PERCENT = "system.process.cpu.total.norm.pct"; +export declare const METRIC_CGROUP_MEMORY_LIMIT_BYTES = "system.process.cgroup.memory.mem.limit.bytes"; +export declare const METRIC_CGROUP_MEMORY_USAGE_BYTES = "system.process.cgroup.memory.mem.usage.bytes"; +export declare const METRIC_JAVA_HEAP_MEMORY_MAX = "jvm.memory.heap.max"; +export declare const METRIC_JAVA_HEAP_MEMORY_COMMITTED = "jvm.memory.heap.committed"; +export declare const METRIC_JAVA_HEAP_MEMORY_USED = "jvm.memory.heap.used"; +export declare const METRIC_JAVA_NON_HEAP_MEMORY_MAX = "jvm.memory.non_heap.max"; +export declare const METRIC_JAVA_NON_HEAP_MEMORY_COMMITTED = "jvm.memory.non_heap.committed"; +export declare const METRIC_JAVA_NON_HEAP_MEMORY_USED = "jvm.memory.non_heap.used"; +export declare const METRIC_JAVA_THREAD_COUNT = "jvm.thread.count"; +export declare const METRIC_JAVA_GC_COUNT = "jvm.gc.count"; +export declare const METRIC_JAVA_GC_TIME = "jvm.gc.time"; +export declare const METRICSET_NAME = "metricset.name"; +export declare const METRICSET_INTERVAL = "metricset.interval"; +export declare const LABEL_NAME = "labels.name"; +export declare const LABEL_GC = "labels.gc"; +export declare const LABEL_TYPE = "labels.type"; +export declare const LABEL_TELEMETRY_AUTO_VERSION = "labels.telemetry_auto_version"; +export declare const LABEL_LIFECYCLE_STATE = "labels.lifecycle_state"; +export declare const HOST = "host"; +export declare const HOST_HOSTNAME = "host.hostname"; +export declare const HOST_NAME = "host.name"; +export declare const HOST_OS_PLATFORM = "host.os.platform"; +export declare const HOST_ARCHITECTURE = "host.architecture"; +export declare const HOST_OS_VERSION = "host.os.version"; +export declare const CONTAINER_ID = "container.id"; +export declare const CONTAINER = "container"; +export declare const CONTAINER_IMAGE = "container.image.name"; +export declare const KUBERNETES = "kubernetes"; +export declare const KUBERNETES_POD_NAME = "kubernetes.pod.name"; +export declare const KUBERNETES_POD_NAME_OTEL = "k8s.pod.name"; +export declare const KUBERNETES_POD_UID = "kubernetes.pod.uid"; +export declare const KUBERNETES_NAMESPACE = "kubernetes.namespace"; +export declare const KUBERNETES_NODE_NAME = "kubernetes.node.name"; +export declare const KUBERNETES_CONTAINER_NAME = "kubernetes.container.name"; +export declare const KUBERNETES_CONTAINER_ID = "kubernetes.container.id"; +export declare const KUBERNETES_DEPLOYMENT_NAME = "kubernetes.deployment.name"; +export declare const KUBERNETES_REPLICASET_NAME = "kubernetes.replicaset.name"; +export declare const FAAS_ID = "faas.id"; +export declare const FAAS_NAME = "faas.name"; +export declare const FAAS_COLDSTART = "faas.coldstart"; +export declare const FAAS_TRIGGER_TYPE = "faas.trigger.type"; +export declare const FAAS_DURATION = "faas.duration"; +export declare const FAAS_COLDSTART_DURATION = "faas.coldstart_duration"; +export declare const FAAS_BILLED_DURATION = "faas.billed_duration"; +export declare const METRIC_OTEL_SYSTEM_CPU_UTILIZATION = "system.cpu.utilization"; +export declare const METRIC_OTEL_SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization"; +export declare const METRIC_OTEL_JVM_PROCESS_CPU_PERCENT = "process.runtime.jvm.cpu.utilization"; +export declare const METRIC_OTEL_JVM_PROCESS_MEMORY_USAGE = "process.runtime.jvm.memory.usage"; +export declare const METRIC_OTEL_JVM_PROCESS_MEMORY_COMMITTED = "process.runtime.jvm.memory.committed"; +export declare const METRIC_OTEL_JVM_PROCESS_MEMORY_LIMIT = "process.runtime.jvm.memory.limit"; +export declare const METRIC_OTEL_JVM_PROCESS_THREADS_COUNT = "process.runtime.jvm.threads.count"; +export declare const METRIC_OTEL_JVM_SYSTEM_CPU_PERCENT = "process.runtime.jvm.system.cpu.utilization"; +export declare const METRIC_OTEL_JVM_GC_DURATION = "process.runtime.jvm.gc.duration"; +export declare const METRIC_OTEL_JVM_CPU_PERCENT = "metrics.jvm.cpu.recent_utilization"; +export declare const METRIC_OTEL_JVM_MEMORY_USED = "metrics.jvm.memory.used"; +export declare const METRIC_OTEL_JVM_MEMORY_COMMITTED = "metrics.jvm.memory.committed"; +export declare const METRIC_OTEL_JVM_MEMORY_LIMIT = "metrics.jvm.memory.limit"; +export declare const METRIC_OTEL_JVM_THREAD_COUNT = "metrics.jvm.thread.count"; +export declare const METRIC_OTEL_JVM_SYSTEM_CPU = "metrics.jvm.system.cpu.utilization"; +export declare const METRIC_OTEL_JVM_GC_DURATION_SECONDS = "metrics.jvm.gc.duration"; +export declare const ATTRIBUTE_OTEL_JVM_MEMORY_TYPE = "attributes.jvm.memory.type"; +export declare const LABEL_OTEL_JVM_MEMORY_TYPE = "labels.jvm_memory_type"; +export declare const VALUE_OTEL_JVM_MEMORY_TYPE_HEAP = "heap"; +export declare const VALUE_OTEL_JVM_MEMORY_TYPE_NON_HEAP = "non_heap"; +export declare const TELEMETRY_SDK_NAME = "telemetry.sdk.name"; +export declare const TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; +export declare const TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; +export declare const URL_PATH = "url.path"; +export declare const URL_SCHEME = "url.scheme"; +export declare const SERVER_ADDRESS = "server.address"; +export declare const SERVER_PORT = "server.port"; +export declare const OTEL_SPAN_LINKS = "links"; +export declare const OTEL_SPAN_LINKS_SPAN_ID = "links.span_id"; +export declare const OTEL_SPAN_LINKS_TRACE_ID = "links.trace_id"; +export declare const TIER = "_tier"; +export declare const INDEX = "_index"; +export declare const DATA_STEAM_TYPE = "data_stream.type"; +export declare const NETWORK_CONNECTION_TYPE = "network.connection.type"; +export declare const DEVICE_MODEL_IDENTIFIER = "device.model.identifier"; +export declare const SESSION_ID = "session.id"; +export declare const APP_LAUNCH_TIME = "application.launch.time"; +export declare const EVENT_NAME = "event.name"; +export declare const CLIENT_GEO_COUNTRY_ISO_CODE = "client.geo.country_iso_code"; +export declare const CLIENT_GEO_REGION_ISO_CODE = "client.geo.region_iso_code"; +export declare const CLIENT_GEO_COUNTRY_NAME = "client.geo.country_name"; +export declare const CLIENT_GEO_CITY_NAME = "client.geo.city_name"; +export declare const CLIENT_GEO_REGION_NAME = "client.geo.region_name"; +export declare const CHILD_ID = "child.id"; +export declare const LOG_LEVEL = "log.level"; +export declare const PROCESS_ARGS = "process.args"; +export declare const PROCESS_PID = "process.pid"; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/common.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/common.d.ts new file mode 100644 index 0000000000000..2bc9c2b165662 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/common.d.ts @@ -0,0 +1 @@ +export declare const ERROR_MESSAGE = "error.message"; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/otel.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/otel.d.ts new file mode 100644 index 0000000000000..db64f78b3afc7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/otel.d.ts @@ -0,0 +1,12 @@ +export declare const STATUS_CODE = "status.code"; +export declare const OTEL_EVENT_NAME = "event_name"; +export declare const EXCEPTION_TYPE = "exception.type"; +export declare const EXCEPTION_MESSAGE = "exception.message"; +export declare const DURATION = "duration"; +export declare const KIND = "kind"; +export declare const RESOURCE_ATTRIBUTES_TELEMETRY_SDK_LANGUAGE = "resource.attributes.telemetry.sdk.language"; +export declare const LINKS_TRACE_ID = "links.trace_id"; +export declare const LINKS_SPAN_ID = "links.span_id"; +export declare const ATTRIBUTE_HTTP_SCHEME = "attributes.http.scheme"; +export declare const ATTRIBUTE_HTTP_STATUS_CODE = "attributes.http.status_code"; +export declare const PROCESS_RUNTIME_VERSION = "process.runtime.version"; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/apm_base_doc.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/apm_base_doc.d.ts new file mode 100644 index 0000000000000..0548ed5e74dff --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/apm_base_doc.d.ts @@ -0,0 +1,18 @@ +import type { Observer } from './fields/observer'; +export interface APMBaseDoc { + '@timestamp': string; + agent: { + name: string; + version?: string; + }; + parent?: { + id?: string; + }; + trace?: { + id?: string; + }; + labels?: { + [key: string]: string | number | boolean; + }; + observer?: Observer; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/error_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/error_raw.d.ts new file mode 100644 index 0000000000000..25e786a46d00e --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/error_raw.d.ts @@ -0,0 +1,53 @@ +import type { APMBaseDoc } from './apm_base_doc'; +import type { Container, Host, Http, Kubernetes, Page, Process, Service, Stackframe, TimestampUs, Url, User } from './fields'; +import type { Server } from './fields/server'; +export interface Processor { + name: 'error'; + event: 'error'; +} +export interface Exception { + attributes?: { + response?: string; + }; + code?: string; + message?: string; + type?: string; + module?: string; + handled?: boolean; + stacktrace?: Stackframe[]; +} +export interface Log { + message: string; + stacktrace?: Stackframe[]; +} +export interface ErrorRaw extends APMBaseDoc { + processor: Processor; + timestamp: TimestampUs; + transaction?: { + id: string; + sampled?: boolean; + type: string; + }; + error: { + id: string; + culprit?: string; + grouping_key: string; + exception?: Exception[]; + page?: Page; + log?: Log; + stack_trace?: string; + custom?: Record; + message?: string; + code?: string; + type?: string; + }; + container?: Container; + host?: Host; + http?: Http; + kubernetes?: Kubernetes; + process?: Process; + service: Service; + url?: Url; + server?: Server; + user?: User; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/event_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/event_raw.d.ts new file mode 100644 index 0000000000000..22ddfcc44d9b8 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/event_raw.d.ts @@ -0,0 +1,17 @@ +import type { APMBaseDoc } from './apm_base_doc'; +import type { TimestampUs } from './fields/timestamp_us'; +export interface EventRaw extends APMBaseDoc { + timestamp: TimestampUs; + transaction?: { + id: string; + sampled?: boolean; + type: string; + }; + log: { + message?: string; + }; + event: { + action: string; + category: string; + }; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/cloud.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/cloud.d.ts new file mode 100644 index 0000000000000..5bceb47a575e7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/cloud.d.ts @@ -0,0 +1,26 @@ +export interface Cloud { + availability_zone?: string; + instance?: { + name?: string; + id?: string; + }; + machine?: { + type?: string; + }; + project?: { + id?: string; + name?: string; + }; + provider?: string; + region?: string; + account?: { + id?: string; + name?: string; + }; + image?: { + id?: string; + }; + service?: { + name?: string; + }; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/container.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/container.d.ts new file mode 100644 index 0000000000000..0e73f48b204ba --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/container.d.ts @@ -0,0 +1,6 @@ +export interface Container { + id?: string | null; + image?: { + name?: string; + }; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/event_outcome.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/event_outcome.d.ts new file mode 100644 index 0000000000000..d6e3bcbbe87e1 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/event_outcome.d.ts @@ -0,0 +1 @@ +export type EventOutcome = 'success' | 'failure' | 'unknown'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/faas.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/faas.d.ts new file mode 100644 index 0000000000000..d34e189ebfdaf --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/faas.d.ts @@ -0,0 +1,9 @@ +export interface Faas { + id: string; + coldstart?: boolean; + execution?: string; + trigger?: { + type?: string; + request_id?: string; + }; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/host.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/host.d.ts new file mode 100644 index 0000000000000..e56da08c01143 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/host.d.ts @@ -0,0 +1,9 @@ +export interface Host { + architecture?: string; + hostname?: string; + name?: string; + ip?: string; + os?: { + platform?: string; + }; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/http.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/http.d.ts new file mode 100644 index 0000000000000..22c71a227faec --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/http.d.ts @@ -0,0 +1,9 @@ +export interface Http { + request?: { + method?: string; + }; + response?: { + status_code?: number; + }; + version?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/index.d.ts new file mode 100644 index 0000000000000..93fdaaec806a6 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/index.d.ts @@ -0,0 +1,18 @@ +export type * from './cloud'; +export type * from './container'; +export type * from './event_outcome'; +export type * from './faas'; +export type * from './host'; +export type * from './http'; +export type * from './kubernetes'; +export type * from './observer'; +export type * from './page'; +export type * from './process'; +export type * from './service'; +export type * from './span_links'; +export type * from './stackframe'; +export type * from './timestamp_us'; +export type * from './url'; +export type * from './user_agent'; +export type * from './user'; +export type * from './otel'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/kubernetes.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/kubernetes.d.ts new file mode 100644 index 0000000000000..eb1b540cf7bde --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/kubernetes.d.ts @@ -0,0 +1,17 @@ +export interface Kubernetes { + pod?: { + uid?: string | null; + name?: string; + }; + namespace?: string; + replicaset?: { + name?: string; + }; + deployment?: { + name?: string; + }; + container?: { + id?: string; + name?: string; + }; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/observer.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/observer.d.ts new file mode 100644 index 0000000000000..b67630b76bf55 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/observer.d.ts @@ -0,0 +1,9 @@ +export interface Observer { + ephemeral_id?: string; + hostname?: string; + id?: string; + name?: string; + type?: string; + version?: string; + version_major?: number; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/index.d.ts new file mode 100644 index 0000000000000..ed303982e28a0 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/index.d.ts @@ -0,0 +1 @@ +export type * from './status_code'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/status_code.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/status_code.d.ts new file mode 100644 index 0000000000000..aa285806f98c0 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/status_code.d.ts @@ -0,0 +1 @@ +export type StatusCode = 'Ok' | 'Unset' | 'Error'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/page.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/page.d.ts new file mode 100644 index 0000000000000..f1f7a69ca9c99 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/page.d.ts @@ -0,0 +1,3 @@ +export interface Page { + url?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/process.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/process.d.ts new file mode 100644 index 0000000000000..f476db85e9c91 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/process.d.ts @@ -0,0 +1,6 @@ +export interface Process { + args?: string[]; + pid: number; + ppid?: number; + title?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/server.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/server.d.ts new file mode 100644 index 0000000000000..9bf2a65caef76 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/server.d.ts @@ -0,0 +1,4 @@ +export interface Server { + address?: string; + port?: number; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/service.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/service.d.ts new file mode 100644 index 0000000000000..95805c9644753 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/service.d.ts @@ -0,0 +1,20 @@ +export interface Service { + name: string; + environment?: string; + framework?: { + name?: string; + version?: string; + }; + node?: { + name?: string; + }; + runtime?: { + name?: string; + version?: string; + }; + language?: { + name?: string; + version?: string; + }; + version?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/span_links.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/span_links.d.ts new file mode 100644 index 0000000000000..c5ba5acfbc49e --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/span_links.d.ts @@ -0,0 +1,12 @@ +export interface SpanLink { + trace: { + id: string; + }; + span: { + id: string; + }; +} +export interface OtelSpanLink { + span_id: Array; + trace_id: Array; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/stackframe.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/stackframe.d.ts new file mode 100644 index 0000000000000..0fc22ed9450a9 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/stackframe.d.ts @@ -0,0 +1,33 @@ +interface Line { + column?: number; + number: number; +} +interface Sourcemap { + error?: string; + updated?: boolean; +} +interface StackframeBase { + abs_path?: string; + classname?: string; + context?: { + post?: string[]; + pre?: string[]; + }; + exclude_from_grouping?: boolean; + filename?: string; + function?: string; + module?: string; + library_frame?: boolean; + line?: Line; + sourcemap?: Sourcemap; + vars?: { + [key: string]: unknown; + }; +} +export type StackframeWithLineContext = StackframeBase & { + line: Line & { + context: string; + }; +}; +export type Stackframe = StackframeBase | StackframeWithLineContext; +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/timestamp_us.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/timestamp_us.d.ts new file mode 100644 index 0000000000000..bcf7c4ebd448a --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/timestamp_us.d.ts @@ -0,0 +1,3 @@ +export interface TimestampUs { + us: number; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/url.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/url.d.ts new file mode 100644 index 0000000000000..2abcb889afd84 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/url.d.ts @@ -0,0 +1,7 @@ +export interface Url { + domain?: string; + full?: string; + original?: string; + scheme?: string; + path?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user.d.ts new file mode 100644 index 0000000000000..907637b97307d --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user.d.ts @@ -0,0 +1,3 @@ +export interface User { + id?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user_agent.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user_agent.d.ts new file mode 100644 index 0000000000000..64b64db75e9e4 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user_agent.d.ts @@ -0,0 +1,13 @@ +export interface UserAgent { + device?: { + name: string; + }; + name?: string; + original?: string; + os?: { + name: string; + version?: string; + full?: string; + }; + version?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/index.d.ts new file mode 100644 index 0000000000000..764c6be75929c --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/index.d.ts @@ -0,0 +1,6 @@ +export type * from './apm_base_doc'; +export type * from './error_raw'; +export type * from './event_raw'; +export type * from './metric_raw'; +export type * from './span_raw'; +export type * from './transaction_raw'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/metric_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/metric_raw.d.ts new file mode 100644 index 0000000000000..f789545fe7413 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/metric_raw.d.ts @@ -0,0 +1,100 @@ +import type { APMBaseDoc } from './apm_base_doc'; +import type { Cloud } from './fields/cloud'; +import type { Container } from './fields/container'; +import type { Host } from './fields/host'; +import type { Kubernetes } from './fields/kubernetes'; +import type { Service } from './fields/service'; +type BaseMetric = APMBaseDoc & { + processor: { + name: 'metric'; + event: 'metric'; + }; + cloud?: Cloud; + container?: Container; + kubernetes?: Kubernetes; + service?: Service; + host?: Host; +}; +type BaseBreakdownMetric = BaseMetric & { + transaction: { + name: string; + type: string; + }; + span: { + self_time: { + count: number; + sum: { + us: number; + }; + }; + }; +}; +type TransactionBreakdownMetric = BaseBreakdownMetric & { + transaction: { + duration: { + count: number; + sum: { + us: number; + }; + }; + breakdown: { + count: number; + }; + }; +}; +type SpanBreakdownMetric = BaseBreakdownMetric & { + span: { + type: string; + subtype?: string; + }; +}; +type SystemMetric = BaseMetric & { + system: unknown; + service: { + node?: { + name: string; + }; + }; +}; +type CGroupMetric = SystemMetric; +type JVMMetric = SystemMetric & { + jvm: unknown; +}; +type TransactionDurationMetric = BaseMetric & { + transaction: { + name: string; + type: string; + result?: string; + duration: { + histogram: { + values: number[]; + counts: number[]; + }; + }; + }; + service: { + name: string; + node?: { + name: string; + }; + environment?: string; + version?: string; + }; +}; +export type SpanDestinationMetric = BaseMetric & { + span: { + destination: { + service: { + resource: string; + response_time: { + count: number; + sum: { + us: number; + }; + }; + }; + }; + }; +}; +export type MetricRaw = BaseMetric | TransactionBreakdownMetric | SpanBreakdownMetric | TransactionDurationMetric | SpanDestinationMetric | SystemMetric | CGroupMetric | JVMMetric; +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/span_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/span_raw.d.ts new file mode 100644 index 0000000000000..6fe8bfced1607 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/span_raw.d.ts @@ -0,0 +1,87 @@ +import type { APMBaseDoc } from './apm_base_doc'; +import type { EventOutcome } from './fields/event_outcome'; +import type { Http } from './fields/http'; +import type { Server } from './fields/server'; +import type { SpanLink } from './fields/span_links'; +import type { Stackframe } from './fields/stackframe'; +import type { TimestampUs } from './fields/timestamp_us'; +import type { Url } from './fields/url'; +interface Processor { + name: 'transaction'; + event: 'span'; +} +export interface SpanRaw extends APMBaseDoc { + processor: Processor; + trace: { + id: string; + }; + event?: { + outcome?: EventOutcome; + }; + service: { + name: string; + environment?: string; + }; + span: { + destination?: { + service: { + resource: string; + }; + }; + action?: string; + duration: { + us: number; + }; + id: string; + name: string; + stacktrace?: Stackframe[]; + subtype?: string; + sync?: boolean; + type: string; + http?: { + url?: { + original?: string; + }; + response: { + status_code: number; + }; + method?: string; + }; + db?: { + statement?: string; + type?: string; + }; + message?: { + queue?: { + name: string; + }; + age?: { + ms: number; + }; + body?: string; + headers?: Record; + }; + composite?: { + count: number; + sum: { + us: number; + }; + compression_strategy: string; + }; + links?: SpanLink[]; + }; + timestamp: TimestampUs; + transaction?: { + id: string; + }; + child?: { + id: string[]; + }; + code?: { + stacktrace?: string; + }; + http?: Http; + url?: Url; + server?: Server; +} +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/transaction_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/transaction_raw.d.ts new file mode 100644 index 0000000000000..7618d627e1a34 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/transaction_raw.d.ts @@ -0,0 +1,81 @@ +import type { APMBaseDoc } from './apm_base_doc'; +import type { Cloud } from './fields/cloud'; +import type { Container } from './fields/container'; +import type { EventOutcome } from './fields/event_outcome'; +import type { Host } from './fields/host'; +import type { Http } from './fields/http'; +import type { Kubernetes } from './fields/kubernetes'; +import type { Page } from './fields/page'; +import type { Process } from './fields/process'; +import type { Service } from './fields/service'; +import type { TimestampUs } from './fields/timestamp_us'; +import type { Url } from './fields/url'; +import type { User } from './fields/user'; +import type { UserAgent } from './fields/user_agent'; +import type { Faas } from './fields/faas'; +import type { SpanLink } from './fields/span_links'; +import type { Server } from './fields/server'; +interface Processor { + name: 'transaction'; + event: 'transaction'; +} +export interface TransactionRaw extends APMBaseDoc { + processor: Processor; + timestamp: TimestampUs; + trace: { + id: string; + }; + event?: { + outcome?: EventOutcome; + }; + transaction: { + duration: { + us: number; + }; + id: string; + marks?: { + agent?: { + [name: string]: number; + }; + }; + name?: string; + page?: Page; + result?: string; + sampled?: boolean; + span_count?: { + started?: number; + dropped?: number; + }; + type: string; + custom?: Record; + message?: { + queue?: { + name: string; + }; + age?: { + ms: number; + }; + body?: string; + headers?: Record; + }; + }; + container?: Container; + ecs?: { + version?: string; + }; + host?: Host; + http?: Http; + server?: Server; + kubernetes?: Kubernetes; + process?: Process; + service: Service; + url?: Url; + user?: User; + user_agent?: UserAgent; + cloud?: Cloud; + faas?: Faas; + span?: { + links?: SpanLink[]; + }; +} +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/apm_error.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/apm_error.d.ts new file mode 100644 index 0000000000000..b189f4c27b2ac --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/apm_error.d.ts @@ -0,0 +1,5 @@ +import type { ErrorRaw } from '../raw/error_raw'; +import type { Agent } from './fields/agent'; +export interface APMError extends ErrorRaw { + agent: Agent; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/event.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/event.d.ts new file mode 100644 index 0000000000000..11158127f6581 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/event.d.ts @@ -0,0 +1,5 @@ +import type { EventRaw } from '../raw/event_raw'; +import type { Agent } from './fields/agent'; +export interface Event extends EventRaw { + agent: Agent; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/agent.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/agent.d.ts new file mode 100644 index 0000000000000..dd7d7ebf94885 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/agent.d.ts @@ -0,0 +1,7 @@ +import type { AgentName } from '@kbn/elastic-agent-utils'; +export type { ElasticAgentName, OpenTelemetryAgentName, AgentName } from '@kbn/elastic-agent-utils'; +export interface Agent { + ephemeral_id?: string; + name: AgentName; + version?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/index.d.ts new file mode 100644 index 0000000000000..eba5b6968a216 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/index.d.ts @@ -0,0 +1 @@ +export type * from './agent'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/index.d.ts new file mode 100644 index 0000000000000..0a7b87ae933ca --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/index.d.ts @@ -0,0 +1,5 @@ +export type * from './apm_error'; +export type * from './event'; +export type * from './metric'; +export type * from './span'; +export type * from './transaction'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/metric.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/metric.d.ts new file mode 100644 index 0000000000000..5562855bcd1ae --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/metric.d.ts @@ -0,0 +1,2 @@ +import type { MetricRaw } from '../raw/metric_raw'; +export type Metric = MetricRaw; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/span.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/span.d.ts new file mode 100644 index 0000000000000..890e53b4b7407 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/span.d.ts @@ -0,0 +1,5 @@ +import type { SpanRaw } from '../raw/span_raw'; +import type { Agent } from './fields/agent'; +export interface Span extends SpanRaw { + agent: Agent; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/transaction.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/transaction.d.ts new file mode 100644 index 0000000000000..fee63c0b3d508 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/transaction.d.ts @@ -0,0 +1,11 @@ +import type { TransactionRaw } from '../raw/transaction_raw'; +import type { Agent } from './fields/agent'; +type InnerTransaction = TransactionRaw['transaction']; +interface InnerTransactionWithName extends InnerTransaction { + name: string; +} +export interface Transaction extends TransactionRaw { + agent: Agent; + transaction: InnerTransactionWithName; +} +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/focused_trace_waterfall.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/focused_trace_waterfall.d.ts new file mode 100644 index 0000000000000..02117267c50b3 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/focused_trace_waterfall.d.ts @@ -0,0 +1,6 @@ +export interface FocusedTraceWaterfallProps { + traceId: string; + rangeFrom: string; + rangeTo: string; + docId?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/full_trace_waterfall.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/full_trace_waterfall.d.ts new file mode 100644 index 0000000000000..656b4c7d534e6 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/full_trace_waterfall.d.ts @@ -0,0 +1,36 @@ +type FullTraceWaterfallScrollProps = { + scrollStrategy?: 'window'; + contextSpanIds?: string[]; +} | { + scrollStrategy: 'parent'; + contextSpanIds?: string[]; + scrollToContextOnMount?: boolean; +}; +export type FullTraceWaterfallProps = { + traceId: string; + rangeFrom: string; + rangeTo: string; + serviceName?: string; + scrollElement?: Element; + onNodeClick?: (nodeSpanId: string) => void; + onErrorClick?: FullTraceWaterfallOnErrorClick; + ebt: { + row: { + element: string; + }; + errorBadge: { + element: string; + }; + serviceBadge: { + element: string; + }; + }; +} & FullTraceWaterfallScrollProps; +export type FullTraceWaterfallOnErrorClick = (params: { + traceId: string; + docId: string; + errorCount: number; + errorDocId?: string; + docIndex?: string; +}) => void; +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/ilm_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/ilm_types.d.ts new file mode 100644 index 0000000000000..9edf09f1175f0 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/ilm_types.d.ts @@ -0,0 +1,14 @@ +export declare enum IndexLifecyclePhaseSelectOption { + All = "all", + Hot = "hot", + Warm = "warm", + Cold = "cold", + Frozen = "frozen" +} +export declare const indexLifeCyclePhaseToDataTier: { + readonly hot: "data_hot"; + readonly warm: "data_warm"; + readonly cold: "data_cold"; + readonly frozen: "data_frozen"; +}; +export type DataTier = (typeof indexLifeCyclePhaseToDataTier)[keyof typeof indexLifeCyclePhaseToDataTier]; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/instances.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/instances.d.ts new file mode 100644 index 0000000000000..6fe527ab82e88 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/instances.d.ts @@ -0,0 +1,10 @@ +import * as t from 'io-ts'; +export declare const instancesSortFieldRt: t.KeyofC<{ + serviceNodeName: null; + latency: null; + throughput: null; + errorRate: null; + cpuUsage: null; + memoryUsage: null; +}>; +export type InstancesSortField = t.TypeOf; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_aggregation_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_aggregation_types.d.ts new file mode 100644 index 0000000000000..5e37314290ac0 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_aggregation_types.d.ts @@ -0,0 +1,7 @@ +import * as t from 'io-ts'; +export declare enum LatencyAggregationType { + avg = "avg", + p99 = "p99", + p95 = "p95" +} +export declare const latencyAggregationTypeRt: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC]>; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution.d.ts new file mode 100644 index 0000000000000..a4091b50f5dc4 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution.d.ts @@ -0,0 +1,10 @@ +export interface OverallLatencyDistributionResponse { + durationMin?: number; + durationMax?: number; + totalDocCount?: number; + percentileThresholdValue?: number | null; + overallHistogram?: Array<{ + key: number; + doc_count: number; + }>; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution_chart_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution_chart_types.d.ts new file mode 100644 index 0000000000000..161b843e4594f --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution_chart_types.d.ts @@ -0,0 +1,9 @@ +import * as t from 'io-ts'; +export declare enum LatencyDistributionChartType { + transactionLatency = "transactionLatency", + spanLatency = "spanLatency", + latencyCorrelations = "latencyCorrelations", + failedTransactionsCorrelations = "failedTransactionsCorrelations", + dependencyLatency = "dependencyLatency" +} +export declare const latencyDistributionChartTypeRt: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC]>; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/mobile_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/mobile_types.d.ts new file mode 100644 index 0000000000000..439ec2e4976e9 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/mobile_types.d.ts @@ -0,0 +1,7 @@ +export declare enum MobileProperty { + Device = "device", + NetworkConnectionType = "netConnectionType", + OsVersion = "osVersion", + AppVersion = "appVersion" +} +export type MobilePropertyType = MobileProperty.Device | MobileProperty.OsVersion | MobileProperty.AppVersion | MobileProperty.NetworkConnectionType; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/processor_event.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/processor_event.d.ts new file mode 100644 index 0000000000000..f6ea07af69277 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/processor_event.d.ts @@ -0,0 +1,10 @@ +import { ProcessorEvent } from '@kbn/apm-types-shared'; +import * as t from 'io-ts'; +export declare const processorEventRt: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC]>; +/** + * Processor events that are searchable in the UI via the query bar. + * + * Some client-side routes will define 1 or more processor events that + * will be used to fetch the dynamic data view for the query bar. + */ +export type UIProcessorEvent = ProcessorEvent.transaction | ProcessorEvent.error | ProcessorEvent.metric; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/rollup.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/rollup.d.ts new file mode 100644 index 0000000000000..18dab62ebb734 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/rollup.d.ts @@ -0,0 +1,6 @@ +export declare enum RollupInterval { + OneMinute = "1m", + TenMinutes = "10m", + SixtyMinutes = "60m", + None = "none" +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/serverless.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/serverless.d.ts new file mode 100644 index 0000000000000..c6460eea48c36 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/serverless.d.ts @@ -0,0 +1,4 @@ +export declare enum ServerlessType { + AWS_LAMBDA = "aws.lambda", + AZURE_FUNCTIONS = "azure.functions" +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomalies.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomalies.d.ts new file mode 100644 index 0000000000000..121dcc7d38549 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomalies.d.ts @@ -0,0 +1,10 @@ +export interface ServiceAnomaliesResponse { + mlJobIds: string[]; + serviceAnomalies: Array<{ + serviceName: string; + jobId: string; + transactionType: string; + actualValue: number; + anomalyScore: number; + }>; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_stats.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_stats.d.ts new file mode 100644 index 0000000000000..c01bad7f71b3e --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_stats.d.ts @@ -0,0 +1,6 @@ +export interface ServiceAnomalyStats { + transactionType?: string; + anomalyScore?: number; + actualValue?: number; + jobId?: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_timeseries.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_timeseries.d.ts new file mode 100644 index 0000000000000..a523e0b0e4427 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_timeseries.d.ts @@ -0,0 +1,18 @@ +import type { Coordinate } from './coordinate'; +import type { AnomalyDetectorType } from './anomaly_detector_type'; +export interface ServiceAnomalyTimeseries { + jobId: string; + type: AnomalyDetectorType; + environment: string; + serviceName: string; + version: number; + transactionType: string; + anomalies: Array; + bounds: Array<{ + x: number; + y0: number | null; + y1: number | null; + }>; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_groups.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_groups.d.ts new file mode 100644 index 0000000000000..cd8c0f50b40bd --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/service_groups.d.ts @@ -0,0 +1,10 @@ +export interface ServiceGroup { + groupName: string; + kuery: string; + description?: string; + color?: string; +} +export interface SavedServiceGroup extends ServiceGroup { + id: string; + updatedAt: number; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_health_status.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_health_status.d.ts new file mode 100644 index 0000000000000..be39214f78ed6 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/service_health_status.d.ts @@ -0,0 +1,6 @@ +export declare enum ServiceHealthStatus { + healthy = "healthy", + critical = "critical", + warning = "warning", + unknown = "unknown" +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_inventory.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_inventory.d.ts new file mode 100644 index 0000000000000..c50d2f86f54a6 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/service_inventory.d.ts @@ -0,0 +1,2 @@ +import type { GroupedStatsResult } from '@kbn/slo-schema'; +export type SloStatus = keyof GroupedStatsResult['summary']; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_map.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_map.d.ts new file mode 100644 index 0000000000000..be8a685410aab --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/service_map.d.ts @@ -0,0 +1,215 @@ +import type { AlertStatus } from '@kbn/rule-data-utils'; +import type { Edge, Node, EdgeMarker as ReactFlowEdgeMarker } from '@xyflow/react'; +import type { AGENT_NAME, SERVICE_ENVIRONMENT, SERVICE_NAME, SPAN_DESTINATION_SERVICE_RESOURCE, SPAN_SUBTYPE, SPAN_TYPE } from './es_fields/apm'; +import type { Coordinate } from './coordinate'; +import type { SloStatus } from './service_inventory'; +import type { ServiceAnomaliesResponse } from './service_anomalies'; +import type { ServiceAnomalyStats } from './service_anomaly_stats'; +import type { AgentName } from './es_schemas/ui/fields/agent'; +export interface ServiceMapTelemetry { + tracesCount: number; + nodesCount: number; +} +export type GroupedConnection = { + label: string; +} & (ConnectionNode | ConnectionEdge); +export interface GroupedNode { + data: { + id: string; + 'span.type': string; + 'span.subtype'?: string; + label: string; + groupedConnections: GroupedConnection[]; + }; +} +export interface GroupedEdge { + data: { + id: string; + source: string; + target: string; + }; +} +export interface GroupResourceNodesResponse extends Pick { + elements: Array; +} +export type ConnectionType = Connection | ConnectionLegacy; +export type DestinationType = ExitSpanDestination | ExitSpanDestinationLegacy; +export interface ServiceMapRawResponse { + spans: ServiceMapSpan[]; + servicesData: ServicesResponse[]; + anomalies: ServiceAnomaliesResponse; +} +export type ServiceMapResponse = Pick & ServiceMapRawResponse; +export interface ServicesResponse { + [SERVICE_NAME]: string; + [AGENT_NAME]: string; + [SERVICE_ENVIRONMENT]: string | null; +} +export interface ServiceConnectionNode extends ServicesResponse { + id: string; + serviceAnomalyStats?: ServiceAnomalyStats; + label?: string; +} +export interface ExternalConnectionNode { + id: string; + [SPAN_DESTINATION_SERVICE_RESOURCE]: string; + [SPAN_TYPE]: string; + [SPAN_SUBTYPE]: string; + label?: string; +} +export type ConnectionNode = ServiceConnectionNode | ExternalConnectionNode; +export type ConnectionNodeLegacy = Omit | Omit; +export interface ConnectionEdge { + id: string; + source: ConnectionNode['id']; + target: ConnectionNode['id']; + label?: string; + bidirectional?: boolean; + isInverseEdge?: boolean; + resources?: string[]; + sourceData?: ConnectionNode; + targetData?: ConnectionNode; + sourceLabel?: string; + targetLabel?: string; +} +export type NodeItem = { + id: string; +} & ConnectionNode; +export interface ConnectionElement { + data: ConnectionNode | ConnectionEdge; +} +export interface Connection { + source: ConnectionNode; + destination: ConnectionNode; +} +export interface ConnectionLegacy { + source: ConnectionNodeLegacy; + destination: ConnectionNodeLegacy; +} +export interface NodeStats { + transactionStats?: { + latency?: { + value: number | null; + timeseries?: Coordinate[]; + }; + throughput?: { + value: number | null; + timeseries?: Coordinate[]; + }; + }; + failedTransactionsRate?: { + value: number | null; + timeseries?: Coordinate[]; + }; + cpuUsage?: { + value?: number | null; + timeseries?: Coordinate[]; + }; + memoryUsage?: { + value?: number | null; + timeseries?: Coordinate[]; + }; +} +export interface ExitSpanDestination { + from: ExternalConnectionNode; + to: ServiceConnectionNode; +} +export interface ExitSpanDestinationLegacy { + from: Omit; + to: Omit; +} +export interface ServiceMapService { + serviceName: string; + agentName: AgentName; + serviceEnvironment?: string; + serviceNodeName?: string; +} +export interface ServiceMapExitSpan extends ServiceMapService { + spanId: string; + spanType: string; + spanSubtype: string; + spanDestinationServiceResource: string; +} +export type ServiceMapSpan = ServiceMapExitSpan & { + destinationService?: ServiceMapService; +}; +interface BaseNodeData extends Record { + id: string; + label: string; +} +export interface ServiceNodeData extends BaseNodeData { + isService: true; + contextHighlight?: boolean; + agentName?: AgentName; + serviceAnomalyStats?: ServiceAnomalyStats; + alertsCount?: number; + alertsByStatus?: Partial>; + sloStatus?: SloStatus | 'noSLOs'; + sloCount?: number; +} +export interface DependencyNodeData extends BaseNodeData { + isService: false; + spanType?: string; + spanSubtype?: string; + [SPAN_TYPE]?: string; + [SPAN_SUBTYPE]?: string; +} +export interface GroupedConnectionInfo { + id: string; + label: string; + spanType?: string; + spanSubtype?: string; + [SPAN_TYPE]?: string; + [SPAN_SUBTYPE]?: string; + [SPAN_DESTINATION_SERVICE_RESOURCE]?: string; +} +export interface GroupInfo { + id: string; + sources: string[]; + targets: string[]; +} +export interface GroupedNodeData extends BaseNodeData { + isService: false; + isGrouped: true; + spanType?: string; + spanSubtype?: string; + groupedConnections: GroupedConnectionInfo[]; + count: number; +} +export type ServiceMapNodeData = ServiceNodeData | DependencyNodeData | GroupedNodeData; +export type ServiceMapNode = Node; +export interface EdgeMarker extends ReactFlowEdgeMarker { + width: number; + height: number; + color: string; +} +export interface ServiceMapEdgeData extends Record { + isBidirectional: boolean; + isGrouped?: boolean; + sourceData?: ConnectionNode; + targetData?: ConnectionNode; + sourceLabel?: string; + targetLabel?: string; + resources?: string[]; +} +export interface ServiceMapEdge extends Edge { + type: 'default'; + style: { + stroke: string; + strokeWidth: number; + }; + markerEnd: EdgeMarker; + markerStart?: EdgeMarker; +} +export interface GroupResourceNodesResult { + nodes: ServiceMapNode[]; + edges: ServiceMapEdge[]; + nodesCount: number; +} +export interface ReactFlowServiceMapResponse { + nodes: ServiceMapNode[]; + edges: ServiceMapEdge[]; + nodesCount: number; + tracesCount: number; +} +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_map_diagnostic_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_map_diagnostic_types.d.ts new file mode 100644 index 0000000000000..690668e4fef39 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/service_map_diagnostic_types.d.ts @@ -0,0 +1,48 @@ +import type { ESSearchResponse, ESSearchRequest } from '@kbn/es-types'; +export interface ExitSpanFields { + destinationService: string; + spanId: string; + transactionId: string; + serviceNodeName: string; + traceId: string; + agentName: string; +} +export interface ServiceMapDiagnosticResponse { + analysis: { + exitSpans: { + found: boolean; + totalConnections: number; + apmExitSpans: ExitSpanFields[] | []; + hasMatchingDestinationResources: boolean; + }; + parentRelationships: { + found: boolean; + documentCount: number; + sourceSpanIds: string[]; + }; + traceCorrelation?: { + found: boolean; + foundInSourceNode: boolean; + foundInDestinationNode: boolean; + sourceNodeDocumentCount: number; + destinationNodeDocumentCount: number; + }; + }; + elasticsearchResponses: { + exitSpansQuery?: ESSearchResponse; + sourceSpansQuery?: ESSearchResponse; + destinationParentIdsQuery?: ESSearchResponse; + traceCorrelationQuery?: ESSearchResponse; + }; +} +export interface DiagnosticNodeSelection { + field: string; + value: string; +} +export interface ServiceMapDiagnosticRequest { + start: number; + end: number; + sourceNode: DiagnosticNodeSelection; + destinationNode: DiagnosticNodeSelection; + traceId: string; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/span_links.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/span_links.d.ts new file mode 100644 index 0000000000000..d6a3d705150db --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/span_links.d.ts @@ -0,0 +1,19 @@ +import type { AgentName } from '../es_schemas_ui'; +export interface SpanLinkDetails { + traceId: string; + spanId: string; + details?: { + agentName: AgentName; + serviceName: string; + duration: number; + environment: string; + transactionId?: string; + spanName?: string; + spanSubtype?: string; + spanType?: string; + }; +} +export interface SpanLinks { + outgoingSpanLinks: SpanLinkDetails[]; + incomingSpanLinks: SpanLinkDetails[]; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/storage_explorer_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/storage_explorer_types.d.ts new file mode 100644 index 0000000000000..58ba9a09eaaa7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/storage_explorer_types.d.ts @@ -0,0 +1,5 @@ +import * as t from 'io-ts'; +import { IndexLifecyclePhaseSelectOption } from './ilm_types'; +export declare const indexLifecyclePhaseRt: t.TypeC<{ + indexLifecyclePhase: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC]>; +}>; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/time_range_metadata.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/time_range_metadata.d.ts new file mode 100644 index 0000000000000..1fbc2f8a7f1e0 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/time_range_metadata.d.ts @@ -0,0 +1,8 @@ +import type { ApmDataSource } from './data_source'; +export interface TimeRangeMetadata { + isUsingServiceDestinationMetrics: boolean; + sources: Array; +} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/timeseries.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/timeseries.d.ts new file mode 100644 index 0000000000000..f34ff2ea5940d --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/timeseries.d.ts @@ -0,0 +1,41 @@ +import type { AccessorFn, AreaSeriesStyle, Fit, FitConfig, LineSeriesStyle, RecursivePartial, SeriesColorAccessorFn, SeriesColorsArray } from '@elastic/charts'; +import type { Coordinate } from './coordinate'; +export interface BandCoordinate { + x: number; + y0: number | null; + y1: number | null; +} +export interface RectCoordinate { + x: number; + x0: number; +} +type Accessor = Array; +export type TimeSeries = APMChartSpec; +export interface APMChartSpec { + title: string; + id?: string; + titleShort?: string; + hideLegend?: boolean; + hideTooltipValue?: boolean; + data: TCoordinate[]; + legendValue?: string; + type: string; + color?: string | SeriesColorsArray | SeriesColorAccessorFn; + areaColor?: string; + fit?: Exclude | FitConfig; + stackAccessors?: Accessor; + yAccessors?: Accessor; + y0Accessors?: Accessor; + splitSeriesAccessors?: Accessor; + markSizeAccessor?: string | AccessorFn; + lineSeriesStyle?: RecursivePartial; + areaSeriesStyle?: RecursivePartial; + groupId?: string; +} +export type ChartType = 'area' | 'linemark' | 'bar'; +export type YUnit = 'percent' | 'bytes' | 'number' | 'time' | 'integer'; +export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/traces.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/traces.d.ts new file mode 100644 index 0000000000000..f81f59524707b --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-apm-types/src/traces.d.ts @@ -0,0 +1,80 @@ +import type { AgentName } from './es_schemas/ui/fields/agent'; +import type { EventOutcome } from './es_schemas/raw/fields/event_outcome'; +import type { StatusCode } from './es_schemas/raw/fields/otel/status_code'; +import type { Span } from './es_schemas/ui/span'; +import type { Transaction } from './es_schemas/ui/transaction'; +declare const STATUS_FIELD_NAME: readonly ["event.outcome", "status.code"]; +export type CompressionStrategy = 'exact_match' | 'same_kind'; +export interface TraceItemComposite { + count: number; + sum: number; + compressionStrategy: CompressionStrategy; +} +export type TraceItemDocType = 'span' | 'transaction'; +export interface TraceItem { + id: string; + timestampUs: number; + name: string; + traceId: string; + duration: number; + result?: string; + errors: Array<{ + errorDocId: string; + errorDocIndex?: string; + }>; + status?: { + fieldName: (typeof STATUS_FIELD_NAME)[number]; + value: EventOutcome | StatusCode; + }; + parentId?: string; + serviceName: string; + serviceEnvironment?: string; + type?: string; + sync?: boolean; + agentName?: AgentName; + spanLinksCount: { + incoming: number; + outgoing: number; + }; + icon?: string; + coldstart?: boolean; + composite?: TraceItemComposite; + docType: TraceItemDocType; + missingDestination?: boolean; +} +export interface TraceItemChild { + traceDoc: TraceItem; + children?: TraceItemChild[]; +} +export interface FocusedTraceItems { + rootDoc: TraceItem; + parentDoc?: TraceItem; + focusedTraceDoc: TraceItem; + focusedTraceTree: TraceItemChild[]; +} +export interface TransactionDetailRedirectInfo { + '@timestamp': string; + trace: { + id: string; + }; + transaction: { + id: string; + type: string; + name: string; + duration: { + us: number; + }; + }; + service: { + name: string; + }; +} +export interface TraceRootSpan { + duration: number; +} +export interface UnifiedSpanDocument extends Omit, Pick { + _id: string; + _index: string; + duration?: number[] | string; +} +export {}; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/index.d.ts new file mode 100644 index 0000000000000..2aba82a79caf9 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/schema'; +export * from './src/rest_specs'; +export * from './src/models'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/constants.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/constants.d.ts new file mode 100644 index 0000000000000..a8185f3459ca1 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/constants.d.ts @@ -0,0 +1 @@ +export declare const ALL_VALUE = "*"; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.d.ts new file mode 100644 index 0000000000000..38d3a44a36d1e --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.d.ts @@ -0,0 +1,23 @@ +import * as moment from 'moment'; +declare enum DurationUnit { + 'Minute' = "m", + 'Hour' = "h", + 'Day' = "d", + 'Week' = "w", + 'Month' = "M" +} +declare class Duration { + readonly value: number; + readonly unit: DurationUnit; + constructor(value: number, unit: DurationUnit); + add(other: Duration): Duration; + isShorterThan(other: Duration): boolean; + isLongerOrEqualThan(other: Duration): boolean; + isEqual(other: Duration): boolean; + format(): string; + asSeconds(): number; + asMinutes(): number; +} +declare const toDurationUnit: (unit: string) => DurationUnit; +declare const toMomentUnitOfTime: (unit: DurationUnit) => moment.unitOfTime.Diff; +export { Duration, DurationUnit, toMomentUnitOfTime, toDurationUnit }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.d.ts new file mode 100644 index 0000000000000..370dfa5ee22e0 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.d.ts @@ -0,0 +1,2 @@ +export type * from './pagination'; +export * from './duration'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.d.ts new file mode 100644 index 0000000000000..f18061cd2f444 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.d.ts @@ -0,0 +1,10 @@ +export interface Paginated { + total: number; + page: number; + perPage: number; + results: T[]; +} +export interface Pagination { + page: number; + perPage: number; +} diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.d.ts new file mode 100644 index 0000000000000..ea23565b05608 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.d.ts @@ -0,0 +1,8 @@ +import type * as t from 'io-ts'; +import type { budgetingMethodSchema, groupSummarySchema, objectiveSchema, statusSchema, timeWindowTypeSchema } from '../schema'; +type BudgetingMethod = t.OutputOf; +type TimeWindowType = t.OutputOf; +type GroupSummary = t.TypeOf; +type Objective = t.OutputOf; +type Status = t.OutputOf; +export type { BudgetingMethod, GroupSummary, Objective, Status, TimeWindowType }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.d.ts new file mode 100644 index 0000000000000..1e1d02555370d --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.d.ts @@ -0,0 +1,4 @@ +export * from './slo'; +export * from './routes'; +export type * from './indicators'; +export type * from './common'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.d.ts new file mode 100644 index 0000000000000..9c9da9c2c549d --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.d.ts @@ -0,0 +1,19 @@ +import type * as t from 'io-ts'; +import type { apmTransactionDurationIndicatorSchema, apmTransactionErrorRateIndicatorSchema, histogramIndicatorSchema, indicatorSchema, indicatorTypesSchema, kqlCustomIndicatorSchema, kqlWithFiltersSchema, metricCustomIndicatorSchema, querySchema, filtersSchema, groupingsSchema, syntheticsAvailabilityIndicatorSchema, timesliceMetricBasicMetricWithField, timesliceMetricDocCountMetric, timesliceMetricIndicatorSchema, timesliceMetricPercentileMetric } from '../schema'; +type IndicatorType = t.OutputOf; +type Indicator = t.OutputOf; +type APMTransactionErrorRateIndicator = t.OutputOf; +type APMTransactionDurationIndicator = t.OutputOf; +type SyntheticsAvailabilityIndicator = t.OutputOf; +type MetricCustomIndicator = t.OutputOf; +type TimesliceMetricIndicator = t.OutputOf; +type TimesliceMetricBasicMetricWithField = t.OutputOf; +type TimesliceMetricDocCountMetric = t.OutputOf; +type TimesclieMetricPercentileMetric = t.OutputOf; +type HistogramIndicator = t.OutputOf; +type KQLCustomIndicator = t.OutputOf; +type KqlWithFiltersSchema = t.TypeOf; +type QuerySchema = t.TypeOf; +type FiltersSchema = t.TypeOf; +type GroupingsSchema = t.TypeOf; +export type { APMTransactionDurationIndicator, APMTransactionErrorRateIndicator, SyntheticsAvailabilityIndicator, IndicatorType, Indicator, MetricCustomIndicator, TimesliceMetricIndicator, TimesliceMetricBasicMetricWithField, TimesclieMetricPercentileMetric, TimesliceMetricDocCountMetric, HistogramIndicator, KQLCustomIndicator, KqlWithFiltersSchema, QuerySchema, FiltersSchema, GroupingsSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_delete.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_delete.d.ts new file mode 100644 index 0000000000000..f5127aed5e486 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_delete.d.ts @@ -0,0 +1,28 @@ +import * as t from 'io-ts'; +declare const bulkDeleteParamsSchema: t.TypeC<{ + body: t.TypeC<{ + list: t.ArrayC>; + }>; +}>; +declare const bulkDeleteStatusParamsSchema: t.TypeC<{ + path: t.TypeC<{ + taskId: t.StringC; + }>; +}>; +type BulkDeleteInput = t.OutputOf; +type BulkDeleteParams = t.TypeOf; +interface BulkDeleteResponse { + taskId: string; +} +interface BulkDeleteResult { + id: string; + success: boolean; + error?: string; +} +interface BulkDeleteStatusResponse { + isDone: boolean; + results?: BulkDeleteResult[]; + error?: string; +} +export type { BulkDeleteInput, BulkDeleteParams, BulkDeleteResponse, BulkDeleteResult, BulkDeleteStatusResponse, }; +export { bulkDeleteParamsSchema, bulkDeleteStatusParamsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_purge_rollup.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_purge_rollup.d.ts new file mode 100644 index 0000000000000..02a231422da5a --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_purge_rollup.d.ts @@ -0,0 +1,31 @@ +import * as t from 'io-ts'; +import type { DeleteByQueryResponse } from '@elastic/elasticsearch/lib/api/types'; +declare const bulkPurgePolicy: t.UnionC<[t.TypeC<{ + purgeType: t.LiteralC<"fixed_age">; + age: t.Type; +}>, t.TypeC<{ + purgeType: t.LiteralC<"fixed_time">; + timestamp: t.Type; +}>]>; +declare const bulkPurgeRollupSchema: t.TypeC<{ + body: t.IntersectionC<[t.TypeC<{ + list: t.ArrayC; + purgePolicy: t.UnionC<[t.TypeC<{ + purgeType: t.LiteralC<"fixed_age">; + age: t.Type; + }>, t.TypeC<{ + purgeType: t.LiteralC<"fixed_time">; + timestamp: t.Type; + }>]>; + }>, t.PartialC<{ + force: t.BooleanC; + }>]>; +}>; +interface BulkPurgeRollupResponse { + taskId?: DeleteByQueryResponse['task']; +} +type BulkPurgePolicyInput = t.OutputOf; +type BulkPurgeRollupInput = t.OutputOf; +type BulkPurgeRollupParams = t.TypeOf; +export type { BulkPurgeRollupResponse, BulkPurgePolicyInput, BulkPurgeRollupInput, BulkPurgeRollupParams, }; +export { bulkPurgeRollupSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_batch_get.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_batch_get.d.ts new file mode 100644 index 0000000000000..e922de1e83049 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_batch_get.d.ts @@ -0,0 +1,62 @@ +import { z } from '@kbn/zod'; +declare const batchGetCompositeSLOParamsSchema: z.ZodObject<{ + body: z.ZodObject<{ + ids: z.ZodArray; + }, z.core.$strip>; +}, z.core.$strip>; +declare const batchGetCompositeSLOResponseSchema: z.ZodArray; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + tags: z.ZodArray; + enabled: z.ZodBoolean; + createdAt: z.ZodString; + updatedAt: z.ZodString; + createdBy: z.ZodString; + updatedBy: z.ZodString; + version: z.ZodNumber; + summary: z.ZodObject<{ + sliValue: z.ZodNumber; + errorBudget: z.ZodObject<{ + initial: z.ZodNumber; + consumed: z.ZodNumber; + remaining: z.ZodNumber; + isEstimated: z.ZodBoolean; + }, z.core.$strip>; + status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + fiveMinuteBurnRate: z.ZodNumber; + oneHourBurnRate: z.ZodNumber; + oneDayBurnRate: z.ZodNumber; + }, z.core.$strip>; + members: z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + errorBudget: z.ZodOptional>; + fiveMinuteBurnRate: z.ZodOptional; + oneHourBurnRate: z.ZodOptional; + oneDayBurnRate: z.ZodOptional; + instanceId: z.ZodOptional; + }, z.core.$strip>>; +}, z.core.$strip>>; +type BatchGetCompositeSLOParams = z.infer; +type BatchGetCompositeSLOResponse = z.infer; +export { batchGetCompositeSLOParamsSchema, batchGetCompositeSLOResponseSchema }; +export type { BatchGetCompositeSLOParams, BatchGetCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_create.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_create.d.ts new file mode 100644 index 0000000000000..20c60c50e46a8 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_create.d.ts @@ -0,0 +1,75 @@ +import { z } from '@kbn/zod'; +declare const createCompositeSLOBodySchema: z.ZodObject<{ + name: z.ZodString; + description: z.ZodString; + members: z.ZodArray; + }, z.core.$strip>>; + compositeMethod: z.ZodLiteral<"weightedAverage">; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + id: z.ZodOptional; + tags: z.ZodOptional>; + enabled: z.ZodOptional; +}, z.core.$strip>; +declare const createCompositeSLOParamsSchema: z.ZodObject<{ + body: z.ZodObject<{ + name: z.ZodString; + description: z.ZodString; + members: z.ZodArray; + }, z.core.$strip>>; + compositeMethod: z.ZodLiteral<"weightedAverage">; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + id: z.ZodOptional; + tags: z.ZodOptional>; + enabled: z.ZodOptional; + }, z.core.$strip>; +}, z.core.$strip>; +declare const createCompositeSLOResponseSchema: z.ZodObject<{ + id: z.ZodString; + name: z.ZodString; + description: z.ZodString; + compositeMethod: z.ZodLiteral<"weightedAverage">; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + tags: z.ZodArray; + enabled: z.ZodBoolean; + createdAt: z.ZodString; + updatedAt: z.ZodString; + createdBy: z.ZodString; + updatedBy: z.ZodString; + version: z.ZodNumber; + members: z.ZodArray; + }, z.core.$strip>>; +}, z.core.$strip>; +type CreateCompositeSLOInput = z.input; +type CreateCompositeSLOResponse = z.infer; +export { createCompositeSLOParamsSchema, createCompositeSLOResponseSchema }; +export type { CreateCompositeSLOInput, CreateCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_delete.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_delete.d.ts new file mode 100644 index 0000000000000..f3810d868aafa --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_delete.d.ts @@ -0,0 +1,7 @@ +import { z } from '@kbn/zod'; +declare const deleteCompositeSLOParamsSchema: z.ZodObject<{ + path: z.ZodObject<{ + id: z.ZodString; + }, z.core.$strip>; +}, z.core.$strip>; +export { deleteCompositeSLOParamsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_find.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_find.d.ts new file mode 100644 index 0000000000000..89af60654ab4e --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_find.d.ts @@ -0,0 +1,56 @@ +import { z } from '@kbn/zod'; +declare const findCompositeSLOQuerySchema: z.ZodObject<{ + search: z.ZodOptional; + page: z.ZodOptional; + perPage: z.ZodOptional; + sortBy: z.ZodOptional, z.ZodLiteral<"createdAt">, z.ZodLiteral<"updatedAt">]>>; + sortDirection: z.ZodOptional, z.ZodLiteral<"desc">]>>; + tags: z.ZodOptional; + status: z.ZodOptional>, z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>>>>; +}, z.core.$strip>; +declare const findCompositeSLOParamsSchema: z.ZodObject<{ + query: z.ZodOptional; + page: z.ZodOptional; + perPage: z.ZodOptional; + sortBy: z.ZodOptional, z.ZodLiteral<"createdAt">, z.ZodLiteral<"updatedAt">]>>; + sortDirection: z.ZodOptional, z.ZodLiteral<"desc">]>>; + tags: z.ZodOptional; + status: z.ZodOptional>, z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>>>>; + }, z.core.$strip>>; +}, z.core.$strip>; +declare const findCompositeSLOResponseSchema: z.ZodObject<{ + page: z.ZodNumber; + perPage: z.ZodNumber; + total: z.ZodNumber; + results: z.ZodArray; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + tags: z.ZodArray; + enabled: z.ZodBoolean; + createdAt: z.ZodString; + updatedAt: z.ZodString; + createdBy: z.ZodString; + updatedBy: z.ZodString; + version: z.ZodNumber; + members: z.ZodArray; + }, z.core.$strip>>; + }, z.core.$strip>>; +}, z.core.$strip>; +type FindCompositeSLOParams = z.infer; +type FindCompositeSLOResponse = z.infer; +export { findCompositeSLOParamsSchema, findCompositeSLOResponseSchema }; +export type { FindCompositeSLOParams, FindCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_get.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_get.d.ts new file mode 100644 index 0000000000000..1f5c80d9252c5 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_get.d.ts @@ -0,0 +1,61 @@ +import { z } from '@kbn/zod'; +declare const getCompositeSLOParamsSchema: z.ZodObject<{ + path: z.ZodObject<{ + id: z.ZodString; + }, z.core.$strip>; +}, z.core.$strip>; +declare const getCompositeSLOResponseSchema: z.ZodObject<{ + id: z.ZodString; + name: z.ZodString; + description: z.ZodString; + compositeMethod: z.ZodLiteral<"weightedAverage">; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + tags: z.ZodArray; + enabled: z.ZodBoolean; + createdAt: z.ZodString; + updatedAt: z.ZodString; + createdBy: z.ZodString; + updatedBy: z.ZodString; + version: z.ZodNumber; + summary: z.ZodObject<{ + sliValue: z.ZodNumber; + errorBudget: z.ZodObject<{ + initial: z.ZodNumber; + consumed: z.ZodNumber; + remaining: z.ZodNumber; + isEstimated: z.ZodBoolean; + }, z.core.$strip>; + status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + fiveMinuteBurnRate: z.ZodNumber; + oneHourBurnRate: z.ZodNumber; + oneDayBurnRate: z.ZodNumber; + }, z.core.$strip>; + members: z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + errorBudget: z.ZodOptional>; + fiveMinuteBurnRate: z.ZodOptional; + oneHourBurnRate: z.ZodOptional; + oneDayBurnRate: z.ZodOptional; + instanceId: z.ZodOptional; + }, z.core.$strip>>; +}, z.core.$strip>; +type GetCompositeSLOResponse = z.infer; +export { getCompositeSLOParamsSchema, getCompositeSLOResponseSchema }; +export type { GetCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_historical_summary.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_historical_summary.d.ts new file mode 100644 index 0000000000000..b72a045b1cf7a --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_historical_summary.d.ts @@ -0,0 +1,24 @@ +import { z } from '@kbn/zod'; +declare const fetchCompositeHistoricalSummaryParamsSchema: z.ZodObject<{ + body: z.ZodObject<{ + list: z.ZodArray; + }, z.core.$strip>; +}, z.core.$strip>; +declare const fetchCompositeHistoricalSummaryResponseSchema: z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + sliValue: z.ZodNumber; + errorBudget: z.ZodObject<{ + initial: z.ZodNumber; + consumed: z.ZodNumber; + remaining: z.ZodNumber; + isEstimated: z.ZodBoolean; + }, z.core.$strip>; + }, z.core.$strip>>; +}, z.core.$strip>>; +type FetchCompositeHistoricalSummaryParams = z.infer; +type FetchCompositeHistoricalSummaryResponse = z.infer; +export { fetchCompositeHistoricalSummaryParamsSchema, fetchCompositeHistoricalSummaryResponseSchema, }; +export type { FetchCompositeHistoricalSummaryParams, FetchCompositeHistoricalSummaryResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_summary_refresh.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_summary_refresh.d.ts new file mode 100644 index 0000000000000..8bd03f003d520 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_summary_refresh.d.ts @@ -0,0 +1,10 @@ +import { z } from '@kbn/zod'; +declare const postCompositeSloSummaryRefreshParamsSchema: z.ZodObject<{}, z.core.$strip>; +export type CompositeSloSummaryRefreshSkippedReason = 'task_disabled' | 'cooldown' | 'task_not_scheduled' | 'already_running' | 'run_soon_failed'; +export type PostCompositeSloSummaryRefreshResponse = { + readonly triggered: true; +} | { + readonly triggered: false; + readonly reason: CompositeSloSummaryRefreshSkippedReason; +}; +export { postCompositeSloSummaryRefreshParamsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_update.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_update.d.ts new file mode 100644 index 0000000000000..f117d5387867f --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_update.d.ts @@ -0,0 +1,56 @@ +import { z } from '@kbn/zod'; +declare const updateCompositeSLOParamsSchema: z.ZodObject<{ + path: z.ZodObject<{ + id: z.ZodString; + }, z.core.$strip>; + body: z.ZodObject<{ + name: z.ZodOptional; + description: z.ZodOptional; + members: z.ZodOptional; + }, z.core.$strip>>>; + compositeMethod: z.ZodOptional>; + timeWindow: z.ZodOptional; + }, z.core.$strip>>; + budgetingMethod: z.ZodOptional>; + objective: z.ZodOptional>; + tags: z.ZodOptional>; + enabled: z.ZodOptional; + }, z.core.$strip>; +}, z.core.$strip>; +declare const updateCompositeSLOResponseSchema: z.ZodObject<{ + id: z.ZodString; + name: z.ZodString; + description: z.ZodString; + compositeMethod: z.ZodLiteral<"weightedAverage">; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + tags: z.ZodArray; + enabled: z.ZodBoolean; + createdAt: z.ZodString; + updatedAt: z.ZodString; + createdBy: z.ZodString; + updatedBy: z.ZodString; + version: z.ZodNumber; + members: z.ZodArray; + }, z.core.$strip>>; +}, z.core.$strip>; +type UpdateCompositeSLOInput = z.input; +type UpdateCompositeSLOResponse = z.infer; +export { updateCompositeSLOParamsSchema, updateCompositeSLOResponseSchema }; +export type { UpdateCompositeSLOInput, UpdateCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.d.ts new file mode 100644 index 0000000000000..0f6af8b9c921b --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.d.ts @@ -0,0 +1,642 @@ +import * as t from 'io-ts'; +declare const createSLOParamsSchema: t.TypeC<{ + body: t.IntersectionC<[t.TypeC<{ + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + }>, t.PartialC<{ + id: t.Type; + settings: t.PartialC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>; + tags: t.ArrayC; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + revision: t.NumberC; + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; + }>]>; +}>; +declare const createSLOResponseSchema: t.TypeC<{ + id: t.Type; +}>; +type CreateSLOInput = t.OutputOf; +type CreateSLOParams = t.TypeOf; +type CreateSLOResponse = t.TypeOf; +export { createSLOParamsSchema, createSLOResponseSchema }; +export type { CreateSLOInput, CreateSLOParams, CreateSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.d.ts new file mode 100644 index 0000000000000..23db51aae3c4c --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.d.ts @@ -0,0 +1,7 @@ +import * as t from 'io-ts'; +declare const deleteSLOParamsSchema: t.TypeC<{ + path: t.TypeC<{ + id: t.Type; + }>; +}>; +export { deleteSLOParamsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.d.ts new file mode 100644 index 0000000000000..be84a4220253a --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.d.ts @@ -0,0 +1,15 @@ +import * as t from 'io-ts'; +declare const deleteSLOInstancesParamsSchema: t.TypeC<{ + body: t.TypeC<{ + list: t.ArrayC; + instanceId: t.StringC; + }>, t.PartialC<{ + excludeRollup: t.BooleanC; + }>]>>; + }>; +}>; +type DeleteSLOInstancesInput = t.OutputOf; +type DeleteSLOInstancesParams = t.TypeOf; +export { deleteSLOInstancesParamsSchema }; +export type { DeleteSLOInstancesInput, DeleteSLOInstancesParams }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.d.ts new file mode 100644 index 0000000000000..b2e72e5bea73b --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.d.ts @@ -0,0 +1,62 @@ +import * as t from 'io-ts'; +declare const fetchHistoricalSummaryParamsSchema: t.TypeC<{ + body: t.TypeC<{ + list: t.ArrayC; + instanceId: t.StringC; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + revision: t.NumberC; + }>, t.PartialC<{ + remoteName: t.StringC; + range: t.TypeC<{ + from: t.Type; + to: t.Type; + }>; + }>]>>; + }>; +}>; +declare const historicalSummarySchema: t.TypeC<{ + date: t.Type; + status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; + sliValue: t.NumberC; + errorBudget: t.TypeC<{ + initial: t.NumberC; + consumed: t.NumberC; + remaining: t.NumberC; + isEstimated: t.BooleanC; + }>; +}>; +declare const fetchHistoricalSummaryResponseSchema: t.ArrayC; + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + data: t.ArrayC; + status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; + sliValue: t.NumberC; + errorBudget: t.TypeC<{ + initial: t.NumberC; + consumed: t.NumberC; + remaining: t.NumberC; + isEstimated: t.BooleanC; + }>; + }>>; +}>>; +type FetchHistoricalSummaryParams = t.TypeOf; +type FetchHistoricalSummaryResponse = t.OutputOf; +type HistoricalSummaryResponse = t.OutputOf; +export { fetchHistoricalSummaryParamsSchema, fetchHistoricalSummaryResponseSchema, historicalSummarySchema, }; +export type { FetchHistoricalSummaryParams, FetchHistoricalSummaryResponse, HistoricalSummaryResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.d.ts new file mode 100644 index 0000000000000..3a35b6dd8feac --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.d.ts @@ -0,0 +1,695 @@ +import * as t from 'io-ts'; +declare const findSLOParamsSchema: t.PartialC<{ + query: t.PartialC<{ + filters: t.StringC; + kqlQuery: t.StringC; + page: t.StringC; + perPage: t.StringC; + sortBy: t.UnionC<[t.LiteralC<"error_budget_consumed">, t.LiteralC<"error_budget_remaining">, t.LiteralC<"sli_value">, t.LiteralC<"status">, t.LiteralC<"burn_rate_5m">, t.LiteralC<"burn_rate_1h">, t.LiteralC<"burn_rate_1d">]>; + sortDirection: t.UnionC<[t.LiteralC<"asc">, t.LiteralC<"desc">]>; + hideStale: t.Type; + searchAfter: t.Type<(string | number)[], string, unknown>; + size: t.StringC; + }>; +}>; +declare const findSLOResponseSchema: t.IntersectionC<[t.TypeC<{ + page: t.NumberC; + perPage: t.NumberC; + total: t.NumberC; + results: t.ArrayC; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; + }>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; + }>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; + }>]>, t.TypeC<{ + summary: t.IntersectionC<[t.TypeC<{ + status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; + sliValue: t.NumberC; + errorBudget: t.TypeC<{ + initial: t.NumberC; + consumed: t.NumberC; + remaining: t.NumberC; + isEstimated: t.BooleanC; + }>; + fiveMinuteBurnRate: t.NumberC; + oneHourBurnRate: t.NumberC; + oneDayBurnRate: t.NumberC; + }>, t.PartialC<{ + summaryUpdatedAt: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + groupings: t.RecordC>; + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>, t.PartialC<{ + meta: t.PartialC<{ + synthetics: t.TypeC<{ + monitorId: t.StringC; + locationId: t.StringC; + configId: t.StringC; + }>; + }>; + remote: t.TypeC<{ + remoteName: t.StringC; + kibanaUrl: t.StringC; + }>; + }>]>>; +}>, t.PartialC<{ + searchAfter: t.ArrayC>; + size: t.NumberC; +}>]>; +type FindSLOParams = t.TypeOf; +type FindSLOResponse = t.OutputOf; +export { findSLOParamsSchema, findSLOResponseSchema }; +export type { FindSLOParams, FindSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.d.ts new file mode 100644 index 0000000000000..ac3676e38ac71 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.d.ts @@ -0,0 +1,1339 @@ +import * as t from 'io-ts'; +declare const findSloDefinitionsParamsSchema: t.PartialC<{ + query: t.PartialC<{ + search: t.StringC; + includeOutdatedOnly: t.Type; + includeHealth: t.Type; + tags: t.StringC; + page: t.StringC; + perPage: t.StringC; + }>; +}>; +declare const sloDefinitionResponseSchema: t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{ + id: t.Type; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; +}>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; +}>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; +}>]>, t.PartialC<{ + health: t.TypeC<{ + isProblematic: t.BooleanC; + rollup: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; + }>, t.PartialC<{ + stateMatches: t.BooleanC; + }>]>; + summary: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; + }>, t.PartialC<{ + stateMatches: t.BooleanC; + }>]>; + }>; +}>]>; +declare const findSloDefinitionsResponseSchema: t.TypeC<{ + page: t.NumberC; + perPage: t.NumberC; + total: t.NumberC; + results: t.ArrayC; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; + }>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; + }>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; + }>]>, t.PartialC<{ + health: t.TypeC<{ + isProblematic: t.BooleanC; + rollup: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; + }>, t.PartialC<{ + stateMatches: t.BooleanC; + }>]>; + summary: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; + }>, t.PartialC<{ + stateMatches: t.BooleanC; + }>]>; + }>; + }>]>>; +}>; +type FindSLODefinitionsParams = t.TypeOf; +type FindSLODefinitionsResponse = t.OutputOf; +type SLODefinitionResponse = t.OutputOf; +export { findSloDefinitionsParamsSchema, findSloDefinitionsResponseSchema, sloDefinitionResponseSchema, }; +export type { FindSLODefinitionsParams, FindSLODefinitionsResponse, SLODefinitionResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.d.ts new file mode 100644 index 0000000000000..d3f5a3cfa5584 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.d.ts @@ -0,0 +1,64 @@ +import * as t from 'io-ts'; +declare const findSLOGroupsParamsSchema: t.PartialC<{ + query: t.PartialC<{ + page: t.StringC; + perPage: t.StringC; + groupBy: t.UnionC<[t.LiteralC<"ungrouped">, t.LiteralC<"slo.tags">, t.LiteralC<"status">, t.LiteralC<"slo.indicator.type">, t.LiteralC<"slo.instanceId">, t.LiteralC<"_index">, t.LiteralC<"slo.id">]>; + groupsFilter: t.UnionC<[t.ArrayC, t.StringC]>; + kqlQuery: t.StringC; + filters: t.StringC; + }>; +}>; +declare const sloGroupWithSummaryResponseSchema: t.TypeC<{ + group: t.StringC; + groupBy: t.UnionC<[t.LiteralC<"ungrouped">, t.LiteralC<"slo.tags">, t.LiteralC<"status">, t.LiteralC<"slo.indicator.type">, t.LiteralC<"slo.instanceId">, t.LiteralC<"_index">, t.LiteralC<"slo.id">]>; + summary: t.TypeC<{ + total: t.NumberC; + worst: t.TypeC<{ + sliValue: t.NumberC; + status: t.StringC; + slo: t.IntersectionC<[t.TypeC<{ + id: t.StringC; + instanceId: t.StringC; + name: t.StringC; + }>, t.PartialC<{ + groupings: t.RecordC; + }>]>; + }>; + violated: t.NumberC; + healthy: t.NumberC; + degrading: t.NumberC; + noData: t.NumberC; + }>; +}>; +declare const findSLOGroupsResponseSchema: t.TypeC<{ + page: t.NumberC; + perPage: t.NumberC; + total: t.NumberC; + results: t.ArrayC, t.LiteralC<"slo.tags">, t.LiteralC<"status">, t.LiteralC<"slo.indicator.type">, t.LiteralC<"slo.instanceId">, t.LiteralC<"_index">, t.LiteralC<"slo.id">]>; + summary: t.TypeC<{ + total: t.NumberC; + worst: t.TypeC<{ + sliValue: t.NumberC; + status: t.StringC; + slo: t.IntersectionC<[t.TypeC<{ + id: t.StringC; + instanceId: t.StringC; + name: t.StringC; + }>, t.PartialC<{ + groupings: t.RecordC; + }>]>; + }>; + violated: t.NumberC; + healthy: t.NumberC; + degrading: t.NumberC; + noData: t.NumberC; + }>; + }>>; +}>; +type FindSLOGroupsParams = t.TypeOf; +type FindSLOGroupsResponse = t.OutputOf; +export { findSLOGroupsParamsSchema, findSLOGroupsResponseSchema, sloGroupWithSummaryResponseSchema, }; +export type { FindSLOGroupsParams, FindSLOGroupsResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_instances.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_instances.d.ts new file mode 100644 index 0000000000000..790c4cd9f94f2 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_instances.d.ts @@ -0,0 +1,30 @@ +import * as t from 'io-ts'; +declare const findSLOInstancesParamsSchema: t.IntersectionC<[t.TypeC<{ + path: t.TypeC<{ + id: t.StringC; + }>; +}>, t.PartialC<{ + query: t.PartialC<{ + search: t.StringC; + size: t.Type; + searchAfter: t.StringC; + remoteName: t.StringC; + }>; +}>]>; +interface FindSLOInstancesResponse { + results: Array<{ + instanceId: string; + groupings: Record; + }>; + searchAfter?: string; +} +interface FindSLOInstancesParams { + sloId: string; + spaceId: string; + search?: string; + size?: number; + searchAfter?: string; + remoteName?: string; +} +export { findSLOInstancesParamsSchema }; +export type { FindSLOInstancesParams, FindSLOInstancesResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.d.ts new file mode 100644 index 0000000000000..3b302123b8838 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.d.ts @@ -0,0 +1,690 @@ +import * as t from 'io-ts'; +declare const getSLOQuerySchema: t.PartialC<{ + query: t.PartialC<{ + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + remoteName: t.StringC; + }>; +}>; +declare const getSLOParamsSchema: t.IntersectionC<[t.TypeC<{ + path: t.TypeC<{ + id: t.Type; + }>; +}>, t.PartialC<{ + query: t.PartialC<{ + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + remoteName: t.StringC; + }>; +}>]>; +declare const getSLOResponseSchema: t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{ + id: t.Type; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; +}>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; +}>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; +}>]>, t.TypeC<{ + summary: t.IntersectionC<[t.TypeC<{ + status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; + sliValue: t.NumberC; + errorBudget: t.TypeC<{ + initial: t.NumberC; + consumed: t.NumberC; + remaining: t.NumberC; + isEstimated: t.BooleanC; + }>; + fiveMinuteBurnRate: t.NumberC; + oneHourBurnRate: t.NumberC; + oneDayBurnRate: t.NumberC; + }>, t.PartialC<{ + summaryUpdatedAt: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + groupings: t.RecordC>; + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; +}>, t.PartialC<{ + meta: t.PartialC<{ + synthetics: t.TypeC<{ + monitorId: t.StringC; + locationId: t.StringC; + configId: t.StringC; + }>; + }>; + remote: t.TypeC<{ + remoteName: t.StringC; + kibanaUrl: t.StringC; + }>; +}>]>; +type GetSLOParams = t.TypeOf; +type GetSLOResponse = t.OutputOf; +export { getSLOParamsSchema, getSLOResponseSchema }; +export type { GetSLOParams, GetSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.d.ts new file mode 100644 index 0000000000000..12767d5cd237b --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.d.ts @@ -0,0 +1,25 @@ +import * as t from 'io-ts'; +declare const getSLOBurnRatesResponseSchema: t.TypeC<{ + burnRates: t.ArrayC>; +}>; +declare const getSLOBurnRatesParamsSchema: t.TypeC<{ + path: t.TypeC<{ + id: t.StringC; + }>; + body: t.IntersectionC<[t.TypeC<{ + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + windows: t.ArrayC; + }>>; + }>, t.PartialC<{ + remoteName: t.StringC; + }>]>; +}>; +type GetSLOBurnRatesResponse = t.OutputOf; +export { getSLOBurnRatesParamsSchema, getSLOBurnRatesResponseSchema }; +export type { GetSLOBurnRatesResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_grouped_stats.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_grouped_stats.d.ts new file mode 100644 index 0000000000000..35590a844d0c9 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_grouped_stats.d.ts @@ -0,0 +1,46 @@ +import * as t from 'io-ts'; +declare const getSLOGroupedStatsParamsSchema: t.TypeC<{ + body: t.IntersectionC<[t.TypeC<{ + /** + * SLO type. + */ + type: t.LiteralC<"apm">; + }>, t.PartialC<{ + /** + * Number of buckets to return. + * If not provided, the query will use elasticsearch default value of 10. + */ + size: t.NumberC; + /** + * List of service names to filter by. + */ + serviceNames: t.ArrayC; + /** + * Environment to filter by. + */ + environment: t.StringC; + /** + * KQL query to filter SLOs. + */ + kqlQuery: t.StringC; + /** + * List of statuses to filter by (e.g. ['VIOLATED', 'DEGRADING']). + */ + statusFilters: t.ArrayC; + }>]>; +}>; +interface GroupedStatsResult { + entity: string; + summary: { + violated: number; + degrading: number; + healthy: number; + noData: number; + }; +} +interface GetSLOGroupedStatsResponse { + results: Array; +} +type GetSLOGroupedStatsParams = t.TypeOf['body']; +export { getSLOGroupedStatsParamsSchema }; +export type { GroupedStatsResult, GetSLOGroupedStatsParams, GetSLOGroupedStatsResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.d.ts new file mode 100644 index 0000000000000..e8470e2e71d23 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.d.ts @@ -0,0 +1,653 @@ +import * as t from 'io-ts'; +declare const getPreviewDataParamsSchema: t.TypeC<{ + body: t.IntersectionC<[t.TypeC<{ + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + range: t.TypeC<{ + from: t.Type; + to: t.Type; + }>; + }>, t.PartialC<{ + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + remoteName: t.StringC; + groupings: t.RecordC>; + groupBy: t.ArrayC; + }>]>; +}>; +declare const previewDataResponseSchema: t.IntersectionC<[t.TypeC<{ + date: t.Type; + sliValue: t.UnionC<[t.NumberC, t.NullC]>; +}>, t.PartialC<{ + events: t.TypeC<{ + good: t.NumberC; + bad: t.NumberC; + total: t.NumberC; + }>; +}>]>; +declare const getPreviewDataResponseSchema: t.IntersectionC<[t.TypeC<{ + results: t.ArrayC; + sliValue: t.UnionC<[t.NumberC, t.NullC]>; + }>, t.PartialC<{ + events: t.TypeC<{ + good: t.NumberC; + bad: t.NumberC; + total: t.NumberC; + }>; + }>]>>; +}>, t.PartialC<{ + groups: t.RecordC; + sliValue: t.UnionC<[t.NumberC, t.NullC]>; + }>, t.PartialC<{ + events: t.TypeC<{ + good: t.NumberC; + bad: t.NumberC; + total: t.NumberC; + }>; + }>]>>>; +}>]>; +type GetPreviewDataParams = t.TypeOf; +type GetPreviewDataResponse = t.OutputOf; +export { getPreviewDataParamsSchema, getPreviewDataResponseSchema, previewDataResponseSchema }; +export type { GetPreviewDataParams, GetPreviewDataResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.d.ts new file mode 100644 index 0000000000000..7e88140419c59 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.d.ts @@ -0,0 +1,38 @@ +import * as t from 'io-ts'; +declare const fetchSLOHealthResponseSchema: t.ArrayC; + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + revision: t.NumberC; + name: t.StringC; + health: t.TypeC<{ + isProblematic: t.BooleanC; + rollup: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; + }>, t.PartialC<{ + stateMatches: t.BooleanC; + }>]>; + summary: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; + }>, t.PartialC<{ + stateMatches: t.BooleanC; + }>]>; + }>; +}>>; +declare const fetchSLOHealthParamsSchema: t.TypeC<{ + body: t.TypeC<{ + list: t.ArrayC; + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + }>; +}>; +type FetchSLOHealthResponse = t.OutputOf; +type FetchSLOHealthParams = t.TypeOf; +export { fetchSLOHealthParamsSchema, fetchSLOHealthResponseSchema }; +export type { FetchSLOHealthParams, FetchSLOHealthResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_stats_overview.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_stats_overview.d.ts new file mode 100644 index 0000000000000..9523ce11ae1a7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_stats_overview.d.ts @@ -0,0 +1,21 @@ +import * as t from 'io-ts'; +declare const getSLOStatsOverviewParamsSchema: t.PartialC<{ + query: t.PartialC<{ + kqlQuery: t.StringC; + filters: t.StringC; + }>; +}>; +declare const getSLOStatsOverviewResponseSchema: t.TypeC<{ + violated: t.NumberC; + degrading: t.NumberC; + stale: t.NumberC; + healthy: t.NumberC; + noData: t.NumberC; + burnRateRules: t.NumberC; + burnRateActiveAlerts: t.NumberC; + burnRateRecoveredAlerts: t.NumberC; +}>; +type GetSLOStatsOverviewParams = t.TypeOf; +type GetSLOStatsOverviewResponse = t.OutputOf; +export { getSLOStatsOverviewParamsSchema, getSLOStatsOverviewResponseSchema }; +export type { GetSLOStatsOverviewParams, GetSLOStatsOverviewResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.d.ts new file mode 100644 index 0000000000000..be799bdd28102 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.d.ts @@ -0,0 +1,11 @@ +import * as t from 'io-ts'; +declare const getSLOSuggestionsResponseSchema: t.TypeC<{ + tags: t.ArrayC>; +}>; +type GetSLOSuggestionsResponse = t.OutputOf; +export { getSLOSuggestionsResponseSchema }; +export type { GetSLOSuggestionsResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/health_scan.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/health_scan.d.ts new file mode 100644 index 0000000000000..9570bb3fab406 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/health_scan.d.ts @@ -0,0 +1,80 @@ +import * as t from 'io-ts'; +declare const postHealthScanParamsSchema: t.PartialC<{ + body: t.PartialC<{ + force: t.Type; + }>; +}>; +interface PostHealthScanResponse { + scanId: string; + scheduledAt: string; + status: 'scheduled' | 'pending' | 'completed'; + processed?: number; + problematic?: number; + error?: string; +} +declare const getHealthScanParamsSchema: t.IntersectionC<[t.TypeC<{ + path: t.TypeC<{ + scanId: t.StringC; + }>; +}>, t.PartialC<{ + query: t.PartialC<{ + size: t.Type; + searchAfter: t.StringC; + problematic: t.Type; + allSpaces: t.Type; + }>; +}>]>; +declare const listHealthScanParamsSchema: t.PartialC<{ + query: t.PartialC<{ + size: t.Type; + }>; +}>; +interface HealthScanSummary { + scanId: string; + latestTimestamp: string; + total: number; + problematic: number; + status: 'pending' | 'completed'; +} +interface ListHealthScanResponse { + scans: HealthScanSummary[]; +} +declare const healthScanResultResponseSchema: t.TypeC<{ + '@timestamp': t.BrandC; + scanId: t.StringC; + spaceId: t.StringC; + slo: t.TypeC<{ + id: t.StringC; + name: t.StringC; + revision: t.NumberC; + enabled: t.BooleanC; + }>; + health: t.TypeC<{ + isProblematic: t.BooleanC; + rollup: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; + }>, t.PartialC<{ + stateMatches: t.BooleanC; + }>]>; + summary: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; + }>, t.PartialC<{ + stateMatches: t.BooleanC; + }>]>; + }>; +}>; +type HealthScanResultResponse = t.OutputOf; +interface GetHealthScanResultsResponse { + results: HealthScanResultResponse[]; + scan: HealthScanSummary; + total: number; + searchAfter?: Array; +} +export { getHealthScanParamsSchema, listHealthScanParamsSchema, postHealthScanParamsSchema }; +export type { GetHealthScanResultsResponse, HealthScanResultResponse, HealthScanSummary, ListHealthScanResponse, PostHealthScanResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.d.ts new file mode 100644 index 0000000000000..1f0e96adfc3be --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.d.ts @@ -0,0 +1,34 @@ +export * from './create'; +export * from './update'; +export * from './delete'; +export * from './find'; +export * from './find_group'; +export * from './find_definition'; +export * from './get'; +export * from './get_burn_rates'; +export * from './bulk_purge_rollup'; +export * from './purge_instances'; +export * from './get_slo_stats_overview'; +export * from './get_preview_data'; +export * from './reset'; +export * from './manage'; +export * from './delete_instance'; +export * from './fetch_historical_summary'; +export * from './put_settings'; +export * from './get_suggestions'; +export * from './get_slo_health'; +export * from './bulk_delete'; +export * from './find_instances'; +export * from './repair'; +export * from './slo_templates'; +export * from './health_scan'; +export * from './search_slo_definitions'; +export * from './get_grouped_stats'; +export * from './composite_slo/composite_slo_create'; +export * from './composite_slo/composite_slo_get'; +export * from './composite_slo/composite_slo_batch_get'; +export * from './composite_slo/composite_slo_find'; +export * from './composite_slo/composite_slo_update'; +export * from './composite_slo/composite_slo_delete'; +export * from './composite_slo/composite_slo_historical_summary'; +export * from './composite_slo/composite_slo_summary_refresh'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.d.ts new file mode 100644 index 0000000000000..a458c29a0612d --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.d.ts @@ -0,0 +1,9 @@ +import * as t from 'io-ts'; +declare const manageSLOParamsSchema: t.TypeC<{ + path: t.TypeC<{ + id: t.Type; + }>; +}>; +type ManageSLOParams = t.TypeOf; +export { manageSLOParamsSchema }; +export type { ManageSLOParams }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/purge_instances.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/purge_instances.d.ts new file mode 100644 index 0000000000000..6b89b074af21d --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/purge_instances.d.ts @@ -0,0 +1,31 @@ +import * as t from 'io-ts'; +declare const purgeInstancesParamsSchema: t.TypeC<{ + body: t.PartialC<{ + list: t.ArrayC>; + staleDuration: t.Type; + force: t.BooleanC; + }>; +}>; +interface PurgeInstancesResponse { + taskId?: string; +} +type PurgeInstancesInput = t.OutputOf; +type PurgeInstancesParams = t.TypeOf; +declare const purgeInstancesStatusParamsSchema: t.TypeC<{ + path: t.TypeC<{ + taskId: t.StringC; + }>; +}>; +interface PurgeInstancesStatusResponse { + completed: boolean; + error?: string; + status?: { + total: number; + deleted: number; + batches: number; + start_time_in_millis: number; + running_time_in_nanos: number; + }; +} +export { purgeInstancesParamsSchema, purgeInstancesStatusParamsSchema }; +export type { PurgeInstancesInput, PurgeInstancesParams, PurgeInstancesResponse, PurgeInstancesStatusResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.d.ts new file mode 100644 index 0000000000000..329d92e59b18e --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.d.ts @@ -0,0 +1,28 @@ +import * as t from 'io-ts'; +import { sloSettingsSchema } from '../../schema/settings'; +declare const putSLOSettingsParamsSchema: t.TypeC<{ + body: t.TypeC<{ + useAllRemoteClusters: t.BooleanC; + selectedRemoteClusters: t.ArrayC; + staleThresholdInHours: t.NumberC; + staleInstancesCleanupEnabled: t.BooleanC; + }>; +}>; +declare const putSLOServerlessSettingsParamsSchema: t.TypeC<{ + body: t.TypeC<{ + staleThresholdInHours: t.NumberC; + staleInstancesCleanupEnabled: t.BooleanC; + }>; +}>; +declare const putSLOSettingsResponseSchema: t.TypeC<{ + useAllRemoteClusters: t.BooleanC; + selectedRemoteClusters: t.ArrayC; + staleThresholdInHours: t.NumberC; + staleInstancesCleanupEnabled: t.BooleanC; +}>; +type PutSLOSettingsParams = t.TypeOf; +type PutServerlessSLOSettingsParams = t.TypeOf; +type PutSLOSettingsResponse = t.OutputOf; +type GetSLOSettingsResponse = t.OutputOf; +export { putSLOServerlessSettingsParamsSchema, putSLOSettingsParamsSchema, putSLOSettingsResponseSchema, }; +export type { GetSLOSettingsResponse, PutServerlessSLOSettingsParams, PutSLOSettingsParams, PutSLOSettingsResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/repair.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/repair.d.ts new file mode 100644 index 0000000000000..aeba9e45a7b8a --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/repair.d.ts @@ -0,0 +1,22 @@ +import * as t from 'io-ts'; +declare const repairParamsSchema: t.TypeC<{ + body: t.TypeC<{ + list: t.ArrayC>; + }>; +}>; +type RepairParams = t.TypeOf; +interface RepairAction { + type: 'recreate-transform' | 'start-transform' | 'stop-transform' | 'noop'; + transformType?: 'rollup' | 'summary'; +} +interface RepairActionResult { + action: RepairAction; + status: 'success' | 'failure'; + error?: unknown; +} +interface RepairActionsGroupResult { + id: string; + results: RepairActionResult[]; +} +export { repairParamsSchema }; +export type { RepairParams, RepairAction, RepairActionResult, RepairActionsGroupResult }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.d.ts new file mode 100644 index 0000000000000..13b093595b903 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.d.ts @@ -0,0 +1,649 @@ +import * as t from 'io-ts'; +declare const resetSLOParamsSchema: t.TypeC<{ + path: t.TypeC<{ + id: t.Type; + }>; +}>; +declare const resetSLOResponseSchema: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ + id: t.Type; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; +}>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; +}>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; +}>]>; +type ResetSLOParams = t.TypeOf; +type ResetSLOResponse = t.OutputOf; +export { resetSLOParamsSchema, resetSLOResponseSchema }; +export type { ResetSLOParams, ResetSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/search_slo_definitions.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/search_slo_definitions.d.ts new file mode 100644 index 0000000000000..6a529b2a7b5e4 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/search_slo_definitions.d.ts @@ -0,0 +1,25 @@ +import * as t from 'io-ts'; +declare const searchSLODefinitionsParamsSchema: t.PartialC<{ + query: t.PartialC<{ + search: t.StringC; + size: t.Type; + searchAfter: t.StringC; + remoteName: t.StringC; + }>; +}>; +type SearchSLODefinitionsParams = t.TypeOf; +interface SearchSLODefinitionItem { + id: string; + name: string; + groupBy: string[]; + remote?: { + remoteName: string; + kibanaUrl: string; + }; +} +interface SearchSLODefinitionResponse { + results: SearchSLODefinitionItem[]; + searchAfter?: string; +} +export { searchSLODefinitionsParamsSchema }; +export type { SearchSLODefinitionsParams, SearchSLODefinitionResponse, SearchSLODefinitionItem }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/slo_templates.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/slo_templates.d.ts new file mode 100644 index 0000000000000..e070eb3404adc --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/slo_templates.d.ts @@ -0,0 +1,28 @@ +import * as t from 'io-ts'; +import type { sloTemplateSchema } from '../../schema'; +declare const getSLOTemplateParamsSchema: t.TypeC<{ + path: t.TypeC<{ + templateId: t.StringC; + }>; +}>; +declare const findSLOTemplatesParamsSchema: t.TypeC<{ + query: t.UnionC<[t.UndefinedC, t.PartialC<{ + search: t.StringC; + tags: t.Type; + page: t.Type; + perPage: t.Type; + }>]>; +}>; +type SLOTemplateResponse = t.OutputOf; +type GetSLOTemplateResponse = SLOTemplateResponse; +interface FindSLOTemplatesResponse { + total: number; + page: number; + perPage: number; + results: SLOTemplateResponse[]; +} +interface FindSLOTemplateTagsResponse { + tags: string[]; +} +export { findSLOTemplatesParamsSchema, getSLOTemplateParamsSchema }; +export type { SLOTemplateResponse, GetSLOTemplateResponse, FindSLOTemplatesResponse, FindSLOTemplateTagsResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.d.ts new file mode 100644 index 0000000000000..cc5894a68bf31 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.d.ts @@ -0,0 +1,1278 @@ +import * as t from 'io-ts'; +declare const updateSLOParamsSchema: t.TypeC<{ + path: t.TypeC<{ + id: t.Type; + }>; + body: t.PartialC<{ + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.PartialC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>; + tags: t.ArrayC; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; + }>; +}>; +declare const updateSLOResponseSchema: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ + id: t.Type; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; +}>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; +}>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; +}>]>; +type UpdateSLOInput = t.OutputOf; +type UpdateSLOParams = t.TypeOf; +type UpdateSLOResponse = t.OutputOf; +export { updateSLOParamsSchema, updateSLOResponseSchema }; +export type { UpdateSLOInput, UpdateSLOParams, UpdateSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.d.ts new file mode 100644 index 0000000000000..99da3c7e53698 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.d.ts @@ -0,0 +1,674 @@ +import * as t from 'io-ts'; +import type { SLODefinitionResponse } from './routes/find_definition'; +declare const sloWithDataResponseSchema: t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{ + id: t.Type; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; +}>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; +}>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; +}>]>, t.TypeC<{ + summary: t.IntersectionC<[t.TypeC<{ + status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; + sliValue: t.NumberC; + errorBudget: t.TypeC<{ + initial: t.NumberC; + consumed: t.NumberC; + remaining: t.NumberC; + isEstimated: t.BooleanC; + }>; + fiveMinuteBurnRate: t.NumberC; + oneHourBurnRate: t.NumberC; + oneDayBurnRate: t.NumberC; + }>, t.PartialC<{ + summaryUpdatedAt: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + groupings: t.RecordC>; + instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; +}>, t.PartialC<{ + meta: t.PartialC<{ + synthetics: t.TypeC<{ + monitorId: t.StringC; + locationId: t.StringC; + configId: t.StringC; + }>; + }>; + remote: t.TypeC<{ + remoteName: t.StringC; + kibanaUrl: t.StringC; + }>; +}>]>; +type SLOWithSummaryResponse = t.OutputOf; +export { sloWithDataResponseSchema }; +export type { SLODefinitionResponse, SLOWithSummaryResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.d.ts new file mode 100644 index 0000000000000..f27fcfedb9789 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.d.ts @@ -0,0 +1,69 @@ +import * as t from 'io-ts'; +import { ALL_VALUE } from '../constants'; +declare const allOrAnyString: t.UnionC<[t.LiteralC<"*">, t.StringC]>; +declare const allOrAnyStringOrArray: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; +declare const dateType: t.Type; +declare const errorBudgetSchema: t.TypeC<{ + initial: t.NumberC; + consumed: t.NumberC; + remaining: t.NumberC; + isEstimated: t.BooleanC; +}>; +declare const SLO_STATUS: { + readonly NO_DATA: "NO_DATA"; + readonly HEALTHY: "HEALTHY"; + readonly DEGRADING: "DEGRADING"; + readonly VIOLATED: "VIOLATED"; +}; +declare const statusSchema: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; +declare const summarySchema: t.IntersectionC<[t.TypeC<{ + status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; + sliValue: t.NumberC; + errorBudget: t.TypeC<{ + initial: t.NumberC; + consumed: t.NumberC; + remaining: t.NumberC; + isEstimated: t.BooleanC; + }>; + fiveMinuteBurnRate: t.NumberC; + oneHourBurnRate: t.NumberC; + oneDayBurnRate: t.NumberC; +}>, t.PartialC<{ + summaryUpdatedAt: t.UnionC<[t.StringC, t.NullC]>; +}>]>; +declare const groupingsSchema: t.RecordC>; +declare const metaSchema: t.PartialC<{ + synthetics: t.TypeC<{ + monitorId: t.StringC; + locationId: t.StringC; + configId: t.StringC; + }>; +}>; +declare const remoteSchema: t.TypeC<{ + remoteName: t.StringC; + kibanaUrl: t.StringC; +}>; +declare const groupSummarySchema: t.TypeC<{ + total: t.NumberC; + worst: t.TypeC<{ + sliValue: t.NumberC; + status: t.StringC; + slo: t.IntersectionC<[t.TypeC<{ + id: t.StringC; + instanceId: t.StringC; + name: t.StringC; + }>, t.PartialC<{ + groupings: t.RecordC; + }>]>; + }>; + violated: t.NumberC; + healthy: t.NumberC; + degrading: t.NumberC; + noData: t.NumberC; +}>; +declare const dateRangeSchema: t.TypeC<{ + from: t.Type; + to: t.Type; +}>; +export type SLOStatus = t.TypeOf; +export { ALL_VALUE, SLO_STATUS, allOrAnyString, allOrAnyStringOrArray, dateRangeSchema, dateType, errorBudgetSchema, groupingsSchema, statusSchema, summarySchema, metaSchema, groupSummarySchema, remoteSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo.d.ts new file mode 100644 index 0000000000000..2ea72a76ac76f --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo.d.ts @@ -0,0 +1,136 @@ +import { z } from '@kbn/zod'; +declare const COMPOSITE_SLO_MIN_MEMBERS = 2; +declare const COMPOSITE_SLO_MAX_MEMBERS = 25; +declare const compositeSloIdSchema: z.ZodString; +declare const compositeTagsSchema: z.ZodArray; +declare const compositeTargetSchema: z.ZodObject<{ + target: z.ZodNumber; +}, z.core.$strip>; +declare const compositeOccurrencesBudgetingMethodSchema: z.ZodLiteral<"occurrences">; +declare const compositeRollingTimeWindowSchema: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; +}, z.core.$strip>; +declare const compositeSloMemberSchema: z.ZodObject<{ + sloId: z.ZodString; + weight: z.ZodNumber; + instanceId: z.ZodOptional; +}, z.core.$strip>; +declare const compositeMethodSchema: z.ZodLiteral<"weightedAverage">; +declare const compositeErrorBudgetSchema: z.ZodObject<{ + initial: z.ZodNumber; + consumed: z.ZodNumber; + remaining: z.ZodNumber; + isEstimated: z.ZodBoolean; +}, z.core.$strip>; +declare const compositeStatusSchema: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; +declare const compositeSloBaseDefinitionSchema: z.ZodObject<{ + id: z.ZodString; + name: z.ZodString; + description: z.ZodString; + compositeMethod: z.ZodLiteral<"weightedAverage">; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + tags: z.ZodArray; + enabled: z.ZodBoolean; + createdAt: z.ZodString; + updatedAt: z.ZodString; + createdBy: z.ZodString; + updatedBy: z.ZodString; + version: z.ZodNumber; +}, z.core.$strip>; +declare const compositeSloDefinitionSchema: z.ZodObject<{ + id: z.ZodString; + name: z.ZodString; + description: z.ZodString; + compositeMethod: z.ZodLiteral<"weightedAverage">; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + tags: z.ZodArray; + enabled: z.ZodBoolean; + createdAt: z.ZodString; + updatedAt: z.ZodString; + createdBy: z.ZodString; + updatedBy: z.ZodString; + version: z.ZodNumber; + members: z.ZodArray; + }, z.core.$strip>>; +}, z.core.$strip>; +declare const storedCompositeSloDefinitionSchema: z.ZodObject<{ + id: z.ZodString; + name: z.ZodString; + description: z.ZodString; + compositeMethod: z.ZodLiteral<"weightedAverage">; + timeWindow: z.ZodObject<{ + duration: z.ZodString; + type: z.ZodLiteral<"rolling">; + }, z.core.$strip>; + budgetingMethod: z.ZodLiteral<"occurrences">; + objective: z.ZodObject<{ + target: z.ZodNumber; + }, z.core.$strip>; + tags: z.ZodArray; + enabled: z.ZodBoolean; + createdAt: z.ZodString; + updatedAt: z.ZodString; + createdBy: z.ZodString; + updatedBy: z.ZodString; + version: z.ZodNumber; + members: z.ZodArray; + }, z.core.$strip>>; +}, z.core.$strip>; +declare const compositeSloMemberSummarySchema: z.ZodObject<{ + id: z.ZodString; + name: z.ZodString; + weight: z.ZodNumber; + normalisedWeight: z.ZodNumber; + sliValue: z.ZodNumber; + status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + errorBudget: z.ZodOptional>; + fiveMinuteBurnRate: z.ZodOptional; + oneHourBurnRate: z.ZodOptional; + oneDayBurnRate: z.ZodOptional; + instanceId: z.ZodOptional; +}, z.core.$strip>; +declare const compositeSloSummarySchema: z.ZodObject<{ + sliValue: z.ZodNumber; + errorBudget: z.ZodObject<{ + initial: z.ZodNumber; + consumed: z.ZodNumber; + remaining: z.ZodNumber; + isEstimated: z.ZodBoolean; + }, z.core.$strip>; + status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + fiveMinuteBurnRate: z.ZodNumber; + oneHourBurnRate: z.ZodNumber; + oneDayBurnRate: z.ZodNumber; +}, z.core.$strip>; +type CompositeSLOMember = z.infer; +type CompositeMethod = z.infer; +type CompositeSLOMemberSummary = z.infer; +type CompositeSLOSummary = z.infer; +export type { CompositeSLOMember, CompositeMethod, CompositeSLOMemberSummary, CompositeSLOSummary }; +export { COMPOSITE_SLO_MIN_MEMBERS, COMPOSITE_SLO_MAX_MEMBERS, compositeSloIdSchema, compositeTagsSchema, compositeTargetSchema, compositeOccurrencesBudgetingMethodSchema, compositeRollingTimeWindowSchema, compositeSloMemberSchema, compositeMethodSchema, compositeErrorBudgetSchema, compositeStatusSchema, compositeSloBaseDefinitionSchema, compositeSloDefinitionSchema, storedCompositeSloDefinitionSchema, compositeSloMemberSummarySchema, compositeSloSummarySchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo_summary_index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo_summary_index.d.ts new file mode 100644 index 0000000000000..702366390e2d1 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo_summary_index.d.ts @@ -0,0 +1,35 @@ +import { z } from '@kbn/zod'; +/** + * Flat summary fields persisted on composite summary index documents (see task `buildSummaryDoc`). + * Other top-level keys (`spaceId`, `summaryUpdatedAt`, `compositeSlo`, …) are ignored by decode. + */ +declare const storedCompositeSloSummarySchema: z.ZodObject<{ + sliValue: z.ZodNumber; + status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + errorBudgetInitial: z.ZodNumber; + errorBudgetConsumed: z.ZodNumber; + errorBudgetRemaining: z.ZodNumber; + errorBudgetIsEstimated: z.ZodBoolean; + fiveMinuteBurnRate: z.ZodNumber; + oneHourBurnRate: z.ZodNumber; + oneDayBurnRate: z.ZodNumber; + members: z.ZodOptional, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; + errorBudget: z.ZodOptional>; + fiveMinuteBurnRate: z.ZodOptional; + oneHourBurnRate: z.ZodOptional; + oneDayBurnRate: z.ZodOptional; + instanceId: z.ZodOptional; + }, z.core.$strip>>>; +}, z.core.$strip>; +export { storedCompositeSloSummarySchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.d.ts new file mode 100644 index 0000000000000..d3dc6fe60e322 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.d.ts @@ -0,0 +1,4 @@ +import * as t from 'io-ts'; +import { Duration } from '../models/duration'; +declare const durationType: t.Type; +export { durationType }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.d.ts new file mode 100644 index 0000000000000..5dae3bc0b71fe --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.d.ts @@ -0,0 +1,17 @@ +import * as t from 'io-ts'; +/** + * IMPORTANT: Any changes to this file must be carefully checked against both usage + * from the SLO definitions API and the SLO Health API, as both depend on these shared types. + * One is a public API, the other is an internal API. + * If types need to diverge, they should be split into separate files. + */ +declare const transformHealthSchema: t.IntersectionC<[t.TypeC<{ + isProblematic: t.BooleanC; + missing: t.BooleanC; + status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; + state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; +}>, t.PartialC<{ + stateMatches: t.BooleanC; +}>]>; +export type TransformHealthResponse = t.OutputOf; +export { transformHealthSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.d.ts new file mode 100644 index 0000000000000..39faf074dc8b8 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.d.ts @@ -0,0 +1,10 @@ +export * from './common'; +export * from './duration'; +export * from './indicators'; +export * from './time_window'; +export * from './slo'; +export * from './composite_slo'; +export * from './composite_slo_summary_index'; +export * from './settings'; +export * from './health'; +export * from './slo_template'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.d.ts new file mode 100644 index 0000000000000..db68345ea76e7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.d.ts @@ -0,0 +1,1518 @@ +import * as t from 'io-ts'; +declare const kqlQuerySchema: t.StringC; +declare const filtersSchema: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; +}>, t.PartialC<{ + $state: t.AnyC; +}>]>>; +declare const kqlWithFiltersSchema: t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; +}>; +declare const querySchema: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; +}>]>; +declare const apmTransactionDurationIndicatorTypeSchema: t.LiteralC<"sli.apm.transactionDuration">; +declare const apmTransactionDurationIndicatorSchema: t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>; +declare const apmTransactionErrorRateIndicatorTypeSchema: t.LiteralC<"sli.apm.transactionErrorRate">; +declare const apmTransactionErrorRateIndicatorSchema: t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>; +declare const kqlCustomIndicatorTypeSchema: t.LiteralC<"sli.kql.custom">; +declare const kqlCustomIndicatorSchema: t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>; +declare const timesliceMetricComparatorMapping: { + GT: string; + GTE: string; + LT: string; + LTE: string; +}; +declare const timesliceMetricBasicMetricWithField: t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.KeyofC<{ + avg: boolean; + max: boolean; + min: boolean; + sum: boolean; + cardinality: boolean; + last_value: boolean; + std_deviation: boolean; + }>; + field: t.StringC; +}>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; +}>]>; +declare const timesliceMetricDocCountMetric: t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; +}>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; +}>]>; +declare const timesliceMetricPercentileMetric: t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; +}>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; +}>]>; +declare const timesliceMetricMetricDef: t.UnionC<[t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.KeyofC<{ + avg: boolean; + max: boolean; + min: boolean; + sum: boolean; + cardinality: boolean; + last_value: boolean; + std_deviation: boolean; + }>; + field: t.StringC; +}>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; +}>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; +}>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; +}>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; +}>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; +}>]>]>; +declare const timesliceMetricIndicatorTypeSchema: t.LiteralC<"sli.metric.timeslice">; +declare const timesliceMetricIndicatorSchema: t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>; +declare const metricCustomDocCountMetric: t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; +}>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; +}>]>; +declare const metricCustomBasicMetric: t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"sum">; + field: t.StringC; +}>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; +}>]>; +declare const metricCustomIndicatorTypeSchema: t.LiteralC<"sli.metric.custom">; +declare const metricCustomIndicatorSchema: t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>; +declare const histogramIndicatorTypeSchema: t.LiteralC<"sli.histogram.custom">; +declare const histogramIndicatorSchema: t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>; +declare const syntheticsAvailabilityIndicatorTypeSchema: t.LiteralC<"sli.synthetics.availability">; +declare const syntheticsAvailabilityIndicatorSchema: t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>; +declare const indicatorTypesSchema: t.UnionC<[t.LiteralC<"sli.apm.transactionDuration">, t.LiteralC<"sli.apm.transactionErrorRate">, t.LiteralC<"sli.synthetics.availability">, t.LiteralC<"sli.kql.custom">, t.LiteralC<"sli.metric.custom">, t.LiteralC<"sli.metric.timeslice">, t.LiteralC<"sli.histogram.custom">]>; +declare const indicatorTypesArraySchema: t.Type; +declare const indicatorSchema: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; +}>]>; +export { kqlQuerySchema, kqlWithFiltersSchema, querySchema, filtersSchema, apmTransactionDurationIndicatorSchema, apmTransactionDurationIndicatorTypeSchema, apmTransactionErrorRateIndicatorSchema, apmTransactionErrorRateIndicatorTypeSchema, syntheticsAvailabilityIndicatorSchema, syntheticsAvailabilityIndicatorTypeSchema, kqlCustomIndicatorSchema, kqlCustomIndicatorTypeSchema, metricCustomIndicatorSchema, metricCustomIndicatorTypeSchema, metricCustomDocCountMetric, metricCustomBasicMetric, timesliceMetricComparatorMapping, timesliceMetricIndicatorSchema, timesliceMetricIndicatorTypeSchema, timesliceMetricMetricDef, timesliceMetricBasicMetricWithField, timesliceMetricDocCountMetric, timesliceMetricPercentileMetric, histogramIndicatorTypeSchema, histogramIndicatorSchema, indicatorSchema, indicatorTypesArraySchema, indicatorTypesSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.d.ts new file mode 100644 index 0000000000000..60a23cb3008d6 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.d.ts @@ -0,0 +1,19 @@ +import * as t from 'io-ts'; +declare const storedSloSettingsSchema: t.IntersectionC<[t.TypeC<{ + useAllRemoteClusters: t.BooleanC; + selectedRemoteClusters: t.ArrayC; +}>, t.PartialC<{ + staleThresholdInHours: t.NumberC; + staleInstancesCleanupEnabled: t.BooleanC; +}>]>; +declare const sloSettingsSchema: t.TypeC<{ + useAllRemoteClusters: t.BooleanC; + selectedRemoteClusters: t.ArrayC; + staleThresholdInHours: t.NumberC; + staleInstancesCleanupEnabled: t.BooleanC; +}>; +declare const serverlessSloSettingsSchema: t.TypeC<{ + staleThresholdInHours: t.NumberC; + staleInstancesCleanupEnabled: t.BooleanC; +}>; +export { serverlessSloSettingsSchema, sloSettingsSchema, storedSloSettingsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.d.ts new file mode 100644 index 0000000000000..78433e143ec73 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.d.ts @@ -0,0 +1,1313 @@ +import * as t from 'io-ts'; +declare const occurrencesBudgetingMethodSchema: t.LiteralC<"occurrences">; +declare const timeslicesBudgetingMethodSchema: t.LiteralC<"timeslices">; +declare const budgetingMethodSchema: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; +declare const targetSchema: t.TypeC<{ + target: t.NumberC; +}>; +declare const objectiveSchema: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; +}>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; +}>]>; +declare const settingsSchema: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; +}>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; +}>]>; +declare const groupBySchema: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; +declare const optionalSettingsSchema: t.PartialC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + syncField: t.UnionC<[t.StringC, t.NullC]>; +}>; +declare const tagsSchema: t.ArrayC; +declare const sloIdSchema: t.Type; +declare const dashboardsWithIdSchema: t.PartialC<{ + dashboards: t.ArrayC>; +}>; +declare const sloDefinitionSchema: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ + id: t.Type; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; +}>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; +}>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; +}>]>; +declare const storedSloDefinitionSchema: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ + id: t.Type; + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + settings: t.IntersectionC<[t.TypeC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + }>, t.PartialC<{ + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>]>; + revision: t.NumberC; + enabled: t.BooleanC; + tags: t.ArrayC; + createdAt: t.Type; + updatedAt: t.Type; + groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; + version: t.NumberC; +}>, t.PartialC<{ + createdBy: t.StringC; + updatedBy: t.StringC; +}>]>, t.PartialC<{ + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; +}>]>; +export { budgetingMethodSchema, dashboardsWithIdSchema, groupBySchema, objectiveSchema, occurrencesBudgetingMethodSchema, optionalSettingsSchema, settingsSchema, sloDefinitionSchema, sloIdSchema, storedSloDefinitionSchema, tagsSchema, targetSchema, timeslicesBudgetingMethodSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo_template.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo_template.d.ts new file mode 100644 index 0000000000000..a9035699045e8 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo_template.d.ts @@ -0,0 +1,633 @@ +import * as t from 'io-ts'; +declare const sloTemplateSchema: t.IntersectionC<[t.TypeC<{ + templateId: t.StringC; +}>, t.PartialC<{ + name: t.StringC; + description: t.StringC; + indicator: t.UnionC<[t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionDuration">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + threshold: t.NumberC; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.apm.transactionErrorRate">; + params: t.IntersectionC<[t.TypeC<{ + environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + index: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.synthetics.availability">; + params: t.IntersectionC<[t.TypeC<{ + monitorIds: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + index: t.StringC; + }>, t.PartialC<{ + tags: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + projects: t.ArrayC, t.StringC]>; + label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; + }>>; + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.kql.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + total: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + good: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + total: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.metric.timeslice">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + metric: t.TypeC<{ + metrics: t.ArrayC; + field: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"doc_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + name: t.StringC; + aggregation: t.LiteralC<"percentile">; + field: t.StringC; + percentile: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>>; + equation: t.StringC; + threshold: t.NumberC; + comparator: t.KeyofC<{ + GT: string; + GTE: string; + LT: string; + LTE: string; + }>; + }>; + timestampField: t.StringC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>, t.TypeC<{ + type: t.LiteralC<"sli.histogram.custom">; + params: t.IntersectionC<[t.TypeC<{ + index: t.StringC; + timestampField: t.StringC; + good: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + total: t.UnionC<[t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"value_count">; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>, t.IntersectionC<[t.TypeC<{ + field: t.StringC; + aggregation: t.LiteralC<"range">; + from: t.NumberC; + to: t.NumberC; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + }>]>]>; + }>, t.PartialC<{ + filter: t.UnionC<[t.StringC, t.TypeC<{ + kqlQuery: t.StringC; + filters: t.ArrayC; + disabled: t.BooleanC; + negate: t.BooleanC; + controlledBy: t.StringC; + group: t.StringC; + index: t.StringC; + isMultiIndex: t.BooleanC; + type: t.StringC; + key: t.StringC; + field: t.StringC; + params: t.AnyC; + value: t.StringC; + }>; + query: t.RecordC; + }>, t.PartialC<{ + $state: t.AnyC; + }>]>>; + }>]>; + dataViewId: t.StringC; + }>]>; + }>]>; + budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; + objective: t.IntersectionC<[t.TypeC<{ + target: t.NumberC; + }>, t.PartialC<{ + timesliceTarget: t.NumberC; + timesliceWindow: t.Type; + }>]>; + timeWindow: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; + }>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; + }>]>; + tags: t.ArrayC; + settings: t.PartialC<{ + syncDelay: t.Type; + frequency: t.Type; + preventInitialBackfill: t.BooleanC; + syncField: t.UnionC<[t.StringC, t.NullC]>; + }>; + groupBy: t.ArrayC; + artifacts: t.PartialC<{ + dashboards: t.ArrayC>; + }>; +}>]>; +declare const storedSloTemplateSchema: t.RecordC; +export { sloTemplateSchema, storedSloTemplateSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.d.ts new file mode 100644 index 0000000000000..2be63e53a334d --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.d.ts @@ -0,0 +1,20 @@ +import * as t from 'io-ts'; +declare const rollingTimeWindowTypeSchema: t.LiteralC<"rolling">; +declare const rollingTimeWindowSchema: t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; +}>; +declare const calendarAlignedTimeWindowTypeSchema: t.LiteralC<"calendarAligned">; +declare const calendarAlignedTimeWindowSchema: t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; +}>; +declare const timeWindowTypeSchema: t.UnionC<[t.LiteralC<"rolling">, t.LiteralC<"calendarAligned">]>; +declare const timeWindowSchema: t.UnionC<[t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"rolling">; +}>, t.TypeC<{ + duration: t.Type; + type: t.LiteralC<"calendarAligned">; +}>]>; +export { rollingTimeWindowSchema, rollingTimeWindowTypeSchema, calendarAlignedTimeWindowSchema, calendarAlignedTimeWindowTypeSchema, timeWindowSchema, timeWindowTypeSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/index.d.ts b/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/index.d.ts new file mode 100644 index 0000000000000..be3dab3aec701 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/index.d.ts @@ -0,0 +1 @@ +export { UiamApiKeyProvisioningEntityType, UiamApiKeyProvisioningStatus, } from './src/uiam_api_key_provisioning_status'; diff --git a/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/src/uiam_api_key_provisioning_status.d.ts b/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/src/uiam_api_key_provisioning_status.d.ts new file mode 100644 index 0000000000000..29a4e1b5e91d8 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/src/uiam_api_key_provisioning_status.d.ts @@ -0,0 +1,9 @@ +export declare enum UiamApiKeyProvisioningStatus { + COMPLETED = "completed", + FAILED = "failed", + SKIPPED = "skipped" +} +export declare enum UiamApiKeyProvisioningEntityType { + RULE = "rule", + TASK = "task" +} diff --git a/x-pack/platform/packages/shared/response-ops/scheduling-types/index.d.ts b/x-pack/platform/packages/shared/response-ops/scheduling-types/index.d.ts new file mode 100644 index 0000000000000..4abf0357d5867 --- /dev/null +++ b/x-pack/platform/packages/shared/response-ops/scheduling-types/index.d.ts @@ -0,0 +1 @@ +export type { IntervalSchedule, RruleSchedule, Schedule, Rrule, RruleCommon, RruleMonthly, RruleWeekly, RruleDaily, RruleHourly, } from './schedule_types'; diff --git a/x-pack/platform/packages/shared/response-ops/scheduling-types/schedule_types.d.ts b/x-pack/platform/packages/shared/response-ops/scheduling-types/schedule_types.d.ts new file mode 100644 index 0000000000000..6b8b37b23197d --- /dev/null +++ b/x-pack/platform/packages/shared/response-ops/scheduling-types/schedule_types.d.ts @@ -0,0 +1,55 @@ +import type { Frequency } from '@kbn/rrule'; +/** + * Interval-based schedule. Use this or RruleSchedule, never both. + */ +export interface IntervalSchedule { + /** + * An interval string (e.g. '5m', '30s'). If specified, this is a recurring schedule. + */ + interval: string; + rrule?: never; +} +/** + * RRule-based schedule. Use this or IntervalSchedule, never both. + */ +export interface RruleSchedule { + rrule: Rrule; + interval?: never; +} +/** Schedule is either interval-based or rrule-based, never both, never neither. */ +export type Schedule = IntervalSchedule | RruleSchedule; +export type Rrule = RruleMonthly | RruleWeekly | RruleDaily | RruleHourly; +export interface RruleCommon { + dtstart?: string; + freq: Frequency; + interval: number; + tzid: string; +} +export interface RruleMonthly extends RruleCommon { + freq: Frequency.MONTHLY; + bymonthday?: number[]; + byhour?: number[]; + byminute?: number[]; + byweekday?: string[]; +} +export interface RruleWeekly extends RruleCommon { + freq: Frequency.WEEKLY; + byweekday?: string[]; + byhour?: number[]; + byminute?: number[]; + bymonthday?: never; +} +export interface RruleDaily extends RruleCommon { + freq: Frequency.DAILY; + byhour?: number[]; + byminute?: number[]; + byweekday?: string[]; + bymonthday?: never; +} +export interface RruleHourly extends RruleCommon { + freq: Frequency.HOURLY; + byhour?: never; + byminute?: number[]; + byweekday?: never; + bymonthday?: never; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/index.d.ts new file mode 100644 index 0000000000000..93a074365bdae --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/index.d.ts @@ -0,0 +1,6 @@ +export type { AuthenticatedUser, UserRealm, User, AuthenticationProvider, } from './src/authentication'; +export type { QueryRolesRole, QueryRolesResult, RemoteClusterPrivilege, Role, RoleIndexPrivilege, RoleKibanaPrivilege, RoleRemoteIndexPrivilege, RoleRemoteClusterPrivilege, FeaturesPrivileges, RawKibanaFeaturePrivileges, RawKibanaPrivileges, RoleKibanaApplication, RoleTransformError, } from './src/authorization'; +export type { SecurityLicense, SecurityLicenseFeatures, LoginLayout } from './src/licensing'; +export type { UserProfileUserInfo, UserProfileData, UserProfileLabels, UserProfile, UserProfileWithSecurity, UserProfileUserInfoWithSecurity, } from './src/user_profile'; +export type { ApiKey, RestApiKey, CrossClusterApiKey, BaseApiKey, CrossClusterApiKeyAccess, ManagedApiKey, ApiKeyRoleDescriptors, ApiKeyToInvalidate, QueryApiKeyResult, CategorizedApiKey, ApiKeyAggregations, } from './src/api_keys/api_key'; +export { RoleTransformErrorReason } from './src/roles'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/api_keys/api_key.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/api_keys/api_key.d.ts new file mode 100644 index 0000000000000..f7948b5e588ab --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/api_keys/api_key.d.ts @@ -0,0 +1,106 @@ +import type { estypes } from '@elastic/elasticsearch'; +/** + * Interface representing an API key the way it is returned by Elasticsearch GET endpoint. + */ +export type ApiKey = RestApiKey | CrossClusterApiKey; +/** + * Interface representing a REST API key the way it is returned by Elasticsearch GET endpoint. + * + * TODO: Remove this type when `@elastic/elasticsearch` has been updated. + */ +export interface RestApiKey extends BaseApiKey { + type: 'rest'; +} +/** + * Interface representing a cross-cluster API key the way it is returned by Elasticsearch GET endpoint. + * + * TODO: Remove this type when `@elastic/elasticsearch` has been updated. + */ +export interface CrossClusterApiKey extends BaseApiKey { + type: 'cross_cluster'; + /** + * The access to be granted to this API key. The access is composed of permissions for cross-cluster + * search and cross-cluster replication. At least one of them must be specified. + */ + access: CrossClusterApiKeyAccess; +} +/** + * Fixing up `estypes.SecurityApiKey` type since some fields are marked as optional even though they are guaranteed to be returned. + * + * TODO: Remove this type when `@elastic/elasticsearch` has been updated to make `role_descriptors` required. + */ +export interface BaseApiKey extends estypes.SecurityApiKey { + role_descriptors: Required['role_descriptors']; +} +export interface CrossClusterApiKeyAccess { + /** + * A list of indices permission entries for cross-cluster search. + */ + search?: CrossClusterApiKeySearch[]; + /** + * A list of indices permission entries for cross-cluster replication. + */ + replication?: CrossClusterApiKeyReplication[]; +} +type CrossClusterApiKeySearch = Pick; +type CrossClusterApiKeyReplication = Pick; +export type ApiKeyRoleDescriptors = Record; +export interface ApiKeyToInvalidate { + id: string; + name: string; +} +export interface ApiKeyAggregations { + usernames?: estypes.AggregationsStringTermsAggregate; + types?: estypes.AggregationsStringTermsAggregate; + expired?: estypes.AggregationsFilterAggregateKeys; + managed?: { + buckets: { + metadataBased: estypes.AggregationsFilterAggregateKeys; + namePrefixBased: estypes.AggregationsFilterAggregateKeys; + }; + }; +} +/** + * Response of Kibana Query API keys endpoint. + */ +export type QueryApiKeyResult = SuccessQueryApiKeyResult | ErrorQueryApiKeyResult; +interface SuccessQueryApiKeyResult extends BaseQueryApiKeyResult { + apiKeys: ApiKey[]; + count: number; + total: number; + queryError: never; + /** + * The search_after cursor for the next page of results. + * Use this value in the next request to get the following page. + */ + searchAfter?: estypes.SortResults; +} +interface ErrorQueryApiKeyResult extends BaseQueryApiKeyResult { + queryError: { + name: string; + message: string; + }; + apiKeys: never; + total: never; +} +interface BaseQueryApiKeyResult { + canManageCrossClusterApiKeys: boolean; + canManageApiKeys: boolean; + canManageOwnApiKeys: boolean; + aggregationTotal: number; + aggregations: Record | undefined; +} +/** + * Interface representing a REST API key that is managed by Kibana. + */ +export interface ManagedApiKey extends Omit { + type: estypes.SecurityApiKeyType | 'managed'; +} +/** + * Interface representing an API key the way it is presented in the Kibana UI (with Kibana system + * API keys given its own dedicated `managed` type). + */ +export type CategorizedApiKey = (ApiKey | ManagedApiKey) & { + expired: boolean; +}; +export {}; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authentication/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authentication/index.d.ts new file mode 100644 index 0000000000000..eac31961aed59 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/authentication/index.d.ts @@ -0,0 +1 @@ +export type { User, UserRealm, AuthenticatedUser, AuthenticationProvider, } from '@kbn/core-security-common'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/features_privileges.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/features_privileges.d.ts new file mode 100644 index 0000000000000..5f4302b1359ea --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/features_privileges.d.ts @@ -0,0 +1,3 @@ +export interface FeaturesPrivileges { + [featureId: string]: string[]; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/index.d.ts new file mode 100644 index 0000000000000..f17173f32cf9e --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/index.d.ts @@ -0,0 +1,3 @@ +export type { FeaturesPrivileges } from './features_privileges'; +export type { RawKibanaFeaturePrivileges, RawKibanaPrivileges } from './raw_kibana_privileges'; +export type { QueryRolesRole, QueryRolesResult, RemoteClusterPrivilege, Role, RoleKibanaPrivilege, RoleIndexPrivilege, RoleRemoteIndexPrivilege, RoleRemoteClusterPrivilege, RoleKibanaApplication, RoleTransformError, } from './role'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/raw_kibana_privileges.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/raw_kibana_privileges.d.ts new file mode 100644 index 0000000000000..50dfba378673a --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/raw_kibana_privileges.d.ts @@ -0,0 +1,11 @@ +export interface RawKibanaFeaturePrivileges { + [featureId: string]: { + [privilegeId: string]: string[]; + }; +} +export interface RawKibanaPrivileges { + global: Record; + features: RawKibanaFeaturePrivileges; + space: Record; + reserved: Record; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/role.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/role.d.ts new file mode 100644 index 0000000000000..b1e9996574c9e --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/role.d.ts @@ -0,0 +1,60 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { FeaturesPrivileges } from './features_privileges'; +export interface RoleIndexPrivilege { + names: string[]; + privileges: string[]; + field_security?: { + grant?: string[]; + except?: string[]; + }; + query?: string; +} +export interface RoleRemoteIndexPrivilege extends RoleIndexPrivilege { + clusters: string[]; +} +export interface RoleKibanaPrivilege { + spaces: string[]; + base: string[]; + feature: FeaturesPrivileges; + _reserved?: string[]; +} +export type RemoteClusterPrivilege = 'monitor_enrich' | 'monitor_stats'; +export interface RoleRemoteClusterPrivilege { + clusters: string | string[]; + privileges: RemoteClusterPrivilege[]; +} +export interface RoleKibanaApplication { + application: string; + privileges: string[]; + resources: string[]; +} +export interface RoleTransformError { + reason: string; + state?: RoleKibanaApplication[]; +} +export interface Role { + name: string; + description?: string; + elasticsearch: { + cluster: string[]; + remote_cluster?: RoleRemoteClusterPrivilege[]; + indices: RoleIndexPrivilege[]; + remote_indices?: RoleRemoteIndexPrivilege[]; + run_as: string[]; + }; + kibana: RoleKibanaPrivilege[]; + metadata?: { + [anyKey: string]: any; + }; + transient_metadata?: { + [anyKey: string]: any; + }; + _transform_error?: RoleTransformError[]; + _unrecognized_applications?: string[]; +} +export type QueryRolesRole = estypes.SecurityQueryRoleQueryRole; +export interface QueryRolesResult { + roles: Role[]; + count: number; + total: number; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/index.d.ts new file mode 100644 index 0000000000000..3f2836927c559 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/index.d.ts @@ -0,0 +1,2 @@ +export type { SecurityLicense } from './license'; +export type { LoginLayout, SecurityLicenseFeatures } from './license_features'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license.d.ts new file mode 100644 index 0000000000000..dcccfdd6d221d --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license.d.ts @@ -0,0 +1,12 @@ +import type { Observable } from 'rxjs'; +import type { LicenseType } from '@kbn/licensing-types'; +import type { SecurityLicenseFeatures } from './license_features'; +export interface SecurityLicense { + isLicenseAvailable(): boolean; + getLicenseType(): string | undefined; + getUnavailableReason: () => string | undefined; + isEnabled(): boolean; + getFeatures(): SecurityLicenseFeatures; + hasAtLeast(licenseType: LicenseType): boolean | undefined; + features$: Observable; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license_features.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license_features.d.ts new file mode 100644 index 0000000000000..9a7c5927e13eb --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license_features.d.ts @@ -0,0 +1,69 @@ +/** + * Represents types of login form layouts. + */ +export type LoginLayout = 'form' | 'error-es-unavailable' | 'error-xpack-unavailable'; +/** + * Describes Security plugin features that depend on license. + */ +export interface SecurityLicenseFeatures { + /** + * Indicates whether we show login page or skip it. + */ + readonly showLogin: boolean; + /** + * Indicates whether we allow login or disable it on the login page. + */ + readonly allowLogin: boolean; + /** + * Indicates whether we show security links throughout the kibana app. + */ + readonly showLinks: boolean; + /** + * Indicates whether we show the Role Mappings UI. + */ + readonly showRoleMappingsManagement: boolean; + /** + * Indicates whether we allow users to access agreement UI and acknowledge it. + */ + readonly allowAccessAgreement: boolean; + /** + * Indicates whether we allow logging of audit events. + */ + readonly allowAuditLogging: boolean; + /** + * Indicates whether we allow users to define document level security in roles. + */ + readonly allowRoleDocumentLevelSecurity: boolean; + /** + * Indicates whether we allow users to define field level security in roles. + */ + readonly allowRoleFieldLevelSecurity: boolean; + /** + * Indicates whether we allow users to define remote index privileges in roles. + */ + readonly allowRoleRemoteIndexPrivileges: boolean; + /** + * Indicates whether we allow users to define remote cluster privileges in roles. + */ + readonly allowRemoteClusterPrivileges: boolean; + /** + * Indicates whether we allow Role-based access control (RBAC). + */ + readonly allowRbac: boolean; + /** + * Indicates whether we allow sub-feature privileges. + */ + readonly allowSubFeaturePrivileges: boolean; + /** + * Indicates whether we allow user profile collaboration features (suggest and privileges checks APIs). + */ + readonly allowUserProfileCollaboration: boolean; + /** + * Describes the layout of the login form if it's displayed. + */ + readonly layout?: LoginLayout; + /** + * Indicates whether we allow FIPS mode + */ + readonly allowFips: boolean; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/roles/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/roles/index.d.ts new file mode 100644 index 0000000000000..7e8a5a4ea06b1 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/roles/index.d.ts @@ -0,0 +1,13 @@ +export declare enum RoleTransformErrorReason { + RESERVED_PRIVILEGES_MIXED = "reserved_privileges_mixed", + RESERVED_PRIVILEGES_WRONG_APP = "reserved_privileges_wrong_app", + SPACE_PRIVILEGES_GLOBAL = "space_privileges_global", + GLOBAL_PRIVILEGES_SPACE = "global_privileges_space", + BASE_FEATURE_PRIVILEGES_MIXED = "base_feature_privileges_mixed", + GLOBAL_RESOURCE_MIXED = "global_resource_mixed", + INVALID_RESOURCE_FORMAT = "invalid_resource_format", + DUPLICATED_RESOURCES = "duplicated_resources", + FEATURE_REQUIRES_ALL_SPACES = "feature_requires_all_spaces", + DISABLED_FEATURE_PRIVILEGES = "disabled_feature_privileges", + TRANSFORMATION_EXCEPTION = "transformation_exception" +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/user_profile/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/user_profile/index.d.ts new file mode 100644 index 0000000000000..f6dc98d6a0331 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_common/src/user_profile/index.d.ts @@ -0,0 +1 @@ +export type { UserProfileUserInfo, UserProfileData, UserProfileLabels, UserProfileUserInfoWithSecurity, UserProfile, UserProfileWithSecurity, } from '@kbn/core-user-profile-common'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/index.d.ts new file mode 100644 index 0000000000000..0ea11a90444d8 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/index.d.ts @@ -0,0 +1,10 @@ +export type { AuditEvent, AuditHttp, AuditKibana, AuditRequest, AuditServiceSetup, AuditLogger, } from './src/audit'; +export type { AuthenticationServiceStart, NativeAPIKeysType, UpdateAPIKeyParams, UpdateAPIKeyResult, UpdateCrossClusterAPIKeyParams, UpdateRestAPIKeyParams, UpdateRestAPIKeyWithKibanaPrivilegesParams, GrantUiamAPIKeyParams, InvalidateUiamAPIKeyParams, ConvertUiamAPIKeyResult, ConvertUiamAPIKeyResultSuccess, ConvertUiamAPIKeyResultFailed, ConvertUiamAPIKeysResponse, UiamAPIKeysType, ClientAuthentication, } from './src/authentication'; +export type { PrivilegeDeprecationsService, PrivilegeDeprecationsRolesByFeatureIdResponse, PrivilegeDeprecationsRolesByFeatureIdRequest, CheckPrivilegesResponse, CheckPrivilegesWithRequest, CheckSavedObjectsPrivilegesWithRequest, CheckPrivilegesDynamicallyWithRequest, SavedObjectActions, UIActions, CheckPrivilegesPayload, CheckSavedObjectsPrivileges, HasPrivilegesResponse, HasPrivilegesResponseApplication, SpaceActions, Actions, CheckPrivilegesOptions, CheckUserProfilesPrivilegesPayload, CheckUserProfilesPrivilegesResponse, CasesActions, CheckPrivileges, AlertingActions, AppActions, ApiActions, CheckPrivilegesDynamically, CheckUserProfilesPrivileges, AuthorizationMode, AuthorizationServiceSetup, EsSecurityConfig, } from './src/authorization'; +export type { SecurityPluginSetup, SecurityPluginStart } from './src/plugin'; +export type { UserProfileServiceStart, UserProfileSuggestParams, UserProfileGetCurrentParams, UserProfileBulkGetParams, UserProfileRequiredPrivileges, } from './src/user_profile'; +export { getUpdateRestApiKeyWithKibanaPrivilegesSchema, updateRestApiKeySchema, updateCrossClusterApiKeySchema, } from './src/authentication'; +export type { ElasticsearchPrivilegesType, KibanaPrivilegesType, CreateAPIKeyParams, CreateAPIKeyResult, InvalidateAPIKeyResult, InvalidateAPIKeysParams, ValidateAPIKeyParams, CreateRestAPIKeyParams, CreateRestAPIKeyWithKibanaPrivilegesParams, CreateCrossClusterAPIKeyParams, GrantAPIKeyResult, CloneAPIKeyParams, CloneAPIKeyResult, } from '@kbn/core-security-server'; +export { isCreateRestAPIKeyParams } from '@kbn/core-security-server'; +export { restApiKeySchema, crossClusterApiKeySchema, getRestApiKeyWithKibanaPrivilegesSchema, } from './src/authentication'; +export { getKibanaRoleSchema, elasticsearchRoleSchema, GLOBAL_RESOURCE } from './src/authorization'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/audit_service.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/audit_service.d.ts new file mode 100644 index 0000000000000..12fc5cb81fb82 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/audit_service.d.ts @@ -0,0 +1,29 @@ +import type { KibanaRequest } from '@kbn/core/server'; +import type { AuditLogger } from '@kbn/core-security-server'; +export interface AuditServiceSetup { + /** + * Creates an {@link AuditLogger} scoped to the current request. + * + * This audit logger logs events with all required user and session info and should be used for + * all user-initiated actions. + * + * @example + * ```typescript + * const auditLogger = securitySetup.audit.asScoped(request); + * auditLogger.log(event); + * ``` + */ + asScoped: (request: KibanaRequest) => AuditLogger; + /** + * {@link AuditLogger} for background tasks only. + * + * This audit logger logs events without any user or session info and should never be used to log + * user-initiated actions. + * + * @example + * ```typescript + * securitySetup.audit.withoutRequest.log(event); + * ``` + */ + withoutRequest: AuditLogger; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/index.d.ts new file mode 100644 index 0000000000000..cdbd2b4cd6808 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/index.d.ts @@ -0,0 +1,2 @@ +export type { AuditServiceSetup } from './audit_service'; +export type { AuditEvent, AuditHttp, AuditKibana, AuditLogger, AuditRequest, } from '@kbn/core-security-server'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/api_keys.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/api_keys.d.ts new file mode 100644 index 0000000000000..d8a2392b3da8f --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/api_keys.d.ts @@ -0,0 +1,129 @@ +import { getKibanaRoleSchema } from '../../authorization'; +export declare const restApiKeySchema: import("@kbn/config-schema").ObjectType<{ + type: import("@kbn/config-schema").Type<"rest" | undefined>; + name: import("@kbn/config-schema").Type; + expiration: import("@kbn/config-schema").Type; + role_descriptors: import("@kbn/config-schema").Type>>; + metadata: import("@kbn/config-schema").Type | undefined>; +}>; +export declare const getRestApiKeyWithKibanaPrivilegesSchema: (getBasePrivilegeNames: Parameters[0]) => import("@kbn/config-schema").ObjectType<{ + type: import("@kbn/config-schema").Type<"rest" | undefined>; + name: import("@kbn/config-schema").Type; + expiration: import("@kbn/config-schema").Type; + metadata: import("@kbn/config-schema").Type | undefined>; + kibana_role_descriptors: import("@kbn/config-schema").Type | undefined; + } & { + spaces: string[] | "*"[]; + }>[]; + elasticsearch: Readonly<{ + indices?: Readonly<{ + query?: string | undefined; + field_security?: Record<"grant" | "except", string[]> | undefined; + allow_restricted_indices?: boolean | undefined; + } & { + names: string[]; + privileges: string[]; + }>[] | undefined; + cluster?: string[] | undefined; + remote_cluster?: Readonly<{} & { + privileges: string[]; + clusters: string[]; + }>[] | undefined; + remote_indices?: Readonly<{ + query?: string | undefined; + field_security?: Record<"grant" | "except", string[]> | undefined; + allow_restricted_indices?: boolean | undefined; + } & { + names: string[]; + privileges: string[]; + clusters: string[]; + }>[] | undefined; + run_as?: string[] | undefined; + } & {}>; + }>>>; +}>; +export declare const crossClusterApiKeySchema: import("@kbn/config-schema").ObjectType<{ + type: import("@kbn/config-schema").Type<"cross_cluster">; + name: import("@kbn/config-schema").Type; + expiration: import("@kbn/config-schema").Type; + metadata: import("@kbn/config-schema").Type | undefined>; + access: import("@kbn/config-schema").ObjectType<{ + search: import("@kbn/config-schema").Type[] | undefined>; + replication: import("@kbn/config-schema").Type[] | undefined>; + }>; +}>; +export declare const updateRestApiKeySchema: import("@kbn/config-schema").ObjectType<{ + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type<"rest" | undefined>; + expiration: import("@kbn/config-schema").Type; + role_descriptors: import("@kbn/config-schema").Type>>; + metadata: import("@kbn/config-schema").Type | undefined>; +}>; +export declare const updateCrossClusterApiKeySchema: import("@kbn/config-schema").ObjectType<{ + id: import("@kbn/config-schema").Type; + type: import("@kbn/config-schema").Type<"cross_cluster">; + expiration: import("@kbn/config-schema").Type; + metadata: import("@kbn/config-schema").Type | undefined>; + access: import("@kbn/config-schema").ObjectType<{ + search: import("@kbn/config-schema").Type[] | undefined>; + replication: import("@kbn/config-schema").Type[] | undefined>; + }>; +}>; +export declare const getUpdateRestApiKeyWithKibanaPrivilegesSchema: (getBasePrivilegeNames: Parameters[0]) => import("@kbn/config-schema").ObjectType<{ + type: import("@kbn/config-schema").Type<"rest" | undefined>; + expiration: import("@kbn/config-schema").Type; + metadata: import("@kbn/config-schema").Type | undefined>; + id: import("@kbn/config-schema").Type; + kibana_role_descriptors: import("@kbn/config-schema").Type | undefined; + } & { + spaces: string[] | "*"[]; + }>[]; + elasticsearch: Readonly<{ + indices?: Readonly<{ + query?: string | undefined; + field_security?: Record<"grant" | "except", string[]> | undefined; + allow_restricted_indices?: boolean | undefined; + } & { + names: string[]; + privileges: string[]; + }>[] | undefined; + cluster?: string[] | undefined; + remote_cluster?: Readonly<{} & { + privileges: string[]; + clusters: string[]; + }>[] | undefined; + remote_indices?: Readonly<{ + query?: string | undefined; + field_security?: Record<"grant" | "except", string[]> | undefined; + allow_restricted_indices?: boolean | undefined; + } & { + names: string[]; + privileges: string[]; + clusters: string[]; + }>[] | undefined; + run_as?: string[] | undefined; + } & {}>; + }>>>; +}>; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/index.d.ts new file mode 100644 index 0000000000000..56f239e1aa59d --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/index.d.ts @@ -0,0 +1 @@ +export { crossClusterApiKeySchema, getRestApiKeyWithKibanaPrivilegesSchema, getUpdateRestApiKeyWithKibanaPrivilegesSchema, restApiKeySchema, updateRestApiKeySchema, updateCrossClusterApiKeySchema, } from './api_keys'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/authentication_service.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/authentication_service.d.ts new file mode 100644 index 0000000000000..f7b7e971b58c9 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/authentication_service.d.ts @@ -0,0 +1,10 @@ +import type { KibanaRequest } from '@kbn/core/server'; +import type { NativeAPIKeysType } from '@kbn/core-security-server'; +import type { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +/** + * Authentication services available on the security plugin's start contract. + */ +export interface AuthenticationServiceStart { + apiKeys: NativeAPIKeysType; + getCurrentUser: (request: KibanaRequest) => AuthenticatedUser | null; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/client_authentication.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/client_authentication.d.ts new file mode 100644 index 0000000000000..8cdd28086c8dd --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/client_authentication.d.ts @@ -0,0 +1,16 @@ +/** + * Represents client authentication information. Don't confuse with the authentication information which represents an + * authenticated user. For example, if Kibana is making a request to Elasticsearch on behalf of an authenticated user, the + * client authentication information would represent Kibana's own authentication information (e.g. shared secret), not the + * end user's. + */ +export interface ClientAuthentication { + /** + * The authentication scheme. Currently only `SharedSecret` scheme is supported. + */ + readonly scheme: 'SharedSecret' | string; + /** + * The authentication credentials for the scheme. + */ + readonly value: string; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/index.d.ts new file mode 100644 index 0000000000000..85965cfbed2aa --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/index.d.ts @@ -0,0 +1,4 @@ +export type { AuthenticationServiceStart } from './authentication_service'; +export type { ClientAuthentication } from './client_authentication'; +export type { NativeAPIKeysType, UpdateAPIKeyParams, UpdateAPIKeyResult, UpdateCrossClusterAPIKeyParams, UpdateRestAPIKeyParams, UpdateRestAPIKeyWithKibanaPrivilegesParams, GrantUiamAPIKeyParams, InvalidateUiamAPIKeyParams, ConvertUiamAPIKeyResult, ConvertUiamAPIKeyResultSuccess, ConvertUiamAPIKeyResultFailed, ConvertUiamAPIKeysResponse, UiamAPIKeysType, } from '@kbn/core-security-server'; +export { crossClusterApiKeySchema, getRestApiKeyWithKibanaPrivilegesSchema, getUpdateRestApiKeyWithKibanaPrivilegesSchema, restApiKeySchema, updateRestApiKeySchema, updateCrossClusterApiKeySchema, } from './api_keys'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/actions.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/actions.d.ts new file mode 100644 index 0000000000000..2e0bc157533b1 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/actions.d.ts @@ -0,0 +1,21 @@ +import type { AlertingActions } from './alerting'; +import type { ApiActions } from './api'; +import type { AppActions } from './app'; +import type { CasesActions } from './cases'; +import type { SavedObjectActions } from './saved_object'; +import type { SpaceActions } from './space'; +import type { UIActions } from './ui'; +/** Actions are used to create the "actions" that are associated with Elasticsearch's + * application privileges, and are used to perform the authorization checks implemented + * by the various `checkPrivilegesWithRequest` derivatives. + */ +export interface Actions { + readonly api: ApiActions; + readonly app: AppActions; + readonly cases: CasesActions; + readonly login: string; + readonly savedObject: SavedObjectActions; + readonly alerting: AlertingActions; + readonly space: SpaceActions; + readonly ui: UIActions; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/alerting.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/alerting.d.ts new file mode 100644 index 0000000000000..fe06488098763 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/alerting.d.ts @@ -0,0 +1,3 @@ +export interface AlertingActions { + get(ruleTypeId: string, consumer: string, alertingEntity: string, operation: string): string; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/api.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/api.d.ts new file mode 100644 index 0000000000000..094ecdd0fce98 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/api.d.ts @@ -0,0 +1,9 @@ +import type { ApiOperation } from '@kbn/core-security-server'; +export interface ApiActions { + get(operation: ApiOperation, subject: string): string; + /** + * @deprecated use `get(operation: ApiOperation, subject: string)` instead + */ + get(subject: string): string; + actionFromRouteTag(routeTag: string): string; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/app.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/app.d.ts new file mode 100644 index 0000000000000..461caed76dcb2 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/app.d.ts @@ -0,0 +1,3 @@ +export interface AppActions { + get(operation: string): string; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/cases.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/cases.d.ts new file mode 100644 index 0000000000000..40b0e0c84669e --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/cases.d.ts @@ -0,0 +1,3 @@ +export interface CasesActions { + get(owner: string, operation: string): string; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/index.d.ts new file mode 100644 index 0000000000000..e415037fe514e --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/index.d.ts @@ -0,0 +1,8 @@ +export type { Actions } from './actions'; +export type { AlertingActions } from './alerting'; +export type { ApiActions } from './api'; +export type { AppActions } from './app'; +export type { CasesActions } from './cases'; +export type { SavedObjectActions } from './saved_object'; +export type { SpaceActions } from './space'; +export type { UIActions } from './ui'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/saved_object.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/saved_object.d.ts new file mode 100644 index 0000000000000..edc7417fc2dfb --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/saved_object.d.ts @@ -0,0 +1,3 @@ +export interface SavedObjectActions { + get(type: string, operation: string): string; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/space.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/space.d.ts new file mode 100644 index 0000000000000..d288134f51e1a --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/space.d.ts @@ -0,0 +1,3 @@ +export interface SpaceActions { + manage: string; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/ui.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/ui.d.ts new file mode 100644 index 0000000000000..42567d5341a1d --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/ui.d.ts @@ -0,0 +1,4 @@ +import type { Capabilities as UICapabilities } from '@kbn/core/server'; +export interface UIActions { + get(featureId: keyof UICapabilities, ...uiCapabilityParts: string[]): string; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/authorization_service.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/authorization_service.d.ts new file mode 100644 index 0000000000000..527d040dd0a12 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/authorization_service.d.ts @@ -0,0 +1,20 @@ +import type { Actions } from './actions'; +import type { CheckPrivilegesWithRequest } from './check_privileges'; +import type { CheckPrivilegesDynamicallyWithRequest } from './check_privileges_dynamically'; +import type { CheckSavedObjectsPrivilegesWithRequest } from './check_saved_objects_privileges'; +import type { AuthorizationMode } from './mode'; +/** + * Authorization services available on the setup contract of the security plugin. + */ +export interface AuthorizationServiceSetup { + /** + * Actions are used to create the "actions" that are associated with Elasticsearch's + * application privileges, and are used to perform the authorization checks implemented + * by the various `checkPrivilegesWithRequest` derivatives. + */ + actions: Actions; + checkPrivilegesWithRequest: CheckPrivilegesWithRequest; + checkPrivilegesDynamicallyWithRequest: CheckPrivilegesDynamicallyWithRequest; + checkSavedObjectsPrivilegesWithRequest: CheckSavedObjectsPrivilegesWithRequest; + mode: AuthorizationMode; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges.d.ts new file mode 100644 index 0000000000000..b853d6a1b04c0 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges.d.ts @@ -0,0 +1,123 @@ +import type { KibanaRequest } from '@kbn/core/server'; +export interface HasPrivilegesResponseApplication { + [resource: string]: { + [privilegeName: string]: boolean; + }; +} +export interface HasPrivilegesResponse { + has_all_requested: boolean; + username: string; + application: { + [applicationName: string]: HasPrivilegesResponseApplication; + }; + cluster?: { + [privilegeName: string]: boolean; + }; + index?: { + [indexName: string]: { + [privilegeName: string]: boolean; + }; + }; +} +/** + * Options to influce the privilege checks. + */ +export interface CheckPrivilegesOptions { + /** + * Whether or not the `login` action should be required (default: true). + * Setting this to false is not advised except for special circumstances, when you do not require + * the request to belong to a user capable of logging into Kibana. + */ + requireLoginAction?: boolean; +} +export interface CheckPrivilegesResponse { + hasAllRequested: boolean; + username: string; + privileges: { + kibana: Array<{ + /** + * If this attribute is undefined, this element is a privilege for the global resource. + */ + resource?: string; + privilege: string; + authorized: boolean; + }>; + elasticsearch: { + cluster: Array<{ + privilege: string; + authorized: boolean; + }>; + index: { + [indexName: string]: Array<{ + privilege: string; + authorized: boolean; + }>; + }; + }; + }; +} +export type CheckPrivilegesWithRequest = (request: KibanaRequest) => CheckPrivileges; +export interface CheckPrivileges { + atSpace(spaceId: string, privileges: CheckPrivilegesPayload, options?: CheckPrivilegesOptions): Promise; + atSpaces(spaceIds: string[], privileges: CheckPrivilegesPayload, options?: CheckPrivilegesOptions): Promise; + globally(privileges: CheckPrivilegesPayload, options?: CheckPrivilegesOptions): Promise; +} +/** + * Privileges that can be checked for the Kibana users. + */ +export interface CheckPrivilegesPayload { + /** + * A list of the Kibana specific privileges (usually generated with `security.authz.actions.*.get(...)`). + */ + kibana?: string | string[]; + /** + * A set of the Elasticsearch cluster and index privileges. + */ + elasticsearch?: { + /** + * A list of Elasticsearch cluster privileges (`manage_security`, `create_snapshot` etc.). + */ + cluster: string[]; + /** + * A map (index name <-> list of privileges) of Elasticsearch index privileges (`view_index_metadata`, `read` etc.). + */ + index: Record; + }; +} +/** + * An interface to check users profiles privileges in a specific context (only a single-space context is supported at + * the moment). + */ +export interface CheckUserProfilesPrivileges { + atSpace(spaceId: string, privileges: CheckUserProfilesPrivilegesPayload): Promise; +} +/** + * Privileges that can be checked for the users profiles (only Kibana specific privileges are supported at the moment). + */ +export interface CheckUserProfilesPrivilegesPayload { + /** + * A list of the Kibana specific privileges (usually generated with `security.authz.actions.*.get(...)`). + */ + kibana: string[]; +} +/** + * Response of the check privileges operation for the users profiles. + */ +export interface CheckUserProfilesPrivilegesResponse { + /** + * The subset of the requested profile IDs of the users that have all the requested privileges. + */ + hasPrivilegeUids: string[]; + /** + * An errors object that may be returned from ES that contains a `count` of UIDs that have errors in the `details` property. + * + * Each entry in `details` will contain an error `type`, e.g 'resource_not_found_exception', and a `reason` message, e.g. 'profile document not found' + */ + errors?: { + count: number; + details: Record; + }; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges_dynamically.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges_dynamically.d.ts new file mode 100644 index 0000000000000..6510442623095 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges_dynamically.d.ts @@ -0,0 +1,4 @@ +import type { KibanaRequest } from '@kbn/core/server'; +import type { CheckPrivilegesOptions, CheckPrivilegesPayload, CheckPrivilegesResponse } from './check_privileges'; +export type CheckPrivilegesDynamically = (privileges: CheckPrivilegesPayload, options?: CheckPrivilegesOptions) => Promise; +export type CheckPrivilegesDynamicallyWithRequest = (request: KibanaRequest) => CheckPrivilegesDynamically; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_saved_objects_privileges.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_saved_objects_privileges.d.ts new file mode 100644 index 0000000000000..a03e32e674fb2 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_saved_objects_privileges.d.ts @@ -0,0 +1,4 @@ +import type { KibanaRequest } from '@kbn/core/server'; +import type { CheckPrivilegesResponse } from './check_privileges'; +export type CheckSavedObjectsPrivilegesWithRequest = (request: KibanaRequest) => CheckSavedObjectsPrivileges; +export type CheckSavedObjectsPrivileges = (actions: string | string[], namespaceOrNamespaces?: string | Array) => Promise; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/constants.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/constants.d.ts new file mode 100644 index 0000000000000..f437e042715ed --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/constants.d.ts @@ -0,0 +1 @@ +export declare const GLOBAL_RESOURCE = "*"; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/deprecations.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/deprecations.d.ts new file mode 100644 index 0000000000000..369c68a8f9ef7 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/deprecations.d.ts @@ -0,0 +1,13 @@ +import type { DeprecationsDetails, GetDeprecationsContext } from '@kbn/core/server'; +import type { Role } from '@kbn/security-plugin-types-common'; +export interface PrivilegeDeprecationsRolesByFeatureIdResponse { + roles?: Role[]; + errors?: DeprecationsDetails[]; +} +export interface PrivilegeDeprecationsRolesByFeatureIdRequest { + context: GetDeprecationsContext; + featureId: string; +} +export interface PrivilegeDeprecationsService { + getKibanaRolesByFeatureId: (args: PrivilegeDeprecationsRolesByFeatureIdRequest) => Promise; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/es_security_config.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/es_security_config.d.ts new file mode 100644 index 0000000000000..3e41351290f79 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/es_security_config.d.ts @@ -0,0 +1,5 @@ +import type { Client } from '@elastic/elasticsearch'; +type XpackUsageResponse = Awaited>; +type XpackUsageSecurity = XpackUsageResponse['security']; +export type EsSecurityConfig = Pick; +export {}; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/index.d.ts new file mode 100644 index 0000000000000..673242cb9a8fa --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/index.d.ts @@ -0,0 +1,10 @@ +export type { Actions, ApiActions, AppActions, AlertingActions, CasesActions, SavedObjectActions, SpaceActions, UIActions, } from './actions'; +export type { AuthorizationServiceSetup } from './authorization_service'; +export type { CheckPrivilegesOptions, CheckPrivilegesResponse, CheckPrivilegesWithRequest, CheckPrivilegesPayload, CheckPrivileges, HasPrivilegesResponse, HasPrivilegesResponseApplication, CheckUserProfilesPrivilegesPayload, CheckUserProfilesPrivilegesResponse, CheckUserProfilesPrivileges, } from './check_privileges'; +export type { CheckPrivilegesDynamically, CheckPrivilegesDynamicallyWithRequest, } from './check_privileges_dynamically'; +export type { CheckSavedObjectsPrivileges, CheckSavedObjectsPrivilegesWithRequest, } from './check_saved_objects_privileges'; +export type { PrivilegeDeprecationsService, PrivilegeDeprecationsRolesByFeatureIdRequest, PrivilegeDeprecationsRolesByFeatureIdResponse, } from './deprecations'; +export type { AuthorizationMode } from './mode'; +export type { EsSecurityConfig } from './es_security_config'; +export { GLOBAL_RESOURCE } from './constants'; +export { elasticsearchRoleSchema, getKibanaRoleSchema } from './role_schema'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/mode.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/mode.d.ts new file mode 100644 index 0000000000000..9f3884c4dd857 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/mode.d.ts @@ -0,0 +1,4 @@ +import type { KibanaRequest } from '@kbn/core/server'; +export interface AuthorizationMode { + useRbacForRequest(request: KibanaRequest): boolean; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/role_schema.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/role_schema.d.ts new file mode 100644 index 0000000000000..43acba0e507dd --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/role_schema.d.ts @@ -0,0 +1,62 @@ +import type { TypeOf } from '@kbn/config-schema'; +/** + * Elasticsearch specific portion of the role definition. + * See more details at https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api.html#security-role-apis. + */ +export declare const elasticsearchRoleSchema: import("@kbn/config-schema").ObjectType<{ + /** + * An optional list of cluster privileges. These privileges define the cluster level actions that + * users with this role are able to execute + */ + cluster: import("@kbn/config-schema").Type; + /** + * An optional list of remote cluster privileges. These privileges define the remote cluster level actions that + * users with this role are able to execute + */ + remote_cluster: import("@kbn/config-schema").Type[] | undefined>; + /** + * An optional list of indices permissions entries. + */ + indices: import("@kbn/config-schema").Type | undefined; + allow_restricted_indices?: boolean | undefined; + } & { + names: string[]; + privileges: string[]; + }>[] | undefined>; + /** + * An optional list of remote indices permissions entries. + */ + remote_indices: import("@kbn/config-schema").Type | undefined; + allow_restricted_indices?: boolean | undefined; + } & { + names: string[]; + privileges: string[]; + clusters: string[]; + }>[] | undefined>; + /** + * An optional list of users that the owners of this role can impersonate. + */ + run_as: import("@kbn/config-schema").Type; +}>; +/** + * Kibana specific portion of the role definition. It's represented as a list of base and/or + * feature Kibana privileges. None of the entries should apply to the same spaces. + */ +export declare const getKibanaRoleSchema: (getBasePrivilegeNames: () => { + global: string[]; + space: string[]; +}) => import("@kbn/config-schema").Type | undefined; +} & { + spaces: string[] | "*"[]; +}>[]>; +export type ElasticsearchPrivilegesType = TypeOf; +export type KibanaPrivilegesType = TypeOf>; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/plugin.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/plugin.d.ts new file mode 100644 index 0000000000000..e857afbbc2955 --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/plugin.d.ts @@ -0,0 +1,45 @@ +import type { SecurityLicense } from '@kbn/security-plugin-types-common'; +import type { AuditServiceSetup } from './audit'; +import type { AuthenticationServiceStart } from './authentication'; +import type { AuthorizationServiceSetup, PrivilegeDeprecationsService } from './authorization'; +import type { UserProfileServiceStart } from './user_profile'; +/** + * Describes public Security plugin contract returned at the `setup` stage. + */ +export interface SecurityPluginSetup { + /** + * Exposes information about the available security features under the current license. + */ + license: SecurityLicense; + /** + * Exposes services for audit logging. + * + * @deprecated in favor of Core's `security` service + */ + audit: AuditServiceSetup; + /** + * Exposes services to access kibana roles per feature id with the GetDeprecationsContext + */ + privilegeDeprecationsService: PrivilegeDeprecationsService; +} +/** + * Describes public Security plugin contract returned at the `start` stage. + */ +export interface SecurityPluginStart { + /** + * Authentication services to confirm the user is who they say they are. + * + * @deprecated in favor of Core's `security` service + */ + authc: AuthenticationServiceStart; + /** + * Authorization services to manage and access the permissions a particular user has. + */ + authz: AuthorizationServiceSetup; + /** + * User profiles services to retrieve user profiles. + * + * @deprecated in favor of Core's `userProfile` service + */ + userProfiles: UserProfileServiceStart; +} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/user_profile/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/user_profile/index.d.ts new file mode 100644 index 0000000000000..4dd796c70a85a --- /dev/null +++ b/x-pack/platform/packages/shared/security/plugin_types_server/src/user_profile/index.d.ts @@ -0,0 +1 @@ +export type { UserProfileServiceStart, UserProfileSuggestParams, UserProfileBulkGetParams, UserProfileRequiredPrivileges, UserProfileGetCurrentParams, } from '@kbn/core-user-profile-server'; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/common/config_schema.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/common/config_schema.d.ts new file mode 100644 index 0000000000000..894525e9b4e09 --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/common/config_schema.d.ts @@ -0,0 +1,33 @@ +import { type TypeOf } from '@kbn/config-schema'; +/** + * Schema for APM indices + */ +export declare const indicesSchema: import("@kbn/config-schema").ObjectType<{ + transaction: import("@kbn/config-schema").Type; + span: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + metric: import("@kbn/config-schema").Type; + onboarding: import("@kbn/config-schema").Type; + sourcemap: import("@kbn/config-schema").Type; +}>; +/** + * Schema for APM Sources configuration + */ +export declare const configSchema: import("@kbn/config-schema").ObjectType<{ + indices: import("@kbn/config-schema").ObjectType<{ + transaction: import("@kbn/config-schema").Type; + span: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + metric: import("@kbn/config-schema").Type; + onboarding: import("@kbn/config-schema").Type; + sourcemap: import("@kbn/config-schema").Type; + }>; +}>; +/** + * Schema for APM Sources configuration + */ +export type APMSourcesAccessConfig = TypeOf; +/** + * Schema for APM indices + */ +export type APMIndices = APMSourcesAccessConfig['indices']; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/public/api.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/public/api.d.ts new file mode 100644 index 0000000000000..e7c5860b1e844 --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/public/api.d.ts @@ -0,0 +1,7 @@ +import type { HttpStart } from '@kbn/core/public'; +import type { APIEndpoint, APIReturnType } from '../server'; +export interface SourcesApiOptions { + body?: unknown; + signal?: AbortSignal; +} +export declare const callSourcesAPI: (http: HttpStart, pathname: T, options?: SourcesApiOptions) => Promise>; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/public/index.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/public/index.d.ts new file mode 100644 index 0000000000000..d8d0d48e4f645 --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/public/index.d.ts @@ -0,0 +1,6 @@ +import type { PluginInitializer } from '@kbn/core/public'; +import { type ApmSourceAccessPluginSetup, type ApmSourceAccessPluginStart } from './plugin'; +export declare const plugin: PluginInitializer; +export type { ApmSourceAccessPluginStart, ApmSourceAccessPluginSetup }; +export type { APMIndices } from '../common/config_schema'; +export { callSourcesAPI, type SourcesApiOptions } from './api'; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/public/plugin.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/public/plugin.d.ts new file mode 100644 index 0000000000000..e4eba8b2186ca --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/public/plugin.d.ts @@ -0,0 +1,28 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { Plugin } from '@kbn/core/public'; +/** + * APM Source setup services + */ +export type ApmSourceAccessPluginSetup = ReturnType; +/** + * APM Source start services + */ +export type ApmSourceAccessPluginStart = ReturnType; +export declare class ApmSourceAccessPlugin implements Plugin { + setup(): void; + start(core: CoreStart): { + getApmIndices: (options?: Omit) => Promise>; + getApmIndexSettings: (options?: Omit) => Promise; + saveApmIndices: (options: import("./api").SourcesApiOptions & { + body: Partial>; + }) => Promise>; + }; + stop(): void; +} diff --git a/x-pack/platform/plugins/shared/apm_sources_access/public/register_services.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/public/register_services.d.ts new file mode 100644 index 0000000000000..db7f6df8dcfa6 --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/public/register_services.d.ts @@ -0,0 +1,34 @@ +import type { HttpStart } from '@kbn/core/public'; +import { type SourcesApiOptions } from './api'; +import type { APMIndices } from '../common/config_schema'; +export interface RegisterServicesParams { + http: HttpStart; +} +export declare function registerServices(params: RegisterServicesParams): { + getApmIndices: (options?: Omit) => Promise>; + getApmIndexSettings: (options?: Omit) => Promise; + saveApmIndices: (options: SourcesApiOptions & { + body: Partial>; + }) => Promise>; +}; +export declare function createApmSourcesAccessService({ http }: RegisterServicesParams): { + getApmIndices: (options?: Omit) => Promise>; + getApmIndexSettings: (options?: Omit) => Promise; + saveApmIndices: (options: SourcesApiOptions & { + body: Partial>; + }) => Promise>; +}; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/config.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/config.d.ts new file mode 100644 index 0000000000000..f80eb4ce740de --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/server/config.d.ts @@ -0,0 +1,6 @@ +import type { PluginConfigDescriptor } from '@kbn/core/server'; +import { type APMSourcesAccessConfig } from '../common/config_schema'; +/** + * Plugin configuration for the apm_sources_access. + */ +export declare const config: PluginConfigDescriptor; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/constants.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/constants.d.ts new file mode 100644 index 0000000000000..701407785e518 --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/server/constants.d.ts @@ -0,0 +1,3 @@ +export declare const APM_AGENT_CONFIGURATION_INDEX = ".apm-agent-configuration"; +export declare const APM_CUSTOM_LINK_INDEX = ".apm-custom-link"; +export declare const APM_SOURCE_MAP_INDEX = ".apm-source-map"; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/index.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/index.d.ts new file mode 100644 index 0000000000000..e08fd1b77495b --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/server/index.d.ts @@ -0,0 +1,9 @@ +import type { PluginInitializerContext } from '@kbn/core/server'; +import type { ApmSourcesAccessPluginSetup, ApmSourcesAccessPluginStart } from './plugin'; +import { config } from './config'; +import { configSchema, type APMSourcesAccessConfig, type APMIndices } from '../common/config_schema'; +declare const plugin: (initContext: PluginInitializerContext) => Promise; +export { APM_AGENT_CONFIGURATION_INDEX, APM_CUSTOM_LINK_INDEX, APM_SOURCE_MAP_INDEX, } from './constants'; +export type { APIEndpoint, APIReturnType, APMSourcesServerRouteRepository, APIClientRequestParamsOf, } from './routes'; +export type { APMIndices, APMSourcesAccessConfig, ApmSourcesAccessPluginSetup, ApmSourcesAccessPluginStart, }; +export { configSchema, config, plugin }; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/plugin.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/plugin.d.ts new file mode 100644 index 0000000000000..301fa074c2722 --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/server/plugin.d.ts @@ -0,0 +1,59 @@ +import type { PluginInitializerContext, CoreSetup, Plugin, SavedObjectsClientContract, Logger } from '@kbn/core/server'; +import type { APMSourcesAccessConfig } from '../common/config_schema'; +/** + * APM Source setup services + */ +export type ApmSourcesAccessPluginSetup = ReturnType; +/** + * APM Source start services + */ +export type ApmSourcesAccessPluginStart = ReturnType; +export declare class ApmSourcesAccessPlugin implements Plugin { + config: APMSourcesAccessConfig; + logger: Logger; + constructor(initContext: PluginInitializerContext); + getApmIndices: (savedObjectsClient: SavedObjectsClientContract) => Promise<{ + error: string; + onboarding: string; + span: string; + transaction: string; + metric: string; + sourcemap: string; + }>; + /** + * Registers the saved object definition and ui settings + * for APM Sources. + */ + setup(core: CoreSetup): { + apmIndicesFromConfigFile: Readonly<{} & { + span: string; + error: string; + transaction: string; + metric: string; + onboarding: string; + sourcemap: string; + }>; + getApmIndices: (savedObjectsClient: SavedObjectsClientContract) => Promise<{ + error: string; + onboarding: string; + span: string; + transaction: string; + metric: string; + sourcemap: string; + }>; + }; + /** + * Initialises the user value for APM Sources UI settings. + */ + start(): { + getApmIndices: (savedObjectsClient: SavedObjectsClientContract) => Promise<{ + error: string; + onboarding: string; + span: string; + transaction: string; + metric: string; + sourcemap: string; + }>; + }; + stop(): void; +} diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/routes/index.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/routes/index.d.ts new file mode 100644 index 0000000000000..444bc195e7b6c --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/server/routes/index.d.ts @@ -0,0 +1,29 @@ +import * as t from 'io-ts'; +import { type ReturnOf, type EndpointOf, type ClientRequestParamsOf } from '@kbn/server-route-repository'; +import type { SavedObject } from '@kbn/core/server'; +import { type APMSourcesRouteHandlerResources } from './settings'; +export type APMSourcesServerRouteRepository = typeof apmSourcesSettingsRouteRepository; +export type APIReturnType = ReturnOf; +export type APIEndpoint = EndpointOf; +export type APIClientRequestParamsOf = ClientRequestParamsOf; +export declare const apmSourcesSettingsRouteRepository: { + "POST /internal/apm-sources/settings/apm-indices/save": import("@kbn/server-route-repository").ServerRoute<"POST /internal/apm-sources/settings/apm-indices/save", t.TypeC<{ + body: t.PartialC<{ + error: t.StringC; + onboarding: t.StringC; + span: t.StringC; + transaction: t.StringC; + metric: t.StringC; + sourcemap: t.StringC; + }>; + }>, APMSourcesRouteHandlerResources, SavedObject<{}>, {}>; + "GET /internal/apm-sources/settings/apm-index-settings": import("@kbn/server-route-repository").ServerRoute<"GET /internal/apm-sources/settings/apm-index-settings", undefined, APMSourcesRouteHandlerResources, import("./settings").ApmIndexSettingsResponse, {}>; + "GET /internal/apm-sources/settings/apm-indices": import("@kbn/server-route-repository").ServerRoute<"GET /internal/apm-sources/settings/apm-indices", undefined, APMSourcesRouteHandlerResources, Readonly<{} & { + span: string; + error: string; + transaction: string; + metric: string; + onboarding: string; + sourcemap: string; + }>, {}>; +}; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/routes/settings.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/routes/settings.d.ts new file mode 100644 index 0000000000000..6da844b495cff --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/server/routes/settings.d.ts @@ -0,0 +1,19 @@ +import type { CoreSetup } from '@kbn/core/server'; +import type { DefaultRouteHandlerResources } from '@kbn/server-route-repository'; +import type { ApmSourcesAccessPlugin } from '../plugin'; +import type { APMIndices } from '..'; +export interface APMSourcesRouteHandlerResources extends DefaultRouteHandlerResources { + sources: ReturnType; +} +export interface APMSourcesCore { + setup: CoreSetup; +} +export interface ApmIndexSettingsResponse { + apmIndexSettings: Array<{ + configurationName: keyof APMIndices; + defaultValue: string; + savedValue: string | undefined; + }>; +} +export declare function getApmIndices({ sources, context, }: APMSourcesRouteHandlerResources): Promise; +export declare function getApmIndexSettings({ sources, context, }: APMSourcesRouteHandlerResources): Promise; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/apm_indices.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/apm_indices.d.ts new file mode 100644 index 0000000000000..12423fec7e1d1 --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/apm_indices.d.ts @@ -0,0 +1,26 @@ +import type { SavedObjectsType } from '@kbn/core/server'; +import type { SavedObjectsClientContract } from '@kbn/core/server'; +import type { APMIndices } from '../../common/config_schema'; +export declare const APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE = "apm-indices"; +export declare const APM_INDEX_SETTINGS_SAVED_OBJECT_ID = "apm-indices"; +export interface APMIndicesSavedObjectBody { + apmIndices?: { + error?: string; + onboarding?: string; + span?: string; + transaction?: string; + metric?: string; + sourcemap?: string; + }; + isSpaceAware?: boolean; +} +export declare const apmIndicesSavedObjectDefinition: SavedObjectsType; +export declare function saveApmIndices(savedObjectsClient: SavedObjectsClientContract, apmIndices: Partial): Promise>; +export declare function getApmIndicesSavedObject(savedObjectsClient: SavedObjectsClientContract): Promise<{ + error?: string; + onboarding?: string; + span?: string; + transaction?: string; + metric?: string; + sourcemap?: string; +} | undefined>; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/migrations/update_apm_oss_index_paths.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/migrations/update_apm_oss_index_paths.d.ts new file mode 100644 index 0000000000000..7de952dcf0a0c --- /dev/null +++ b/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/migrations/update_apm_oss_index_paths.d.ts @@ -0,0 +1,13 @@ +declare const apmIndexConfigs: readonly [readonly ["error", "apm_oss.errorIndices"], readonly ["onboarding", "apm_oss.onboardingIndices"], readonly ["span", "apm_oss.spanIndices"], readonly ["transaction", "apm_oss.transactionIndices"], readonly ["metric", "apm_oss.metricsIndices"]]; +type DeprecatedApmIndexConfigPaths = (typeof apmIndexConfigs)[number][1]; +type DeprecatedApmIndicesSavedObjectAttributes = Partial<{ + [Property in DeprecatedApmIndexConfigPaths]: string; +}>; +export declare function updateApmOssIndexPaths(attributes: DeprecatedApmIndicesSavedObjectAttributes): Partial<{ + span: string; + error: string; + transaction: string; + metric: string; + onboarding: string; +}>; +export {}; diff --git a/x-pack/platform/plugins/shared/cloud/common/constants.d.ts b/x-pack/platform/plugins/shared/cloud/common/constants.d.ts new file mode 100644 index 0000000000000..77e95fb5103ce --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/common/constants.d.ts @@ -0,0 +1,10 @@ +export declare const ELASTIC_SUPPORT_LINK = "https://support.elastic.co/"; +/** + * This is the page for managing your snapshots on Cloud. + */ +export declare const CLOUD_SNAPSHOTS_PATH = "elasticsearch/snapshots/"; +export declare const ELASTICSEARCH_CONFIG_ROUTE = "/api/internal/cloud/elasticsearch_config"; +/** + * Users with this role present are shown the "Billing and subscription" link in the side navigation. + */ +export declare const CLOUD_USER_BILLING_ADMIN_ROLE = "_ec_billing_admin"; diff --git a/x-pack/platform/plugins/shared/cloud/common/decode_cloud_id.d.ts b/x-pack/platform/plugins/shared/cloud/common/decode_cloud_id.d.ts new file mode 100644 index 0000000000000..606374727f822 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/common/decode_cloud_id.d.ts @@ -0,0 +1,8 @@ +import type { Logger } from '@kbn/logging'; +export interface DecodedCloudId { + host: string; + defaultPort: string; + elasticsearchUrl: string; + kibanaUrl: string; +} +export declare function decodeCloudId(cid: string, logger: Logger): DecodedCloudId | undefined; diff --git a/x-pack/platform/plugins/shared/cloud/common/is_cloud_enabled.d.ts b/x-pack/platform/plugins/shared/cloud/common/is_cloud_enabled.d.ts new file mode 100644 index 0000000000000..138d52c4a316d --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/common/is_cloud_enabled.d.ts @@ -0,0 +1 @@ +export declare function getIsCloudEnabled(cloudId?: string): cloudId is string; diff --git a/x-pack/platform/plugins/shared/cloud/common/parse_deployment_id_from_deployment_url.d.ts b/x-pack/platform/plugins/shared/cloud/common/parse_deployment_id_from_deployment_url.d.ts new file mode 100644 index 0000000000000..fcd2047d067cf --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/common/parse_deployment_id_from_deployment_url.d.ts @@ -0,0 +1 @@ +export declare function parseDeploymentIdFromDeploymentUrl(deploymentUrl?: string): string | undefined; diff --git a/x-pack/platform/plugins/shared/cloud/common/parse_onboarding_default_solution.d.ts b/x-pack/platform/plugins/shared/cloud/common/parse_onboarding_default_solution.d.ts new file mode 100644 index 0000000000000..83896fb51bc03 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/common/parse_onboarding_default_solution.d.ts @@ -0,0 +1,9 @@ +import type { SolutionId } from '@kbn/core-chrome-browser'; +/** + * Cloud does not type the value of the "use case" that is set during onboarding for a deployment. Any string can + * be passed. This function maps the known values to the Kibana values. + * + * @param value The solution value set by Cloud. + * @returns The default solution value for onboarding that matches Kibana naming. + */ +export declare function parseOnboardingSolution(value?: string): SolutionId | undefined; diff --git a/x-pack/platform/plugins/shared/cloud/common/register_cloud_deployment_id_analytics_context.d.ts b/x-pack/platform/plugins/shared/cloud/common/register_cloud_deployment_id_analytics_context.d.ts new file mode 100644 index 0000000000000..edabb9af9e740 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/common/register_cloud_deployment_id_analytics_context.d.ts @@ -0,0 +1,16 @@ +import type { AnalyticsClient } from '@elastic/ebt/client'; +export interface CloudDeploymentMetadata { + id?: string; + organization_id?: string; + trial_end_date?: string; + is_elastic_staff_owned?: boolean; + deployment_url?: string; + serverless?: { + project_id?: string; + project_type?: string; + product_tier?: string; + orchestrator_target?: string; + in_trial?: boolean; + }; +} +export declare function registerCloudDeploymentMetadataAnalyticsContext(analytics: Pick, cloudMetadata: CloudDeploymentMetadata): void; diff --git a/x-pack/platform/plugins/shared/cloud/common/types.d.ts b/x-pack/platform/plugins/shared/cloud/common/types.d.ts new file mode 100644 index 0000000000000..a2b829639f344 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/common/types.d.ts @@ -0,0 +1,30 @@ +export interface ElasticsearchConfigType { + elasticsearch_url?: string; +} +export type SolutionType = 'search' | 'elasticsearch' | 'observability' | 'security'; +export interface CloudDataAttributes { + onboardingData: { + solutionType?: SolutionType; + token: string; + security?: CloudSecurityAnswer; + }; + resourceData?: ResourceData; +} +export interface ResourceData { + project?: { + search?: { + type: 'general' | 'vector' | 'timeseries'; + }; + }; + deployment?: { + id?: string; + name?: string; + }; +} +export interface CloudSecurityAnswer { + useCase: 'siem' | 'cloud' | 'edr' | 'other'; + migration?: { + value: boolean; + type?: 'splunk' | 'other'; + }; +} diff --git a/x-pack/platform/plugins/shared/cloud/common/utils.d.ts b/x-pack/platform/plugins/shared/cloud/common/utils.d.ts new file mode 100644 index 0000000000000..56ee51284c41c --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/common/utils.d.ts @@ -0,0 +1 @@ +export declare function getFullCloudUrl(baseUrl: string | undefined, dirPath: string | undefined): string; diff --git a/x-pack/platform/plugins/shared/cloud/public/index.d.ts b/x-pack/platform/plugins/shared/cloud/public/index.d.ts new file mode 100644 index 0000000000000..65d3f652f0b7a --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/public/index.d.ts @@ -0,0 +1,5 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import { CloudPlugin } from './plugin'; +export type { CloudConfigType } from './plugin'; +export type { CloudBasicUrls, CloudPrivilegedUrls, CloudSetup, CloudStart, CloudUrls, } from './types'; +export declare function plugin(initializerContext: PluginInitializerContext): CloudPlugin; diff --git a/x-pack/platform/plugins/shared/cloud/public/plugin.d.ts b/x-pack/platform/plugins/shared/cloud/public/plugin.d.ts new file mode 100644 index 0000000000000..00eebe1562836 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/public/plugin.d.ts @@ -0,0 +1,52 @@ +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { KibanaProductTier, KibanaSolution } from '@kbn/projects-solutions-groups'; +import type { CloudSetup, CloudStart } from './types'; +export interface CloudConfigType { + id?: string; + organization_id?: string; + cname?: string; + csp?: string; + base_url?: string; + profile_url?: string; + deployments_url?: string; + deployment_url?: string; + projects_url?: string; + billing_url?: string; + organization_url?: string; + users_and_roles_url?: string; + performance_url?: string; + trial_end_date?: string; + isSaasContainer?: boolean; + is_elastic_staff_owned?: boolean; + managed_otlp?: { + url?: string; + }; + onboarding?: { + default_solution?: string; + }; + serverless?: { + project_id: string; + project_name?: string; + project_type?: KibanaSolution; + product_tier?: KibanaProductTier; + orchestrator_target?: string; + in_trial?: boolean; + }; +} +export declare class CloudPlugin implements Plugin { + private readonly initializerContext; + private readonly config; + private readonly isCloudEnabled; + private readonly isServerlessEnabled; + private readonly contextProviders; + private readonly logger; + private elasticsearchConfig?; + private readonly cloudUrls; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup): CloudSetup; + start(coreStart: CoreStart): CloudStart; + stop(): void; + private fetchElasticsearchConfig; + private trialDaysLeft; + private isInTrial; +} diff --git a/x-pack/platform/plugins/shared/cloud/public/types.d.ts b/x-pack/platform/plugins/shared/cloud/public/types.d.ts new file mode 100644 index 0000000000000..9a0e8369a3095 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/public/types.d.ts @@ -0,0 +1,287 @@ +import type { SolutionId } from '@kbn/core-chrome-browser'; +import type { KibanaProductTier, KibanaSolution } from '@kbn/projects-solutions-groups'; +import type { FC, PropsWithChildren } from 'react'; +/** + * Represents basic URLs for the Cloud plugin, that do not require specific user roles to access. + */ +export interface CloudBasicUrls { + /** + * This is the URL of the Cloud interface. + */ + baseUrl?: string; + /** + * The full URL to the Kibana deployment. + */ + kibanaUrl?: string; + /** + * This is the path to the Cloud deployments management page. The value is already prepended with `baseUrl`. + * + * @example `{baseUrl}/deployments` + */ + deploymentsUrl?: string; + /** + * This is the path to the Cloud deployment management page for the deployment to which the Kibana instance belongs. The value is already prepended with `baseUrl`. + * + * @example `{baseUrl}/deployments/bfdad4ef99a24212a06d387593686d63` + */ + deploymentUrl?: string; + /** + * The full URL to the user profile page on Elastic Cloud. Undefined if not running on Cloud. + */ + profileUrl?: string; + /** + * The full URL to the organization management page on Elastic Cloud. Undefined if not running on Cloud. + */ + organizationUrl?: string; + /** + * The full URL to the performance page on Elastic Cloud. Undefined if not running on Cloud. + */ + performanceUrl?: string; + /** + * The full URL to the serverless projects page on Elastic Cloud. Undefined if not running in Serverless. + */ + projectsUrl?: string; + /** + * This is the path to the Snapshots page for the deployment to which the Kibana instance belongs. The value is already prepended with `deploymentUrl`. + * + * @example `{deploymentUrl}/elasticsearch/snapshots` + */ + snapshotsUrl?: string; +} +/** + * Represents privileged URLs that require specific user roles to access. + */ +export interface CloudPrivilegedUrls { + /** + * The full URL to the billing page on Elastic Cloud. + */ + billingUrl?: string; + /** + * The full URL to the users and roles page on Elastic Cloud. Undefined if not running on Cloud, + * or if the user does not have the `manage_security` cluster privilege. + */ + usersAndRolesUrl?: string; +} +export type CloudUrls = CloudBasicUrls & CloudPrivilegedUrls; +export interface CloudStart extends CloudBasicUrls { + /** + * A React component that provides a pre-wired `React.Context` which connects components to Cloud services. + */ + CloudContextProvider: FC>; + /** + * `true` when Kibana is running on Elastic Cloud. + */ + isCloudEnabled: boolean; + /** + * Cloud ID. + */ + cloudId?: string; + /** + * Fetches the full URL to the elasticsearch cluster. + */ + fetchElasticsearchConfig: () => Promise; + /** + * Managed OTLP service configuration. Only present when the deployment is configured to use the + * managed OTLP service (always on observability serverless projects, and feature-flagged on ECH). + */ + managedOtlp?: { + /** + * URL of the managed OTLP endpoint. + */ + url?: string; + }; + /** + * Method to retrieve privileged URLs for the Cloud plugin. + */ + getPrivilegedUrls: () => Promise; + /** + * Method to retrieve basic URLs for the Cloud plugin. + */ + getUrls: () => CloudBasicUrls; + /** + * Method to retrieve if the organization is in trial. + */ + isInTrial: () => boolean; + /** + * Method to retrieve the number of days left in the trial. + * Returns undefined if trial_end_date is not set, or the number of days remaining (0 if expired). + */ + trialDaysLeft: () => number | undefined; + /** + * `true` when running on Serverless Elastic Cloud + * Note that `isCloudEnabled` will always be true when `isServerlessEnabled` is. + */ + isServerlessEnabled: boolean; + /** + * Serverless configuration + */ + serverless: { + /** + * The serverless projectId. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectId?: string; + /** + * The serverless project name. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectName?: string; + /** + * The serverless project type. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectType?: KibanaSolution; + /** + * Whether the serverless project belongs to an organization currently in trial. + */ + organizationInTrial?: boolean; + }; +} +export interface CloudSetup extends CloudBasicUrls { + /** + * Cloud ID. Undefined if not running on Cloud. + */ + cloudId?: string; + /** + * The Elastic Cloud Organization that owns this deployment/project. + */ + organizationId?: string; + /** + * The deployment's ID. Only available when running on Elastic Cloud. + */ + deploymentId?: string; + /** + * This value is the same as `baseUrl` on ESS but can be customized on ECE. + * + * @example `cloud.elastic.co` + */ + cname?: string; + /** + * The cloud service provider identifier. + * + * @note Expected to be one of `aws`, `gcp` or `azure`, but could be something different. + */ + csp?: string; + /** + * Method to retrieve privileged URLs for the Cloud plugin. + */ + getPrivilegedUrls: () => Promise; + /** + * Method to retrieve basic URLs for the Cloud plugin. + */ + getUrls: () => CloudUrls; + /** + * Fetches the full URL to the elasticsearch cluster. + */ + fetchElasticsearchConfig: () => Promise; + /** + * {host} from the deployment url https://.. + */ + cloudHost?: string; + /** + * {port} from the deployment url https://.. + */ + cloudDefaultPort?: string; + /** + * `true` when Kibana is running on Elastic Cloud. + */ + isCloudEnabled: boolean; + /** + * `true` when running on ECE (Elastic Cloud Enterprise). + * `false` or `undefined` on ESS or self-managed. + */ + isEce?: boolean; + /** + * The end date for the Elastic Cloud trial. Only available on Elastic Cloud. + * + * @example `2020-10-14T10:40:22Z` + */ + trialEndDate?: Date; + /** + * `true` if the Elastic Cloud organization that owns this deployment is owned by an Elastician. Only available when running on Elastic Cloud. + */ + isElasticStaffOwned?: boolean; + /** + * Registers CloudServiceProviders so start's `CloudContextProvider` hooks them. + * + * @param contextProvider The React component from the Service Provider. + */ + registerCloudService: (contextProvider: FC) => void; + /** + * Managed OTLP service configuration. Only present when the deployment is configured to use the + * managed OTLP service (always on observability serverless projects, and feature-flagged on ECH). + */ + managedOtlp?: { + /** + * URL of the managed OTLP endpoint. + */ + url?: string; + }; + /** + * Onboarding configuration + */ + onboarding: { + /** + * The default solution selected during onboarding. + */ + defaultSolution?: SolutionId; + }; + /** + * `true` when running on Serverless Elastic Cloud + * Note that `isCloudEnabled` will always be true when `isServerlessEnabled` is. + */ + isServerlessEnabled: boolean; + /** + * Serverless configuration + */ + serverless: { + /** + * The serverless projectId. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectId?: string; + /** + * The serverless project name. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectName?: string; + /** + * The serverless project type. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectType?: KibanaSolution; + /** + * The serverless product tier. + * Only present if the current project type has product tiers defined. + * @remarks This field is only exposed for informational purposes. Use the `core.pricing` when checking if a feature if available for the current product tier. + * @internal + */ + productTier?: KibanaProductTier; + /** + * The serverless orchestrator target. The potential values are `canary` or `non-canary` + * Will always be present if `isServerlessEnabled` is `true` + */ + orchestratorTarget?: string; + /** + * Whether the serverless project belongs to an organization currently in trial. + */ + organizationInTrial?: boolean; + }; + /** + * Method to retrieve if the organization is in trial. + */ + isInTrial: () => boolean; + /** + * Method to retrieve the number of days left in the trial. + * Returns undefined if trial_end_date is not set, or the number of days remaining (0 if expired). + */ + trialDaysLeft: () => number | undefined; +} +export interface PublicElasticsearchConfigType { + /** + * The URL to the Elasticsearch cluster, derived from elasticsearch.publicBaseUrl if populated + * Otherwise this is based on the cloudId + * If neither is populated, this will be undefined + */ + elasticsearchUrl?: string; +} diff --git a/x-pack/platform/plugins/shared/cloud/public/urls.d.ts b/x-pack/platform/plugins/shared/cloud/public/urls.d.ts new file mode 100644 index 0000000000000..9b2f585a9ff8d --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/public/urls.d.ts @@ -0,0 +1,25 @@ +import type { CoreSetup } from '@kbn/core/public'; +import type { CloudConfigType } from '.'; +import type { CloudBasicUrls, CloudPrivilegedUrls } from './types'; +/** + * Service that manages all URLs for the Cloud plugin. + */ +export declare class CloudUrlsService { + private config?; + private coreSetup?; + private kibanaUrl?; + setup(config: CloudConfigType, coreSetup: CoreSetup, kibanaUrl: string | undefined): void; + /** + * Returns the set of "basic" URLs. No special privileges needed + */ + getUrls(): CloudBasicUrls; + /** + * Returns the set of "privilged" URLs. Each requires a specific privilege to access. + */ + getPrivilegedUrls(): Promise; + private getCoreStart; + /** + * Needed for determining access to privileged URLs, such as billing. + */ + private getCurrentUserRoles; +} diff --git a/x-pack/platform/plugins/shared/cloud/public/utils.d.ts b/x-pack/platform/plugins/shared/cloud/public/utils.d.ts new file mode 100644 index 0000000000000..4e73290db117e --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/public/utils.d.ts @@ -0,0 +1,2 @@ +import type { CloudConfigType } from './plugin'; +export declare function getSupportUrl(config: CloudConfigType): string; diff --git a/x-pack/platform/plugins/shared/cloud/server/cloud_data/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/cloud_data/index.d.ts new file mode 100644 index 0000000000000..9ee0c954446eb --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/cloud_data/index.d.ts @@ -0,0 +1 @@ +export { persistTokenCloudData } from './persist_token'; diff --git a/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.d.ts b/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.d.ts new file mode 100644 index 0000000000000..604f93ac82a25 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.d.ts @@ -0,0 +1,10 @@ +import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; +import type { CloudSecurityAnswer, ResourceData } from '../../common/types'; +export declare const persistTokenCloudData: (savedObjectsClient: SavedObjectsClientContract, { logger, returnError, onboardingToken, solutionType, security, resourceData, }: { + logger?: Logger; + returnError?: boolean; + onboardingToken?: string; + solutionType?: string; + security?: CloudSecurityAnswer; + resourceData?: ResourceData; +}) => Promise; diff --git a/x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.d.ts b/x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.d.ts new file mode 100644 index 0000000000000..8a4e5c617cdc2 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.d.ts @@ -0,0 +1,28 @@ +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +export interface CloudUsageCollectorConfig { + isCloudEnabled: boolean; + trialEndDate: string | undefined; + isElasticStaffOwned: boolean | undefined; + organizationId: string | undefined; + deploymentId: string | undefined; + projectId: string | undefined; + projectType: string | undefined; + productTier: string | undefined; + orchestratorTarget: string | undefined; + organizationInTrial: boolean | undefined; +} +interface CloudUsage { + isCloudEnabled: boolean; + trialEndDate?: string; + inTrial?: boolean; + isElasticStaffOwned?: boolean; + organizationId?: string; + deploymentId?: string; + projectId?: string; + projectType?: string; + productTier?: string; + orchestratorTarget?: string; +} +export declare function createCloudUsageCollector(usageCollection: UsageCollectionSetup, config: CloudUsageCollectorConfig): import("@kbn/usage-collection-plugin/server").Collector; +export declare function registerCloudUsageCollector(usageCollection: UsageCollectionSetup | undefined, config: CloudUsageCollectorConfig): void; +export {}; diff --git a/x-pack/platform/plugins/shared/cloud/server/collectors/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/collectors/index.d.ts new file mode 100644 index 0000000000000..107720ba9ce8c --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/collectors/index.d.ts @@ -0,0 +1 @@ +export { registerCloudUsageCollector } from './cloud_usage_collector'; diff --git a/x-pack/platform/plugins/shared/cloud/server/config.d.ts b/x-pack/platform/plugins/shared/cloud/server/config.d.ts new file mode 100644 index 0000000000000..a28568069a144 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/config.d.ts @@ -0,0 +1,44 @@ +import type { Type, TypeOf } from '@kbn/config-schema'; +import type { PluginConfigDescriptor } from '@kbn/core/server'; +declare const configSchema: import("@kbn/config-schema").ObjectType<{ + apm: Type | undefined; + secret_token?: string | undefined; + } & {}> | undefined>; + base_url: Type; + cname: Type; + csp: Type; + deployments_url: Type; + deployment_url: Type; + id: Type; + isSaasContainer: Type; + organization_id: Type; + billing_url: Type; + performance_url: Type; + users_and_roles_url: Type; + organization_url: Type; + profile_url: Type; + projects_url: import("@kbn/config-schema").ConditionalType; + trial_end_date: Type; + is_elastic_staff_owned: Type; + managed_otlp: Type | undefined>; + onboarding: Type | undefined>; + serverless: Type | undefined>; +}>; +export type CloudConfigType = TypeOf; +export declare const config: PluginConfigDescriptor; +export {}; diff --git a/x-pack/platform/plugins/shared/cloud/server/env.d.ts b/x-pack/platform/plugins/shared/cloud/server/env.d.ts new file mode 100644 index 0000000000000..ba94963755d74 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/env.d.ts @@ -0,0 +1 @@ +export declare function readInstanceSizeMb(): undefined | number; diff --git a/x-pack/platform/plugins/shared/cloud/server/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/index.d.ts new file mode 100644 index 0000000000000..431e45c17cfdc --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/index.d.ts @@ -0,0 +1,5 @@ +import type { PluginInitializerContext } from '@kbn/core/server'; +export type { CloudSetup, CloudStart } from './plugin'; +export { config } from './config'; +export declare const plugin: (initializerContext: PluginInitializerContext) => Promise; +export { getOnboardingToken } from './saved_objects'; diff --git a/x-pack/platform/plugins/shared/cloud/server/plugin.d.ts b/x-pack/platform/plugins/shared/cloud/server/plugin.d.ts new file mode 100644 index 0000000000000..c4ea6e3a22d0d --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/plugin.d.ts @@ -0,0 +1,206 @@ +import type { CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { SolutionId } from '@kbn/core-chrome-browser'; +import type { KibanaProductTier, KibanaSolution } from '@kbn/projects-solutions-groups'; +interface PluginsSetup { + usageCollection?: UsageCollectionSetup; +} +/** + * Setup contract + */ +export interface CloudSetup { + /** + * This is the ID of the Cloud deployment to which the Kibana instance belongs. + * + * @example `eastus2.azure.elastic-cloud.com:9243$59ef636c6917463db140321484d63cfa$a8b109c08adc43279ef48f29af1a3911` + * + * @note The `cloudId` is a concatenation of the deployment name and a hash. Users can update the deployment name, changing the `cloudId`. However, the changed `cloudId` will not be re-injected into `kibana.yml`. If you need the current `cloudId` the best approach is to split the injected `cloudId` on the semi-colon, and replace the first element with the `persistent.cluster.metadata.display_name` value as provided by a call to `GET _cluster/settings`. + */ + cloudId?: string; + /** + * The cloud service provider identifier. + * + * @note Expected to be one of `aws`, `gcp` or `azure`, but could be something different. + */ + csp?: string; + /** + * The Elastic Cloud Organization that owns this deployment/project. + */ + organizationId?: string; + /** + * The deployment's ID. Only available when running on Elastic Cloud. + */ + deploymentId?: string; + /** + * The full URL to the elasticsearch cluster. + */ + elasticsearchUrl?: string; + /** + * The full URL to the Kibana deployment. + */ + kibanaUrl?: string; + /** + * This is the URL to the "projects" interface on cloud. + * + * @example `https://cloud.elastic.co/projects` + */ + projectsUrl?: string; + /** + * This is the URL of the Cloud interface. + * + * @example `https://cloud.elastic.co` (on the ESS production environment) + */ + baseUrl?: string; + /** + * {host} of the deployment url https://.. + */ + cloudHost?: string; + /** + * {port} of the deployment url https://.. + */ + cloudDefaultPort?: string; + /** + * This is set to `true` for both ESS and ECE deployments. + */ + isCloudEnabled: boolean; + /** + * The size of the instance in which Kibana is running. Only available when running on Elastic Cloud. + */ + instanceSizeMb?: number; + /** + * When the Cloud Trial ends/ended for the organization that owns this deployment. Only available when running on Elastic Cloud. + */ + trialEndDate?: Date; + /** + * `true` if the Elastic Cloud organization that owns this deployment is owned by an Elastician. Only available when running on Elastic Cloud. + */ + isElasticStaffOwned?: boolean; + /** + * APM configuration keys. + */ + apm: { + url?: string; + secretToken?: string; + }; + /** + * Managed OTLP service configuration. Only present when the deployment is configured to use the + * managed OTLP service (always on observability serverless projects, and feature-flagged on ECH). + */ + managedOtlp?: { + /** + * URL of the managed OTLP endpoint. + */ + url?: string; + }; + /** + * Onboarding configuration. + */ + onboarding: { + /** + * The default solution selected during onboarding. + */ + defaultSolution?: SolutionId; + }; + /** + * `true` when running on ECE (Elastic Cloud Enterprise). + * `false` or `undefined` on ESS or self-managed. + */ + isEce?: boolean; + /** + * `true` when running on Serverless Elastic Cloud + * Note that `isCloudEnabled` will always be true when `isServerlessEnabled` is. + */ + isServerlessEnabled: boolean; + /** + * Serverless configuration. + * + * @note We decided to place any cloud URL values at the top level of this object + * even if they contain serverless specific values. All other serverless + * config should live in this object. + */ + serverless: { + /** + * The serverless projectId. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectId?: string; + /** + * The serverless project name. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectName?: string; + /** + * The serverless project type. + * Will always be present if `isServerlessEnabled` is `true` + */ + projectType?: KibanaSolution; + /** + * The serverless product tier. + * Only present if the current project type has product tiers defined. + * @remarks This field is only exposed for informational purposes. Use the `core.pricing` when checking if a feature is available for the current product tier. + * @internal + */ + productTier?: KibanaProductTier; + /** + * The serverless orchestrator target. The potential values are `canary` or `non-canary` + * Will always be present if `isServerlessEnabled` is `true` + */ + orchestratorTarget?: string; + /** + * Whether the serverless project belongs to an organization currently in trial. + */ + organizationInTrial?: boolean; + }; + /** + * Method to retrieve if the organization is in trial. + */ + isInTrial: () => boolean; + /** + * Method to retrieve the number of days left in the trial. + * Returns undefined if trial_end_date is not set, or the number of days remaining (0 if expired). + */ + trialDaysLeft: () => number | undefined; +} +/** + * Start contract + */ +export interface CloudStart { + /** + * This is set to `true` for both ESS and ECE deployments. + */ + isCloudEnabled: boolean; + /** + * This is the URL to the "projects" interface on cloud. + * + * @example `https://cloud.elastic.co/projects` + */ + projectsUrl?: string; + /** + * This is the URL of the Cloud interface. + * + * @example `https://cloud.elastic.co` (on the ESS production environment) + */ + baseUrl?: string; + /** + * Method to retrieve if the organization is in trial. + */ + isInTrial: () => boolean; + /** + * Method to retrieve the number of days left in the trial. + * Returns undefined if trial_end_date is not set, or the number of days remaining (0 if expired). + */ + trialDaysLeft: () => number | undefined; +} +export declare class CloudPlugin implements Plugin { + private readonly context; + private readonly config; + private readonly logger; + private readonly trialEndDate; + constructor(context: PluginInitializerContext); + setup(core: CoreSetup, { usageCollection }: PluginsSetup): CloudSetup; + start(): CloudStart; + private getCloudUrls; + private trialDaysLeft; + private isInTrial; +} +export {}; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/constants.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/constants.d.ts new file mode 100644 index 0000000000000..22f8a41a8db4f --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/routes/constants.d.ts @@ -0,0 +1 @@ +export declare const CLOUD_DATA_SAVED_OBJECT_ID = "cloud-data-saved-object-id"; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/elasticsearch_route.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/elasticsearch_route.d.ts new file mode 100644 index 0000000000000..2cef5bb458206 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/routes/elasticsearch_route.d.ts @@ -0,0 +1,7 @@ +import type { IRouter } from '@kbn/core/server'; +import type { Logger } from '@kbn/logging'; +export declare function setElasticsearchRoute({ elasticsearchUrl, logger, router, }: { + elasticsearchUrl?: string; + logger: Logger; + router: IRouter; +}): void; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.d.ts new file mode 100644 index 0000000000000..8fdab5bdff172 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.d.ts @@ -0,0 +1,2 @@ +import type { RouteOptions } from '.'; +export declare const setGetCloudSolutionDataRoute: ({ router }: RouteOptions) => void; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/index.d.ts new file mode 100644 index 0000000000000..58a70f5a5a6a3 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/routes/index.d.ts @@ -0,0 +1,9 @@ +import type { IRouter } from '@kbn/core/server'; +import type { Logger } from '@kbn/logging'; +import type { CloudRequestHandlerContext } from './types'; +export interface RouteOptions { + logger: Logger; + router: IRouter; + elasticsearchUrl?: string; +} +export declare function defineRoutes(opts: RouteOptions): void; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/set_cloud_data_route.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/set_cloud_data_route.d.ts new file mode 100644 index 0000000000000..d014e114cb727 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/routes/set_cloud_data_route.d.ts @@ -0,0 +1,2 @@ +import type { RouteOptions } from '.'; +export declare const setPostCloudSolutionDataRoute: ({ router }: RouteOptions) => void; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/types.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/types.d.ts new file mode 100644 index 0000000000000..04f59330be582 --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/routes/types.d.ts @@ -0,0 +1,5 @@ +import type { CustomRequestHandlerContext } from '@kbn/core/server'; +/** + * @internal + */ +export type CloudRequestHandlerContext = CustomRequestHandlerContext<{}>; diff --git a/x-pack/platform/plugins/shared/cloud/server/saved_objects/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/saved_objects/index.d.ts new file mode 100644 index 0000000000000..8f84495ace44b --- /dev/null +++ b/x-pack/platform/plugins/shared/cloud/server/saved_objects/index.d.ts @@ -0,0 +1,4 @@ +import type { Logger, SavedObjectsClientContract, SavedObjectsServiceSetup } from '@kbn/core/server'; +export declare const CLOUD_DATA_SAVED_OBJECT_TYPE: "cloud"; +export declare function setupSavedObjects(savedObjects: SavedObjectsServiceSetup, logger: Logger): void; +export declare function getOnboardingToken(savedObjectsClient: SavedObjectsClientContract): Promise; diff --git a/x-pack/platform/plugins/shared/licensing/common/has_license_info_changed.d.ts b/x-pack/platform/plugins/shared/licensing/common/has_license_info_changed.d.ts new file mode 100644 index 0000000000000..594d8bc1eb97f --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/common/has_license_info_changed.d.ts @@ -0,0 +1,6 @@ +import type { ILicense } from '@kbn/licensing-types'; +/** + * Check if 2 potential license instances have changes between them + * @internal + */ +export declare function hasLicenseInfoChanged(currentLicense: ILicense | undefined, newLicense: ILicense): boolean; diff --git a/x-pack/platform/plugins/shared/licensing/common/license.d.ts b/x-pack/platform/plugins/shared/licensing/common/license.d.ts new file mode 100644 index 0000000000000..6291d957c93d0 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/common/license.d.ts @@ -0,0 +1,40 @@ +import type { LicenseType, ILicense, LicenseStatus, LicenseCheck, PublicLicenseJSON, PublicLicense, PublicFeatures } from '@kbn/licensing-types'; +/** + * @public + */ +export declare class License implements ILicense { + private readonly license?; + private readonly features?; + readonly error?: string; + readonly isActive: boolean; + readonly isAvailable: boolean; + readonly uid?: string; + readonly status?: LicenseStatus; + readonly expiryDateInMillis?: number; + readonly type?: LicenseType; + readonly mode?: LicenseType; + readonly signature: string; + /** + * @internal + * Generate a License instance from json representation. + */ + static fromJSON(json: PublicLicenseJSON): License; + constructor({ license, features, error, signature, }: { + license?: PublicLicense; + features?: PublicFeatures; + error?: string; + signature: string; + }); + toJSON(): { + license: PublicLicense | undefined; + features: PublicFeatures | undefined; + signature: string; + }; + getUnavailableReason(): string | undefined; + hasAtLeast(minimumLicenseRequired: LicenseType): boolean; + check(pluginName: string, minimumLicenseRequired: LicenseType): LicenseCheck; + getFeature(id: string): { + isAvailable: boolean; + isEnabled: boolean; + }; +} diff --git a/x-pack/platform/plugins/shared/licensing/common/license_update.d.ts b/x-pack/platform/plugins/shared/licensing/common/license_update.d.ts new file mode 100644 index 0000000000000..ea575cc02cbe4 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/common/license_update.d.ts @@ -0,0 +1,6 @@ +import { type Observable } from 'rxjs'; +import type { ILicense } from '@kbn/licensing-types'; +export declare function createLicenseUpdate(triggerRefresh$: Observable, stop$: Observable, fetcher: () => Promise, initialValues?: ILicense): { + license$: Observable; + refreshManually(): Promise; +}; diff --git a/x-pack/platform/plugins/shared/licensing/common/register_analytics_context_provider.d.ts b/x-pack/platform/plugins/shared/licensing/common/register_analytics_context_provider.d.ts new file mode 100644 index 0000000000000..d7f77f6fb3779 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/common/register_analytics_context_provider.d.ts @@ -0,0 +1,4 @@ +import type { Observable } from 'rxjs'; +import type { AnalyticsClient } from '@elastic/ebt/client'; +import type { ILicense } from '@kbn/licensing-types'; +export declare function registerAnalyticsContextProvider(analytics: Pick, license$: Observable): void; diff --git a/x-pack/platform/plugins/shared/licensing/public/expired_banner.d.ts b/x-pack/platform/plugins/shared/licensing/public/expired_banner.d.ts new file mode 100644 index 0000000000000..cad6cd36af9b4 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/public/expired_banner.d.ts @@ -0,0 +1,8 @@ +import type { CoreStart } from '@kbn/core/public'; +interface Props { + type: string; + uploadUrl: string; +} +type MountProps = Props & Pick; +export declare const mountExpiredBanner: ({ type, uploadUrl, ...startServices }: MountProps) => import("@kbn/core/public").MountPoint; +export {}; diff --git a/x-pack/platform/plugins/shared/licensing/public/index.d.ts b/x-pack/platform/plugins/shared/licensing/public/index.d.ts new file mode 100644 index 0000000000000..680607d9861eb --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/public/index.d.ts @@ -0,0 +1,4 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import { LicensingPlugin } from './plugin'; +export type { LicensingPluginSetup, LicensingPluginStart } from './types'; +export declare const plugin: (context: PluginInitializerContext) => LicensingPlugin; diff --git a/x-pack/platform/plugins/shared/licensing/public/plugin.d.ts b/x-pack/platform/plugins/shared/licensing/public/plugin.d.ts new file mode 100644 index 0000000000000..76178d0e63d03 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/public/plugin.d.ts @@ -0,0 +1,56 @@ +import type { Observable } from 'rxjs'; +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { ILicense } from '@kbn/licensing-types'; +import type { LicensingPluginSetup, LicensingPluginStart } from './types'; +export declare const licensingSessionStorageKey = "xpack.licensing"; +/** + * @public + * A plugin for fetching, refreshing, and receiving information about the license for the + * current Kibana instance. + */ +export declare class LicensingPlugin implements Plugin { + private readonly storage; + /** + * Used as a flag to halt all other plugin observables. + */ + private stop$; + /** + * A function to execute once the plugin's HTTP interceptor needs to stop listening. + */ + private removeInterceptor?; + private internalSubscription?; + private isLicenseExpirationBannerShown?; + private readonly infoEndpoint; + private coreStart?; + private prevSignature?; + private refresh?; + private license$?; + private featureUsage; + constructor(_context: PluginInitializerContext, storage?: Storage); + /** + * Fetch the objectified license and signature from storage. + */ + private getSaved; + /** + * Store the given license and signature in storage. + */ + private save; + /** + * Clear license and signature information from storage. + */ + private removeSaved; + setup(core: CoreSetup): { + refresh: () => Promise; + license$: Observable; + featureUsage: import("./services").FeatureUsageServiceSetup; + }; + start(core: CoreStart): { + refresh: () => Promise; + getLicense: () => Promise; + license$: Observable; + featureUsage: import("./services").FeatureUsageServiceStart; + }; + stop(): void; + private fetchLicense; + private showExpiredBanner; +} diff --git a/x-pack/platform/plugins/shared/licensing/public/services/feature_usage_service.d.ts b/x-pack/platform/plugins/shared/licensing/public/services/feature_usage_service.d.ts new file mode 100644 index 0000000000000..84fe316e17c0f --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/public/services/feature_usage_service.d.ts @@ -0,0 +1,31 @@ +import type { HttpStart } from '@kbn/core/public'; +import type { LicenseType } from '@kbn/licensing-types'; +/** @public */ +export interface FeatureUsageServiceSetup { + /** + * Register a feature to be able to notify of it's usages using the {@link FeatureUsageServiceStart | service start contract}. + */ + register(featureId: string, licenseType: LicenseType): void; +} +/** @public */ +export interface FeatureUsageServiceStart { + /** + * Notify of a registered feature usage at given time. + * + * @param featureId - the identifier of the feature to notify usage of + * @param usedAt - Either a `Date` or an unix timestamp with ms. If not specified, it will be set to the current time. + */ + notifyUsage(featureId: string, usedAt?: Date | number): Promise; +} +interface StartDeps { + http: HttpStart; +} +/** + * @internal + */ +export declare class FeatureUsageService { + private readonly registrations; + setup(): FeatureUsageServiceSetup; + start({ http }: StartDeps): FeatureUsageServiceStart; +} +export {}; diff --git a/x-pack/platform/plugins/shared/licensing/public/services/index.d.ts b/x-pack/platform/plugins/shared/licensing/public/services/index.d.ts new file mode 100644 index 0000000000000..6af8db8268967 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/public/services/index.d.ts @@ -0,0 +1,2 @@ +export { FeatureUsageService } from './feature_usage_service'; +export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './feature_usage_service'; diff --git a/x-pack/platform/plugins/shared/licensing/public/types.d.ts b/x-pack/platform/plugins/shared/licensing/public/types.d.ts new file mode 100644 index 0000000000000..daddf732fd5e5 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/public/types.d.ts @@ -0,0 +1,41 @@ +import type { Observable } from 'rxjs'; +import type { ILicense } from '@kbn/licensing-types'; +import type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; +/** @public */ +export interface LicensingPluginSetup { + /** + * Steam of licensing information {@link ILicense}. + * @deprecated in favour of the counterpart provided from start contract + * @removeBy 8.8.0 + */ + license$: Observable; + /** + * Triggers licensing information re-fetch. + * @deprecated in favour of the counterpart provided from start contract + * @removeBy 8.8.0 + */ + refresh(): Promise; + /** + * APIs to register licensed feature usage. + */ + featureUsage: FeatureUsageServiceSetup; +} +/** @public */ +export interface LicensingPluginStart { + /** + * Steam of licensing information {@link ILicense}. + */ + license$: Observable; + /** + * Retrieves the {@link ILicense | licensing information} + */ + getLicense(): Promise; + /** + * Triggers licensing information re-fetch. + */ + refresh(): Promise; + /** + * APIs to manage licensed feature usage. + */ + featureUsage: FeatureUsageServiceStart; +} diff --git a/x-pack/platform/plugins/shared/licensing/server/index.d.ts b/x-pack/platform/plugins/shared/licensing/server/index.d.ts new file mode 100644 index 0000000000000..bbb51202ca0f0 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/index.d.ts @@ -0,0 +1,7 @@ +import type { PluginInitializerContext } from '@kbn/core/server'; +export declare const plugin: (context: PluginInitializerContext) => Promise; +export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; +export type { ElasticsearchError, LicensingApiRequestHandlerContext, LicensingPluginSetup, LicensingPluginStart, } from './types'; +export { config } from './licensing_config'; +export type { CheckLicense } from './wrap_route_with_license_check'; +export { wrapRouteWithLicenseCheck } from './wrap_route_with_license_check'; diff --git a/x-pack/platform/plugins/shared/licensing/server/license_fetcher.d.ts b/x-pack/platform/plugins/shared/licensing/server/license_fetcher.d.ts new file mode 100644 index 0000000000000..f0bc920e1a8c4 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/license_fetcher.d.ts @@ -0,0 +1,9 @@ +import type { MaybePromise } from '@kbn/utility-types'; +import type { IClusterClient, Logger } from '@kbn/core/server'; +import type { LicenseFetcher } from './types'; +export declare const getLicenseFetcher: ({ clusterClient, logger, cacheDurationMs, maxRetryDelay, }: { + clusterClient: MaybePromise; + logger: Logger; + cacheDurationMs: number; + maxRetryDelay: number; +}) => LicenseFetcher; diff --git a/x-pack/platform/plugins/shared/licensing/server/licensing_config.d.ts b/x-pack/platform/plugins/shared/licensing/server/licensing_config.d.ts new file mode 100644 index 0000000000000..294dbfc289960 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/licensing_config.d.ts @@ -0,0 +1,9 @@ +import type { TypeOf } from '@kbn/config-schema'; +import type { PluginConfigDescriptor } from '@kbn/core/server'; +declare const configSchema: import("@kbn/config-schema").ObjectType<{ + api_polling_frequency: import("@kbn/config-schema").Type; + license_cache_duration: import("@kbn/config-schema").Type; +}>; +export type LicenseConfigType = TypeOf; +export declare const config: PluginConfigDescriptor; +export {}; diff --git a/x-pack/platform/plugins/shared/licensing/server/licensing_route_handler_context.d.ts b/x-pack/platform/plugins/shared/licensing/server/licensing_route_handler_context.d.ts new file mode 100644 index 0000000000000..1ffea84ee2eef --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/licensing_route_handler_context.d.ts @@ -0,0 +1,10 @@ +import type { IContextProvider, StartServicesAccessor } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import type { ILicense } from '@kbn/licensing-types'; +import type { LicensingPluginStart, LicensingRequestHandlerContext } from './types'; +/** + * Create a route handler context for access to Kibana license information. + * @param license$ An observable of a License instance. + * @public + */ +export declare function createRouteHandlerContext(license$: Observable, getStartServices: StartServicesAccessor<{}, LicensingPluginStart>): IContextProvider; diff --git a/x-pack/platform/plugins/shared/licensing/server/on_pre_response_handler.d.ts b/x-pack/platform/plugins/shared/licensing/server/on_pre_response_handler.d.ts new file mode 100644 index 0000000000000..b691c98db78e7 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/on_pre_response_handler.d.ts @@ -0,0 +1,4 @@ +import type { OnPreResponseHandler } from '@kbn/core/server'; +import type { ILicense } from '@kbn/licensing-types'; +import type { Observable } from 'rxjs'; +export declare function createOnPreResponseHandler(refresh: () => Promise, license$: Observable): OnPreResponseHandler; diff --git a/x-pack/platform/plugins/shared/licensing/server/plugin.d.ts b/x-pack/platform/plugins/shared/licensing/server/plugin.d.ts new file mode 100644 index 0000000000000..72538e58785b2 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/plugin.d.ts @@ -0,0 +1,39 @@ +import type { Observable } from 'rxjs'; +import type { MaybePromise } from '@kbn/utility-types'; +import type { CoreSetup, Plugin, PluginInitializerContext, IClusterClient } from '@kbn/core/server'; +import type { ILicense } from '@kbn/licensing-types'; +import type { LicensingPluginSetup, LicensingPluginStart } from './types'; +/** + * @public + * A plugin for fetching, refreshing, and receiving information about the license for the + * current Kibana instance. + */ +export declare class LicensingPlugin implements Plugin { + private readonly context; + private stop$; + private readonly isElasticsearchAvailable$; + private readonly logger; + private readonly config; + private licenseSubscription?; + private featureUsage; + private refresh?; + private license$?; + constructor(context: PluginInitializerContext); + setup(core: CoreSetup<{}, LicensingPluginStart>): { + refresh: () => Promise; + license$: Observable; + featureUsage: import("./services").FeatureUsageServiceSetup; + }; + private createLicensePoller; + start(): { + refresh: () => Promise; + getLicense: () => Promise; + license$: Observable; + featureUsage: import("./services").FeatureUsageServiceStart; + createLicensePoller: (clusterClient: MaybePromise, pollingFrequency: number) => { + refresh: () => Promise; + license$: Observable; + }; + }; + stop(): void; +} diff --git a/x-pack/platform/plugins/shared/licensing/server/plugin_status.d.ts b/x-pack/platform/plugins/shared/licensing/server/plugin_status.d.ts new file mode 100644 index 0000000000000..f4a5d285c0e3f --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/plugin_status.d.ts @@ -0,0 +1,4 @@ +import type { Observable } from 'rxjs'; +import { type ServiceStatus } from '@kbn/core/server'; +import type { ILicense } from '@kbn/licensing-types'; +export declare const getPluginStatus$: (license$: Observable, stop$: Observable) => Observable; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/feature_usage.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/feature_usage.d.ts new file mode 100644 index 0000000000000..ddfb5d8a122b6 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/routes/feature_usage.d.ts @@ -0,0 +1,4 @@ +import type { StartServicesAccessor } from '@kbn/core/server'; +import type { LicensingPluginStart } from '../types'; +import type { LicensingRouter } from '../types'; +export declare function registerFeatureUsageRoute(router: LicensingRouter, getStartServices: StartServicesAccessor<{}, LicensingPluginStart>): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/index.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/index.d.ts new file mode 100644 index 0000000000000..d051650ae4fdd --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/routes/index.d.ts @@ -0,0 +1,5 @@ +import type { StartServicesAccessor } from '@kbn/core/server'; +import type { LicensingPluginStart } from '../types'; +import type { FeatureUsageServiceSetup } from '../services'; +import type { LicensingRouter } from '../types'; +export declare function registerRoutes(router: LicensingRouter, featureUsageSetup: FeatureUsageServiceSetup, getStartServices: StartServicesAccessor<{}, LicensingPluginStart>): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/info.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/info.d.ts new file mode 100644 index 0000000000000..42c1c2d4b4c43 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/routes/info.d.ts @@ -0,0 +1,2 @@ +import type { LicensingRouter } from '../types'; +export declare function registerInfoRoute(router: LicensingRouter): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/internal/index.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/internal/index.d.ts new file mode 100644 index 0000000000000..a012c1e9943a9 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/routes/internal/index.d.ts @@ -0,0 +1,2 @@ +export { registerNotifyFeatureUsageRoute } from './notify_feature_usage'; +export { registerRegisterFeatureRoute } from './register_feature'; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/internal/notify_feature_usage.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/internal/notify_feature_usage.d.ts new file mode 100644 index 0000000000000..1e4ae787dfaea --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/routes/internal/notify_feature_usage.d.ts @@ -0,0 +1,2 @@ +import type { LicensingRouter } from '../../types'; +export declare function registerNotifyFeatureUsageRoute(router: LicensingRouter): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/internal/register_feature.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/internal/register_feature.d.ts new file mode 100644 index 0000000000000..2e09a41e11d29 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/routes/internal/register_feature.d.ts @@ -0,0 +1,3 @@ +import type { FeatureUsageServiceSetup } from '../../services'; +import type { LicensingRouter } from '../../types'; +export declare function registerRegisterFeatureRoute(router: LicensingRouter, featureUsageSetup: FeatureUsageServiceSetup): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/services/feature_usage_service.d.ts b/x-pack/platform/plugins/shared/licensing/server/services/feature_usage_service.d.ts new file mode 100644 index 0000000000000..c8d34793398ff --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/services/feature_usage_service.d.ts @@ -0,0 +1,33 @@ +import type { LicenseType } from '@kbn/licensing-types'; +/** @public */ +export interface FeatureUsageServiceSetup { + /** + * Register a feature to be able to notify of it's usages using the {@link FeatureUsageServiceStart | service start contract}. + */ + register(featureId: string, licenseType: LicenseType): void; +} +export interface LastFeatureUsage { + id: string; + lastUsed: Date | null; + licenseType: LicenseType; +} +/** @public */ +export interface FeatureUsageServiceStart { + /** + * Notify of a registered feature usage at given time. + * + * @param featureId - the identifer of the feature to notify usage of + * @param usedAt - Either a `Date` or an unix timestamp with ms. If not specified, it will be set to the current time. + */ + notifyUsage(featureId: string, usedAt?: Date | number): void; + /** + * Return a map containing last usage timestamp for all features. + * Features that were not used yet do not appear in the map. + */ + getLastUsages(): LastFeatureUsage[]; +} +export declare class FeatureUsageService { + private readonly lastUsages; + setup(): FeatureUsageServiceSetup; + start(): FeatureUsageServiceStart; +} diff --git a/x-pack/platform/plugins/shared/licensing/server/services/index.d.ts b/x-pack/platform/plugins/shared/licensing/server/services/index.d.ts new file mode 100644 index 0000000000000..6af8db8268967 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/services/index.d.ts @@ -0,0 +1,2 @@ +export { FeatureUsageService } from './feature_usage_service'; +export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './feature_usage_service'; diff --git a/x-pack/platform/plugins/shared/licensing/server/types.d.ts b/x-pack/platform/plugins/shared/licensing/server/types.d.ts new file mode 100644 index 0000000000000..b593674a8fa5f --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/types.d.ts @@ -0,0 +1,81 @@ +import type { Observable } from 'rxjs'; +import type { IClusterClient, IRouter, CustomRequestHandlerContext } from '@kbn/core/server'; +import type { ILicense } from '@kbn/licensing-types'; +import type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; +export interface ElasticsearchError extends Error { + status?: number; +} +export type LicenseFetcher = () => Promise; +/** + * Result from remote request fetching raw feature set. + * @internal + */ +export interface RawFeature { + available: boolean; + enabled: boolean; +} +/** + * The APIs exposed on the `licensing` key of {@link RequestHandlerContext} for plugins that depend on licensing. + * @public + */ +export interface LicensingApiRequestHandlerContext { + featureUsage: FeatureUsageServiceStart; + license: ILicense; +} +/** + * @internal + */ +export type LicensingRequestHandlerContext = CustomRequestHandlerContext<{ + licensing: LicensingApiRequestHandlerContext; +}>; +/** + * @internal + */ +export type LicensingRouter = IRouter; +/** @public */ +export interface LicensingPluginSetup { + /** + * Steam of licensing information {@link ILicense}. + * @deprecated in favour of the counterpart provided from start contract + * @removeBy 8.8.0 + */ + license$: Observable; + /** + * Triggers licensing information re-fetch. + * @deprecated in favour of the counterpart provided from start contract + * @removeBy 8.8.0 + */ + refresh(): Promise; + /** + * APIs to register licensed feature usage. + */ + featureUsage: FeatureUsageServiceSetup; +} +/** @public */ +export interface LicensingPluginStart { + /** + * Steam of licensing information {@link ILicense}. + */ + license$: Observable; + /** + * Retrieves the {@link ILicense | licensing information} + */ + getLicense(): Promise; + /** + * Triggers licensing information re-fetch. + */ + refresh(): Promise; + /** + * Creates a license poller to retrieve a license data with. + * Allows a plugin to configure a cluster to retrieve data from at + * given polling frequency. + */ + createLicensePoller: (clusterClient: IClusterClient, pollingFrequency: number) => { + license$: Observable; + refresh(): Promise; + }; + /** + * APIs to manage licensed feature usage. + */ + featureUsage: FeatureUsageServiceStart; +} diff --git a/x-pack/platform/plugins/shared/licensing/server/wrap_route_with_license_check.d.ts b/x-pack/platform/plugins/shared/licensing/server/wrap_route_with_license_check.d.ts new file mode 100644 index 0000000000000..f71ec338406d9 --- /dev/null +++ b/x-pack/platform/plugins/shared/licensing/server/wrap_route_with_license_check.d.ts @@ -0,0 +1,11 @@ +import type { RequestHandler } from '@kbn/core/server'; +import type { ILicense } from '@kbn/licensing-types'; +import type { LicensingRequestHandlerContext } from './types'; +export type CheckLicense = (license: ILicense) => { + valid: false; + message: string; +} | { + valid: true; + message: null; +}; +export declare function wrapRouteWithLicenseCheck(checkLicense: CheckLicense, handler: RequestHandler): RequestHandler; diff --git a/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/types.d.ts b/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/types.d.ts new file mode 100644 index 0000000000000..17b9b881be0ff --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/types.d.ts @@ -0,0 +1,8 @@ +export interface LogSource { + indexPattern: string; +} +export interface LogSourcesService { + getLogSources: () => Promise; + getFlattenedLogSources: () => Promise; + setLogSources: (sources: LogSource[]) => Promise; +} diff --git a/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/utils.d.ts b/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/utils.d.ts new file mode 100644 index 0000000000000..41b8e0ee53f9e --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/utils.d.ts @@ -0,0 +1,2 @@ +import type { LogSource } from './types'; +export declare const flattenLogSources: (logSources: LogSource[]) => string; diff --git a/x-pack/platform/plugins/shared/logs_data_access/common/types.d.ts b/x-pack/platform/plugins/shared/logs_data_access/common/types.d.ts new file mode 100644 index 0000000000000..e7a4e712ffafe --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/common/types.d.ts @@ -0,0 +1 @@ +export type * from './services/log_sources_service/types'; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/components/logs_sources_setting.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/components/logs_sources_setting.d.ts new file mode 100644 index 0000000000000..67a413f87d1b7 --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/components/logs_sources_setting.d.ts @@ -0,0 +1,8 @@ +import type { ApplicationStart } from '@kbn/core-application-browser'; +import React from 'react'; +export declare const LogSourcesSettingSynchronisationInfo: React.FC<{ + isLoading: boolean; + logSourcesValue: string; + getUrlForApp: ApplicationStart['getUrlForApp']; + title?: string; +}>; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/hooks/use_log_sources.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/hooks/use_log_sources.d.ts new file mode 100644 index 0000000000000..0b79a52d6ebe8 --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/hooks/use_log_sources.d.ts @@ -0,0 +1,21 @@ +import type { LogSource, LogSourcesService } from '../../common/services/log_sources_service/types'; +export declare const useLogSources: ({ logSourcesService }: { + logSourcesService: LogSourcesService; +}) => { + isUninitialized: boolean; + isLoadingLogSources: boolean; + hasFailedLoadingLogSources: boolean; + logSourcesError: Error | undefined; + logSources: LogSource[]; + combinedIndices: string; +}; +export declare const LogSourcesProvider: import("react").FC>, useLogSourcesContext: () => { + isUninitialized: boolean; + isLoadingLogSources: boolean; + hasFailedLoadingLogSources: boolean; + logSourcesError: Error | undefined; + logSources: LogSource[]; + combinedIndices: string; +}; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/index.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/index.d.ts new file mode 100644 index 0000000000000..10aa90c7bc3c6 --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/index.d.ts @@ -0,0 +1,7 @@ +import type { PluginInitializer } from '@kbn/core/public'; +import type { LogsDataAccessPluginSetup, LogsDataAccessPluginStart } from './plugin'; +export type { LogsDataAccessPluginSetup, LogsDataAccessPluginStart }; +import type { LogsDataAccessPluginSetupDeps, LogsDataAccessPluginStartDeps } from './types'; +export { LogSourcesProvider, useLogSourcesContext } from './hooks/use_log_sources'; +export { LogSourcesSettingSynchronisationInfo } from './components/logs_sources_setting'; +export declare const plugin: PluginInitializer; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/plugin.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/plugin.d.ts new file mode 100644 index 0000000000000..a14797aa55fe8 --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/plugin.d.ts @@ -0,0 +1,15 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { Plugin } from '@kbn/core/public'; +import type { LogsDataAccessPluginSetupDeps, LogsDataAccessPluginStartDeps } from './types'; +export type LogsDataAccessPluginSetup = ReturnType; +export type LogsDataAccessPluginStart = ReturnType; +export declare class LogsDataAccessPlugin implements Plugin { + setup(): void; + start(core: CoreStart, plugins: LogsDataAccessPluginStartDeps): { + services: { + logSourcesService: import("../common/types").LogSourcesService; + logDataService: import("./services/log_data_service").LogDataService; + }; + }; + stop(): void; +} diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/index.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/index.d.ts new file mode 100644 index 0000000000000..cf0f467687538 --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/index.d.ts @@ -0,0 +1,2 @@ +export * from './log_data_service'; +export type * from './types'; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/log_data_service.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/log_data_service.d.ts new file mode 100644 index 0000000000000..734b15c3c36ad --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/log_data_service.d.ts @@ -0,0 +1,6 @@ +import type { LogSourcesService } from '../../../common/types'; +import type { RegisterServicesParams } from '../register_services'; +import type { LogDataService } from './types'; +export declare function createLogDataService(params: RegisterServicesParams & { + logSourcesService: LogSourcesService; +}): LogDataService; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/types.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/types.d.ts new file mode 100644 index 0000000000000..a415f829c3c29 --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/types.d.ts @@ -0,0 +1,9 @@ +export type LogDataStatus = 'available' | 'empty' | 'missing' | 'unknown'; +export interface LogDataService { + getStatus(opts?: { + excludeIndices?: string[]; + }): Promise<{ + status: LogDataStatus; + hasData: boolean; + }>; +} diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_sources_service/index.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_sources_service/index.d.ts new file mode 100644 index 0000000000000..1b454d19a3639 --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_sources_service/index.d.ts @@ -0,0 +1,3 @@ +import type { LogSourcesService } from '../../../common/services/log_sources_service/types'; +import type { RegisterServicesParams } from '../register_services'; +export declare function createLogSourcesService(params: RegisterServicesParams): LogSourcesService; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/register_services.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/register_services.d.ts new file mode 100644 index 0000000000000..f8efc1cd2d432 --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/services/register_services.d.ts @@ -0,0 +1,12 @@ +import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; +import type { ISearchStart } from '@kbn/data-plugin/public'; +export interface RegisterServicesParams { + deps: { + uiSettings: IUiSettingsClient; + search: ISearchStart; + }; +} +export declare function registerServices(params: RegisterServicesParams): { + logSourcesService: import("../../common/types").LogSourcesService; + logDataService: import("./log_data_service").LogDataService; +}; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/types.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/types.d.ts new file mode 100644 index 0000000000000..f012cffe9d20b --- /dev/null +++ b/x-pack/platform/plugins/shared/logs_data_access/public/types.d.ts @@ -0,0 +1,6 @@ +import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; +export interface LogsDataAccessPluginSetupDeps { +} +export interface LogsDataAccessPluginStartDeps { + data: DataPublicPluginStart; +} diff --git a/x-pack/platform/plugins/shared/serverless/public/index.d.ts b/x-pack/platform/plugins/shared/serverless/public/index.d.ts new file mode 100644 index 0000000000000..c95db3d731ac4 --- /dev/null +++ b/x-pack/platform/plugins/shared/serverless/public/index.d.ts @@ -0,0 +1,3 @@ +import { ServerlessPlugin } from './plugin'; +export declare function plugin(): ServerlessPlugin; +export type { ServerlessPluginSetup, ServerlessPluginStart } from './types'; diff --git a/x-pack/platform/plugins/shared/serverless/public/navigation/index.d.ts b/x-pack/platform/plugins/shared/serverless/public/navigation/index.d.ts new file mode 100644 index 0000000000000..a16beb8d411c6 --- /dev/null +++ b/x-pack/platform/plugins/shared/serverless/public/navigation/index.d.ts @@ -0,0 +1 @@ +export { manageOrgMembersNavCardName, generateManageOrgMembersNavCard } from './nav_cards'; diff --git a/x-pack/platform/plugins/shared/serverless/public/navigation/nav_cards.d.ts b/x-pack/platform/plugins/shared/serverless/public/navigation/nav_cards.d.ts new file mode 100644 index 0000000000000..059b8d7c9b920 --- /dev/null +++ b/x-pack/platform/plugins/shared/serverless/public/navigation/nav_cards.d.ts @@ -0,0 +1,3 @@ +import type { CardNavExtensionDefinition } from '@kbn/management-cards-navigation'; +export declare const manageOrgMembersNavCardName = "organization_members"; +export declare function generateManageOrgMembersNavCard(cloudOrgUrl?: string): CardNavExtensionDefinition; diff --git a/x-pack/platform/plugins/shared/serverless/public/plugin.d.ts b/x-pack/platform/plugins/shared/serverless/public/plugin.d.ts new file mode 100644 index 0000000000000..aca4cc4f6d9d2 --- /dev/null +++ b/x-pack/platform/plugins/shared/serverless/public/plugin.d.ts @@ -0,0 +1,8 @@ +import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import type { ServerlessPluginSetup, ServerlessPluginSetupDependencies, ServerlessPluginStart, ServerlessPluginStartDependencies } from './types'; +export declare class ServerlessPlugin implements Plugin { + constructor(); + setup(_core: CoreSetup, _dependencies: ServerlessPluginSetupDependencies): ServerlessPluginSetup; + start(core: CoreStart, dependencies: ServerlessPluginStartDependencies): ServerlessPluginStart; + stop(): void; +} diff --git a/x-pack/platform/plugins/shared/serverless/public/types.d.ts b/x-pack/platform/plugins/shared/serverless/public/types.d.ts new file mode 100644 index 0000000000000..f02d4660d6b0a --- /dev/null +++ b/x-pack/platform/plugins/shared/serverless/public/types.d.ts @@ -0,0 +1,17 @@ +import type { ChromeBreadcrumb, ChromeSetProjectBreadcrumbsParams, NavigationTreeDefinition, SolutionId } from '@kbn/core-chrome-browser'; +import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; +import type { Observable } from 'rxjs'; +import type { CardNavExtensionDefinition } from '@kbn/management-cards-navigation'; +export interface ServerlessPluginSetup { +} +export interface ServerlessPluginStart { + setBreadcrumbs: (breadcrumbs: ChromeBreadcrumb | ChromeBreadcrumb[], params?: Partial) => void; + initNavigation(id: SolutionId, navigationTree$: Observable): void; + getNavigationCards$(roleManagementEnabled?: boolean, extendCardNavDefinitions?: Record): Observable | undefined>; +} +export interface ServerlessPluginSetupDependencies { + cloud: CloudSetup; +} +export interface ServerlessPluginStartDependencies { + cloud: CloudStart; +} diff --git a/x-pack/platform/plugins/shared/task_manager/common/constants.d.ts b/x-pack/platform/plugins/shared/task_manager/common/constants.d.ts new file mode 100644 index 0000000000000..05513977072ba --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/common/constants.d.ts @@ -0,0 +1,4 @@ +export declare enum TaskErrorSource { + FRAMEWORK = "framework", + USER = "user" +} diff --git a/x-pack/platform/plugins/shared/task_manager/common/index.d.ts b/x-pack/platform/plugins/shared/task_manager/common/index.d.ts new file mode 100644 index 0000000000000..1793dc47a3575 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/common/index.d.ts @@ -0,0 +1 @@ +export { TaskErrorSource } from './constants'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/api_key_strategy.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/api_key_strategy.d.ts new file mode 100644 index 0000000000000..9389bf2a178b0 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/api_key_strategy.d.ts @@ -0,0 +1,27 @@ +import type { Logger, SecurityServiceStart, IBasePath, KibanaRequest, SavedObjectsClientContract } from '@kbn/core/server'; +import type { ApiKeyType } from '../config'; +import type { ConcreteTaskInstance, TaskInstance, TaskUserScope } from '../task'; +export type { ApiKeyType } from '../config'; +export interface ApiKeySOFields { + apiKey: string; + uiamApiKey?: string; + userScope: TaskUserScope; +} +/** Optional flags passed to {@link ApiKeyStrategy.grantApiKeys}. */ +export interface GrantApiKeysOpts { + /** When true, grant only the Elasticsearch API key (skip UIAM). */ + onEsKey?: boolean; +} +export interface InvalidationTarget { + apiKeyId: string; + uiamApiKey?: string; +} +export interface ApiKeyStrategy { + readonly shouldGrantUiam: boolean; + readonly typeToUse: ApiKeyType; + grantApiKeys(taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart, basePath: IBasePath, opts?: GrantApiKeysOpts): Promise>; + getApiKeyForFakeRequest(taskInstance: ConcreteTaskInstance): string | undefined; + getApiKeyIdsForInvalidation(taskInstance: ConcreteTaskInstance): InvalidationTarget[]; + markForInvalidation(targets: InvalidationTarget[], logger: Logger, savedObjectsClient: SavedObjectsClientContract): Promise; +} +export declare const markApiKeysForInvalidation: (targets: InvalidationTarget[], logger: Logger, savedObjectsClient: SavedObjectsClientContract) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/create_api_key_strategy.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/create_api_key_strategy.d.ts new file mode 100644 index 0000000000000..61c8cc5146c64 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/create_api_key_strategy.d.ts @@ -0,0 +1,4 @@ +import type { Logger, SecurityServiceStart } from '@kbn/core/server'; +import type { ApiKeyType } from '../config'; +import type { ApiKeyStrategy } from './api_key_strategy'; +export declare const createApiKeyStrategy: (apiKeyType: ApiKeyType, grantUiamApiKeys: boolean, security: SecurityServiceStart, logger: Logger) => ApiKeyStrategy; diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_and_uiam_api_key_strategy.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_and_uiam_api_key_strategy.d.ts new file mode 100644 index 0000000000000..589292d819b9e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_and_uiam_api_key_strategy.d.ts @@ -0,0 +1,16 @@ +import type { Logger, SecurityServiceStart, IBasePath, KibanaRequest, SavedObjectsClientContract } from '@kbn/core/server'; +import { ApiKeyType } from '../config'; +import type { ConcreteTaskInstance, TaskInstance } from '../task'; +import type { ApiKeySOFields, ApiKeyStrategy, GrantApiKeysOpts, InvalidationTarget } from './api_key_strategy'; +export declare class EsAndUiamApiKeyStrategy implements ApiKeyStrategy { + readonly shouldGrantUiam = true; + readonly typeToUse: ApiKeyType; + private readonly security; + private readonly logger; + constructor(apiKeyType: ApiKeyType, security: SecurityServiceStart, logger: Logger); + grantApiKeys(taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart, basePath: IBasePath, opts?: GrantApiKeysOpts): Promise>; + private grantUiamApiKeys; + getApiKeyForFakeRequest(taskInstance: ConcreteTaskInstance): string | undefined; + getApiKeyIdsForInvalidation(taskInstance: ConcreteTaskInstance): InvalidationTarget[]; + markForInvalidation(targets: InvalidationTarget[], logger: Logger, savedObjectsClient: SavedObjectsClientContract): Promise; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_api_key_strategy.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_api_key_strategy.d.ts new file mode 100644 index 0000000000000..d544723b6646e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_api_key_strategy.d.ts @@ -0,0 +1,12 @@ +import type { Logger, SecurityServiceStart, IBasePath, KibanaRequest, SavedObjectsClientContract } from '@kbn/core/server'; +import { ApiKeyType } from '../config'; +import type { ConcreteTaskInstance, TaskInstance } from '../task'; +import type { ApiKeySOFields, ApiKeyStrategy, InvalidationTarget } from './api_key_strategy'; +export declare class EsApiKeyStrategy implements ApiKeyStrategy { + readonly shouldGrantUiam = false; + readonly typeToUse = ApiKeyType.ES; + grantApiKeys(taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart, basePath: IBasePath): Promise>; + getApiKeyForFakeRequest(taskInstance: ConcreteTaskInstance): string | undefined; + getApiKeyIdsForInvalidation(taskInstance: ConcreteTaskInstance): InvalidationTarget[]; + markForInvalidation(targets: InvalidationTarget[], logger: Logger, savedObjectsClient: SavedObjectsClientContract): Promise; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/index.d.ts new file mode 100644 index 0000000000000..b98d235cc05a4 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/index.d.ts @@ -0,0 +1,5 @@ +export type { ApiKeyStrategy, ApiKeySOFields, InvalidationTarget, ApiKeyType, } from './api_key_strategy'; +export { markApiKeysForInvalidation } from './api_key_strategy'; +export { EsApiKeyStrategy } from './es_api_key_strategy'; +export { EsAndUiamApiKeyStrategy } from './es_and_uiam_api_key_strategy'; +export { createApiKeyStrategy } from './create_api_key_strategy'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/buffered_task_store.d.ts b/x-pack/platform/plugins/shared/task_manager/server/buffered_task_store.d.ts new file mode 100644 index 0000000000000..4828522d03d1e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/buffered_task_store.d.ts @@ -0,0 +1,19 @@ +import type { TaskStore } from './task_store'; +import type { ConcreteTaskInstance, PartialConcreteTaskInstance } from './task'; +import type { Updatable } from './task_running'; +import type { BufferOptions } from './lib/bulk_operation_buffer'; +export declare class BufferedTaskStore implements Updatable { + private readonly taskStore; + private bufferedPartialUpdate; + private bufferedUpdate; + private bufferedRemove; + constructor(taskStore: TaskStore, options: BufferOptions); + update(doc: ConcreteTaskInstance, options: { + validate: boolean; + }): Promise; + partialUpdate(partialDoc: PartialConcreteTaskInstance, options: { + validate: boolean; + doc: ConcreteTaskInstance; + }): Promise; + remove(id: string): Promise; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/config.d.ts b/x-pack/platform/plugins/shared/task_manager/server/config.d.ts new file mode 100644 index 0000000000000..172dc2abc06c9 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/config.d.ts @@ -0,0 +1,95 @@ +import type { TypeOf } from '@kbn/config-schema'; +export declare const MAX_WORKERS_LIMIT = 100; +export declare const DEFAULT_CAPACITY = 10; +export declare const MAX_CAPACITY = 50; +export declare const MIN_CAPACITY = 5; +export declare const DEFAULT_MAX_WORKERS = 10; +export declare const DEFAULT_POLL_INTERVAL = 3000; +export declare const MGET_DEFAULT_POLL_INTERVAL = 500; +export declare const DEFAULT_VERSION_CONFLICT_THRESHOLD = 80; +export declare const DEFAULT_MONITORING_REFRESH_RATE: number; +export declare const DEFAULT_MONITORING_STATS_RUNNING_AVERAGE_WINDOW = 50; +export declare const DEFAULT_MONITORING_STATS_WARN_DELAYED_TASK_START_IN_SECONDS = 60; +export declare const DEFAULT_METRICS_RESET_INTERVAL: number; +export declare const DEFAULT_WORKER_UTILIZATION_RUNNING_AVERAGE_WINDOW = 5; +export declare const WORKER_UTILIZATION_RUNNING_AVERAGE_WINDOW_SIZE_MS: number; +export declare const CLAIM_STRATEGY_UPDATE_BY_QUERY = "update_by_query"; +export declare const CLAIM_STRATEGY_MGET = "mget"; +export declare const DEFAULT_DISCOVERY_INTERVAL_MS: number; +export declare const DISCOVERY_INTERVAL_AFTER_BLOCK_EXCEPTION_MS: number; +export declare const DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION = "30s"; +export declare const DEFAULT_KIBANAS_PER_PARTITION = 2; +export declare enum ApiKeyType { + ES = "es", + UIAM = "uiam" +} +export declare const taskExecutionFailureThresholdSchema: import("@kbn/config-schema").ObjectType<{ + error_threshold: import("@kbn/config-schema").Type; + warn_threshold: import("@kbn/config-schema").Type; +}>; +declare const eventLoopDelaySchema: import("@kbn/config-schema").ObjectType<{ + monitor: import("@kbn/config-schema").Type; + warn_threshold: import("@kbn/config-schema").Type; +}>; +declare const requestTimeoutsConfig: import("@kbn/config-schema").ObjectType<{ + update_by_query: import("@kbn/config-schema").Type; +}>; +export declare const configSchema: import("@kbn/config-schema").ObjectType<{ + allow_reading_invalid_state: import("@kbn/config-schema").Type; + api_key_type: import("@kbn/config-schema").Type; + grant_uiam_api_keys: import("@kbn/config-schema").Type; + capacity: import("@kbn/config-schema").Type; + discovery: import("@kbn/config-schema").ObjectType<{ + active_nodes_lookback: import("@kbn/config-schema").Type; + interval: import("@kbn/config-schema").Type; + }>; + ephemeral_tasks: import("@kbn/config-schema").Type; + event_loop_delay: import("@kbn/config-schema").ObjectType<{ + monitor: import("@kbn/config-schema").Type; + warn_threshold: import("@kbn/config-schema").Type; + }>; + invalidate_api_key_task: import("@kbn/config-schema").ObjectType<{ + interval: import("@kbn/config-schema").Type; + removalDelay: import("@kbn/config-schema").Type; + }>; + kibanas_per_partition: import("@kbn/config-schema").Type; + max_attempts: import("@kbn/config-schema").Type; + max_workers: import("@kbn/config-schema").Type; + metrics_reset_interval: import("@kbn/config-schema").Type; + monitored_aggregated_stats_refresh_rate: import("@kbn/config-schema").Type; + monitored_stats_health_verbose_log: import("@kbn/config-schema").ObjectType<{ + enabled: import("@kbn/config-schema").Type; + level: import("@kbn/config-schema").Type<"debug" | "info">; + warn_delayed_task_start_in_seconds: import("@kbn/config-schema").Type; + }>; + monitored_stats_required_freshness: import("@kbn/config-schema").Type; + monitored_stats_running_average_window: import("@kbn/config-schema").Type; + monitored_task_execution_thresholds: import("@kbn/config-schema").ObjectType<{ + custom: import("@kbn/config-schema").Type>>; + default: import("@kbn/config-schema").ObjectType<{ + error_threshold: import("@kbn/config-schema").Type; + warn_threshold: import("@kbn/config-schema").Type; + }>; + }>; + poll_interval: import("@kbn/config-schema").ConditionalType<"mget", number, number>; + request_capacity: import("@kbn/config-schema").Type; + unsafe: import("@kbn/config-schema").ObjectType<{ + authenticate_background_task_utilization: import("@kbn/config-schema").Type; + exclude_task_types: import("@kbn/config-schema").Type; + }>; + version_conflict_threshold: import("@kbn/config-schema").Type; + worker_utilization_running_average_window: import("@kbn/config-schema").Type; + claim_strategy: import("@kbn/config-schema").Type; + request_timeouts: import("@kbn/config-schema").ObjectType<{ + update_by_query: import("@kbn/config-schema").Type; + }>; + auto_calculate_default_ech_capacity: import("@kbn/config-schema").Type; +}>; +export type TaskManagerConfig = TypeOf; +export type TaskExecutionFailureThreshold = TypeOf; +export type EventLoopDelayConfig = TypeOf; +export type RequestTimeoutsConfig = TypeOf; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/constants.d.ts b/x-pack/platform/plugins/shared/task_manager/server/constants.d.ts new file mode 100644 index 0000000000000..4163b655479c0 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/constants.d.ts @@ -0,0 +1,15 @@ +export declare const TASK_MANAGER_INDEX = ".kibana_task_manager"; +export declare const CONCURRENCY_ALLOW_LIST_BY_TASK_TYPE: string[]; +export declare const EVENT_LOG_PROVIDER = "taskManager"; +export declare const EVENT_LOG_ACTIONS: { + taskRun: string; + taskCancel: string; +}; +export declare enum EventLogOutcomes { + success = "success", + failure = "failure" +} +export declare const UIAM_LOGS_GRANT_TAGS: string[]; +export declare const UIAM_LOGS_INVALIDATE_TAGS: string[]; +export declare const UIAM_LOGS_CREDENTIALS_TAGS: string[]; +export declare const UIAM_LOGS_USAGE_TAGS: string[]; diff --git a/x-pack/platform/plugins/shared/task_manager/server/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/index.d.ts new file mode 100644 index 0000000000000..15fe772ee0ea0 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/index.d.ts @@ -0,0 +1,21 @@ +import type { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; +import type { TaskManagerConfig } from './config'; +export declare const plugin: (initContext: PluginInitializerContext) => Promise; +export type { TaskInstance, ConcreteTaskInstance, TaskRunCreatorFunction, RunContext, IntervalSchedule, } from './task'; +export { Frequency, Weekday } from '@kbn/rrule'; +export { scheduleRruleSchemaV1, scheduleRruleSchemaV2, scheduleRruleSchemaV3, } from './saved_objects'; +export type { RruleSchedule } from './task'; +export { TaskStatus, TaskPriority, TaskCost, InstanceTaskCost } from './task'; +export type { TaskRegisterDefinition, TaskDefinitionRegistry } from './task_type_dictionary'; +export { asInterval } from './lib/intervals'; +export { isUnrecoverableError, throwUnrecoverableError, throwRetryableError, createTaskRunError, TaskErrorSource, } from './task_running'; +export type { DecoratedError } from './task_running'; +export type { RunNowResult, BulkUpdateTaskResult } from './task_scheduling'; +export { getOldestIdleActionTask } from './queries/oldest_idle_action_task'; +export { IdleTaskWithExpiredRunAt, RunningOrClaimingTaskWithExpiredRetryAt, } from './queries/mark_available_tasks_as_claimed'; +export { aggregateTaskOverduePercentilesForType } from './queries/aggregate_task_overdue_percentiles_for_type'; +export { runInvalidate } from './invalidate_api_keys/lib'; +export type { TaskManagerPlugin as TaskManager, TaskManagerSetupContract, TaskManagerStartContract, } from './plugin'; +export { TaskAlreadyRunningError } from './lib/errors'; +export { EVENT_LOG_ACTIONS, EVENT_LOG_PROVIDER } from './constants'; +export declare const config: PluginConfigDescriptor; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/invalidate_api_keys_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/invalidate_api_keys_task.d.ts new file mode 100644 index 0000000000000..bac5ab421e0d6 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/invalidate_api_keys_task.d.ts @@ -0,0 +1,45 @@ +import type { Logger } from '@kbn/logging'; +import type { CoreStart } from '@kbn/core-lifecycle-server'; +import type { InvalidateAPIKeyResult, InvalidateAPIKeysParams, InvalidateUiamAPIKeyParams } from '@kbn/security-plugin-types-server'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; +import type { TaskScheduling } from '../task_scheduling'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +import type { TaskManagerStartContract } from '..'; +import type { TaskManagerPluginsStart } from '../plugin'; +export declare const TASK_ID = "invalidate_api_keys"; +export type ApiKeyInvalidationFn = (params: InvalidateAPIKeysParams) => Promise | undefined; +export type UiamApiKeyInvalidationFn = (request: KibanaRequest, params: InvalidateUiamAPIKeyParams) => Promise; +export declare function scheduleInvalidateApiKeyTask(logger: Logger, taskScheduling: TaskScheduling, interval: string): Promise; +interface RegisterInvalidateApiKeyTaskOpts { + configInterval: string; + coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>; + getEncryptedSavedObjectsClient: () => EncryptedSavedObjectsClient | undefined; + invalidateApiKeyFn?: ApiKeyInvalidationFn; + invalidateUiamApiKeyFn?: () => UiamApiKeyInvalidationFn | undefined; + logger: Logger; + removalDelay: string; + taskTypeDictionary: TaskTypeDictionary; +} +export declare function registerInvalidateApiKeyTask(opts: RegisterInvalidateApiKeyTaskOpts): void; +type InvalidateApiKeysTaskRunnerOpts = Pick; +interface InvalidateApiKeysTaskState { + missing_api_key_retries?: Record; +} +export declare function taskRunner(opts: InvalidateApiKeysTaskRunnerOpts): ({ taskInstance }: { + taskInstance: { + state: InvalidateApiKeysTaskState; + }; +}) => { + run(): Promise<{ + state: { + missing_api_key_retries: { + [x: string]: number; + }; + }; + schedule: { + interval: string; + }; + }>; +}; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/constants.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/constants.d.ts new file mode 100644 index 0000000000000..fffb3ce82db5f --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/constants.d.ts @@ -0,0 +1 @@ +export declare const PAGE_SIZE = 100; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_api_key_ids_to_invalidate.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_api_key_ids_to_invalidate.d.ts new file mode 100644 index 0000000000000..9f9fae36746a0 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_api_key_ids_to_invalidate.d.ts @@ -0,0 +1,27 @@ +import type { SavedObjectsFindResponse, SavedObjectsClientContract } from '@kbn/core/server'; +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; +import type { ApiKeyToInvalidate } from '../../saved_objects/schemas/api_key_to_invalidate'; +import type { SavedObjectTypesToQuery } from './run_invalidate'; +export interface ApiKeyIdAndSOId { + id: string; + apiKeyId: string; +} +export interface UiamApiKeyAndSOId { + id: string; + apiKeyId: string; + uiamApiKey: string; +} +interface GetApiKeyIdsToInvalidateOpts { + apiKeySOsPendingInvalidation: SavedObjectsFindResponse; + encryptedSavedObjectsClient?: EncryptedSavedObjectsClient; + savedObjectsClient: SavedObjectsClientContract; + savedObjectType: string; + savedObjectTypesToQuery: SavedObjectTypesToQuery[]; +} +interface GetApiKeysToInvalidateResult { + apiKeyIdsToInvalidate: ApiKeyIdAndSOId[]; + uiamApiKeysToInvalidate?: UiamApiKeyAndSOId[]; + apiKeyIdsToExclude: ApiKeyIdAndSOId[]; +} +export declare function getApiKeyIdsToInvalidate({ apiKeySOsPendingInvalidation, encryptedSavedObjectsClient, savedObjectsClient, savedObjectType, savedObjectTypesToQuery, }: GetApiKeyIdsToInvalidateOpts): Promise; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_find_filter.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_find_filter.d.ts new file mode 100644 index 0000000000000..26955226f72f8 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_find_filter.d.ts @@ -0,0 +1,7 @@ +interface GetFindFilterOpts { + removalDelay: string; + excludedSOIds?: string[]; + savedObjectType: string; +} +export declare function getFindFilter(opts: GetFindFilterOpts): string; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/index.d.ts new file mode 100644 index 0000000000000..39a5ad8dd7e7e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/index.d.ts @@ -0,0 +1 @@ +export { runInvalidate } from './run_invalidate'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys.d.ts new file mode 100644 index 0000000000000..7d35439f7a9d5 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys.d.ts @@ -0,0 +1,13 @@ +import type { InvalidateAPIKeysParams, InvalidateAPIKeyResult as SecurityPluginInvalidateAPIKeyResult } from '@kbn/security-plugin-types-server'; +import type { ApiKeyInvalidationFn, UiamApiKeyInvalidationFn } from '../invalidate_api_keys_task'; +export type InvalidateAPIKeyResult = { + apiKeysEnabled: false; +} | { + apiKeysEnabled: true; + result: SecurityPluginInvalidateAPIKeyResult; +}; +export declare function invalidateAPIKeys(params: InvalidateAPIKeysParams, invalidateApiKeyFn?: ApiKeyInvalidationFn): Promise; +export declare function invalidateUiamAPIKeys(params: { + uiamApiKey: string; + apiKeyId: string; +}, invalidateUiamApiKeyFn?: UiamApiKeyInvalidationFn): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys_and_delete_so.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys_and_delete_so.d.ts new file mode 100644 index 0000000000000..59643295776a2 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys_and_delete_so.d.ts @@ -0,0 +1,19 @@ +import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; +import type { ApiKeyIdAndSOId, UiamApiKeyAndSOId } from './get_api_key_ids_to_invalidate'; +import type { ApiKeyInvalidationFn, UiamApiKeyInvalidationFn } from '../invalidate_api_keys_task'; +interface InvalidateApiKeysAndDeleteSO { + apiKeyIdsToInvalidate: ApiKeyIdAndSOId[]; + uiamApiKeysToInvalidate?: UiamApiKeyAndSOId[]; + invalidateApiKeyFn?: ApiKeyInvalidationFn; + invalidateUiamApiKeyFn?: UiamApiKeyInvalidationFn; + logger: Logger; + missingApiKeyRetries: Record; + savedObjectsClient: SavedObjectsClientContract; + savedObjectType: string; +} +export interface InvalidateApiKeysResult { + totalInvalidated: number; + missingApiKeyRetries: Record; +} +export declare function invalidateApiKeysAndDeletePendingApiKeySavedObject({ apiKeyIdsToInvalidate, uiamApiKeysToInvalidate, invalidateApiKeyFn, invalidateUiamApiKeyFn, logger, missingApiKeyRetries: inputRetries, savedObjectsClient, savedObjectType, }: InvalidateApiKeysAndDeleteSO): Promise; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/query_for_api_keys_in_use.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/query_for_api_keys_in_use.d.ts new file mode 100644 index 0000000000000..9bea5636ff580 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/query_for_api_keys_in_use.d.ts @@ -0,0 +1,10 @@ +import type { AggregationsStringTermsBucketKeys } from '@elastic/elasticsearch/lib/api/types'; +import type { SavedObjectsClientContract } from '@kbn/core/server'; +import type { SavedObjectTypesToQuery } from './run_invalidate'; +interface QueryForApiKeysInUseOpts { + apiKeyIds: string[]; + savedObjectTypeToQuery: SavedObjectTypesToQuery; + savedObjectsClient: SavedObjectsClientContract; +} +export declare function queryForApiKeysInUse(opts: QueryForApiKeysInUseOpts): Promise; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/run_invalidate.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/run_invalidate.d.ts new file mode 100644 index 0000000000000..edc7a5722b651 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/run_invalidate.d.ts @@ -0,0 +1,24 @@ +import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; +import type { ApiKeyInvalidationFn, UiamApiKeyInvalidationFn } from '../invalidate_api_keys_task'; +export interface SavedObjectTypesToQuery { + type: string; + apiKeyAttributePath: string; +} +interface RunInvalidateOpts { + encryptedSavedObjectsClient?: EncryptedSavedObjectsClient; + invalidateApiKeyFn?: ApiKeyInvalidationFn; + invalidateUiamApiKeyFn?: UiamApiKeyInvalidationFn; + logger: Logger; + missingApiKeyRetries?: Record; + removalDelay: string; + savedObjectsClient: SavedObjectsClientContract; + savedObjectType: string; + savedObjectTypesToQuery: SavedObjectTypesToQuery[]; +} +export interface RunInvalidateResult { + totalInvalidated: number; + missingApiKeyRetries: Record; +} +export declare function runInvalidate(opts: RunInvalidateOpts): Promise; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/delete_inactive_nodes_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/delete_inactive_nodes_task.d.ts new file mode 100644 index 0000000000000..f433127b9dfde --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/delete_inactive_nodes_task.d.ts @@ -0,0 +1,19 @@ +import type { Logger } from '@kbn/logging'; +import type { CoreStart } from '@kbn/core-lifecycle-server'; +import type { TaskScheduling } from '../task_scheduling'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +import type { TaskManagerStartContract } from '..'; +import type { TaskManagerPluginsStart } from '../plugin'; +export declare const TASK_ID = "delete_inactive_background_task_nodes"; +export declare const CLEANUP_INTERVAL = "1m"; +export declare const CLEANUP_LOOKBACK = "5m"; +export declare function scheduleDeleteInactiveNodesTaskDefinition(logger: Logger, taskScheduling: TaskScheduling): Promise; +export declare function registerDeleteInactiveNodesTaskDefinition(logger: Logger, coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>, taskTypeDictionary: TaskTypeDictionary): void; +export declare function taskRunner(logger: Logger, coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>): () => { + run(): Promise<{ + state: {}; + schedule: { + interval: string; + }; + }>; +}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/index.d.ts new file mode 100644 index 0000000000000..b1c60a5286a7b --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/index.d.ts @@ -0,0 +1 @@ +export { KibanaDiscoveryService } from './kibana_discovery_service'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/kibana_discovery_service.d.ts b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/kibana_discovery_service.d.ts new file mode 100644 index 0000000000000..32e106247c67a --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/kibana_discovery_service.d.ts @@ -0,0 +1,34 @@ +import type { ISavedObjectsRepository } from '@kbn/core/server'; +import type { Logger } from '@kbn/core/server'; +import type { TaskManagerConfig } from '../config'; +interface DiscoveryServiceParams { + config: TaskManagerConfig['discovery']; + currentNode: string; + savedObjectsRepository: ISavedObjectsRepository; + logger: Logger; + onNodesCounted?: (numOfNodes: number) => void; +} +export declare const DEFAULT_TIMEOUT = 2000; +export declare class KibanaDiscoveryService { + private readonly activeNodesLookBack; + private readonly discoveryInterval; + private currentNode; + private started; + private savedObjectsRepository; + private logger; + private stopped; + private timer; + private onNodesCounted?; + constructor(opts: DiscoveryServiceParams); + private upsertCurrentNode; + private scheduleUpsertCurrentNode; + isStarted(): boolean; + start(): Promise; + getActiveKibanaNodes(): Promise>[]>; + deleteCurrentNode(): Promise; + stop(): void; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/adhoc_task_counter.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/adhoc_task_counter.d.ts new file mode 100644 index 0000000000000..8befb6f4e2e4f --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/adhoc_task_counter.d.ts @@ -0,0 +1,17 @@ +/** + * Keeps track of how many tasks have been created. + * + * @export + * @class AdHocTaskCounter + * + */ +export declare class AdHocTaskCounter { + /** + * Gets the number of created tasks. + */ + get count(): number; + private _count; + constructor(); + increment(by?: number): void; + reset(): void; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/api_key_utils.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/api_key_utils.d.ts new file mode 100644 index 0000000000000..2b72f0e5c401f --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/api_key_utils.d.ts @@ -0,0 +1,23 @@ +import type { AuthenticatedUser, SecurityServiceStart, IBasePath } from '@kbn/core/server'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { TaskInstance, TaskUserScope } from '../task'; +export interface APIKeyResult { + id: string; + api_key: string; +} +export interface EncodedApiKeyResult { + apiKey: string; + apiKeyId: string; +} +export interface ApiKeyAndUserScope { + apiKey: string; + userScope: TaskUserScope; +} +export declare const isRequestApiKeyType: (user: AuthenticatedUser | null) => boolean; +export declare const requestHasApiKey: (security: SecurityServiceStart, request: KibanaRequest) => boolean; +export declare const getApiKeyFromRequest: (request: KibanaRequest) => { + id: string; + api_key: string; +} | null; +export declare const createApiKey: (taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart) => Promise>; +export declare const getApiKeyAndUserScope: (taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart, basePath: IBasePath) => Promise>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/assign_pod_partitions.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/assign_pod_partitions.d.ts new file mode 100644 index 0000000000000..143139c32c440 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/assign_pod_partitions.d.ts @@ -0,0 +1,14 @@ +interface GetPartitionMapOpts { + kibanasPerPartition: number; + partitions: number[]; + podNames: string[]; +} +export declare function getPartitionMap({ kibanasPerPartition, podNames, partitions, }: GetPartitionMapOpts): Record; +interface AssignPodPartitionsOpts { + kibanasPerPartition: number; + podName: string; + podNames: string[]; + partitions: number[]; +} +export declare function assignPodPartitions({ kibanasPerPartition, podName, podNames, partitions, }: AssignPodPartitionsOpts): number[]; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/bulk_operation_buffer.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/bulk_operation_buffer.d.ts new file mode 100644 index 0000000000000..9678dd7ae8d14 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/bulk_operation_buffer.d.ts @@ -0,0 +1,22 @@ +import type { Logger } from '@kbn/core/server'; +import type { estypes } from '@elastic/elasticsearch'; +import type { SavedObjectError } from '@kbn/core-saved-objects-common'; +import type { Result } from './result_type'; +export interface BufferOptions { + bufferMaxDuration?: number; + bufferMaxOperations?: number; + logger?: Logger; +} +export interface Entity { + id: string; +} +export interface ErrorOutput { + type: string; + id: string; + status?: number; + error: SavedObjectError | estypes.ErrorCause; +} +export type OperationResult = Result; +export type Operation = (entity: T) => Promise>; +export type BulkOperation = (entities: T[]) => Promise>>; +export declare function createBuffer(bulkOperation: BulkOperation, { bufferMaxDuration, bufferMaxOperations, logger }: BufferOptions): Operation; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/calculate_health_status.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/calculate_health_status.d.ts new file mode 100644 index 0000000000000..a01f5dc0ecc9f --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/calculate_health_status.d.ts @@ -0,0 +1,8 @@ +import type { Logger } from '@kbn/core/server'; +import type { RawMonitoringStats } from '../monitoring'; +import { HealthStatus } from '../monitoring'; +import type { TaskManagerConfig } from '../config'; +export declare function calculateHealthStatus(summarizedStats: RawMonitoringStats, config: TaskManagerConfig, shouldRunTasks: boolean, logger: Logger): { + status: HealthStatus; + reason?: string; +}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/correct_deprecated_fields.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/correct_deprecated_fields.d.ts new file mode 100644 index 0000000000000..ab14b02adfe39 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/correct_deprecated_fields.d.ts @@ -0,0 +1,3 @@ +import type { Logger } from '@kbn/core/server'; +import type { TaskInstance, TaskInstanceWithDeprecatedFields } from '../task'; +export declare function ensureDeprecatedFieldsAreCorrected({ id, taskType, interval, schedule, ...taskInstance }: TaskInstanceWithDeprecatedFields, logger: Logger): TaskInstance; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/create_managed_configuration.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/create_managed_configuration.d.ts new file mode 100644 index 0000000000000..30d4cebb0af31 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/create_managed_configuration.d.ts @@ -0,0 +1,20 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { TaskManagerConfig } from '../config'; +export declare const ADJUST_THROUGHPUT_INTERVAL: number; +export declare const PREFERRED_MAX_POLL_INTERVAL: number; +export declare const INTERVAL_AFTER_BLOCK_EXCEPTION: number; +export declare const MIN_COST: number; +export declare const MIN_WORKERS = 1; +interface ErrorScanResult { + count: number; + isBlockException: boolean; +} +export declare function createCapacityScan(config: TaskManagerConfig, logger: Logger, startingCapacity: number): import("rxjs").OperatorFunction; +export declare function createPollIntervalScan(logger: Logger, startingPollInterval: number, claimStrategy: string, tmUtilizationQueue: (value?: number | undefined) => number[]): import("rxjs").OperatorFunction<[{ + count: any; + isBlockException: any; +}, any], number>; +export declare function countErrors(errors$: Observable, countInterval: number): Observable; +export declare function calculateStartingCapacity(config: TaskManagerConfig, logger: Logger, defaultCapacity: number): number; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/bulk_update_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/bulk_update_error.d.ts new file mode 100644 index 0000000000000..344cb33dc110a --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/bulk_update_error.d.ts @@ -0,0 +1,14 @@ +export declare class BulkUpdateError extends Error { + private _statusCode; + private _type; + constructor({ statusCode, message, type, }: { + statusCode: number; + message?: string; + type: string; + }); + get statusCode(): number; + get type(): string; +} +export declare function getBulkUpdateStatusCode(error: Error | BulkUpdateError): number | undefined; +export declare function getBulkUpdateErrorType(error: Error | BulkUpdateError): string | undefined; +export declare function isClusterBlockException(error: Error | BulkUpdateError): boolean; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/index.d.ts new file mode 100644 index 0000000000000..88026566b5493 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/index.d.ts @@ -0,0 +1,3 @@ +export { BulkUpdateError, getBulkUpdateStatusCode, isClusterBlockException, } from './bulk_update_error'; +export { MsearchError, getMsearchStatusCode } from './msearch_error'; +export { TaskAlreadyRunningError } from './task_already_running_error'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/msearch_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/msearch_error.d.ts new file mode 100644 index 0000000000000..2f699760be51e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/msearch_error.d.ts @@ -0,0 +1,6 @@ +export declare class MsearchError extends Error { + private _statusCode?; + constructor(statusCode?: number); + get statusCode(): number | undefined; +} +export declare function getMsearchStatusCode(error: Error | MsearchError): number | undefined; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/task_already_running_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/task_already_running_error.d.ts new file mode 100644 index 0000000000000..83cb17a28a5ba --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/task_already_running_error.d.ts @@ -0,0 +1,3 @@ +export declare class TaskAlreadyRunningError extends Error { + constructor(id: string, noForce?: boolean); +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/execution_context.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/execution_context.d.ts new file mode 100644 index 0000000000000..f5012843bc448 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/execution_context.d.ts @@ -0,0 +1,16 @@ +import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; +import type { ExecutionContextSetup } from '@kbn/core/server'; +export interface CreateExecutionContextArgs { + contextSetup: ExecutionContextSetup; + baseContext: KibanaExecutionContext; +} +export interface ExecutionContextRunner { + run(fn: () => Promise, context?: KibanaExecutionContext): Promise; +} +export declare class ExecutionContextRunnerImpl implements ExecutionContextRunner { + private contextSetup; + private baseContext; + constructor(args: CreateExecutionContextArgs); + run(fn: () => Promise, context?: KibanaExecutionContext): Promise; +} +export declare function getExecutionContextRunner(contextSetup: ExecutionContextSetup, baseContext?: KibanaExecutionContext): ExecutionContextRunner; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/fill_pool.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/fill_pool.d.ts new file mode 100644 index 0000000000000..61eb5caf96012 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/fill_pool.d.ts @@ -0,0 +1,31 @@ +import type { ClaimOwnershipResult } from '../queries/task_claiming'; +import type { ConcreteTaskInstance } from '../task'; +import type { WithTaskTiming } from '../task_events'; +import { TaskPoolRunResult } from '../task_pool'; +import type { TaskManagerRunner } from '../task_running'; +import type { Result } from './result_type'; +export declare enum FillPoolResult { + Failed = "Failed", + NoAvailableWorkers = "NoAvailableWorkers", + NoTasksClaimed = "NoTasksClaimed", + RunningAtCapacity = "RunningAtCapacity", + RanOutOfCapacity = "RanOutOfCapacity", + PoolFilled = "PoolFilled" +} +export type ClaimAndFillPoolResult = Partial> & { + result: FillPoolResult; +}; +export type TimedFillPoolResult = WithTaskTiming; +/** + * Given a function that runs a batch of tasks (e.g. taskPool.run), a function + * that fetches task records (e.g. store.fetchAvailableTasks), and a function + * that converts task records to the appropriate task runner, this function + * fills the pool with work. + * + * This is annoyingly general in order to simplify testing. + * + * @param run - a function that runs a batch of tasks (e.g. taskPool.run) + * @param fetchAvailableTasks - a function that fetches task records (e.g. store.fetchAvailableTasks) + * @param converter - a function that converts task records to the appropriate task runner + */ +export declare function fillPool(fetchAvailableTasks: () => Promise>, converter: (taskInstance: ConcreteTaskInstance) => TaskManagerRunner, run: (tasks: TaskManagerRunner[]) => Promise): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_default_capacity.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_default_capacity.d.ts new file mode 100644 index 0000000000000..193a3a9fa1eed --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/get_default_capacity.d.ts @@ -0,0 +1,10 @@ +interface GetDefaultCapacityOpts { + autoCalculateDefaultEchCapacity: boolean; + claimStrategy?: string; + heapSizeLimit: number; + isCloud: boolean; + isServerless: boolean; + isBackgroundTaskNodeOnly: boolean; +} +export declare function getDefaultCapacity({ autoCalculateDefaultEchCapacity, claimStrategy, heapSizeLimit: heapSizeLimitInBytes, isCloud, isServerless, isBackgroundTaskNodeOnly, }: GetDefaultCapacityOpts): number; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_es_and_so_availability.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_es_and_so_availability.d.ts new file mode 100644 index 0000000000000..920156493394c --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/get_es_and_so_availability.d.ts @@ -0,0 +1,9 @@ +import type { Observable } from 'rxjs'; +import type { Logger, CoreStatus, IClusterClient } from '@kbn/core/server'; +export interface GetElasticsearchAndSOAvailabilityOpts { + core$: Observable; + isServerless: boolean; + logger: Logger; + getClusterClient: () => Promise; +} +export declare function getElasticsearchAndSOAvailability({ core$, isServerless, logger, getClusterClient, }: GetElasticsearchAndSOAvailabilityOpts): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_execution_id.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_execution_id.d.ts new file mode 100644 index 0000000000000..2d91f4a7281d2 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/get_execution_id.d.ts @@ -0,0 +1 @@ +export declare function getExecutionId(executionId: string): string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_first_run_at.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_first_run_at.d.ts new file mode 100644 index 0000000000000..ec72f239c0c7f --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/get_first_run_at.d.ts @@ -0,0 +1,6 @@ +import type { Logger } from '@kbn/core/server'; +import type { TaskInstance } from '../task'; +export declare function getFirstRunAt({ taskInstance, logger, }: { + taskInstance: TaskInstance; + logger: Logger; +}): string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_next_run_at.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_next_run_at.d.ts new file mode 100644 index 0000000000000..702d160f87f33 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/get_next_run_at.d.ts @@ -0,0 +1,7 @@ +import type { Logger } from '@kbn/core/server'; +import type { ConcreteTaskInstance, IntervalSchedule, RruleSchedule } from '../task'; +export declare function getNextRunAt({ runAt, startedAt, schedule }: Pick, taskDelayThresholdForPreciseScheduling: number | undefined, logger: Logger): Date; +export declare function calculateNextRunAtFromSchedule({ schedule, startDate, }: { + schedule?: IntervalSchedule | RruleSchedule; + startDate: Date; +}): number; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_retry_at.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_retry_at.d.ts new file mode 100644 index 0000000000000..e73f07359f6f4 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/get_retry_at.d.ts @@ -0,0 +1,9 @@ +import type { ConcreteTaskInstance, TaskDefinition } from '../task'; +export declare function getRetryAt(task: ConcreteTaskInstance, taskDefinition: TaskDefinition | undefined): Date | undefined; +export declare function getRetryDate({ error, attempts, addDuration, }: { + error: Error; + attempts: number; + addDuration?: string; +}): Date | undefined; +export declare function calculateDelayBasedOnAttempts(attempts: number): number; +export declare function getTimeout(task: ConcreteTaskInstance, taskDefinition: TaskDefinition | undefined): string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/identify_es_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/identify_es_error.d.ts new file mode 100644 index 0000000000000..ae220caed8147 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/identify_es_error.d.ts @@ -0,0 +1,29 @@ +export interface ESErrorCausedBy { + type?: string; + reason?: string; + caused_by?: ESErrorCausedBy; +} +export interface ESError { + root_cause?: ESErrorCausedBy[]; + caused_by?: ESErrorCausedBy; +} +export interface ESErrorBody { + error?: ESError; + status?: number; +} +export interface ESErrorMeta { + body?: ESErrorBody; + statusCode?: number; +} +export interface ElasticsearchResponseError { + name?: string; + meta?: ESErrorMeta; +} +/** + * Identified causes for ES Error + * + * @param err Object Error thrown by ES JS client + * @return ES error cause + */ +export declare function identifyEsError(err: ElasticsearchResponseError): string[]; +export declare function isEsCannotExecuteScriptError(err: ElasticsearchResponseError): boolean; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/intervals.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/intervals.d.ts new file mode 100644 index 0000000000000..c523588911788 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/intervals.d.ts @@ -0,0 +1,47 @@ +export declare enum IntervalCadence { + Minute = "m", + Second = "s", + Hour = "h", + Day = "d" +} +export type Interval = string; +export declare function isInterval(interval: Interval | string): interval is Interval; +export declare function asInterval(ms: number): Interval; +/** + * Returns a date that is the specified interval from now. Currently, + * only minute-intervals and second-intervals are supported. + * + * @param {Interval} interval - An interval of the form `Nm` such as `5m` + */ +export declare function intervalFromNow(interval?: Interval): Date | undefined; +/** + * Returns a date that is the specified interval from given date. Currently, + * only minute-intervals and second-intervals are supported. + * + * @param {Date} date - The date to add interval to + * @param {Interval} interval - An interval of the form `Nm` such as `5m` + */ +export declare function intervalFromDate(date: Date, interval?: Interval): Date | undefined; +export declare function maxIntervalFromDate(date: Date, ...intervals: Array): Date | undefined; +/** + * Returns a date that is secs seconds from now. + * + * @param secs The number of seconds from now + */ +export declare function secondsFromNow(secs: number): Date; +/** + * Returns a date that is secs seconds from given date. + * + * @param date The date to add seconds to + * @param secs The number of seconds from given date + */ +export declare function secondsFromDate(date: Date, secs: number): Date; +/** + * Verifies that the specified interval matches our expected format. + * + * @param {Interval} interval - An interval such as `5m` or `10s` + * @returns {number} The interval as seconds + */ +export declare const parseIntervalAsSecond: ((interval: Interval) => number) & import("lodash").MemoizedFunction; +export declare const parseIntervalAsMillisecond: ((interval: Interval) => number) & import("lodash").MemoizedFunction; +export declare const timePeriodBeforeDate: (date: Date, timePeriod: string) => Date; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/is_task_not_found_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/is_task_not_found_error.d.ts new file mode 100644 index 0000000000000..3340bb5544ff0 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/is_task_not_found_error.d.ts @@ -0,0 +1 @@ +export declare function isTaskSavedObjectNotFoundError(err: Error, taskId: string): boolean; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/log_health_metrics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/log_health_metrics.d.ts new file mode 100644 index 0000000000000..7bcce0608c2f5 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/log_health_metrics.d.ts @@ -0,0 +1,7 @@ +import type { Observable } from 'rxjs'; +import type { Logger, DocLinksServiceSetup } from '@kbn/core/server'; +import type { TaskManagerConfig } from '../config'; +import type { MonitoredHealth } from '../routes/health'; +export declare function resetLastLogLevel(): void; +export declare function setupIntervalLogging(monitoredHealth$: Observable, logger: Logger, minutes: number): void; +export declare function logHealthMetrics(monitoredHealth: MonitoredHealth, logger: Logger, config: TaskManagerConfig, shouldRunTasks: boolean, docLinks: DocLinksServiceSetup): void; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/middleware.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/middleware.d.ts new file mode 100644 index 0000000000000..f9b845d414b3e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/middleware.d.ts @@ -0,0 +1,20 @@ +import type { RunContext, TaskInstance } from '../task'; +type Mapper = (params: T) => Promise; +interface BeforeSaveContext { + taskInstance: TaskInstance; +} +export type BeforeRunContext = Omit; +export type BeforeSaveContextFunction = Mapper; +export type BeforeRunContextFunction = Mapper; +export interface Middleware { + beforeSave: BeforeSaveContextFunction; + beforeRun: BeforeRunContextFunction; + beforeMarkRunning: BeforeRunContextFunction; +} +export declare function addMiddlewareToChain(prev: Middleware, next: Partial): { + beforeSave: BeforeSaveContextFunction; + beforeRun: BeforeRunContextFunction; + beforeMarkRunning: BeforeRunContextFunction; +}; +export declare function createInitialMiddleware(): Middleware; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/millis_to_nanos.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/millis_to_nanos.d.ts new file mode 100644 index 0000000000000..784b3115a9487 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/millis_to_nanos.d.ts @@ -0,0 +1 @@ +export declare function millisToNanos(millis: number): string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/remove_if_exists.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/remove_if_exists.d.ts new file mode 100644 index 0000000000000..183295ad24296 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/remove_if_exists.d.ts @@ -0,0 +1,9 @@ +import type { TaskStore } from '../task_store'; +/** + * Removes a task from the store, ignoring a not found error + * Other errors are re-thrown + * + * @param taskStore + * @param taskId + */ +export declare function removeIfExists(taskStore: TaskStore, taskId: string): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/result_type.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/result_type.d.ts new file mode 100644 index 0000000000000..6ef6d38f653c2 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/result_type.d.ts @@ -0,0 +1,23 @@ +export interface Ok { + tag: 'ok'; + value: T; +} +export interface Err { + tag: 'err'; + error: E; +} +export type Result = Ok | Err; +export declare function asOk(value: T): Ok; +export declare function asErr(error: T): Err; +export declare function isOk(result: Result): result is Ok; +export declare function isErr(result: Result): result is Err; +export declare function tryAsResult(fn: () => T): Result; +export declare function promiseResult(future: Promise): Promise>; +export declare function unwrapPromise(future: Promise>): Promise; +export declare function unwrap(result: Result): T | E; +export declare function either(result: Result, onOk: (value: T) => void, onErr: (error: E) => void): Result; +export declare function eitherAsync(result: Result, onOk: (value: T) => Promise, onErr: (error: E) => Promise): Promise | void>; +export declare function map(result: Result, onOk: (value: T) => Resolution, onErr: (error: E) => Resolution): Resolution; +export declare const mapR: (...args: any[]) => any; +export declare const mapOk: (...args: any[]) => any; +export declare const mapErr: (...args: any[]) => any; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/retryable_bulk_update.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/retryable_bulk_update.d.ts new file mode 100644 index 0000000000000..a8ce769f21dba --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/retryable_bulk_update.d.ts @@ -0,0 +1,15 @@ +import type { ApiKeyOptions, ConcreteTaskInstance } from '../task'; +import type { TaskStore, BulkGetResult } from '../task_store'; +import type { BulkUpdateTaskResult } from '../task_scheduling'; +export declare const MAX_RETRIES = 2; +export interface RetryableBulkUpdateOpts { + taskIds: string[]; + getTasks: (taskIds: string[]) => Promise; + filter: (task: ConcreteTaskInstance) => boolean; + map: (task: ConcreteTaskInstance, i: number, arr: ConcreteTaskInstance[]) => ConcreteTaskInstance; + store: TaskStore; + validate: boolean; + mergeAttributes?: boolean; + options?: ApiKeyOptions; +} +export declare function retryableBulkUpdate({ taskIds, getTasks, filter, map, store, validate, mergeAttributes, options, }: RetryableBulkUpdateOpts): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/runtime_statistics_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/runtime_statistics_aggregator.d.ts new file mode 100644 index 0000000000000..c452b3b2613e5 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/runtime_statistics_aggregator.d.ts @@ -0,0 +1,7 @@ +import type { Observable } from 'rxjs'; +import type { JsonValue } from '@kbn/utility-types'; +export interface AggregatedStat { + key: string; + value: Stat; +} +export type AggregatedStatProvider = Observable>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/task_partitioner.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/task_partitioner.d.ts new file mode 100644 index 0000000000000..aeee83ce39813 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/task_partitioner.d.ts @@ -0,0 +1,25 @@ +import type { Logger } from 'elastic-apm-node'; +import type { KibanaDiscoveryService } from '../kibana_discovery_service'; +export declare const MAX_PARTITIONS = 256; +export declare const CACHE_INTERVAL = 10000; +export interface TaskPartitionerConstructorOpts { + kibanaDiscoveryService: KibanaDiscoveryService; + kibanasPerPartition: number; + podName: string; + logger: Logger; +} +export declare class TaskPartitioner { + private readonly allPartitions; + private readonly podName; + private readonly kibanasPerPartition; + private readonly logger; + private kibanaDiscoveryService; + private podPartitions; + private podPartitionsLastUpdated; + constructor(opts: TaskPartitionerConstructorOpts); + getAllPartitions(): number[]; + getPodName(): string; + getPodPartitions(): number[]; + getPartitions(): Promise; + private getAllPodNames; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/wrapped_logger.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/wrapped_logger.d.ts new file mode 100644 index 0000000000000..2f1c92df6ab4a --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/lib/wrapped_logger.d.ts @@ -0,0 +1,7 @@ +import type { Logger } from '@kbn/core/server'; +interface WrappedLoggerOpts { + logger: Logger; + tags: string[]; +} +export declare function createWrappedLogger(opts: WrappedLoggerOpts): Logger; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/license_subscriber.d.ts b/x-pack/platform/plugins/shared/task_manager/server/license_subscriber.d.ts new file mode 100644 index 0000000000000..c09dc3c4a916d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/license_subscriber.d.ts @@ -0,0 +1,10 @@ +import type { ILicense } from '@kbn/licensing-types'; +import type { Observable } from 'rxjs'; +export declare class LicenseSubscriber { + private subscription; + private licenseState?; + constructor(license: Observable); + private updateState; + getIsSecurityEnabled(): boolean; + cleanup(): void; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/create_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/create_aggregator.d.ts new file mode 100644 index 0000000000000..283c84bb6fd8d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/create_aggregator.d.ts @@ -0,0 +1,17 @@ +import type { Observable } from 'rxjs'; +import type { JsonValue } from '@kbn/utility-types'; +import type { Logger } from '@kbn/core/server'; +import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; +import type { TaskManagerConfig } from '../config'; +import type { ITaskMetricsAggregator } from './types'; +import type { TaskLifecycleEvent } from '../polling_lifecycle'; +export interface CreateMetricsAggregatorOpts { + key: string; + config: TaskManagerConfig; + logger?: Logger; + reset$?: Observable; + events$: Observable; + eventFilter: (event: TaskLifecycleEvent) => boolean; + metricsAggregator: ITaskMetricsAggregator; +} +export declare function createAggregator({ key, config, reset$, logger, events$, eventFilter, metricsAggregator, }: CreateMetricsAggregatorOpts): AggregatedStatProvider; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/index.d.ts new file mode 100644 index 0000000000000..e3bb2f713d4f1 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/index.d.ts @@ -0,0 +1,15 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { TaskManagerConfig } from '../config'; +import type { Metrics } from './metrics_stream'; +import type { TaskPollingLifecycle } from '../polling_lifecycle'; +import type { TaskManagerMetricsCollector } from './task_metrics_collector'; +export type { Metrics } from './metrics_stream'; +interface MetricsStreamOpts { + config: TaskManagerConfig; + logger: Logger; + reset$: Observable; + taskPollingLifecycle?: TaskPollingLifecycle; + taskManagerMetricsCollector?: TaskManagerMetricsCollector; +} +export declare function metricsStream({ config, reset$, logger, taskPollingLifecycle, taskManagerMetricsCollector, }: MetricsStreamOpts): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/counter.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/counter.d.ts new file mode 100644 index 0000000000000..b89c2b63d13b9 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/counter.d.ts @@ -0,0 +1,7 @@ +export declare class Counter { + private count; + initialCount(): number; + get(): number; + increment(): void; + reset(): void; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/get_task_type_group.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/get_task_type_group.d.ts new file mode 100644 index 0000000000000..bdc068b150f0d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/get_task_type_group.d.ts @@ -0,0 +1 @@ +export declare function getTaskTypeGroup(taskType: string): string | undefined; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/index.d.ts new file mode 100644 index 0000000000000..66846113b2cfc --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/index.d.ts @@ -0,0 +1,5 @@ +export { Counter } from './counter'; +export { getTaskTypeGroup } from './get_task_type_group'; +export { MetricCounterService } from './metric_counter_service'; +export { type SerializedHistogram, SimpleHistogram } from './simple_histogram'; +export { unflattenObject } from './unflatten_object'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/metric_counter_service.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/metric_counter_service.d.ts new file mode 100644 index 0000000000000..9b0437c27c0f5 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/metric_counter_service.d.ts @@ -0,0 +1,13 @@ +import type { JsonObject } from '@kbn/utility-types'; +export declare class MetricCounterService { + private readonly counters; + private readonly keys; + constructor(keys: string[], initialNamespace?: string); + initialMetrics(): T; + reset(): void; + increment(key: string, namespace?: string): void; + collect(): T; + private initializeCountersForNamespace; + private buildCounterKey; + private toJson; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/simple_histogram.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/simple_histogram.d.ts new file mode 100644 index 0000000000000..da0af7619bffd --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/simple_histogram.d.ts @@ -0,0 +1,21 @@ +import type { JsonObject } from '@kbn/utility-types'; +export interface SerializedHistogram extends JsonObject { + counts: number[]; + values: number[]; +} +export declare class SimpleHistogram { + private maxValue; + private bucketSize; + private histogramBuckets; + private allValues; + constructor(max: number, bucketSize: number); + reset(): void; + record(value: number, increment?: number): void; + get(truncate?: boolean): { + count: number; + value: number; + }[]; + getAllValues(truncate?: boolean): number[]; + serialize(): SerializedHistogram; + private initializeBuckets; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/unflatten_object.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/unflatten_object.d.ts new file mode 100644 index 0000000000000..34522720ae025 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/unflatten_object.d.ts @@ -0,0 +1,5 @@ +interface GenericObject { + [key: string]: unknown; +} +export declare const unflattenObject: (object: object) => T; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/metrics_stream.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/metrics_stream.d.ts new file mode 100644 index 0000000000000..0da485892403f --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/metrics_stream.d.ts @@ -0,0 +1,31 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { TaskPollingLifecycle } from '../polling_lifecycle'; +import type { TaskManagerConfig } from '../config'; +import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; +import type { TaskClaimMetric } from './task_claim_metrics_aggregator'; +import type { TaskRunMetric } from './task_run_metrics_aggregator'; +import type { TaskOverdueMetric } from './task_overdue_metrics_aggregator'; +import type { TaskManagerMetricsCollector } from './task_metrics_collector'; +export interface Metrics { + last_update: string; + metrics: { + task_claim?: Metric; + task_run?: Metric; + task_overdue?: Metric; + }; +} +export interface Metric { + timestamp: string; + value: T; +} +interface CreateMetricsAggregatorsOpts { + config: TaskManagerConfig; + logger: Logger; + reset$: Observable; + taskPollingLifecycle?: TaskPollingLifecycle; + taskManagerMetricsCollector?: TaskManagerMetricsCollector; +} +export declare function createMetricsAggregators({ config, reset$, logger, taskPollingLifecycle, taskManagerMetricsCollector, }: CreateMetricsAggregatorsOpts): AggregatedStatProvider; +export declare function createMetricsStream(provider$: AggregatedStatProvider): Observable; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_claim_metrics_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_claim_metrics_aggregator.d.ts new file mode 100644 index 0000000000000..3b185aa906bf3 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_claim_metrics_aggregator.d.ts @@ -0,0 +1,26 @@ +import type { JsonObject } from '@kbn/utility-types'; +import type { TaskLifecycleEvent } from '../polling_lifecycle'; +import { type SerializedHistogram } from './lib'; +import type { ITaskMetricsAggregator } from './types'; +declare enum TaskClaimKeys { + SUCCESS = "success", + TOTAL = "total", + TOTAL_ERRORS = "total_errors" +} +interface TaskClaimCounts extends JsonObject { + [TaskClaimKeys.SUCCESS]: number; + [TaskClaimKeys.TOTAL]: number; +} +export type TaskClaimMetric = TaskClaimCounts & { + duration: SerializedHistogram; + duration_values: number[]; +}; +export declare class TaskClaimMetricsAggregator implements ITaskMetricsAggregator { + private counter; + private durationHistogram; + initialMetric(): TaskClaimMetric; + collect(): TaskClaimMetric; + reset(): void; + processTaskLifecycleEvent(taskEvent: TaskLifecycleEvent): void; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_metrics_collector.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_metrics_collector.d.ts new file mode 100644 index 0000000000000..46376d44537b0 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_metrics_collector.d.ts @@ -0,0 +1,32 @@ +import type { Logger } from '@kbn/core/server'; +import type { AggregationsStringTermsBucketKeys } from '@elastic/elasticsearch/lib/api/types'; +import type { Observable } from 'rxjs'; +import type { TaskStore } from '../task_store'; +import type { ITaskEventEmitter, TaskLifecycleEvent } from '../polling_lifecycle'; +interface ConstructorOpts { + logger: Logger; + store: TaskStore; + pollInterval?: number; + taskTypes: Set; + excludedTypes: Set; +} +export interface TaskManagerMetrics { + numOverdueTasks: { + total: AggregationsStringTermsBucketKeys[]; + [key: string]: AggregationsStringTermsBucketKeys[]; + }; +} +export declare class TaskManagerMetricsCollector implements ITaskEventEmitter { + private store; + private logger; + private readonly pollInterval; + private readonly taskTypes; + private readonly excludedTypes; + private running; + private metrics$; + constructor({ logger, store, pollInterval, taskTypes, excludedTypes }: ConstructorOpts); + get events(): Observable; + private start; + private runCollectionCycle; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_overdue_metrics_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_overdue_metrics_aggregator.d.ts new file mode 100644 index 0000000000000..eca07c51d7705 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_overdue_metrics_aggregator.d.ts @@ -0,0 +1,28 @@ +import type { JsonObject } from '@kbn/utility-types'; +import type { TaskLifecycleEvent } from '../polling_lifecycle'; +import { type SerializedHistogram } from './lib'; +import type { ITaskMetricsAggregator } from './types'; +declare const OVERDUE_BY_KEY = "overdue_by"; +declare const OVERDUE_BY_VALUES_KEY = "overdue_by_values"; +declare enum TaskOverdueMetricKeys { + OVERALL = "overall", + BY_TYPE = "by_type" +} +interface TaskOverdueHistogram extends JsonObject { + [OVERDUE_BY_KEY]: SerializedHistogram; + [OVERDUE_BY_VALUES_KEY]: number[]; +} +export interface TaskOverdueMetric extends JsonObject { + [TaskOverdueMetricKeys.OVERALL]: TaskOverdueHistogram; + [TaskOverdueMetricKeys.BY_TYPE]: { + [key: string]: TaskOverdueHistogram; + }; +} +export declare class TaskOverdueMetricsAggregator implements ITaskMetricsAggregator { + private histograms; + initialMetric(): TaskOverdueMetric; + collect(): TaskOverdueMetric; + reset(): void; + processTaskLifecycleEvent(taskEvent: TaskLifecycleEvent): void; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_run_metrics_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_run_metrics_aggregator.d.ts new file mode 100644 index 0000000000000..50a2803423d9b --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_run_metrics_aggregator.d.ts @@ -0,0 +1,53 @@ +import type { JsonObject } from '@kbn/utility-types'; +import type { Logger } from '@kbn/core/server'; +import type { TaskLifecycleEvent } from '../polling_lifecycle'; +import type { SerializedHistogram } from './lib'; +import type { ITaskMetricsAggregator } from './types'; +declare enum TaskRunKeys { + SUCCESS = "success", + NOT_TIMED_OUT = "not_timed_out", + TOTAL = "total", + TOTAL_ERRORS = "total_errors", + RESCHEDULED_FAILURES = "rescheduled_failures", + USER_ERRORS = "user_errors", + FRAMEWORK_ERRORS = "framework_errors" +} +declare enum TaskRunMetricKeys { + OVERALL = "overall", + BY_TYPE = "by_type" +} +interface TaskRunCounts extends JsonObject { + [TaskRunKeys.SUCCESS]: number; + [TaskRunKeys.NOT_TIMED_OUT]: number; + [TaskRunKeys.TOTAL]: number; + [TaskRunKeys.USER_ERRORS]: number; + [TaskRunKeys.FRAMEWORK_ERRORS]: number; + [TaskRunKeys.RESCHEDULED_FAILURES]: number; +} +export interface TaskRunMetrics extends JsonObject { + [TaskRunMetricKeys.OVERALL]: TaskRunCounts; + [TaskRunMetricKeys.BY_TYPE]: { + [key: string]: TaskRunCounts; + }; +} +export interface TaskRunMetric extends JsonObject { + overall: TaskRunMetrics['overall'] & { + delay: SerializedHistogram; + delay_values: number[]; + }; + by_type: TaskRunMetrics['by_type']; +} +export declare class TaskRunMetricsAggregator implements ITaskMetricsAggregator { + private logger; + private counter; + private delayHistogram; + constructor(logger: Logger); + initialMetric(): TaskRunMetric; + collect(): TaskRunMetric; + reset(): void; + processTaskLifecycleEvent(taskEvent: TaskLifecycleEvent): void; + private processTaskRunEvent; + private processTaskManagerStatEvent; + private incrementCounters; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/types.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/types.d.ts new file mode 100644 index 0000000000000..ea133fba019a1 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/metrics/types.d.ts @@ -0,0 +1,7 @@ +import type { TaskLifecycleEvent } from '../polling_lifecycle'; +export interface ITaskMetricsAggregator { + initialMetric: () => T; + collect: () => T; + reset: () => void; + processTaskLifecycleEvent: (event: TaskLifecycleEvent) => void; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/background_task_utilization_statistics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/background_task_utilization_statistics.d.ts new file mode 100644 index 0000000000000..119167f321360 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/background_task_utilization_statistics.d.ts @@ -0,0 +1,38 @@ +import type { JsonObject } from '@kbn/utility-types'; +import type { AdHocTaskCounter } from '../lib/adhoc_task_counter'; +import type { TaskPollingLifecycle } from '../polling_lifecycle'; +import type { MonitoredStat } from './monitoring_stats_stream'; +import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; +export interface PublicBackgroundTaskUtilizationStat extends JsonObject { + load: number; +} +export interface BackgroundTaskUtilizationStat extends PublicBackgroundTaskUtilizationStat { + adhoc: AdhocTaskStat; + recurring: TaskStat; +} +interface TaskStat extends JsonObject { + ran: { + service_time: { + actual: number; + adjusted: number; + task_counter: number; + }; + }; +} +interface AdhocTaskStat extends TaskStat { + created: { + counter: number; + }; +} +export declare function createBackgroundTaskUtilizationAggregator(taskPollingLifecycle: TaskPollingLifecycle, adHocTaskCounter: AdHocTaskCounter, pollInterval: number, workerUtilizationRunningAverageWindowSize?: number): AggregatedStatProvider; +interface SummarizeUtilizationStatsOpts { + lastUpdate: string; + monitoredStats: MonitoredStat | undefined; + isInternal: boolean; +} +interface SummarizeUtilizationStatsResult { + last_update: string; + stats: MonitoredStat | MonitoredStat | null; +} +export declare function summarizeUtilizationStats({ lastUpdate, monitoredStats, isInternal, }: SummarizeUtilizationStatsOpts): SummarizeUtilizationStatsResult; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.d.ts new file mode 100644 index 0000000000000..3267d5275dec2 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.d.ts @@ -0,0 +1,24 @@ +import type { JsonObject } from '@kbn/utility-types'; +import type { Logger } from '@kbn/core/server'; +import type { RawMonitoringStats, RawMonitoredStat } from './monitoring_stats_stream'; +export interface CapacityEstimationStat extends JsonObject { + observed: { + observed_kibana_instances: number; + max_throughput_per_minute: number; + max_throughput_per_minute_per_kibana: number; + minutes_to_drain_overdue: number; + avg_required_throughput_per_minute: number; + avg_required_throughput_per_minute_per_kibana: number; + avg_recurring_required_throughput_per_minute: number; + avg_recurring_required_throughput_per_minute_per_kibana: number; + }; + proposed: { + provisioned_kibana: number; + min_required_kibana: number; + avg_recurring_required_throughput_per_minute_per_kibana: number; + avg_required_throughput_per_minute_per_kibana: number; + }; +} +export type CapacityEstimationParams = Omit, 'capacity_estimation'>; +export declare function estimateCapacity(logger: Logger, capacityStats: CapacityEstimationParams, assumedKibanaInstances: number): RawMonitoredStat; +export declare function withCapacityEstimate(logger: Logger, monitoredStats: RawMonitoringStats['stats'], assumedKibanaInstances: number): RawMonitoringStats['stats']; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/configuration_statistics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/configuration_statistics.d.ts new file mode 100644 index 0000000000000..03b248afcea6b --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/configuration_statistics.d.ts @@ -0,0 +1,15 @@ +import type { JsonObject } from '@kbn/utility-types'; +import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; +import type { TaskManagerConfig } from '../config'; +import type { TaskPollingLifecycle } from '../polling_lifecycle'; +declare const CONFIG_FIELDS_TO_EXPOSE: readonly ["request_capacity", "monitored_aggregated_stats_refresh_rate", "monitored_stats_running_average_window", "monitored_task_execution_thresholds"]; +interface CapacityConfig extends JsonObject { + capacity: { + config: number; + as_workers: number; + as_cost: number; + }; +} +export type ConfigStat = Pick & CapacityConfig; +export declare function createConfigurationAggregator(config: TaskManagerConfig, startingCapacity: number, taskPollingLifecycle?: TaskPollingLifecycle): AggregatedStatProvider; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/index.d.ts new file mode 100644 index 0000000000000..aaf0b44f03e37 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/index.d.ts @@ -0,0 +1,21 @@ +import type { Logger } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import type { TaskManagerConfig } from '../config'; +import type { MonitoringStats } from './monitoring_stats_stream'; +import type { TaskStore } from '../task_store'; +import type { TaskPollingLifecycle } from '../polling_lifecycle'; +import type { AdHocTaskCounter } from '../lib/adhoc_task_counter'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +export type { MonitoringStats, RawMonitoringStats } from './monitoring_stats_stream'; +export { HealthStatus, summarizeMonitoringStats, createAggregators, createMonitoringStatsStream, } from './monitoring_stats_stream'; +export interface CreateMonitoringStatsOpts { + taskStore: TaskStore; + elasticsearchAndSOAvailability$: Observable; + config: TaskManagerConfig; + logger: Logger; + adHocTaskCounter: AdHocTaskCounter; + taskDefinitions: TaskTypeDictionary; + startingCapacity: number; + taskPollingLifecycle?: TaskPollingLifecycle; +} +export declare function createMonitoringStats(opts: CreateMonitoringStatsOpts): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/monitoring_stats_stream.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/monitoring_stats_stream.d.ts new file mode 100644 index 0000000000000..f96e44e89c0db --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/monitoring_stats_stream.d.ts @@ -0,0 +1,46 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { JsonObject } from '@kbn/utility-types'; +import type { SummarizedWorkloadStat, WorkloadStat } from './workload_statistics'; +import type { TaskRunStat, SummarizedTaskRunStat } from './task_run_statistics'; +import type { BackgroundTaskUtilizationStat } from './background_task_utilization_statistics'; +import type { ConfigStat } from './configuration_statistics'; +import type { TaskManagerConfig } from '../config'; +import type { CapacityEstimationStat } from './capacity_estimation'; +import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; +import type { CreateMonitoringStatsOpts } from '.'; +export interface MonitoringStats { + last_update: string; + stats: { + configuration?: MonitoredStat; + workload?: MonitoredStat; + runtime?: MonitoredStat; + utilization?: MonitoredStat; + }; +} +export declare enum HealthStatus { + Uninitialized = "uninitialized", + OK = "OK", + Warning = "warn", + Error = "error" +} +export interface MonitoredStat { + timestamp: string; + value: T; +} +export type RawMonitoredStat = MonitoredStat & { + status: HealthStatus; + reason?: string; +}; +export interface RawMonitoringStats { + last_update: string; + stats: { + configuration?: RawMonitoredStat; + workload?: RawMonitoredStat; + runtime?: RawMonitoredStat; + capacity_estimation?: RawMonitoredStat; + }; +} +export declare function createAggregators({ taskStore, elasticsearchAndSOAvailability$, config, logger, taskDefinitions, adHocTaskCounter, startingCapacity, taskPollingLifecycle, }: CreateMonitoringStatsOpts): AggregatedStatProvider; +export declare function createMonitoringStatsStream(provider$: AggregatedStatProvider): Observable; +export declare function summarizeMonitoringStats(logger: Logger, { last_update, stats: { runtime, workload, configuration, utilization } }: MonitoringStats, config: TaskManagerConfig, assumedKibanaInstances: number): RawMonitoringStats; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_calculators.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_calculators.d.ts new file mode 100644 index 0000000000000..76d898544d827 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_calculators.d.ts @@ -0,0 +1,22 @@ +import type { JsonObject } from '@kbn/utility-types'; +export interface AveragedStat extends JsonObject { + p50: number; + p90: number; + p95: number; + p99: number; +} +export declare function calculateRunningAverage(values: number[]): AveragedStat; +/** + * Calculate the frequency of each term in a list of terms. + * @param values + */ +export declare function calculateFrequency(values: T[]): JsonObject; +/** + * Utility to keep track of a bounded array of values which changes over time + * dropping older values as they slide out of the window we wish to track + */ +export declare function createRunningAveragedStat(runningAverageWindowSize: number): (value?: T) => T[]; +export declare function createMapOfRunningAveragedStats(runningAverageWindowSize: number): (key?: string, value?: T) => { + [x: string]: T[]; +}; +export declare function filterOutliers(values: number[]): number[]; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_statistics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_statistics.d.ts new file mode 100644 index 0000000000000..d8556f8088831 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_statistics.d.ts @@ -0,0 +1,82 @@ +import type { JsonObject, JsonValue } from '@kbn/utility-types'; +import type { Logger } from '@kbn/core/server'; +import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; +import { TaskPersistence } from '../task_events'; +import { TaskRunResult } from '../task_running'; +import { FillPoolResult } from '../lib/fill_pool'; +import type { AveragedStat } from './task_run_calculators'; +import { HealthStatus } from './monitoring_stats_stream'; +import type { TaskPollingLifecycle } from '../polling_lifecycle'; +import type { TaskManagerConfig } from '../config'; +interface FillPoolStat extends JsonObject { + duration: number[]; + claim_duration: number[]; + claim_conflicts: number[]; + claim_mismatches: number[]; + claim_stale_tasks: number[]; + result_frequency_percent_as_number: FillPoolResult[]; + persistence: TaskPersistence[]; +} +interface OptionalFillPoolStat extends JsonObject { + last_successful_poll: string; + last_polling_delay: string; +} +interface ExecutionStat extends JsonObject { + duration: Record; + duration_by_persistence: Record; + result_frequency_percent_as_number: Record; + persistence: TaskPersistence[]; +} +export interface TaskRunStat extends JsonObject { + drift: number[]; + drift_by_type: Record; + load: number[]; + execution: ExecutionStat; + polling: FillPoolStat & Partial; +} +interface FillPoolRawStat extends JsonObject { + last_successful_poll: string; + last_polling_delay: string; + result_frequency_percent_as_number: { + [FillPoolResult.Failed]: number; + [FillPoolResult.NoAvailableWorkers]: number; + [FillPoolResult.NoTasksClaimed]: number; + [FillPoolResult.RanOutOfCapacity]: number; + [FillPoolResult.RunningAtCapacity]: number; + [FillPoolResult.PoolFilled]: number; + }; + persistence: TaskPersistenceTypes; +} +interface ResultFrequency extends JsonObject { + [TaskRunResult.Success]: number; + [TaskRunResult.SuccessRescheduled]: number; + [TaskRunResult.RetryScheduled]: number; + [TaskRunResult.Failed]: number; +} +export interface TaskPersistenceTypes extends JsonObject { + [TaskPersistence.Recurring]: T; + [TaskPersistence.NonRecurring]: T; +} +type ResultFrequencySummary = ResultFrequency & { + status: HealthStatus; +}; +export interface SummarizedTaskRunStat extends JsonObject { + drift: AveragedStat; + drift_by_type: { + [alertType: string]: AveragedStat; + }; + load: AveragedStat; + execution: { + duration: Record; + duration_by_persistence: Record; + result_frequency_percent_as_number: Record; + persistence: TaskPersistenceTypes; + }; + polling: FillPoolRawStat | Omit; +} +export declare function createTaskRunAggregator(taskPollingLifecycle: TaskPollingLifecycle, runningAverageWindowSize: number): AggregatedStatProvider; +export declare function summarizeTaskRunStat(logger: Logger, { polling: { last_successful_poll, last_polling_delay, duration: pollingDuration, claim_duration, result_frequency_percent_as_number: pollingResultFrequency, claim_conflicts: claimConflicts, claim_mismatches: claimMismatches, claim_stale_tasks: claimStaleTasks, persistence: pollingPersistence, }, drift, drift_by_type, load, execution: { duration, duration_by_persistence: durationByPersistence, persistence, result_frequency_percent_as_number: executionResultFrequency, }, }: TaskRunStat, config: TaskManagerConfig): { + value: SummarizedTaskRunStat; + status: HealthStatus; +}; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.d.ts new file mode 100644 index 0000000000000..1a61b58644300 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.d.ts @@ -0,0 +1,202 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { JsonObject } from '@kbn/utility-types'; +import type { estypes } from '@elastic/elasticsearch'; +import type { AggregationResultOf } from '@kbn/es-types'; +import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; +import { HealthStatus } from './monitoring_stats_stream'; +import type { TaskStore } from '../task_store'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +interface StatusStat extends JsonObject { + [status: string]: number; +} +interface TaskTypeStat extends JsonObject { + [taskType: string]: { + count: number; + cost: number; + status: StatusStat; + }; +} +interface RawWorkloadStat extends JsonObject { + count: number; + cost: number; + task_types: TaskTypeStat; + schedule: Array<[string, number]>; + non_recurring: number; + non_recurring_cost: number; + overdue: number; + overdue_cost: number; + overdue_non_recurring: number; + estimated_schedule_density: number[]; + capacity_requirements: CapacityRequirements; +} +export type WorkloadStat = RawWorkloadStat; +export type SummarizedWorkloadStat = RawWorkloadStat; +export interface CapacityRequirements extends JsonObject { + per_minute: number; + per_hour: number; + per_day: number; +} +export interface WorkloadAggregation { + aggs: { + taskType: { + terms: { + field: string; + }; + aggs: { + status: { + terms: { + field: string; + }; + }; + }; + }; + schedule: { + terms: { + field: string; + size: number; + }; + }; + idleTasks: { + filter: { + term: { + 'task.status': string; + }; + }; + aggs: { + scheduleDensity: { + range: { + field: string; + ranges: [{ + from: string; + to: string; + }]; + }; + aggs: { + histogram: { + date_histogram: { + field: string; + fixed_interval: string; + }; + aggs: { + interval: { + terms: { + field: string; + }; + }; + }; + }; + }; + }; + overdue: { + filter: { + range: { + 'task.runAt': { + lt: string; + }; + }; + }; + }; + }; + }; + }; +} +type ScheduleDensityResult = AggregationResultOf['buckets'][0]; +export interface CreateWorkloadAggregatorOpts { + taskStore: TaskStore; + elasticsearchAndSOAvailability$: Observable; + refreshInterval: number; + pollInterval: number; + logger: Logger; + taskDefinitions: TaskTypeDictionary; +} +export declare function createWorkloadAggregator({ taskStore, elasticsearchAndSOAvailability$, refreshInterval, pollInterval, logger, taskDefinitions, }: CreateWorkloadAggregatorOpts): AggregatedStatProvider; +interface IntervalTaskCountTouple { + nonRecurring?: number; + recurring?: Array<[number, string]>; + key: number; +} +export declare function padBuckets(scheduleDensityBuckets: number, pollInterval: number, scheduleDensity: ScheduleDensityResult): number[]; +export declare function estimateRecurringTaskScheduling(scheduleDensity: IntervalTaskCountTouple[], pollInterval: number): number[]; +export declare function summarizeWorkloadStat(workloadStats: WorkloadStat): { + value: SummarizedWorkloadStat; + status: HealthStatus; +}; +export interface WorkloadAggregationResponse { + taskType: TaskTypeAggregation; + schedule: ScheduleAggregation; + idleTasks: IdleTasksAggregation; + nonRecurringTasks: { + doc_count: number; + taskType: TaskTypeAggregation; + }; + [otherAggs: string]: estypes.AggregationsAggregate; +} +export type TaskTypeWithStatusBucket = TaskTypeBucket & { + status: { + buckets: Array<{ + doc_count: number; + key: string | number; + }>; + doc_count_error_upper_bound?: number | undefined; + sum_other_doc_count?: number | undefined; + }; +}; +export interface TaskTypeBucket { + doc_count: number; + key: string | number; +} +export interface TaskTypeAggregation extends estypes.AggregationsFiltersAggregate { + buckets: Array; + doc_count_error_upper_bound?: number | undefined; + sum_other_doc_count?: number | undefined; +} +export interface ScheduleAggregation extends estypes.AggregationsFiltersAggregate { + buckets: Array<{ + doc_count: number; + key: string; + }>; + doc_count_error_upper_bound?: number | undefined; + sum_other_doc_count?: number | undefined; +} +export type ScheduleDensityHistogram = DateRangeBucket & { + histogram: { + buckets: Array; + doc_count_error_upper_bound?: number | undefined; + sum_other_doc_count?: number | undefined; + }; + }>; + }; +}; +export interface IdleTasksAggregation extends estypes.AggregationsFiltersAggregate { + doc_count: number; + scheduleDensity: { + buckets: ScheduleDensityHistogram[]; + }; + overdue: { + doc_count: number; + nonRecurring: { + doc_count: number; + }; + taskTypes: TaskTypeAggregation; + }; +} +interface DateHistogramBucket { + doc_count: number; + key: number; + key_as_string: string; +} +interface DateRangeBucket { + key: string; + to?: number; + from?: number; + to_as_string?: string; + from_as_string?: string; + doc_count: number; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/plugin.d.ts b/x-pack/platform/plugins/shared/task_manager/server/plugin.d.ts new file mode 100644 index 0000000000000..5fed518e1843e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/plugin.d.ts @@ -0,0 +1,79 @@ +import type { UsageCollectionSetup, UsageCollectionStart } from '@kbn/usage-collection-plugin/server'; +import type { PluginInitializerContext, Plugin, CoreSetup, CoreStart } from '@kbn/core/server'; +import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/server'; +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; +import type { LicensingPluginStart } from '@kbn/licensing-plugin/server'; +import type { Middleware } from './lib/middleware'; +import type { TaskDefinitionRegistry } from './task_type_dictionary'; +import { TaskStore } from './task_store'; +import { TaskScheduling } from './task_scheduling'; +import type { TaskEventLogger } from './task'; +import type { ApiKeyInvalidationFn, UiamApiKeyInvalidationFn } from './invalidate_api_keys/invalidate_api_keys_task'; +export interface TaskManagerSetupContract { + /** + * @deprecated + */ + index: string; + addMiddleware: (middleware: Middleware) => void; + /** + * Method for allowing consumers to register task definitions into the system. + * @param taskDefinitions - The Kibana task definitions dictionary + */ + registerTaskDefinitions: (taskDefinitions: TaskDefinitionRegistry) => void; + registerCanEncryptedSavedObjects: (canEncrypt: boolean) => void; + registerTaskEventLogger: (logger: TaskEventLogger) => void; +} +export type TaskManagerStartContract = Pick & Pick & { + removeIfExists: TaskStore['remove']; +} & { + getRegisteredTypes: () => string[]; + registerEncryptedSavedObjectsClient: (client: EncryptedSavedObjectsClient) => void; + registerApiKeyInvalidateFn: (fn?: ApiKeyInvalidationFn) => void; + registerUiamApiKeyInvalidateFn: (fn?: UiamApiKeyInvalidationFn) => void; +}; +export interface TaskManagerPluginsStart { + licensing: LicensingPluginStart; + cloud?: CloudStart; + usageCollection?: UsageCollectionStart; +} +export interface TaskManagerPluginsSetup { + cloud?: CloudSetup; + usageCollection?: UsageCollectionSetup; +} +export declare class TaskManagerPlugin implements Plugin { + private readonly initContext; + private taskPollingLifecycle?; + private taskManagerId?; + private usageCounter?; + private config; + private logger; + private definitions; + private middleware; + private elasticsearchAndSOAvailability$?; + private monitoringStats$; + private metrics$; + private resetMetrics$; + private shouldRunBackgroundTasks; + private readonly kibanaVersion; + private adHocTaskCounter; + private taskManagerMetricsCollector?; + private nodeRoles; + private kibanaDiscoveryService?; + private heapSizeLimit; + private numOfKibanaInstances$; + private canEncryptSavedObjects; + private licenseSubscriber?; + private invalidateApiKeyFn?; + private taskEventLogger?; + private invalidateUiamApiKeyFn?; + private taskStore?; + private startContract?; + private uiamApiKeyProvisioningTask?; + constructor(initContext: PluginInitializerContext); + isNodeBackgroundTasksOnly(): boolean; + private invalidateApiKey; + private get invalidateUiamApiKey(); + setup(core: CoreSetup, plugins: TaskManagerPluginsSetup): TaskManagerSetupContract; + start(core: CoreStart, { cloud, licensing }: TaskManagerPluginsStart): TaskManagerStartContract; + stop(): Promise; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/polling/delay_on_claim_conflicts.d.ts b/x-pack/platform/plugins/shared/task_manager/server/polling/delay_on_claim_conflicts.d.ts new file mode 100644 index 0000000000000..a47b0f35a140e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/polling/delay_on_claim_conflicts.d.ts @@ -0,0 +1,6 @@ +import type { Observable } from 'rxjs'; +import type { TaskLifecycleEvent } from '../polling_lifecycle'; +/** + * Emits a delay amount in ms to apply to polling whenever the task store exceeds a threshold of claim claimClashes + */ +export declare function delayOnClaimConflicts(capacityConfiguration$: Observable, pollIntervalConfiguration$: Observable, taskLifecycleEvents$: Observable, claimClashesPercentageThreshold: number, runningAverageWindowSize: number): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/polling/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/polling/index.d.ts new file mode 100644 index 0000000000000..08014d3f68933 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/polling/index.d.ts @@ -0,0 +1,2 @@ +export { createTaskPoller, PollingError, PollingErrorType } from './task_poller'; +export { delayOnClaimConflicts } from './delay_on_claim_conflicts'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/polling/task_poller.d.ts b/x-pack/platform/plugins/shared/task_manager/server/polling/task_poller.d.ts new file mode 100644 index 0000000000000..130d86395cd21 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/polling/task_poller.d.ts @@ -0,0 +1,44 @@ +import type { Observable } from 'rxjs'; +import type { Option } from 'fp-ts/Option'; +import type { Logger } from '@kbn/core/server'; +import { TaskErrorSource } from '../task_running'; +import type { Result } from '../lib/result_type'; +type WorkFn = () => Promise; +interface Opts { + logger: Logger; + initialPollInterval: number; + pollInterval$: Observable; + pollIntervalDelay$?: Observable; + getCapacity: () => number; + work: WorkFn; +} +export interface TaskPoller { + start: () => void; + stop: () => void; + events$: Observable>>; +} +/** + * constructs a new TaskPoller stream, which emits events on demand and on a scheduled interval, waiting for capacity to be available before emitting more events. + * + * @param opts + * @prop {number} pollInterval - How often, in milliseconds, we will an event be emnitted, assuming there's capacity to do so + * @prop {() => number} getCapacity - A function specifying whether there is capacity to emit new events + * @prop {() => Promise} work - The worker we wish to execute in order to `poll` + * + * @returns {Observable>} - An observable which emits an event whenever a polling event is due to take place, providing access to a singleton Set representing a queue + * of unique request argumets of type T. + */ +export declare function createTaskPoller({ logger, initialPollInterval, pollInterval$, pollIntervalDelay$, getCapacity, work, }: Opts): TaskPoller; +export declare enum PollingErrorType { + WorkError = 0, + WorkTimeout = 1, + RequestCapacityReached = 2, + PollerError = 3 +} +export declare class PollingError extends Error { + readonly type: PollingErrorType; + readonly data: Option; + readonly source: TaskErrorSource; + constructor(message: string, type: PollingErrorType, data: Option, cause?: Error); +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/polling_lifecycle.d.ts b/x-pack/platform/plugins/shared/task_manager/server/polling_lifecycle.d.ts new file mode 100644 index 0000000000000..b9bee8528e408 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/polling_lifecycle.d.ts @@ -0,0 +1,74 @@ +import type { Observable } from 'rxjs'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { Logger, ExecutionContextStart, IBasePath } from '@kbn/core/server'; +import type { Result } from './lib/result_type'; +import type { TaskManagerConfig } from './config'; +import type { TaskMarkRunning, TaskRun, TaskClaim, TaskRunRequest, TaskPollingCycle, TaskManagerStat, TaskManagerMetric } from './task_events'; +import { FillPoolResult } from './lib/fill_pool'; +import type { Middleware } from './lib/middleware'; +import type { TaskEventLogger } from './task'; +import { TaskPool } from './task_pool'; +import type { TaskStore } from './task_store'; +import type { ApiKeyStrategy } from './api_key_strategy'; +import type { TaskTypeDictionary } from './task_type_dictionary'; +import { TaskClaiming } from './queries/task_claiming'; +import type { ClaimOwnershipResult } from './task_claimers'; +import type { TaskPartitioner } from './lib/task_partitioner'; +export interface ITaskEventEmitter { + get events(): Observable; +} +export interface TaskPollingLifecycleOpts { + basePathService: IBasePath; + logger: Logger; + definitions: TaskTypeDictionary; + taskStore: TaskStore; + config: TaskManagerConfig; + middleware: Middleware; + elasticsearchAndSOAvailability$: Observable; + executionContext: ExecutionContextStart; + usageCounter?: UsageCounter; + taskPartitioner: TaskPartitioner; + startingCapacity: number; + apiKeyStrategy: ApiKeyStrategy; + eventLogger: TaskEventLogger; +} +export type TaskLifecycleEvent = TaskMarkRunning | TaskRun | TaskClaim | TaskRunRequest | TaskPollingCycle | TaskManagerStat | TaskManagerMetric; +/** + * The public interface into the task manager system. + */ +export declare class TaskPollingLifecycle implements ITaskEventEmitter { + private definitions; + private store; + private taskClaiming; + private bufferedStore; + private readonly basePathService; + private readonly executionContext; + private logger; + private poller; + private started; + pool: TaskPool; + capacityConfiguration$: Observable; + pollIntervalConfiguration$: Observable; + private events$; + private middleware; + private usageCounter?; + private config; + private currentPollInterval; + private apiKeyStrategy; + private currentTmUtilization$; + private eventLogger; + /** + * Initializes the task manager, preventing any further addition of middleware, + * enabling the task manipulation methods, and beginning the background polling + * mechanism. + */ + constructor({ basePathService, logger, middleware, config, elasticsearchAndSOAvailability$, taskStore, definitions, executionContext, usageCounter, taskPartitioner, startingCapacity, apiKeyStrategy, eventLogger, }: TaskPollingLifecycleOpts); + get events(): Observable; + stop(): void; + getCurrentTasksInPool(): string[]; + private emitEvent; + private createTaskRunnerForTask; + private pollForWork; + private subscribeToPoller; +} +export declare function claimAvailableTasks(taskClaiming: TaskClaiming, logger: Logger): Promise>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.d.ts new file mode 100644 index 0000000000000..f3610d04d6703 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.d.ts @@ -0,0 +1,6 @@ +import type { AggregationsAggregationContainer, QueryDslQueryContainer, MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/types'; +export declare function aggregateTaskOverduePercentilesForType(type: string): { + aggs: Record; + query: QueryDslQueryContainer; + runtime_mappings: MappingRuntimeFields; +}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/mark_available_tasks_as_claimed.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/mark_available_tasks_as_claimed.d.ts new file mode 100644 index 0000000000000..4f0971e812469 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/queries/mark_available_tasks_as_claimed.d.ts @@ -0,0 +1,31 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +import type { ConcreteTaskInstance } from '../task'; +import type { ScriptClause, MustCondition, MustNotCondition } from './query_clauses'; +export declare function tasksOfType(taskTypes: string[]): estypes.QueryDslQueryContainer; +export declare function tasksClaimedByOwner(taskManagerId: string, ...taskFilters: estypes.QueryDslQueryContainer[]): { + bool: { + must: estypes.QueryDslQueryContainer[]; + }; +}; +export declare const IdleTaskWithExpiredRunAt: MustCondition; +export declare const InactiveTasks: MustNotCondition; +export declare const EnabledTask: MustCondition; +export declare const RecognizedTask: MustNotCondition; +export declare const RunningOrClaimingTaskWithExpiredRetryAt: MustCondition; +export declare const SortByRunAtAndRetryAt: estypes.SortCombinations; +export declare function getClaimSort(definitions: TaskTypeDictionary): estypes.SortCombinations[]; +export declare function claimSort(definitions: TaskTypeDictionary, tasks: ConcreteTaskInstance[]): ConcreteTaskInstance[]; +export interface UpdateFieldsAndMarkAsFailedOpts { + fieldUpdates: { + [field: string]: string | number | Date; + }; + claimableTaskTypes: string[]; + skippedTaskTypes: string[]; + taskMaxAttempts: { + [field: string]: number; + }; +} +export declare const updateFieldsAndMarkAsFailed: ({ fieldUpdates, claimableTaskTypes, skippedTaskTypes, taskMaxAttempts, }: UpdateFieldsAndMarkAsFailedOpts) => ScriptClause; +export declare const OneOfTaskTypes: (field: string, types: string[]) => MustCondition; +export declare function tasksWithPartitions(partitions: number[]): estypes.QueryDslQueryContainer; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/oldest_idle_action_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/oldest_idle_action_task.d.ts new file mode 100644 index 0000000000000..0aea298ee9791 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/queries/oldest_idle_action_task.d.ts @@ -0,0 +1,7 @@ +import type { ElasticsearchClient } from '@kbn/core/server'; +/** + * Returns the millisecond timestamp of the oldest action task that may still be executed (with a 24 hour delay). + * Useful for cleaning up related objects that may no longer be needed. + * @internal + */ +export declare const getOldestIdleActionTask: (client: Pick, taskManagerIndex: string) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/query_clauses.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/query_clauses.d.ts new file mode 100644 index 0000000000000..ef547891b51aa --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/queries/query_clauses.d.ts @@ -0,0 +1,42 @@ +import type { estypes } from '@elastic/elasticsearch'; +export interface MustCondition { + bool: Pick; +} +export interface MustNotCondition { + bool: Pick; +} +export interface ScriptBasedSortClause { + _script: { + type: string; + order: string; + script: ScriptClause; + }; +} +export interface ScriptClause { + source: string; + lang: estypes.ScriptLanguage; + params?: { + [field: string]: string | number | Date | string[] | { + [field: string]: string | number | Date; + }; + }; +} +export type PinnedQuery = Pick, 'pinned'>; +type BoolClause = Pick, 'bool'>; +export declare function matchesClauses(...clauses: Array): BoolClause; +export declare function shouldBeOneOf(...should: estypes.QueryDslQueryContainer[]): { + bool: { + should: estypes.QueryDslQueryContainer[]; + }; +}; +export declare function mustBeAllOf(...must: estypes.QueryDslQueryContainer[]): { + bool: { + must: estypes.QueryDslQueryContainer[]; + }; +}; +export declare function filterDownBy(...filter: estypes.QueryDslQueryContainer[]): { + bool: { + filter: estypes.QueryDslQueryContainer[]; + }; +}; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/task_claiming.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/task_claiming.d.ts new file mode 100644 index 0000000000000..5e7d904bff785 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/queries/task_claiming.d.ts @@ -0,0 +1,77 @@ +import type { Observable } from 'rxjs'; +import { Subject } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { Result } from '../lib/result_type'; +import type { ConcreteTaskInstance } from '../task'; +import type { TaskClaim } from '../task_events'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +import type { TaskStore, UpdateByQueryResult } from '../task_store'; +import { FillPoolResult } from '../lib/fill_pool'; +import type { ClaimOwnershipResult } from '../task_claimers'; +import type { TaskPartitioner } from '../lib/task_partitioner'; +export type { ClaimOwnershipResult } from '../task_claimers'; +export interface TaskClaimingOpts { + logger: Logger; + strategy: string; + definitions: TaskTypeDictionary; + taskStore: TaskStore; + maxAttempts: number; + excludedTaskTypes: string[]; + getAvailableCapacity: (taskType?: string) => number; + taskPartitioner: TaskPartitioner; +} +export interface OwnershipClaimingOpts { + claimOwnershipUntil: Date; + size: number; + taskTypes: Set; +} +export type IncrementalOwnershipClaimingOpts = OwnershipClaimingOpts & { + precedingQueryResult: UpdateByQueryResult; +}; +export type IncrementalOwnershipClaimingReduction = (opts: IncrementalOwnershipClaimingOpts) => Promise; +export interface FetchResult { + docs: ConcreteTaskInstance[]; +} +export declare function isClaimOwnershipResult(result: unknown): result is ClaimOwnershipResult; +export declare enum BatchConcurrency { + Unlimited = 0, + Limited = 1 +} +export type TaskClaimingBatches = Array; +export interface TaskClaimingBatch { + concurrency: Concurrency; + tasksTypes: TaskType; +} +export type UnlimitedBatch = TaskClaimingBatch>; +export type LimitedBatch = TaskClaimingBatch; +export declare const TASK_MANAGER_MARK_AS_CLAIMED = "mark-available-tasks-as-claimed"; +export declare class TaskClaiming { + readonly errors$: Subject; + readonly maxAttempts: number; + private definitions; + private events$; + private taskStore; + private getAvailableCapacity; + private logger; + private readonly taskClaimingBatchesByType; + private readonly taskMaxAttempts; + private readonly excludedTaskTypes; + private readonly taskClaimer; + private readonly taskPartitioner; + /** + * Constructs a new TaskStore. + * @param {TaskClaimingOpts} opts + * @prop {number} maxAttempts - The maximum number of attempts before a task will be abandoned + * @prop {TaskDefinition} definition - The definition of the task being run + */ + constructor(opts: TaskClaimingOpts); + private partitionIntoClaimingBatches; + private normalizeMaxAttempts; + private claimingBatchIndex; + private getClaimingBatches; + get events(): Observable; + claimAvailableTasksIfCapacityIsAvailable(claimingOptions: Omit): Promise>; +} +export declare function isLimited(batch: TaskClaimingBatch): batch is LimitedBatch; +export declare function asLimited(tasksType: string): LimitedBatch; +export declare function asUnlimited(tasksTypes: Set): UnlimitedBatch; diff --git a/x-pack/platform/plugins/shared/task_manager/server/removed_tasks/mark_removed_tasks_as_unrecognized.d.ts b/x-pack/platform/plugins/shared/task_manager/server/removed_tasks/mark_removed_tasks_as_unrecognized.d.ts new file mode 100644 index 0000000000000..0f614c74331c7 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/removed_tasks/mark_removed_tasks_as_unrecognized.d.ts @@ -0,0 +1,18 @@ +import type { Logger } from '@kbn/logging'; +import type { CoreStart } from '@kbn/core-lifecycle-server'; +import type { TaskScheduling } from '../task_scheduling'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +import type { TaskManagerStartContract } from '..'; +import type { TaskManagerPluginsStart } from '../plugin'; +export declare const TASK_ID = "mark_removed_tasks_as_unrecognized"; +export declare const SCHEDULE_INTERVAL = "1h"; +export declare function scheduleMarkRemovedTasksAsUnrecognizedDefinition(logger: Logger, taskScheduling: TaskScheduling): Promise; +export declare function registerMarkRemovedTasksAsUnrecognizedDefinition(logger: Logger, coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>, taskTypeDictionary: TaskTypeDictionary): void; +export declare function taskRunner(logger: Logger, coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>): () => { + run(): Promise<{ + state: {}; + schedule: { + interval: string; + }; + }>; +}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/routes/background_task_utilization.d.ts b/x-pack/platform/plugins/shared/task_manager/server/routes/background_task_utilization.d.ts new file mode 100644 index 0000000000000..e048a1a8862cd --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/routes/background_task_utilization.d.ts @@ -0,0 +1,26 @@ +import type { IRouter, Logger } from '@kbn/core/server'; +import type { IClusterClient } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { MonitoringStats } from '../monitoring'; +import type { TaskManagerConfig } from '../config'; +import type { BackgroundTaskUtilizationStat, PublicBackgroundTaskUtilizationStat } from '../monitoring/background_task_utilization_statistics'; +import type { MonitoredStat } from '../monitoring/monitoring_stats_stream'; +export interface MonitoredUtilization { + process_uuid: string; + timestamp: string; + last_update: string; + stats: MonitoredStat | MonitoredStat | null; +} +export interface BackgroundTaskUtilRouteParams { + router: IRouter; + monitoringStats$: Observable; + logger: Logger; + taskManagerId: string; + config: TaskManagerConfig; + kibanaVersion: string; + kibanaIndexName: string; + getClusterClient: () => Promise; + usageCounter?: UsageCounter; +} +export declare function backgroundTaskUtilizationRoute(params: BackgroundTaskUtilRouteParams): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/routes/health.d.ts b/x-pack/platform/plugins/shared/task_manager/server/routes/health.d.ts new file mode 100644 index 0000000000000..60f8aff9f0a6d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/routes/health.d.ts @@ -0,0 +1,42 @@ +import type { IRouter } from '@kbn/core/server'; +import type { IClusterClient, DocLinksServiceSetup } from '@kbn/core/server'; +import type { Observable } from 'rxjs'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { Logger, ServiceStatus } from '@kbn/core/server'; +import type { MonitoringStats, RawMonitoringStats } from '../monitoring'; +import { HealthStatus } from '../monitoring'; +import type { TaskManagerConfig } from '../config'; +export type MonitoredHealth = RawMonitoringStats & { + id: string; + reason?: string; + status: HealthStatus; + timestamp: string; +}; +/** + * We enforce a `meta` of `never` because this meta gets duplicated into *every dependant plugin*, and + * this will then get logged out when logging is set to Verbose. + * We used to pass in the the entire MonitoredHealth into this `meta` field, but this means that the + * whole MonitoredHealth JSON (which can be quite big) was duplicated dozens of times and when we + * try to view logs in Discover, it fails to render as this JSON was often dozens of levels deep. + */ +type TaskManagerServiceStatus = ServiceStatus; +export interface HealthRouteParams { + router: IRouter; + monitoringStats$: Observable; + logger: Logger; + taskManagerId: string; + config: TaskManagerConfig; + kibanaVersion: string; + kibanaIndexName: string; + shouldRunTasks: boolean; + getClusterClient: () => Promise; + usageCounter?: UsageCounter; + docLinks: DocLinksServiceSetup; + numOfKibanaInstances$: Observable; +} +export declare function healthRoute(params: HealthRouteParams): { + serviceStatus$: Observable; + monitoredHealth$: Observable; +}; +export declare function withServiceStatus(monitoredHealth: MonitoredHealth): [MonitoredHealth, TaskManagerServiceStatus]; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/routes/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/routes/index.d.ts new file mode 100644 index 0000000000000..a9aa57ded2a55 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/routes/index.d.ts @@ -0,0 +1,3 @@ +export { healthRoute } from './health'; +export { backgroundTaskUtilizationRoute } from './background_task_utilization'; +export { metricsRoute } from './metrics'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/routes/metrics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/routes/metrics.d.ts new file mode 100644 index 0000000000000..e4412ad7ac0b6 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/routes/metrics.d.ts @@ -0,0 +1,17 @@ +import type { IRouter, Logger } from '@kbn/core/server'; +import type { Observable, Subject } from 'rxjs'; +import type { Metrics } from '../metrics'; +export interface NodeMetrics { + process_uuid: string; + timestamp: string; + last_update: string; + metrics: Metrics['metrics'] | null; +} +export interface MetricsRouteParams { + router: IRouter; + logger: Logger; + metrics$: Observable; + resetMetrics$: Subject; + taskManagerId: string; +} +export declare function metricsRoute(params: MetricsRouteParams): void; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/index.d.ts new file mode 100644 index 0000000000000..ffa16424e0c64 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/index.d.ts @@ -0,0 +1,6 @@ +import type { SavedObjectsServiceSetup } from '@kbn/core/server'; +export { scheduleRruleSchemaV1, scheduleRruleSchemaV2, scheduleRruleSchemaV3, } from './schemas/rrule'; +export declare const TASK_SO_NAME = "task"; +export declare const BACKGROUND_TASK_NODE_SO_NAME = "background-task-node"; +export declare const INVALIDATE_API_KEY_SO_NAME = "api_key_to_invalidate"; +export declare function setupSavedObjects(savedObjects: SavedObjectsServiceSetup): void; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/mappings.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/mappings.d.ts new file mode 100644 index 0000000000000..cbb3d168a9ba5 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/mappings.d.ts @@ -0,0 +1,4 @@ +import type { SavedObjectsTypeMappingDefinition } from '@kbn/core/server'; +export declare const taskMappings: SavedObjectsTypeMappingDefinition; +export declare const backgroundTaskNodeMapping: SavedObjectsTypeMappingDefinition; +export declare const apiKeyToInvalidateMappings: SavedObjectsTypeMappingDefinition; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/migrations.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/migrations.d.ts new file mode 100644 index 0000000000000..f36b740932d2c --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/migrations.d.ts @@ -0,0 +1,2 @@ +import type { SavedObjectMigrationMap } from '@kbn/core/server'; +export declare function getMigrations(): SavedObjectMigrationMap; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/api_key_to_invalidate_model_versions.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/api_key_to_invalidate_model_versions.d.ts new file mode 100644 index 0000000000000..1352ebf8f583c --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/api_key_to_invalidate_model_versions.d.ts @@ -0,0 +1,2 @@ +import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; +export declare const apiKeyToInvalidateModelVersions: SavedObjectsModelVersionMap; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/background_task_node_model_versions.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/background_task_node_model_versions.d.ts new file mode 100644 index 0000000000000..248276a69be4d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/background_task_node_model_versions.d.ts @@ -0,0 +1,2 @@ +import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; +export declare const backgroundTaskNodeModelVersions: SavedObjectsModelVersionMap; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/index.d.ts new file mode 100644 index 0000000000000..057b09fc7a88b --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/index.d.ts @@ -0,0 +1,3 @@ +export { taskModelVersions } from './task_model_versions'; +export { backgroundTaskNodeModelVersions } from './background_task_node_model_versions'; +export { apiKeyToInvalidateModelVersions } from './api_key_to_invalidate_model_versions'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/task_model_versions.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/task_model_versions.d.ts new file mode 100644 index 0000000000000..ef9e65d4a8323 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/task_model_versions.d.ts @@ -0,0 +1,2 @@ +import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; +export declare const taskModelVersions: SavedObjectsModelVersionMap; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/api_key_to_invalidate.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/api_key_to_invalidate.d.ts new file mode 100644 index 0000000000000..5271179d6112d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/api_key_to_invalidate.d.ts @@ -0,0 +1,11 @@ +import type { TypeOf } from '@kbn/config-schema'; +export declare const apiKeyToInvalidateSchemaV1: import("@kbn/config-schema").ObjectType<{ + apiKeyId: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; +}>; +export declare const apiKeyToInvalidateSchemaV2: import("@kbn/config-schema").ObjectType<{ + apiKeyId: import("@kbn/config-schema").Type; + createdAt: import("@kbn/config-schema").Type; + uiamApiKey: import("@kbn/config-schema").Type; +}>; +export type ApiKeyToInvalidate = TypeOf; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/background_task_node.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/background_task_node.d.ts new file mode 100644 index 0000000000000..52d496eb0f39d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/background_task_node.d.ts @@ -0,0 +1,6 @@ +import type { TypeOf } from '@kbn/config-schema'; +export declare const backgroundTaskNodeSchemaV1: import("@kbn/config-schema").ObjectType<{ + id: import("@kbn/config-schema").Type; + last_seen: import("@kbn/config-schema").Type; +}>; +export type BackgroundTaskNode = TypeOf; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/index.d.ts new file mode 100644 index 0000000000000..520d91b42865f --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/index.d.ts @@ -0,0 +1,3 @@ +export { rruleSchedule as rruleScheduleV1, scheduleRruleSchema as scheduleRruleSchemaV1, } from './v1'; +export { rruleSchedule as rruleScheduleV2, scheduleRruleSchema as scheduleRruleSchemaV2, } from './v2'; +export { rruleSchedule as rruleScheduleV3, scheduleRruleSchema as scheduleRruleSchemaV3, } from './v3'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v1.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v1.d.ts new file mode 100644 index 0000000000000..e4a3099f9c9ed --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v1.d.ts @@ -0,0 +1,69 @@ +import { Frequency } from '@kbn/rrule'; +export declare function validateTimezone(timezone: string): string | undefined; +export declare const rruleCommon: import("@kbn/config-schema").ObjectType<{ + freq: import("@kbn/config-schema").Type<0 | 2 | 1 | 3 | 5 | 4 | 6>; + interval: import("@kbn/config-schema").Type; + tzid: import("@kbn/config-schema").Type; +}>; +export declare const byminute: import("@kbn/config-schema").Type; +export declare const byhour: import("@kbn/config-schema").Type; +export declare const byweekday: import("@kbn/config-schema").Type; +export declare const bymonthday: import("@kbn/config-schema").Type; +export declare const rruleSchedule: import("@kbn/config-schema").Type | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; +} & { + interval: number; + bymonthday: never; + freq: Frequency.WEEKLY; + tzid: string; +}> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; +} & { + interval: number; + bymonthday: never; + freq: Frequency.DAILY; + tzid: string; +}>>; +export declare const scheduleRruleSchema: import("@kbn/config-schema").ObjectType<{ + rrule: import("@kbn/config-schema").Type | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: Frequency.DAILY; + tzid: string; + }>>; +}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v2.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v2.d.ts new file mode 100644 index 0000000000000..9e0ef3c04824a --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v2.d.ts @@ -0,0 +1,111 @@ +import { Frequency } from '@kbn/rrule'; +export declare const rruleCommon: import("@kbn/config-schema").ObjectType; + interval: import("@kbn/config-schema").Type; + tzid: import("@kbn/config-schema").Type; +}, "dtstart"> & { + dtstart: import("@kbn/config-schema").Type; +}>; +export declare const rruleMonthly: import("@kbn/config-schema").ObjectType; + interval: import("@kbn/config-schema").Type; + tzid: import("@kbn/config-schema").Type; +}, "dtstart"> & { + dtstart: import("@kbn/config-schema").Type; +}, "bymonthday" | "byweekday" | "byhour" | "byminute" | "freq"> & { + bymonthday: import("@kbn/config-schema").Type; + byweekday: import("@kbn/config-schema").Type; + byhour: import("@kbn/config-schema").Type; + byminute: import("@kbn/config-schema").Type; + freq: import("@kbn/config-schema").Type; +}>; +export declare const rruleWeekly: import("@kbn/config-schema").ObjectType; + interval: import("@kbn/config-schema").Type; + tzid: import("@kbn/config-schema").Type; +}, "dtstart"> & { + dtstart: import("@kbn/config-schema").Type; +}, "bymonthday" | "byweekday" | "byhour" | "byminute" | "freq"> & { + bymonthday: import("@kbn/config-schema").Type; + byweekday: import("@kbn/config-schema").Type; + byhour: import("@kbn/config-schema").Type; + byminute: import("@kbn/config-schema").Type; + freq: import("@kbn/config-schema").Type; +}>; +export declare const rruleDaily: import("@kbn/config-schema").ObjectType; + interval: import("@kbn/config-schema").Type; + tzid: import("@kbn/config-schema").Type; +}, "dtstart"> & { + dtstart: import("@kbn/config-schema").Type; +}, "bymonthday" | "byweekday" | "byhour" | "byminute" | "freq"> & { + bymonthday: import("@kbn/config-schema").Type; + byweekday: import("@kbn/config-schema").Type; + byhour: import("@kbn/config-schema").Type; + byminute: import("@kbn/config-schema").Type; + freq: import("@kbn/config-schema").Type; +}>; +export declare const rruleSchedule: import("@kbn/config-schema").Type | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; +} & { + interval: number; + bymonthday: never; + freq: Frequency.WEEKLY; + tzid: string; +}> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; +} & { + interval: number; + bymonthday: never; + freq: Frequency.DAILY; + tzid: string; +}>>; +export declare const scheduleRruleSchema: import("@kbn/config-schema").ObjectType<{ + rrule: import("@kbn/config-schema").Type | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: Frequency.DAILY; + tzid: string; + }>>; +}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v3.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v3.d.ts new file mode 100644 index 0000000000000..3489287c50d12 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v3.d.ts @@ -0,0 +1,85 @@ +import { Frequency } from '@kbn/rrule'; +export declare const rruleSchedule: import("@kbn/config-schema").Type | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; +} & { + interval: number; + bymonthday: never; + freq: Frequency.WEEKLY; + tzid: string; +}> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; +} & { + interval: number; + bymonthday: never; + freq: Frequency.DAILY; + tzid: string; +}> | Readonly<{ + byminute?: number[] | undefined; + dtstart?: string | undefined; +} & { + interval: number; + bymonthday: never; + byweekday: never; + byhour: never; + freq: Frequency.HOURLY; + tzid: string; +}>>; +export declare const scheduleRruleSchema: import("@kbn/config-schema").ObjectType<{ + rrule: import("@kbn/config-schema").Type | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: Frequency.DAILY; + tzid: string; + }> | Readonly<{ + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + byweekday: never; + byhour: never; + freq: Frequency.HOURLY; + tzid: string; + }>>; +}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/task.d.ts new file mode 100644 index 0000000000000..37a637b543f4f --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/task.d.ts @@ -0,0 +1,895 @@ +export declare function validateDuration(duration: string): string | undefined; +export declare const taskSchemaV1: import("@kbn/config-schema").ObjectType<{ + taskType: import("@kbn/config-schema").Type; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}>; +export declare const taskSchemaV2: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}>; +export declare const taskSchemaV3: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}, "priority"> & { + priority: import("@kbn/config-schema").Type; +}>; +export declare const scheduleIntervalSchema: import("@kbn/config-schema").ObjectType<{ + interval: import("@kbn/config-schema").Type; +}>; +export declare const taskSchemaV4: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}, "priority"> & { + priority: import("@kbn/config-schema").Type; +}, "userScope" | "apiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + apiKey: import("@kbn/config-schema").Type; +}>; +export declare const taskSchemaV5: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}, "priority"> & { + priority: import("@kbn/config-schema").Type; +}, "userScope" | "apiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + apiKey: import("@kbn/config-schema").Type; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}>; +export declare const taskSchemaV6: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}, "priority"> & { + priority: import("@kbn/config-schema").Type; +}, "userScope" | "apiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + apiKey: import("@kbn/config-schema").Type; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}>; +export declare const taskSchemaV7: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}, "priority"> & { + priority: import("@kbn/config-schema").Type; +}, "userScope" | "apiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + apiKey: import("@kbn/config-schema").Type; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }> | Readonly<{ + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + byweekday: never; + byhour: never; + freq: import("@kbn/rrule").Frequency.HOURLY; + tzid: string; + }>; + }> | undefined>; +}>; +export declare const taskSchemaV8: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}, "priority"> & { + priority: import("@kbn/config-schema").Type; +}, "userScope" | "apiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + apiKey: import("@kbn/config-schema").Type; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }> | Readonly<{ + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + byweekday: never; + byhour: never; + freq: import("@kbn/rrule").Frequency.HOURLY; + tzid: string; + }>; + }> | undefined>; +}, "cost"> & { + cost: import("@kbn/config-schema").Type<"normal" | "tiny" | "extralarge" | undefined>; +}>; +export declare const taskSchemaV9: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}, "priority"> & { + priority: import("@kbn/config-schema").Type; +}, "userScope" | "apiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + apiKey: import("@kbn/config-schema").Type; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }> | Readonly<{ + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + byweekday: never; + byhour: never; + freq: import("@kbn/rrule").Frequency.HOURLY; + tzid: string; + }>; + }> | undefined>; +}, "cost"> & { + cost: import("@kbn/config-schema").Type<"normal" | "tiny" | "extralarge" | undefined>; +}, "userScope" | "uiamApiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + uiamApiKey: import("@kbn/config-schema").Type; +}>; +export declare const taskSchemaV10: import("@kbn/config-schema").ObjectType; + scheduledAt: import("@kbn/config-schema").Type; + startedAt: import("@kbn/config-schema").Type; + retryAt: import("@kbn/config-schema").Type; + runAt: import("@kbn/config-schema").Type; + schedule: import("@kbn/config-schema").Type | undefined>; + params: import("@kbn/config-schema").Type; + state: import("@kbn/config-schema").Type; + stateVersion: import("@kbn/config-schema").Type; + traceparent: import("@kbn/config-schema").Type; + user: import("@kbn/config-schema").Type; + scope: import("@kbn/config-schema").Type; + ownerId: import("@kbn/config-schema").Type; + enabled: import("@kbn/config-schema").Type; + timeoutOverride: import("@kbn/config-schema").Type; + attempts: import("@kbn/config-schema").Type; + status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; + version: import("@kbn/config-schema").Type; +}, "partition"> & { + partition: import("@kbn/config-schema").Type; +}, "priority"> & { + priority: import("@kbn/config-schema").Type; +}, "userScope" | "apiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + apiKey: import("@kbn/config-schema").Type; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }>; + }> | undefined>; +}, "schedule"> & { + schedule: import("@kbn/config-schema").Type | Readonly<{} & { + rrule: Readonly<{ + bymonthday?: number[] | undefined; + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + freq: import("@kbn/rrule").Frequency.MONTHLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.WEEKLY; + tzid: string; + }> | Readonly<{ + byweekday?: string[] | undefined; + byhour?: number[] | undefined; + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + freq: import("@kbn/rrule").Frequency.DAILY; + tzid: string; + }> | Readonly<{ + byminute?: number[] | undefined; + dtstart?: string | undefined; + } & { + interval: number; + bymonthday: never; + byweekday: never; + byhour: never; + freq: import("@kbn/rrule").Frequency.HOURLY; + tzid: string; + }>; + }> | undefined>; +}, "cost"> & { + cost: import("@kbn/config-schema").Type<"normal" | "tiny" | "extralarge" | undefined>; +}, "userScope" | "uiamApiKey"> & { + userScope: import("@kbn/config-schema").Type | undefined>; + uiamApiKey: import("@kbn/config-schema").Type; +}, "cost"> & { + cost: import("@kbn/config-schema").Type; +}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task.d.ts new file mode 100644 index 0000000000000..cc69d4e118623 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task.d.ts @@ -0,0 +1,414 @@ +import type { ObjectType, TypeOf } from '@kbn/config-schema'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { IntervalSchedule, RruleSchedule } from '@kbn/response-ops-scheduling-types'; +import type { DecoratedError } from './task_running'; +export declare const DEFAULT_TIMEOUT = "5m"; +export declare enum TaskPriority { + Low = 1, + NormalLongRunning = 40, + Normal = 50 +} +export declare enum TaskCost { + Tiny = 1, + Normal = 2, + ExtraLarge = 10 +} +/** + * String values for task cost as stored in the task schema (e.g. in saved objects). + * Use these when reading cost from task params or instance attributes. + */ +export declare enum InstanceTaskCost { + Tiny = "tiny", + Normal = "normal", + ExtraLarge = "extralarge" +} +/** + * Translates cost string from task params/instance (e.g. 'extralarge') to the + * corresponding TaskCost integer. Returns undefined if the string is invalid or null. + */ +export declare const getTaskCostFromInstance: (cost?: InstanceTaskCost) => number | undefined; +/** + * Require + * @desc Create a Subtype of type T `T` such that the property under key `P` becomes required + * @example + * type TaskInstance = { + * id?: string; + * name: string; + * }; + * + * // This type is now defined as { id: string; name: string; } + * type TaskInstanceWithId = Require; + */ +type Require = Omit & Required>; +/** + * The run context is passed into a task's run function as its sole argument. + */ +export interface RunContext { + /** + * The document describing the task instance, its params, state, id, etc. + */ + taskInstance: ConcreteTaskInstance; + /** + * If an API key is associated with the task, a fake KibanaRequest object + * is generated using the API key and passed as part of the run context. + */ + fakeRequest?: KibanaRequest; + abortController: AbortController; +} +/** + * The return value of a task's run function should be a promise of RunResult. + */ +export type SuccessfulRunResult = { + /** + * The state which will be passed to the next run of this task (if this is a + * recurring task). See the RunContext type definition for more details. + */ + state: Record; + taskRunError?: DecoratedError; + shouldValidate?: boolean; + shouldDeleteTask?: boolean; + shouldDisableTask?: boolean; +} & (// ensure a SuccessfulRunResult can either specify a new `runAt` or a new `schedule`, but not both +{ + /** + * Specifies the next run date / time for this task. If unspecified, this is + * treated as a single-run task, and will not be rescheduled after + * completion. + */ + runAt?: Date; + schedule?: never; +} | { + /** + * Specifies a new schedule for this tasks. If unspecified, the task will + * continue to use which ever schedule it already has, and if no there is + * no previous schedule then it will be treated as a single-run task. + */ + schedule?: IntervalSchedule | RruleSchedule; + runAt?: never; +}); +export type FailedRunResult = SuccessfulRunResult & { + /** + * If specified, indicates that the task failed to accomplish its work. This is + * logged out as a warning, and the task will be reattempted after a delay. + */ + error: DecoratedError; +}; +export type RunResult = FailedRunResult | SuccessfulRunResult; +export declare const getDeleteTaskRunResult: () => { + state: {}; + shouldDeleteTask: boolean; +}; +export declare const isFailedRunResult: (result: unknown) => result is FailedRunResult; +export interface FailedTaskResult { + status: TaskStatus.Failed | TaskStatus.DeadLetter; +} +export type AnyRunResult = RunResult | undefined | void; +export type RunFunction = () => Promise; +export type CancelFunction = () => Promise; +export interface CancellableTask { + run: RunFunction; + cancel?: CancelFunction; + cleanup?: () => Promise; +} +export type TaskRunCreatorFunction = (context: RunContext) => CancellableTask; +export declare const taskDefinitionSchema: ObjectType<{ + /** + * A unique identifier for the type of task being defined. + */ + type: import("@kbn/config-schema").Type; + /** + * A brief, human-friendly title for this task. + */ + title: import("@kbn/config-schema").Type; + /** + * Priority of this task type. Defaults to "NORMAL" if not defined + */ + priority: import("@kbn/config-schema").Type; + /** + * Cost to run this task type. Defaults to "Normal". + */ + cost: import("@kbn/config-schema").Type; + /** + * An optional more detailed description of what this task does. + */ + description: import("@kbn/config-schema").Type; + /** + * How long, in minutes or seconds, the system should wait for the task to complete + * before it is considered to be timed out. (e.g. '5m', the default). If + * the task takes longer than this, Kibana will send it a kill command and + * the task will be re-attempted. + */ + timeout: import("@kbn/config-schema").Type; + /** + * Up to how many times the task should retry when it fails to run. This will + * default to the global variable. + */ + maxAttempts: import("@kbn/config-schema").Type; + /** + * The maximum number tasks of this type that can be run concurrently per Kibana instance. + * Setting this value will force Task Manager to poll for this task type seperatly from other task types + * which can add significant load to the ES cluster, so please use this configuration only when absolutly necesery. + */ + maxConcurrency: import("@kbn/config-schema").Type; + stateSchemaByVersion: import("@kbn/config-schema").Type> | undefined>; + paramsSchema: import("@kbn/config-schema").Type; +}>; +/** + * Defines a task which can be scheduled and run by the Kibana + * task manager. + */ +export type TaskDefinition = Omit, 'paramsSchema'> & { + /** + * Creates an object that has a run function which performs the task's work, + * and an optional cancel function which cancels the task. + */ + createTaskRunner: TaskRunCreatorFunction; + stateSchemaByVersion?: Record) => Record; + }>; + paramsSchema?: ObjectType; +}; +export declare enum TaskStatus { + Idle = "idle", + Claiming = "claiming", + Running = "running", + Failed = "failed", + ShouldDelete = "should_delete", + Unrecognized = "unrecognized", + DeadLetter = "dead_letter" +} +export declare enum TaskLifecycleResult { + NotFound = "notFound" +} +export type TaskLifecycle = TaskStatus | TaskLifecycleResult; +export type { IntervalSchedule, Rrule, RruleSchedule } from '@kbn/response-ops-scheduling-types'; +export interface TaskUserScope { + apiKeyId: string; + uiamApiKeyId?: string; + spaceId?: string; + apiKeyCreatedByUser: boolean; +} +export interface TaskInstance { + /** + * Optional ID that can be passed by the caller. When ID is undefined, ES + * will auto-generate a unique id. Otherwise, ID will be used to either + * create a new document, or update existing document + */ + id?: string; + /** + * The task definition type whose run function will execute this instance. + */ + taskType: string; + /** + * The date and time that this task was originally scheduled. This is used + * for convenience to task run functions, and for troubleshooting. + */ + scheduledAt?: Date; + /** + * The date and time that this task started execution. This is used to determine + * the "real" runAt that ended up running the task. This value is only set + * when status is set to "running". + */ + startedAt?: Date | null; + /** + * The date and time that this task should re-execute if stuck in "running" / timeout + * status. This value is only set when status is set to "running". + */ + retryAt?: Date | null; + /** + * The date and time that this task is scheduled to be run. It is not + * guaranteed to run at this time, but it is guaranteed not to run earlier + * than this. Defaults to immediately. + */ + runAt?: Date; + /** + * A TaskSchedule string, which specifies this as a recurring task. + * + * Currently, this supports a single format: an interval in minutes or seconds (e.g. '5m', '30s'). + */ + schedule?: IntervalSchedule | RruleSchedule; + /** + * A task-specific set of parameters, used by the task's run function to tailor + * its work. This is generally user-input, such as { sms: '333-444-2222' }. + */ + params: Record; + /** + * The state passed into the task's run function, and returned by the previous + * run. If there was no previous run, or if the previous run did not return + * any state, this will be the empy object: {} + */ + state: Record; + stateVersion?: number; + /** + * The serialized traceparent string of the current APM transaction or span. + */ + traceparent?: string; + /** + * The id of the user who scheduled this task. + */ + user?: string; + /** + * Used to group tasks for querying. So, reporting might schedule tasks with a scope of 'reporting', + * and then query such tasks to provide a glimpse at only reporting tasks, rather than at all tasks. + */ + scope?: string[]; + /** + * The random uuid of the Kibana instance which claimed ownership of the task last + */ + ownerId?: string | null; + /** + * Indicates whether the task is currently enabled. Disabled tasks will not be claimed. + */ + enabled?: boolean; + timeoutOverride?: string; + partition?: number; + /** + * Used to allow tasks to be scoped to a user via their ES API key + */ + apiKey?: string; + /** + * Used to allow tasks to be scoped to a user via their UIAM API key + */ + uiamApiKey?: string; + /** + * Meta data related to the API key associated with this task + */ + userScope?: TaskUserScope; + priority?: TaskPriority; + /** + * Optional cost for this task instance, overriding the task type's default cost. + * When set, must be one of the InstanceTaskCost enum values ('tiny', 'normal', 'extralarge'). + * Used by the task selector and capacity logic to limit concurrent work. + * Use getTaskCostFromInstance() to translate to the integer TaskCost. + */ + cost?: InstanceTaskCost; +} +/** + * Support for the depracated interval field, this should be removed in version 8.0.0 + * and marked as a breaking change, ideally nutil then all usage of `interval` will be + * replaced with use of `schedule` + */ +export interface TaskInstanceWithDeprecatedFields extends TaskInstance { + /** + * An interval in minutes (e.g. '5m'). If specified, this is a recurring task. + * */ + interval?: string; + /** + * Indicates the number of skipped executions. + */ + numSkippedRuns?: number; +} +/** + * A task instance that has an id. + */ +export type TaskInstanceWithId = Require; +/** + * A task instance that has an id and is ready for storage. + */ +export interface ConcreteTaskInstance extends TaskInstance { + /** + * The id of the Elastic document that stores this instance's data. This can + * be passed by the caller when scheduling the task. + */ + id: string; + /** + * @deprecated This field has been moved under schedule (deprecated) with version 7.6.0 + */ + interval?: string; + /** + * @deprecated removed with version 8.14.0 + */ + numSkippedRuns?: number; + /** + * The saved object version from the Elasticsearch document. + */ + version?: string; + /** + * The date and time that this task was originally scheduled. This is used + * for convenience to task run functions, and for troubleshooting. + */ + scheduledAt: Date; + /** + * The number of unsuccessful attempts since the last successful run. This + * will be zeroed out after a successful run. + */ + attempts: number; + /** + * Indicates whether or not the task is currently running. + */ + status: TaskStatus; + /** + * The date and time that this task is scheduled to be run. It is not guaranteed + * to run at this time, but it is guaranteed not to run earlier than this. + */ + runAt: Date; + /** + * The date and time that this task started execution. This is used to determine + * the "real" runAt that ended up running the task. This value is only set + * when status is set to "running". + */ + startedAt: Date | null; + /** + * The date and time that this task should re-execute if stuck in "running" / timeout + * status. This value is only set when status is set to "running". + */ + retryAt: Date | null; + /** + * The state passed into the task's run function, and returned by the previous + * run. If there was no previous run, or if the previous run did not return + * any state, this will be the empy object: {} + */ + state: Record; + /** + * The random uuid of the Kibana instance which claimed ownership of the task last + */ + ownerId: string | null; + partition?: number; +} +export type PartialConcreteTaskInstance = Partial & { + id: ConcreteTaskInstance['id']; +}; +export interface ConcreteTaskInstanceVersion { + /** The _id of the the document (not the SO id) */ + esId: string; + /** The _seq_no of the document when using seq_no_primary_term on fetch */ + seqNo?: number; + /** The _primary_term of the document when using seq_no_primary_term on fetch */ + primaryTerm?: number; + /** The error found if trying to resolve the version info for this esId */ + error?: string; +} +export type SerializedConcreteTaskInstance = Omit & { + state: string; + params: string; + traceparent: string; + scheduledAt: string; + startedAt: string | null; + retryAt: string | null; + runAt: string; + partition?: number; + apiKey?: string; + uiamApiKey?: string; + userScope?: TaskUserScope; +}; +export type PartialSerializedConcreteTaskInstance = Partial & { + id: SerializedConcreteTaskInstance['id']; +}; +export interface ApiKeyOptions { + request?: KibanaRequest; + regenerateApiKey?: boolean; + /** + * When true with a request, grant only the Elasticsearch API key (skip UIAM). Intended for + * tests and narrow internal flows (e.g. exercising UIAM provisioning on tasks that have ES + * credentials only). + */ + onEsKey?: boolean; +} +export type ScheduleOptions = Record & ApiKeyOptions; +export interface TaskEventLogger { + logEvent(properties: object, id?: string): void; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/index.d.ts new file mode 100644 index 0000000000000..e2d73ea9ea44c --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/index.d.ts @@ -0,0 +1,37 @@ +import type { Subject } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { TaskStore } from '../task_store'; +import type { TaskClaim, TaskTiming } from '../task_events'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +import type { TaskClaimingBatches } from '../queries/task_claiming'; +import type { ConcreteTaskInstance } from '../task'; +import type { TaskPartitioner } from '../lib/task_partitioner'; +export interface TaskClaimerOpts { + getCapacity: (taskType?: string | undefined) => number; + claimOwnershipUntil: Date; + batches: TaskClaimingBatches; + events$: Subject; + taskStore: TaskStore; + definitions: TaskTypeDictionary; + excludedTaskTypes: string[]; + taskMaxAttempts: Record; + logger: Logger; + taskPartitioner: TaskPartitioner; +} +export interface ClaimOwnershipResult { + stats: { + tasksUpdated: number; + tasksConflicted: number; + tasksClaimed: number; + tasksLeftUnclaimed?: number; + tasksErrors?: number; + staleTasks?: number; + }; + docs: ConcreteTaskInstance[]; + timing?: TaskTiming; +} +export type TaskClaimerFn = (opts: TaskClaimerOpts) => Promise; +export declare function getTaskClaimer(logger: Logger, strategy: string): TaskClaimerFn; +export declare function getEmptyClaimOwnershipResult(): ClaimOwnershipResult; +export declare function isTaskTypeExcluded(excludedTaskTypePatterns: string[], taskType: string): boolean; +export declare function getExcludedTaskTypes(definitions: TaskTypeDictionary, excludedTaskTypePatterns: string[]): string[]; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/get_task_cost.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/get_task_cost.d.ts new file mode 100644 index 0000000000000..2195c746d5a51 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/get_task_cost.d.ts @@ -0,0 +1,3 @@ +import type { ConcreteTaskInstance } from '../../task'; +import type { TaskTypeDictionary } from '../../task_type_dictionary'; +export declare function getTaskCost(task: ConcreteTaskInstance, definitions: TaskTypeDictionary): number; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/task_selector_by_capacity.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/task_selector_by_capacity.d.ts new file mode 100644 index 0000000000000..6fc6916b003c2 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/task_selector_by_capacity.d.ts @@ -0,0 +1,10 @@ +import type { ConcreteTaskInstance } from '../../task'; +import type { TaskClaimingBatches } from '../../queries/task_claiming'; +import { type TaskTypeDictionary } from '../../task_type_dictionary'; +interface SelectTasksByCapacityOpts { + definitions: TaskTypeDictionary; + tasks: ConcreteTaskInstance[]; + batches: TaskClaimingBatches; +} +export declare function selectTasksByCapacity({ definitions, tasks, batches, }: SelectTasksByCapacityOpts): ConcreteTaskInstance[]; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.d.ts new file mode 100644 index 0000000000000..12615fb3e4ebd --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.d.ts @@ -0,0 +1,3 @@ +import type { TaskClaimerOpts, ClaimOwnershipResult } from '.'; +export declare function claimAvailableTasksMget(opts: TaskClaimerOpts): Promise; +export declare const NO_ASSIGNED_PARTITIONS_WARNING_INTERVAL = 60000; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_update_by_query.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_update_by_query.d.ts new file mode 100644 index 0000000000000..9d25a1c267c68 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_update_by_query.d.ts @@ -0,0 +1,2 @@ +import type { TaskClaimerOpts, ClaimOwnershipResult } from '.'; +export declare function claimAvailableTasksUpdateByQuery(opts: TaskClaimerOpts): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_events.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_events.d.ts new file mode 100644 index 0000000000000..988f713485269 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_events.d.ts @@ -0,0 +1,70 @@ +import type { ConcreteTaskInstance } from './task'; +import type { Result, Err } from './lib/result_type'; +import type { ClaimAndFillPoolResult } from './lib/fill_pool'; +import type { PollingError } from './polling'; +import type { DecoratedError, TaskRunResult } from './task_running'; +import type { EventLoopDelayConfig } from './config'; +import type { TaskManagerMetrics } from './metrics/task_metrics_collector'; +export declare enum TaskPersistence { + Recurring = "recurring", + NonRecurring = "non_recurring" +} +export declare enum TaskEventType { + TASK_CLAIM = "TASK_CLAIM", + TASK_MARK_RUNNING = "TASK_MARK_RUNNING", + TASK_RUN = "TASK_RUN", + TASK_RUN_REQUEST = "TASK_RUN_REQUEST", + TASK_POLLING_CYCLE = "TASK_POLLING_CYCLE", + TASK_MANAGER_METRIC = "TASK_MANAGER_METRIC", + TASK_MANAGER_STAT = "TASK_MANAGER_STAT" +} +export interface TaskTiming { + start: number; + stop: number; + eventLoopBlockMs?: number; +} +export type WithTaskTiming = T & { + timing: TaskTiming; +}; +export declare function startTaskTimer(): () => TaskTiming; +export declare function startTaskTimerWithEventLoopMonitoring(eventLoopDelayConfig: EventLoopDelayConfig): () => TaskTiming; +export interface TaskEvent { + id?: ID; + timing?: TaskTiming; + type: TaskEventType; + event: Result; +} +export interface RanTask { + task: ConcreteTaskInstance; + persistence: TaskPersistence; + result: TaskRunResult; + isExpired: boolean; +} +export type ErroredTask = RanTask & { + error: DecoratedError; +}; +export type TaskMarkRunning = TaskEvent; +export type TaskRun = TaskEvent; +export type TaskClaim = TaskEvent; +export type TaskRunRequest = TaskEvent; +export type TaskPollingCycle = TaskEvent>; +export type TaskManagerMetric = TaskEvent; +export type TaskManagerStats = 'load' | 'pollingDelay' | 'claimDuration' | 'workerUtilization' | 'runDelay'; +export type TaskManagerStat = TaskEvent; +export type OkResultOf = EventType extends TaskEvent ? OkResult : never; +export type ErrResultOf = EventType extends TaskEvent ? ErrorResult : never; +export declare function asTaskMarkRunningEvent(id: string, event: Result, timing?: TaskTiming): TaskMarkRunning; +export declare function asTaskRunEvent(id: string, event: Result, timing?: TaskTiming): TaskRun; +export declare function asTaskClaimEvent(id: string, event: Result, timing?: TaskTiming): TaskClaim; +export declare function asTaskRunRequestEvent(id: string, event: Err, timing?: TaskTiming): TaskRunRequest; +export declare function asTaskPollingCycleEvent(event: Result>, timing?: TaskTiming): TaskPollingCycle; +export declare function asTaskManagerStatEvent(id: TaskManagerStats, event: Result): TaskManagerStat; +export declare function asTaskManagerMetricEvent(event: Result): TaskManagerMetric; +export declare function isTaskMarkRunningEvent(taskEvent: TaskEvent): taskEvent is TaskMarkRunning; +export declare function isTaskRunEvent(taskEvent: TaskEvent): taskEvent is TaskRun; +export declare function isTaskClaimEvent(taskEvent: TaskEvent): taskEvent is TaskClaim; +export declare function isTaskRunRequestEvent(taskEvent: TaskEvent): taskEvent is TaskRunRequest; +export declare function isTaskPollingCycleEvent(taskEvent: TaskEvent): taskEvent is TaskPollingCycle; +export declare function isTaskManagerStatEvent(taskEvent: TaskEvent): taskEvent is TaskManagerStat; +export declare function isTaskManagerWorkerUtilizationStatEvent(taskEvent: TaskEvent): taskEvent is TaskManagerStat; +export declare function isTaskManagerMetricEvent(taskEvent: TaskEvent): taskEvent is TaskManagerStat; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.d.ts new file mode 100644 index 0000000000000..a35c4f44d14c1 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.d.ts @@ -0,0 +1,23 @@ +import type { TaskDefinition } from '../task'; +import type { TaskRunner } from '../task_running'; +import type { CapacityOpts, ICapacity } from './types'; +export declare class CostCapacity implements ICapacity { + private maxAllowedCost; + private logger; + constructor(opts: CapacityOpts); + get capacity(): number; + /** + * Gets how much capacity is currently in use. + */ + usedCapacity(tasksInPool: Map): number; + /** + * Gets % of capacity in use + */ + usedCapacityPercentage(tasksInPool: Map): number; + /** + * Gets how much capacity is currently in use by each type. + */ + getUsedCapacityByType(tasksInPool: TaskRunner[], type: string): number; + availableCapacity(tasksInPool: Map, taskDefinition?: TaskDefinition | null): number; + determineTasksToRunBasedOnCapacity(tasks: TaskRunner[], availableCapacity: number): [TaskRunner[], TaskRunner[]]; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/index.d.ts new file mode 100644 index 0000000000000..d98ce792a786a --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_pool/index.d.ts @@ -0,0 +1,2 @@ +export { TaskPool, TaskPoolRunResult } from './task_pool'; +export { getCapacityInCost, getCapacityInWorkers } from './utils'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/task_pool.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/task_pool.d.ts new file mode 100644 index 0000000000000..411e6d53f5166 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_pool/task_pool.d.ts @@ -0,0 +1,72 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { TaskRunner } from '../task_running'; +import type { TaskManagerStat } from '../task_events'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +interface TaskPoolOpts { + capacity$: Observable; + definitions: TaskTypeDictionary; + logger: Logger; + strategy: string; +} +export declare enum TaskPoolRunResult { + NoTaskWereRan = "NoTaskWereRan", + RunningAllClaimedTasks = "RunningAllClaimedTasks", + RunningAtCapacity = "RunningAtCapacity", + RanOutOfCapacity = "RanOutOfCapacity" +} +/** + * Runs tasks in batches, taking costs into account. + */ +export declare class TaskPool { + private tasksInPool; + private logger; + private load$; + private definitions; + private capacityCalculator; + /** + * Creates an instance of TaskPool. + * + * @param {Opts} opts + * @prop {number} capacity - The total capacity available + * (e.g. capacity is 4, then 2 tasks of cost 2 can run at a time, or 4 tasks of cost 1) + * @prop {Logger} logger - The task manager logger. + */ + constructor(opts: TaskPoolOpts); + get load(): Observable; + /** + * Gets the IDs of current tasks in pool + */ + getCurrentTasksInPool(): string[]; + /** + * Gets how much capacity is currently in use. + */ + get usedCapacity(): number; + /** + * Gets how much capacity is currently in use as a percentage + */ + get usedCapacityPercentage(): number; + /** + * Gets how much capacity is currently available. + */ + availableCapacity(taskType?: string): number; + /** + * Gets how much capacity is currently in use by each type. + */ + getUsedCapacityByType(type: string): number; + /** + * Attempts to run the specified list of tasks. Returns true if it was able + * to start every task in the list, false if there was not enough capacity + * to run every task. + * + * @param {TaskRunner[]} tasks + * @returns {Promise} + */ + run(tasks: TaskRunner[]): Promise; + cancelRunningTasks(): void; + private handleMarkAsRunning; + private handleFailureOfMarkAsRunning; + private cancelExpiredTasks; + private cancelTask; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/types.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/types.d.ts new file mode 100644 index 0000000000000..69e00af352bff --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_pool/types.d.ts @@ -0,0 +1,16 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/core/server'; +import type { TaskRunner } from '../task_running'; +import type { TaskDefinition } from '../task'; +export interface ICapacity { + get capacity(): number; + availableCapacity(tasksInPool: Map, taskDefinition?: TaskDefinition | null): number; + usedCapacity(tasksInPool: Map): number; + usedCapacityPercentage(tasksInPool: Map): number; + getUsedCapacityByType(tasksInPool: TaskRunner[], type: string): number; + determineTasksToRunBasedOnCapacity(tasks: TaskRunner[], availableCapacity: number): [TaskRunner[], TaskRunner[]]; +} +export interface CapacityOpts { + capacity$: Observable; + logger: Logger; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/utils.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/utils.d.ts new file mode 100644 index 0000000000000..975efdd1cd6c6 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_pool/utils.d.ts @@ -0,0 +1,2 @@ +export declare const getCapacityInWorkers: (capacity: number) => number; +export declare const getCapacityInCost: (capacity: number) => number; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.d.ts new file mode 100644 index 0000000000000..dccf30627a3bf --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.d.ts @@ -0,0 +1,23 @@ +import type { TaskRunner } from '../task_running'; +import type { CapacityOpts, ICapacity } from './types'; +import type { TaskDefinition } from '../task'; +export declare class WorkerCapacity implements ICapacity { + private workers; + private logger; + constructor(opts: CapacityOpts); + get capacity(): number; + /** + * Gets how many workers are currently in use. + */ + usedCapacity(tasksInPool: Map): number; + /** + * Gets % of workers in use + */ + usedCapacityPercentage(tasksInPool: Map): number; + /** + * Gets how many workers are currently in use by each type. + */ + getUsedCapacityByType(tasksInPool: TaskRunner[], type: string): number; + availableCapacity(tasksInPool: Map, taskDefinition?: TaskDefinition | null): number; + determineTasksToRunBasedOnCapacity(tasks: TaskRunner[], availableCapacity: number): [TaskRunner[], TaskRunner[]]; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_running/errors.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_running/errors.d.ts new file mode 100644 index 0000000000000..41adec3a11025 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_running/errors.d.ts @@ -0,0 +1,18 @@ +import { TaskErrorSource } from '../../common'; +export { TaskErrorSource }; +declare const code: unique symbol; +declare const retry: unique symbol; +declare const source: unique symbol; +export interface DecoratedError extends Error { + [code]?: string; + [retry]?: Date | boolean; + [source]?: TaskErrorSource; +} +export declare function isUnrecoverableError(error: Error | DecoratedError): boolean; +export declare function throwUnrecoverableError(error: Error): void; +export declare function isRetryableError(error: Error | DecoratedError): boolean | Date | null | undefined; +export declare function createRetryableError(error: Error, shouldRetry: Date | boolean): DecoratedError; +export declare function throwRetryableError(error: Error, shouldRetry: Date | boolean): void; +export declare function createTaskRunError(error: Error, errorSource?: TaskErrorSource): DecoratedError; +export declare function getErrorSource(error: Error | DecoratedError): TaskErrorSource | undefined; +export declare function isUserError(error: Error | DecoratedError): boolean; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_running/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_running/index.d.ts new file mode 100644 index 0000000000000..77ea5f704c34e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_running/index.d.ts @@ -0,0 +1,2 @@ +export * from './task_runner'; +export * from './errors'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_running/task_runner.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_running/task_runner.d.ts new file mode 100644 index 0000000000000..96340d2e44adf --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_running/task_runner.d.ts @@ -0,0 +1,219 @@ +import type { ExecutionContextStart, IBasePath, Logger } from '@kbn/core/server'; +import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; +import type { Middleware } from '../lib/middleware'; +import type { Result } from '../lib/result_type'; +import type { TaskMarkRunning, TaskRun, TaskManagerStat } from '../task_events'; +import type { CancelFunction, ConcreteTaskInstance, FailedRunResult, PartialConcreteTaskInstance, SuccessfulRunResult, TaskDefinition, TaskEventLogger } from '../task'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +import { type TaskManagerConfig } from '../config'; +import type { ApiKeyStrategy } from '../api_key_strategy'; +export declare const EMPTY_RUN_RESULT: SuccessfulRunResult; +export declare const TASK_MANAGER_RUN_TRANSACTION_TYPE = "task-run"; +export declare const TASK_MANAGER_TRANSACTION_TYPE = "task-manager"; +export declare const TASK_MANAGER_TRANSACTION_TYPE_MARK_AS_RUNNING = "mark-task-as-running"; +export interface TaskRunner { + isExpired: boolean; + expiration: Date; + startedAt: Date | null; + definition: TaskDefinition | undefined; + /** Effective cost for this task (instance override, then definition, then Normal). */ + cost: number; + cancel: CancelFunction; + markTaskAsRunning: () => Promise; + run: () => Promise>; + id: string; + taskExecutionId: string; + stage: string; + toString: () => string; + isSameTask: (executionId: string) => boolean; + isAdHocTaskAndOutOfAttempts: boolean; + removeTask: () => Promise; +} +export declare enum TaskRunningStage { + PENDING = "PENDING", + READY_TO_RUN = "READY_TO_RUN", + RAN = "RAN" +} +export interface TaskRunning { + timestamp: Date; + stage: Stage; + task: Instance; +} +export interface Updatable { + update(doc: ConcreteTaskInstance, options: { + validate: boolean; + }): Promise; + partialUpdate(partialDoc: PartialConcreteTaskInstance, options: { + validate: boolean; + doc: ConcreteTaskInstance; + }): Promise; + remove(id: string): Promise; +} +type Opts = { + basePathService: IBasePath; + logger: Logger; + definitions: TaskTypeDictionary; + instance: ConcreteTaskInstance; + store: Updatable; + onTaskEvent?: (event: TaskRun | TaskMarkRunning | TaskManagerStat) => void; + defaultMaxAttempts: number; + executionContext: ExecutionContextStart; + usageCounter?: UsageCounter; + config: TaskManagerConfig; + allowReadingInvalidState: boolean; + strategy: string; + getPollInterval: () => number; + apiKeyStrategy: ApiKeyStrategy; + eventLogger: TaskEventLogger; +} & Pick; +export declare enum TaskRunResult { + Success = "Success", + SuccessRescheduled = "Success", + RetryScheduled = "RetryScheduled", + Failed = "Failed", + Deleted = "Deleted" +} +export type ConcreteTaskInstanceWithStartedAt = ConcreteTaskInstance & { + startedAt: Date; +}; +export type PendingTask = TaskRunning; +export type ReadyToRunTask = TaskRunning; +export type RanTask = TaskRunning; +export type TaskRunningInstance = PendingTask | ReadyToRunTask | RanTask; +/** + * Runs a background task, ensures that errors are properly handled, + * allows for cancellation. + * + * @export + * @class TaskManagerRunner + * @implements {TaskRunner} + */ +export declare class TaskManagerRunner implements TaskRunner { + private task?; + private instance; + private definitions; + private logger; + private bufferedTaskStore; + private beforeRun; + private beforeMarkRunning; + private onTaskEvent; + private defaultMaxAttempts; + private uuid; + private readonly basePathService; + private readonly executionContext; + private usageCounter?; + private config; + private readonly taskValidator; + private readonly claimStrategy; + private getPollInterval; + private apiKeyStrategy; + private eventLogger; + private isCancelled; + /** + * Creates an instance of TaskManagerRunner. + * @param {Opts} opts + * @prop {Logger} logger - The task manager logger + * @prop {TaskDefinition} definition - The definition of the task being run + * @prop {ConcreteTaskInstance} instance - The record describing this particular task instance + * @prop {Updatable} store - The store used to read / write tasks instance info + * @prop {BeforeRunFunction} beforeRun - A function that adjusts the run context prior to running the task + * @memberof TaskManagerRunner + */ + constructor({ basePathService, instance, definitions, logger, store, beforeRun, beforeMarkRunning, defaultMaxAttempts, onTaskEvent, executionContext, usageCounter, config, allowReadingInvalidState, strategy, getPollInterval, apiKeyStrategy, eventLogger, }: Opts); + /** + * Gets the id of this task instance. + */ + get id(): string; + /** + * Gets the execution id of this task instance. + */ + get taskExecutionId(): string; + /** + * Test whether given execution ID identifies a different execution of this same task + * @param id + */ + isSameTask(executionId: string): boolean; + /** + * Gets the task type of this task instance. + */ + get taskType(): string; + /** + * Get the stage this TaskRunner is at + */ + get stage(): TaskRunningStage; + /** + * Gets the task defintion from the dictionary. + */ + get definition(): TaskDefinition | undefined; + /** + * Effective cost for this task (instance override, then definition, then Normal). + */ + get cost(): number; + /** + * Gets the time at which this task will expire. + */ + get expiration(): Date; + get timeout(): string; + /** + * Gets the duration of the current task run + */ + get startedAt(): Date | null; + /** + * Gets whether or not this task has run longer than its expiration setting allows. + */ + get isExpired(): boolean; + /** + * Returns true whenever the task is ad hoc and has ran out of attempts. When true before + * running a task, the task should be deleted instead of ran. + */ + get isAdHocTaskAndOutOfAttempts(): boolean; + /** + * Returns a log-friendly representation of this task. + */ + toString(): string; + /** + * Runs the task, handling the task result, errors, etc, rescheduling if need + * be. NOTE: the time of applying the middleware's beforeRun is incorporated + * into the total timeout time the task in configured with. We may decide to + * start the timer after beforeRun resolves + * + * @returns {Promise>} + */ + run(): Promise>; + private validateTaskState; + removeTask(): Promise; + /** + * Attempts to claim exclusive rights to run the task. If the attempt fails + * with a 409 (http conflict), we assume another Kibana instance beat us to the punch. + * + * @returns {Promise} + */ + markTaskAsRunning(): Promise; + /** + * Attempts to cancel the task. + * + * @returns {Promise} + */ + cancel(): Promise; + private validateResult; + private releaseClaimAndIncrementAttempts; + private shouldTryToScheduleRetry; + private shouldUpdateExpiredTask; + private rescheduleFailedRun; + private processResultForRecurringTask; + private processResultWhenDone; + private processResult; + private getMaxAttempts; + private getFakeKibanaRequest; + private updateRetryAtOnIntervalForLongRunningTasks; + private logTaskRunEvent; + private logTaskCancelEvent; +} +type InstanceOf = T extends TaskRunning ? I : never; +export declare function isPending(taskRunning: TaskRunningInstance): taskRunning is PendingTask; +export declare function asPending(task: InstanceOf): PendingTask; +export declare function isReadyToRun(taskRunning: TaskRunningInstance): taskRunning is ReadyToRunTask; +export declare function asReadyToRun(task: InstanceOf): ReadyToRunTask; +export declare function asRan(task: InstanceOf): RanTask; +export declare function getTaskDelayInSeconds(scheduledAt: Date): number; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_scheduling.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_scheduling.d.ts new file mode 100644 index 0000000000000..da9e44d9add07 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_scheduling.d.ts @@ -0,0 +1,88 @@ +import type { Logger } from '@kbn/core/server'; +import type { Middleware } from './lib/middleware'; +import { type ApiKeyOptions, type ConcreteTaskInstance, type IntervalSchedule, type RruleSchedule, type ScheduleOptions, type TaskInstanceWithDeprecatedFields, type TaskInstanceWithId } from './task'; +import type { TaskStore } from './task_store'; +import type { ErrorOutput } from './lib/bulk_operation_buffer'; +import type { TaskPollingLifecycle } from './polling_lifecycle'; +export interface TaskSchedulingOpts { + logger: Logger; + taskStore: TaskStore; + middleware: Middleware; + taskManagerId: string; + taskPollingLifecycle?: TaskPollingLifecycle; +} +/** + * return type of TaskScheduling.bulkUpdateSchedules method + */ +export interface BulkUpdateTaskResult { + /** + * list of successfully updated tasks + */ + tasks: ConcreteTaskInstance[]; + /** + * list of failed tasks and errors caused failure + */ + errors: ErrorOutput[]; +} +export interface RunSoonResult { + id: ConcreteTaskInstance['id']; + forced: boolean; +} +export interface RunNowResult { + id: ConcreteTaskInstance['id']; + state?: ConcreteTaskInstance['state']; +} +export declare class TaskScheduling { + private store; + private logger; + private middleware; + private readonly taskPolling; + /** + * Initializes the task manager, preventing any further addition of middleware, + * enabling the task manipulation methods, and beginning the background polling + * mechanism. + */ + constructor(opts: TaskSchedulingOpts); + /** + * Schedules a task. + * + * @param task - The task being scheduled. + * @returns {Promise} + */ + schedule(taskInstance: TaskInstanceWithDeprecatedFields, options?: ScheduleOptions): Promise; + /** + * Bulk schedules a task. + * + * @param tasks - The tasks being scheduled. + * @returns {Promise} + */ + bulkSchedule(taskInstances: TaskInstanceWithDeprecatedFields[], options?: ScheduleOptions): Promise; + bulkDisable(taskIds: string[], clearStateIdsOrBoolean?: string[] | boolean, options?: ApiKeyOptions): Promise; + bulkEnable(taskIds: string[], runSoon?: boolean, options?: ApiKeyOptions): Promise; + bulkUpdateState(taskIds: string[], stateMapFn: (s: ConcreteTaskInstance['state'], id: string) => ConcreteTaskInstance['state'], options?: ApiKeyOptions): Promise; + /** + * Bulk updates schedules for tasks by ids. + * Only tasks with `idle` status will be updated, as for the tasks which have `running` status, + * `schedule` and `runAt` will be recalculated after task run finishes + * + * @param {string[]} taskIds - list of task ids + * @param {IntervalSchedule | RruleSchedule} schedule - new schedule + * @returns {Promise} + */ + bulkUpdateSchedules(taskIds: string[], schedule: IntervalSchedule | RruleSchedule, options?: ApiKeyOptions): Promise; + private bulkGetTasksHelper; + /** + * Run task. + * + * @param taskId - The task being scheduled. + * @returns {Promise} + */ + runSoon(taskId: string, force?: boolean): Promise; + /** + * Schedules a task with an Id + * + * @param task - The task being scheduled. + * @returns {Promise} + */ + ensureScheduled(taskInstance: TaskInstanceWithId, options?: ScheduleOptions): Promise; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_store.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_store.d.ts new file mode 100644 index 0000000000000..546f13147c578 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_store.d.ts @@ -0,0 +1,251 @@ +import { Subject } from 'rxjs'; +import type { SavedObjectError } from '@kbn/core-saved-objects-common'; +import type { estypes } from '@elastic/elasticsearch'; +import type { SavedObjectsBulkDeleteResponse, Logger, SavedObjectsServiceStart, SecurityServiceStart, SavedObject, ISavedObjectsSerializer, ISavedObjectsRepository, ElasticsearchClient } from '@kbn/core/server'; +import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; +import type { IBasePath, ExecutionContextStart } from '@kbn/core/server'; +import type { RequestTimeoutsConfig } from './config'; +import type { Result } from './lib/result_type'; +import type { ConcreteTaskInstance, ConcreteTaskInstanceVersion, TaskInstance, TaskLifecycle, SerializedConcreteTaskInstance, PartialConcreteTaskInstance, PartialSerializedConcreteTaskInstance, ApiKeyOptions } from './task'; +import type { TaskTypeDictionary } from './task_type_dictionary'; +import type { AdHocTaskCounter } from './lib/adhoc_task_counter'; +import { TaskValidator } from './task_validator'; +import type { ErrorOutput } from './lib/bulk_operation_buffer'; +import type { ApiKeyStrategy } from './api_key_strategy'; +export interface StoreOpts { + esClient: ElasticsearchClient; + index: string; + taskManagerId: string; + definitions: TaskTypeDictionary; + savedObjectsRepository: ISavedObjectsRepository; + savedObjectsService: SavedObjectsServiceStart; + serializer: ISavedObjectsSerializer; + adHocTaskCounter: AdHocTaskCounter; + allowReadingInvalidState: boolean; + logger: Logger; + requestTimeouts: RequestTimeoutsConfig; + security: SecurityServiceStart; + canEncryptSavedObjects?: boolean; + esoClient?: EncryptedSavedObjectsClient; + getIsSecurityEnabled: () => boolean; + basePath: IBasePath; + executionContext: ExecutionContextStart; + apiKeyStrategy: ApiKeyStrategy; +} +export interface SearchOpts { + search_after?: Array; + size?: number; + sort?: estypes.Sort; + query?: estypes.QueryDslQueryContainer; + seq_no_primary_term?: boolean; +} +export interface AggregationOpts { + aggs: Record; + query?: estypes.QueryDslQueryContainer; + runtime_mappings?: estypes.MappingRuntimeFields; + size?: number; +} +export interface UpdateByQuerySearchOpts extends SearchOpts { + script?: estypes.Script; +} +export interface UpdateByQueryOpts extends SearchOpts { + max_docs?: number; +} +export interface FetchResult { + docs: ConcreteTaskInstance[]; + versionMap: Map; +} +export interface BulkUpdateOpts { + validate: boolean; + mergeAttributes?: boolean; + options?: ApiKeyOptions; +} +export type BulkUpdateResult = Result; +export type PartialBulkUpdateResult = Result; +export type BulkGetResult = Array>; +export interface UpdateByQueryResult { + updated: number; + version_conflicts: number; + total: number; +} +/** + * Wraps an elasticsearch connection and provides a task manager-specific + * interface into the index. + */ +export declare class TaskStore { + readonly index: string; + readonly taskManagerId: string; + readonly errors$: Subject; + readonly taskValidator: TaskValidator; + private esClient; + private esoClient?; + private definitions; + private savedObjectsRepository; + private savedObjectsService; + private _invalidationSoClient?; + private serializer; + private adHocTaskCounter; + private requestTimeouts; + private security; + private canEncryptSavedObjects?; + private getIsSecurityEnabled; + private logger; + private basePath; + private executionContextRunner; + private apiKeyStrategy; + private get invalidationSoClient(); + /** + * Constructs a new TaskStore. + * @param {StoreOpts} opts + * @prop {esClient} esClient - An elasticsearch client + * @prop {string} index - The name of the task manager index + * @prop {TaskDefinition} definition - The definition of the task being run + * @prop {serializer} - The saved object serializer + * @prop {savedObjectsRepository} - An instance to the saved objects repository + */ + constructor(opts: StoreOpts); + registerEncryptedSavedObjectsClient(client: EncryptedSavedObjectsClient): void; + getEncryptedSavedObjectsClient(): EncryptedSavedObjectsClient | undefined; + private canEncryptSo; + private validateCanEncryptSavedObjects; + private getSoClientForCreate; + private regenerateApiKeyFromRequest; + private getSoClientForUpdate; + private grantApiKeysFromRequest; + private bulkGetDecryptedTaskApiKeys; + private getDecryptedApiKeys; + private bulkGetAndMergeTasksWithDecryptedApiKey; + /** + * Convert ConcreteTaskInstance Ids to match their SavedObject format as serialized + * in Elasticsearch + * @param tasks - The task being scheduled. + */ + convertToSavedObjectIds(taskIds: Array): Array; + /** + * Schedules a task. + * + * @param task - The task being scheduled. + */ + schedule(taskInstance: TaskInstance, options?: ApiKeyOptions): Promise; + private _schedule; + /** + * Bulk schedules a task. + * + * @param tasks - The tasks being scheduled. + */ + bulkSchedule(taskInstances: TaskInstance[], options?: ApiKeyOptions): Promise; + private _bulkSchedule; + /** + * Fetches a list of scheduled tasks with default sorting. + * + * @param opts - The query options used to filter tasks + * @param limitResponse - Whether to exclude the task state and params from the source for a smaller respose payload + */ + fetch({ sort, ...opts }?: SearchOpts, limitResponse?: boolean): Promise; + /** + * Updates the specified doc in the index, returning the doc + * with its version up to date. + * + * @param {TaskDoc} doc + * @returns {Promise} + */ + update(doc: ConcreteTaskInstance, options: { + validate: boolean; + }): Promise; + private _update; + /** + * Updates the specified docs in the index, returning the docs + * with their versions up to date. + * + * @param {Array} docs + * @returns {Promise>} + */ + bulkUpdate(docs: ConcreteTaskInstance[], options: BulkUpdateOpts): Promise; + private _bulkUpdate; + bulkPartialUpdate(docs: PartialConcreteTaskInstance[]): Promise; + private _bulkPartialUpdate; + /** + * Removes the specified task from the index. + * + * @param {string} id + * @returns {Promise} + */ + remove(id: string): Promise; + private _remove; + /** + * Bulk removes the specified tasks from the index. + * + * @param {SavedObjectsBulkDeleteObject[]} savedObjectsToDelete + * @returns {Promise} + */ + bulkRemove(taskIds: string[]): Promise; + private _bulkRemove; + /** + * Gets a task by id + * + * @param {string} id + * @returns {Promise} + */ + get(id: string): Promise; + private _get; + /** + * Gets tasks by ids + * + * @param {Array} ids + * @returns {Promise} + */ + bulkGet(ids: string[]): Promise; + private _bulkGet; + /** + * Gets task version info by ids + * + * @param {Array} esIds + * @returns {Promise} + */ + bulkGetVersions(ids: string[]): Promise; + private _bulkGetVersions; + /** + * Gets task lifecycle step by id + * + * @param {string} id + * @returns {Promise} + */ + getLifecycle(id: string): Promise; + msearch(opts?: SearchOpts[]): Promise; + private _msearch; + search(opts?: SearchOpts, limitResponse?: boolean): Promise; + private _search; + private filterTasks; + private addTasksToVersionMap; + private createVersionMap; + aggregate({ aggs, query, runtime_mappings, size, }: TSearchRequest): Promise>; + private _aggregate; + updateByQuery(opts?: UpdateByQuerySearchOpts, updateByQueryOpts?: UpdateByQueryOpts): Promise; + private _updateByQuery; + getDocVersions(esIds: string[]): Promise>; + private _getDocVersions; +} +/** + * When we run updateByQuery with conflicts='proceed', it's possible for the `version_conflicts` + * to count against the specified `max_docs`, as per https://github.com/elastic/elasticsearch/issues/63671 + * In order to correct for that happening, we only count `version_conflicts` if we haven't updated as + * many docs as we could have. + * This is still no more than an estimation, as there might have been less docuemnt to update that the + * `max_docs`, but we bias in favour of over zealous `version_conflicts` as that's the best indicator we + * have for an unhealthy cluster distribution of Task Manager polling intervals + */ +export declare function correctVersionConflictsForContinuation(updated: estypes.ReindexResponse['updated'], versionConflicts: estypes.ReindexResponse['version_conflicts'], maxDocs?: number): number; +/** + * Returns true when a task document holds an encrypted API key credential + * (either an ES API key or a UIAM API key) together with the `userScope` + * metadata required to process it. Must be kept in sync with every credential + * field registered for ESO encryption on the `task` saved object type. + */ +export declare function docHasEncryptedApiKey(doc: Pick): boolean; +export declare function taskInstanceToAttributes(doc: TaskInstance, id: string): SerializedConcreteTaskInstance; +export declare function partialTaskInstanceToAttributes(doc: PartialConcreteTaskInstance): PartialSerializedConcreteTaskInstance; +export declare function savedObjectToConcreteTaskInstance(savedObject: Omit, 'references'>): ConcreteTaskInstance; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_type_dictionary.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_type_dictionary.d.ts new file mode 100644 index 0000000000000..ef3160a780fdf --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_type_dictionary.d.ts @@ -0,0 +1,91 @@ +import type { ObjectType } from '@kbn/config-schema'; +import type { Logger } from '@kbn/core/server'; +import type { TaskDefinition, TaskRunCreatorFunction, TaskPriority, TaskCost } from './task'; +/** + * Types that are no longer registered and will be marked as unregistered + */ +export declare const REMOVED_TYPES: string[]; +export declare const SHARED_CONCURRENCY_TASKS: string[][]; +/** + * Defines a task which can be scheduled and run by the Kibana + * task manager. + */ +export interface TaskRegisterDefinition { + /** + * A brief, human-friendly title for this task. + */ + title?: string; + /** + * How long, in minutes or seconds, the system should wait for the task to complete + * before it is considered to be timed out. (e.g. '5m', the default). If + * the task takes longer than this, Kibana will send it a kill command and + * the task will be re-attempted. + */ + timeout?: string; + /** + * An optional definition of task priority. Tasks will be sorted by priority prior to claiming + * so high priority tasks will always be claimed before normal priority, which will always be + * claimed before low priority + */ + priority?: TaskPriority; + /** + * An optional definition of the cost associated with running the task. + */ + cost?: TaskCost; + /** + * An optional more detailed description of what this task does. + */ + description?: string; + /** + * Creates an object that has a run function which performs the task's work, + * and an optional cancel function which cancels the task. + */ + createTaskRunner: TaskRunCreatorFunction; + /** + * Up to how many times the task should retry when it fails to run. This will + * default to the global variable. The default value, if not specified, is 1. + */ + maxAttempts?: number; + /** + * The maximum number tasks of this type that can be run concurrently per Kibana instance. + * Setting this value will force Task Manager to poll for this task type separately from other task types + * which can add significant load to the ES cluster, so please use this configuration only when absolutely necessary. + * The default value, if not given, is 0. + */ + maxConcurrency?: number; + stateSchemaByVersion?: Record) => Record; + }>; + paramsSchema?: ObjectType; +} +/** + * A mapping of task type id to the task definition. + */ +export type TaskDefinitionRegistry = Record; +export declare class TaskTypeDictionary { + private definitions; + private logger; + constructor(logger: Logger); + [Symbol.iterator](): MapIterator<[string, TaskDefinition]>; + getAllTypes(): string[]; + getAllDefinitions(): TaskDefinition[]; + has(type: string): boolean; + size(): number; + get(type: string): TaskDefinition | undefined; + ensureHas(type: string): void; + /** + * Method for allowing consumers to register task definitions into the system. + * @param taskDefinitions - The Kibana task definitions dictionary + */ + registerTaskDefinitions(taskDefinitions: TaskDefinitionRegistry): void; + private verifySharedConcurrencyAndCost; +} +/** + * Sanitizes the system's task definitions. Task definitions have optional properties, and + * this ensures they all are given a reasonable default. + * + * @param taskDefinitions - The Kibana task definitions dictionary + */ +export declare function sanitizeTaskDefinitions(taskDefinitions: TaskDefinitionRegistry): TaskDefinition[]; +export declare function sharedConcurrencyTaskTypes(taskType: string): string[] | undefined; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_validator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_validator.d.ts new file mode 100644 index 0000000000000..c5cd20649b735 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/task_validator.d.ts @@ -0,0 +1,28 @@ +import type { Logger } from '@kbn/core/server'; +import type { TaskTypeDictionary } from './task_type_dictionary'; +import type { TaskInstance } from './task'; +interface TaskValidatorOpts { + allowReadingInvalidState: boolean; + definitions: TaskTypeDictionary; + logger: Logger; +} +export declare class TaskValidator { + private readonly logger; + private readonly definitions; + private readonly allowReadingInvalidState; + private readonly cachedGetLatestStateSchema; + private readonly cachedExtendSchema; + constructor({ definitions, allowReadingInvalidState, logger }: TaskValidatorOpts); + getValidatedTaskInstanceFromReading(task: T, options?: { + validate: boolean; + }): T; + getValidatedTaskInstanceForUpdating(task: T, options?: { + validate: boolean; + }): T; + validateTimeoutOverride(task: T): T; + validateInterval(task: T): T; + validateRrule(task: T): T; + private migrateTaskState; + private getValidatedStateSchema; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/constants.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/constants.d.ts new file mode 100644 index 0000000000000..8bb13760b9589 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/constants.d.ts @@ -0,0 +1,26 @@ +import type { IntervalSchedule } from '../task'; +export declare const PROVISION_UIAM_API_KEYS_FLAG = "taskManager.provisionUiamApiKeys"; +export declare const TASK_ID = "uiam_api_key_provisioning"; +export declare const TASK_TYPE = "task_manager:uiam_api_key_provisioning"; +export declare const UIAM_PROVISIONING_TASK_TITLE = "UIAM API key provisioning for task manager tasks"; +export declare const SCHEDULE_INTERVAL: IntervalSchedule; +export declare const TASK_TIMEOUT = "5m"; +/** + * Lower bound for `task.runAt` in the UIAM provisioning fetch query (Elasticsearch date math). + * Keeps eligible tasks from being claimed for execution imminently; evaluated as `now` on the cluster. + */ +export declare const UIAM_PROVISIONING_FETCH_RUN_AT_GT = "now+30s"; +/** When there are more tasks to convert, run again after this many ms (10m) to process the next batch. */ +export declare const RUN_AT_INTERVAL_MS = 600000; +/** Max number of task docs to fetch per run (same as referenced alerting provisioning task). */ +export declare const FETCH_BATCH_SIZE = 500; +/** + * Page size when listing final UIAM provisioning status SOs (matches Alerting `GET_STATUS_BATCH_SIZE`). + */ +export declare const GET_STATUS_BATCH_SIZE = 500; +/** + * UIAM convert error code returned when the Elasticsearch API key creator is not a Cloud user. + * Source: https://github.com/elastic/uiam/blob/main/modules/domain/src/main/java/co/elastic/cloud/uiam/domain/errors/ErrorCode.java + */ +export declare const NON_CLOUD_USER_API_KEY_CREATOR_ERROR_CODE = "0x357391"; +export declare const TAGS: string[]; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/event_based_telemetry.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/event_based_telemetry.d.ts new file mode 100644 index 0000000000000..011cdb3776224 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/event_based_telemetry.d.ts @@ -0,0 +1,12 @@ +import type { EventTypeOpts } from '@kbn/core/server'; +export interface TaskManagerUiamProvisioningRunEventData { + total: number; + completed: number; + failed: number; + skipped: number; + has_more_to_provision: boolean; + has_error: boolean; + run_number: number; +} +export declare const TASK_MANAGER_UIAM_PROVISIONING_RUN_EVENT: EventTypeOpts; +export declare const taskManagerUiamProvisioningEvents: Array>>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/index.d.ts new file mode 100644 index 0000000000000..f5f169ea7d338 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/index.d.ts @@ -0,0 +1,6 @@ +export { UiamApiKeyProvisioningTask } from './uiam_api_key_provisioning_task'; +export { TASK_TYPE, PROVISION_UIAM_API_KEYS_FLAG } from './constants'; +export { UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE } from './uiam_api_keys_provisioning_status_saved_object'; +export { TASK_MANAGER_UIAM_PROVISIONING_RUN_EVENT, taskManagerUiamProvisioningEvents, } from './event_based_telemetry'; +export type { TaskManagerUiamProvisioningRunEventData } from './event_based_telemetry'; +export type { ApiKeyToConvert, TaskApiKeyToConvertAttributes, TaskManagerUiamProvisioningRunContext, UiamKeyResult, UiamConvertResponse, UiamConvertSuccessResult, UiamConvertFailedResult, } from './types'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_provisioning_run_telemetry.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_provisioning_run_telemetry.d.ts new file mode 100644 index 0000000000000..57b12a97c78a6 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_provisioning_run_telemetry.d.ts @@ -0,0 +1,13 @@ +import type { TaskManagerUiamProvisioningRunEventData } from '../event_based_telemetry'; +export declare const failedProvisioningRunTelemetry: () => TaskManagerUiamProvisioningRunEventData; +/** + * Shapes run telemetry like Alerting's `UiamProvisioningRunEventData` + * (`completed` + `failed` + `skipped` = `total`, `has_more_to_provision` from batching). + */ +export declare const buildSuccessProvisioningRunTelemetry: ({ completed, failed, skipped, hasMoreToProvision, nextRunNumber, }: { + completed: number; + failed: number; + skipped: number; + hasMoreToProvision: boolean; + nextRunNumber: number; +}) => TaskManagerUiamProvisioningRunEventData; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_saved_object_bulk_updates_for_uiam.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_saved_object_bulk_updates_for_uiam.d.ts new file mode 100644 index 0000000000000..334bdc1a7f73a --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_saved_object_bulk_updates_for_uiam.d.ts @@ -0,0 +1,28 @@ +import type { SavedObjectsBulkUpdateObject } from '@kbn/core/server'; +import type { InvalidationTarget } from '../../api_key_strategy'; +import type { TaskUserScope } from '../../task'; +import type { UiamKeyResult } from '../types'; +/** Shape of attributes sent in a UIAM provisioning partial bulkUpdate. */ +interface UiamBulkUpdateAttrs { + uiamApiKey: string; + userScope: TaskUserScope; + /** + * `taskType` is in the Task ESO `attributesToIncludeInAAD` set, so it must be + * included on every partial encrypt-update — otherwise `uiamApiKey` is encrypted + * with a mismatched AAD and decrypt fails on subsequent reads (and ESO strips + * `apiKey` along with it). See `task_manager_dependencies/server/plugin.ts`. + */ + taskType: string; +} +/** + * {@link markApiKeysForInvalidation} targets from task SO bulk updates built by + * {@link buildSavedObjectBulkUpdatesForUiamKeys} (attributes carry UIAM id + secret). + */ +export declare const invalidationTargetsFromUiamTaskBulkUpdates: (updates: Array>) => InvalidationTarget[]; +/** + * Saved-object bulk update operations for successful UIAM converts. + * Callers only enqueue tasks that passed {@link classifyTaskForUiamProvisioning} with usable + * `userScope` / `apiKeyId`, so one update is built per converted result. + */ +export declare const buildSavedObjectBulkUpdatesForUiamKeys: (converted: UiamKeyResult[]) => Array>; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/classify_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/classify_task.d.ts new file mode 100644 index 0000000000000..084ed1393b65c --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/classify_task.d.ts @@ -0,0 +1,30 @@ +import type { ConcreteTaskInstance } from '../../task'; +import type { ApiKeyToConvert } from '../types'; +import { type TaskUiamProvisioningStatusDoc } from './task_uiam_provisioning_observability_status'; +/** + * Task document for UIAM provisioning classification + * (mirrors {@link RuleForClassification} in `alerting/.../fetch_first_batch.ts`). + */ +export type TaskForClassification = ConcreteTaskInstance; +export type ClassifyTaskResult = { + action: 'skip'; + status: TaskUiamProvisioningStatusDoc; +} | { + action: 'convert'; + task: ApiKeyToConvert; +}; +/** + * Classifies a task as either skip (with status doc) or convert (with API key payload + instance for merge). + * Skip: no API key, already has UIAM key, user-created key, or unusable userScope. + * Convert: system-generated API key, no UIAM key yet, usable userScope. + */ +export declare const classifyTaskForUiamProvisioning: (task: TaskForClassification) => ClassifyTaskResult; +export interface ClassifyTasksResult { + provisioningStatusForSkippedTasks: TaskUiamProvisioningStatusDoc[]; + apiKeysToConvert: ApiKeyToConvert[]; +} +/** + * Classifies a batch of tasks into skipped (with status docs) and to-convert payloads. + * Mirrors `classifyRulesForUiamProvisioning` in `alerting/.../classify_rule.ts`. + */ +export declare const classifyTasksForUiamProvisioning: (tasks: TaskForClassification[]) => ClassifyTasksResult; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_provisioning_run_context.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_provisioning_run_context.d.ts new file mode 100644 index 0000000000000..19e1516763491 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_provisioning_run_context.d.ts @@ -0,0 +1,9 @@ +import type { CoreSetup } from '@kbn/core/server'; +import type { TaskManagerPluginsStart, TaskManagerStartContract } from '../../plugin'; +import type { TaskManagerUiamProvisioningRunContext } from '../types'; +/** + * Builds the shared context for a Task Manager UIAM provisioning run + * (mirrors {@link createProvisioningRunContext} in + * `alerting/server/provisioning/lib/create_provisioning_run_context.ts`). + */ +export declare const createProvisioningRunContext: (core: CoreSetup) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_uiam_provisioning_task_runner.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_uiam_provisioning_task_runner.d.ts new file mode 100644 index 0000000000000..81bd026784553 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_uiam_provisioning_task_runner.d.ts @@ -0,0 +1,27 @@ +import type { CoreSetup } from '@kbn/core/server'; +import type { TaskManagerStartContract } from '../..'; +import type { ConcreteTaskInstance } from '../../task'; +import type { TaskManagerPluginsStart } from '../../plugin'; +import type { TaskManagerUiamProvisioningRunEventData } from '../event_based_telemetry'; +export interface UiamProvisioningRunTaskOutcome { + state: { + runs: number; + }; + runAt?: Date; + telemetry: TaskManagerUiamProvisioningRunEventData; +} +export interface UiamProvisioningTaskRunnerDeps { + runTask: (taskInstance: ConcreteTaskInstance, coreSetup: CoreSetup) => Promise; + reportProvisioningRunEvent: (telemetry: TaskManagerUiamProvisioningRunEventData) => void; +} +export declare const createUiamProvisioningTaskRunner: (coreSetup: CoreSetup, deps: UiamProvisioningTaskRunnerDeps) => ({ taskInstance }: { + taskInstance: ConcreteTaskInstance; +}) => { + run: () => Promise<{ + state: { + runs: number; + }; + runAt?: Date; + }>; + cancel: () => Promise; +}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/deferred_non_running_tasks_query.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/deferred_non_running_tasks_query.d.ts new file mode 100644 index 0000000000000..c0d3734a0e296 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/deferred_non_running_tasks_query.d.ts @@ -0,0 +1,16 @@ +import type { estypes } from '@elastic/elasticsearch'; +/** + * Tasks eligible for UIAM API key background conversion: + * - Not in `running` status, and + * - Either `runAt` is after `UIAM_PROVISIONING_FETCH_RUN_AT_GT` (Elasticsearch `now+30s`, so an + * enabled task will not be claimed for execution imminently), or the task is **disabled** (Task + * Manager does not claim disabled tasks, so there is no race with execution regardless of + * `runAt`). + * + * Optional `excludeTaskEntityIdsWithFinalStatus`: Kibana task document `_id` values are `task:`. + * Excluding by `ids` prevents re-fetching tasks that already have a SKIPPED or COMPLETED + * UIAM provisioning status document (see `getExcludeTasksFilter`). + */ +export declare const buildUiamProvisioningFetchQuery: (options?: { + excludeTaskEntityIdsWithFinalStatus?: string[]; +}) => estypes.QueryDslQueryContainer; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/error_utils.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/error_utils.d.ts new file mode 100644 index 0000000000000..e23f6e8fd2f6e --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/error_utils.d.ts @@ -0,0 +1,2 @@ +/** Same as `alerting/server/provisioning/lib/error_utils.ts` for log message parity. */ +export declare const getErrorMessage: (error: unknown) => string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/fetch_first_batch_of_tasks_to_convert.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/fetch_first_batch_of_tasks_to_convert.d.ts new file mode 100644 index 0000000000000..ea2682d5f3fe4 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/fetch_first_batch_of_tasks_to_convert.d.ts @@ -0,0 +1,19 @@ +import type { TaskManagerStartContract } from '../..'; +import type { TaskForClassification } from './classify_task'; +export interface FetchFirstBatchOfTasksOptions { + /** + * Task `entityId`s that already have final UIAM provisioning status + * (return value of {@link getExcludeTasksFilter}). + */ + excludeTaskEntityIdsWithFinalStatus: string[]; + /** Defaults to {@link FETCH_BATCH_SIZE}. */ + perPage?: number; +} +/** + * Fetches the first page of task docs for UIAM conversion + * (mirrors `fetchFirstBatchOfRulesToConvert` in Alerting’s provisioning layer). + */ +export declare const fetchFirstBatchOfTasksToConvert: (taskManager: TaskManagerStartContract, options: FetchFirstBatchOfTasksOptions) => Promise<{ + tasks: TaskForClassification[]; + hasMore: boolean; +}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/get_exclude_tasks_filter.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/get_exclude_tasks_filter.d.ts new file mode 100644 index 0000000000000..25eb2e113b26b --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/get_exclude_tasks_filter.d.ts @@ -0,0 +1,10 @@ +import type { ISavedObjectsRepository } from '@kbn/core/server'; +/** + * Returns task `entityId`s that already have a final UIAM provisioning status + * (completed, skipped, or failed due to non-Cloud user API key creator code) so + * the provisioning fetch can exclude them. + * + * Mirrors {@link getExcludeRulesFilter} in + * `x-pack/.../alerting/server/provisioning/lib/get_exclude_rules_filter.ts`. + */ +export declare const getExcludeTasksFilter: (savedObjectsClient: ISavedObjectsRepository) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/map_uiam_convert_response_to_key_results.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/map_uiam_convert_response_to_key_results.d.ts new file mode 100644 index 0000000000000..1f0ad2214d8bb --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/map_uiam_convert_response_to_key_results.d.ts @@ -0,0 +1,7 @@ +import type { ConvertUiamAPIKeysResponse } from '@kbn/core-security-server'; +import type { ApiKeyToConvert, ConvertApiKeysResult } from '../types'; +/** + * Maps the UIAM convert API response and input tasks into result rows and failed-conversion status docs. + * Caller must ensure `convertResponse.results.length === apiKeysToConvert.length`. + */ +export declare const mapUiamConvertResponseToKeyResults: (apiKeysToConvert: ApiKeyToConvert[], convertResponse: ConvertUiamAPIKeysResponse) => ConvertApiKeysResult; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_status_and_orphaned_keys_from_bulk_update.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_status_and_orphaned_keys_from_bulk_update.d.ts new file mode 100644 index 0000000000000..5eab164a6984d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_status_and_orphaned_keys_from_bulk_update.d.ts @@ -0,0 +1,23 @@ +import type { InvalidationTarget } from '../../api_key_strategy'; +import type { UiamKeyResult } from '../types'; +import { type TaskUiamProvisioningStatusDoc } from './task_uiam_provisioning_observability_status'; +/** + * Result item from a bulkUpdate call (has id and optional error). + * Mirrors `BulkUpdateResultItem` in alerting's `provisioning_status.ts`. + */ +export interface TaskBulkUpdateResultItem { + id: string; + error?: { + message?: string; + }; +} +/** + * Builds status docs from bulk update results and collects invalidation targets for tasks + * that failed to update (orphaned), shaped like {@link InvalidationTarget} in `api_key_strategy` + * and Alerting’s notion of “orphan” UIAM material to queue for the invalidate pipeline. + */ +export declare const statusDocsAndOrphanedUiamKeysFromTaskBulkUpdate: (savedObjects: Array, uiamKeyByTaskId: Map) => { + provisioningStatusForCompletedTasks: TaskUiamProvisioningStatusDoc[]; + provisioningStatusForFailedTasks: TaskUiamProvisioningStatusDoc[]; + orphanedInvalidationTargets: InvalidationTarget[]; +}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_uiam_provisioning_observability_status.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_uiam_provisioning_observability_status.d.ts new file mode 100644 index 0000000000000..19eb118a4ccb7 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_uiam_provisioning_observability_status.d.ts @@ -0,0 +1,52 @@ +import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; +import { UiamApiKeyProvisioningEntityType, UiamApiKeyProvisioningStatus } from '@kbn/uiam-api-keys-provisioning-status'; +import { UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE } from '../uiam_api_keys_provisioning_status_saved_object'; +export interface TaskUiamProvisioningStatusDoc { + type: typeof UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE; + id: string; + attributes: { + '@timestamp': string; + entityId: string; + entityType: typeof UiamApiKeyProvisioningEntityType.TASK; + status: typeof UiamApiKeyProvisioningStatus.SKIPPED | typeof UiamApiKeyProvisioningStatus.FAILED | typeof UiamApiKeyProvisioningStatus.COMPLETED; + message?: string; + errorCode?: string; + }; +} +export declare const createSkippedTaskProvisioningStatus: (taskId: string, message: string) => TaskUiamProvisioningStatusDoc; +export declare const createFailedConversionTaskProvisioningStatus: (taskId: string, message: string, errorCode?: string) => TaskUiamProvisioningStatusDoc; +export declare const createTaskProvisioningStatusFromBulkUpdateResult: (so: { + id: string; + error?: { + message?: string; + }; +}) => TaskUiamProvisioningStatusDoc; +export interface TaskUiamProvisioningObservabilityStatusPayload { + skipped: TaskUiamProvisioningStatusDoc[]; + failedConversions: TaskUiamProvisioningStatusDoc[]; + completed: TaskUiamProvisioningStatusDoc[]; + failed: TaskUiamProvisioningStatusDoc[]; +} +/** + * Same shape as Alerting's `ProvisioningStatusWritePayload` for `uiam_api_keys_provisioning_status`. + */ +export type TaskProvisioningStatusWritePayload = TaskUiamProvisioningObservabilityStatusPayload; +export interface TaskProvisioningStatusCounts { + skipped: number; + failedConversions: number; + completed: number; + failed: number; + total: number; +} +/** + * Builds the flat docs array and counts for a provisioning status write (mirrors + * `prepareProvisioningStatusWrite` in `alerting/server/provisioning/lib/provisioning_status.ts`). + */ +export declare const prepareTaskProvisioningStatusWrite: (payload: TaskProvisioningStatusWritePayload) => { + docs: TaskUiamProvisioningStatusDoc[]; + counts: TaskProvisioningStatusCounts; +}; +/** + * Persists provisioning status docs for monitoring only. Swallows errors so execution is unchanged. + */ +export declare const writeTaskUiamProvisioningObservabilityStatus: (savedObjectsClient: ISavedObjectsRepository, logger: Logger, payload: TaskUiamProvisioningObservabilityStatusPayload) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/uiam_provisioning_feature_flag_scheduler.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/uiam_provisioning_feature_flag_scheduler.d.ts new file mode 100644 index 0000000000000..1ef870cb43f0a --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/uiam_provisioning_feature_flag_scheduler.d.ts @@ -0,0 +1,16 @@ +import type { CoreStart, Logger } from '@kbn/core/server'; +import type { TaskScheduling } from '../../task_scheduling'; +import type { IntervalSchedule } from '../../task'; +export declare class UiamProvisioningFeatureFlagScheduler { + private readonly logger; + private featureFlagSubscription; + private appliedFlagValue; + constructor(logger: Logger); + start({ core, taskScheduling, removeIfExists, schedule, }: { + core: CoreStart; + taskScheduling: TaskScheduling; + removeIfExists: (id: string) => Promise; + schedule: IntervalSchedule; + }): void; + stop(): void; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/task_state.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/task_state.d.ts new file mode 100644 index 0000000000000..2721c09600154 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/task_state.d.ts @@ -0,0 +1,24 @@ +import type { TypeOf } from '@kbn/config-schema'; +/** + * WARNING: Do not modify the existing versioned schema(s) below, instead define a new version (ex: 2, 3, 4). + * This is required to support zero-downtime upgrades and rollbacks. See https://github.com/elastic/kibana/issues/155764. + * + * As you add a new schema version, don't forget to change latestTaskStateSchema variable to reference the latest schema. + * For example, changing stateSchemaByVersion[1].schema to stateSchemaByVersion[2].schema. + */ +export declare const stateSchemaByVersion: { + 1: { + up: (state: Record) => { + runs: {}; + }; + schema: import("@kbn/config-schema").ObjectType<{ + runs: import("@kbn/config-schema").Type; + }>; + }; +}; +declare const latestTaskStateSchema: import("@kbn/config-schema").ObjectType<{ + runs: import("@kbn/config-schema").Type; +}>; +export type LatestTaskStateSchema = TypeOf; +export declare const emptyState: LatestTaskStateSchema; +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/types.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/types.d.ts new file mode 100644 index 0000000000000..39e118409afbd --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/types.d.ts @@ -0,0 +1,95 @@ +import type { CoreStart, ISavedObjectsRepository } from '@kbn/core/server'; +import type { ConvertUiamAPIKeysResponse } from '@kbn/core-security-server'; +import type { TaskUiamProvisioningStatusDoc } from './lib/task_uiam_provisioning_observability_status'; +import type { TaskUserScope } from '../task'; +import type { TaskManagerStartContract } from '../plugin'; +/** Success result from UIAM convert API */ +export interface UiamConvertSuccessResult { + status: 'success'; + id: string; + key: string; + organization_id: string; + description: string; + internal: boolean; + role_assignments: Record; + creation_date: string; +} +/** Failed result from UIAM convert API */ +export interface UiamConvertFailedResult { + status: 'failed'; + message: string; + type: string; + resource: string; + code: string; +} +/** Response from core.security.authc.apiKeys.uiam.convert */ +export interface UiamConvertResponse { + results: Array; +} +/** Task document fields required for convert + ESO/SO merge (mirrors Alerting's full `RawRule` on `ApiKeyToConvert`) */ +export interface TaskApiKeyToConvertAttributes { + /** System API key string to send to UIAM convert (mirrors `apiKey` on the rule) */ + apiKey: string; + /** + * Required so the partial `bulkUpdate` payload includes `taskType` and ESO can + * compute the same AAD that was used when the doc was originally encrypted. + * The Task ESO type lists `taskType` in `attributesToIncludeInAAD` (see + * `task_manager_dependencies/server/plugin.ts`); omitting it would corrupt + * `uiamApiKey` (and silently strip `apiKey` on subsequent reads). + */ + taskType: string; + userScope: TaskUserScope; +} +/** + * Runtime dependencies for a UIAM task provisioning run + * (mirrors Alerting's `ProvisioningRunContext` in `alerting/server/provisioning/types.ts`). + */ +export interface TaskManagerUiamProvisioningRunContext { + coreStart: CoreStart; + taskManager: TaskManagerStartContract; + savedObjectsClient: ISavedObjectsRepository; + uiamConvert: (keys: string[]) => Promise; +} +/** Task doc queued for UIAM convert + SO update (mirrors Alerting's `ApiKeyToConvert`) */ +export interface ApiKeyToConvert { + taskId: string; + attributes: TaskApiKeyToConvertAttributes; + /** Task SO version for `bulkUpdate` (mirrors rule `version` on `ApiKeyToConvert`) */ + version?: string; +} +/** + * One successfully converted task with material for SO update + * (mirrors `UiamApiKeyByRuleId` in `alerting/server/provisioning/types.ts`). + */ +export interface UiamKeyResult { + taskId: string; + uiamApiKey: string; + uiamApiKeyId: string; + /** Decrypted task fields for merge; required for ESO/SO `bulkUpdate` */ + attributes: TaskApiKeyToConvertAttributes; + /** Task SO version for `bulkUpdate` (optimistic concurrency) */ + version?: string; +} +/** + * Result of the first provisioning step (mirrors Alerting's `GetApiKeysToConvertResult`). + */ +export interface GetApiKeysToConvertResult { + apiKeysToConvert: ApiKeyToConvert[]; + provisioningStatusForSkippedTasks: TaskUiamProvisioningStatusDoc[]; + /** True when the fetch batch is full, so more tasks may be provisioned on a later run */ + hasMoreToProvision: boolean; +} +/** + * Result of the convert step (mirrors Alerting's `ConvertApiKeysResult`). + */ +export interface ConvertApiKeysResult { + converted: UiamKeyResult[]; + provisioningStatusForFailedConversions: TaskUiamProvisioningStatusDoc[]; +} +/** + * Result of the bulk task update step (mirrors completed/failed status from Alerting's `updateRules`). + */ +export interface UpdateTasksResult { + provisioningStatusForCompletedTasks: TaskUiamProvisioningStatusDoc[]; + provisioningStatusForFailedTasks: TaskUiamProvisioningStatusDoc[]; +} diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_key_provisioning_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_key_provisioning_task.d.ts new file mode 100644 index 0000000000000..2d20a2f1c827c --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_key_provisioning_task.d.ts @@ -0,0 +1,35 @@ +import type { AnalyticsServiceSetup, Logger } from '@kbn/core/server'; +import type { CoreSetup, CoreStart } from '@kbn/core/server'; +import type { TaskManagerStartContract } from '..'; +import type { TaskScheduling } from '../task_scheduling'; +import type { TaskTypeDictionary } from '../task_type_dictionary'; +import type { TaskManagerPluginsStart } from '../plugin'; +interface RegisterUiamApiKeyProvisioningTaskOpts { + coreSetup: CoreSetup; + taskTypeDictionary: TaskTypeDictionary; +} +export declare class UiamApiKeyProvisioningTask { + private readonly logger; + private readonly isServerless; + private readonly analytics; + private readonly featureFlagScheduler; + constructor({ logger, isServerless, analytics, }: { + logger: Logger; + isServerless: boolean; + analytics: AnalyticsServiceSetup; + }); + register(opts: RegisterUiamApiKeyProvisioningTaskOpts): void; + start({ core, taskScheduling, removeIfExists, }: { + core: CoreStart; + taskScheduling: TaskScheduling; + removeIfExists: (id: string) => Promise; + }): Promise; + stop(): void; + private runTask; + private reportProvisioningRunEvent; + private getApiKeysToConvert; + private convertApiKeys; + private updateTasks; + private updateProvisioningStatus; +} +export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_keys_provisioning_status_saved_object.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_keys_provisioning_status_saved_object.d.ts new file mode 100644 index 0000000000000..8bdcaf9857ffa --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_keys_provisioning_status_saved_object.d.ts @@ -0,0 +1,19 @@ +/** + * Saved object type id for UIAM API key provisioning status documents. + * + * This string intentionally matches Alerting's + * `UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE` in + * `x-pack/platform/plugins/shared/alerting/server/saved_objects/index.ts`. Task Manager cannot + * import that constant + * because `alerting` already depends on `taskManager`; importing alerting from Task Manager + * would introduce an undesirable plugin/module dependency cycle. + * + * The type is registered by Alerting (`setupSavedObjects`) on `ALERTING_CASES_SAVED_OBJECT_INDEX`. + * Task Manager only writes `entityType: 'task'` rows for observability; these writes do not + * participate in Task Manager execution logic. + * + * Note: `UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE` is treated as a transitional + * saved object type and is expected to be removed once a migration path to a longer-term + * storage or telemetry strategy is completed. + */ +export declare const UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE = "uiam_api_keys_provisioning_status"; diff --git a/x-pack/platform/plugins/shared/task_manager/server/usage/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/usage/index.d.ts new file mode 100644 index 0000000000000..9250de9f32d22 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/usage/index.d.ts @@ -0,0 +1 @@ +export { registerTaskManagerUsageCollector } from './task_manager_usage_collector'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/usage/task_manager_usage_collector.d.ts b/x-pack/platform/plugins/shared/task_manager/server/usage/task_manager_usage_collector.d.ts new file mode 100644 index 0000000000000..8c0c147e8779d --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/usage/task_manager_usage_collector.d.ts @@ -0,0 +1,7 @@ +import type { Observable } from 'rxjs'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { MonitoredHealth } from '../routes/health'; +import type { TaskManagerUsage } from './types'; +import type { MonitoredUtilization } from '../routes/background_task_utilization'; +export declare function createTaskManagerUsageCollector(usageCollection: UsageCollectionSetup, monitoringStats$: Observable, monitoredUtilization$: Observable, excludeTaskTypes: string[]): import("@kbn/usage-collection-plugin/server").Collector; +export declare function registerTaskManagerUsageCollector(usageCollection: UsageCollectionSetup, monitoringStats$: Observable, monitoredUtilization$: Observable, excludeTaskTypes: string[]): void; diff --git a/x-pack/platform/plugins/shared/task_manager/server/usage/types.d.ts b/x-pack/platform/plugins/shared/task_manager/server/usage/types.d.ts new file mode 100644 index 0000000000000..7decc8cb22e26 --- /dev/null +++ b/x-pack/platform/plugins/shared/task_manager/server/usage/types.d.ts @@ -0,0 +1,13 @@ +export interface TaskManagerUsage { + task_type_exclusion: string[]; + failed_tasks: number; + recurring_tasks: { + actual_service_time: number; + adjusted_service_time: number; + }; + adhoc_tasks: { + actual_service_time: number; + adjusted_service_time: number; + }; + capacity: number; +} From 3c9c10d9042de41f5b607d18086b03472b2a7bae Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Thu, 28 May 2026 09:45:01 +0200 Subject: [PATCH 13/21] add fetch test --- .../main/data_fetching/fetch_esql.test.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.test.ts b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.test.ts index 777a1f61044f4..1055832880f70 100644 --- a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.test.ts +++ b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.test.ts @@ -132,4 +132,35 @@ describe('fetchEsql', () => { expect(result.time).toEqual(absoluteTimeRange); }); + + it('should add inline_highlights to the raw record when inline highlights are present', async () => { + const hits = [ + { _index: 'i', _id: '1', snippets: 'bar' }, + { _index: 'i', _id: '2', snippets: 'baz' }, + ] as unknown as EsHitRecord[]; + const expressionsExecuteSpy = jest.spyOn(discoverServiceMock.expressions, 'execute'); + expressionsExecuteSpy.mockReturnValueOnce({ + cancel: jest.fn(), + getData: jest.fn(() => + of({ + result: { + columns: ['_id', 'snippets'], + rows: hits, + }, + }) + ), + } as unknown as ExecutionContract); + + const result = await fetchEsql({ + ...fetchEsqlMockProps, + query: { esql: 'from * | EVAL snippets = TOP_SNIPPETS(foo, "bar", { "highlight": true })' }, + }); + + expect(result.records[0].raw.inline_highlights).toEqual({ + snippets: { preTag: '', postTag: '' }, + }); + expect(result.records[1].raw.inline_highlights).toEqual({ + snippets: { preTag: '', postTag: '' }, + }); + }); }); From 47fb4640b745f4d6bda8bfa74f6ae2e8fb3f3260 Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Thu, 28 May 2026 09:53:42 +0200 Subject: [PATCH 14/21] fix: push empty object --- .../public/application/main/data_fetching/fetch_esql.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts index 9ff196096ac18..4a5cd547505d7 100644 --- a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts +++ b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts @@ -124,7 +124,9 @@ export function fetchEsql({ } } finalData = rows.map((row, idx) => { - const raw = inlineHighlights ? { ...row, inline_highlights: inlineHighlights } : row; + const raw = Object.keys(inlineHighlights ?? {}).length + ? { ...row, inline_highlights: inlineHighlights } + : row; const record: DataTableRecord = { id: row._index && row._id ? getDocId(row) : `${idx + 1}@${responseTime}`, raw, From 7adea4d5c1a57b0bdfb04204cb5cae00f5608fe4 Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Thu, 28 May 2026 10:38:32 +0200 Subject: [PATCH 15/21] fix circular dep --- .../plugins/shared/field_formats/common/types.ts | 12 +++++++++++- .../common/utils/highlight/highlight_react.test.tsx | 3 +-- .../common/utils/highlight/highlight_react.tsx | 7 +++---- .../shared/field_formats/common/utils/index.ts | 6 +----- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/platform/plugins/shared/field_formats/common/types.ts b/src/platform/plugins/shared/field_formats/common/types.ts index 58af079a731ba..10cbc2edca7fa 100644 --- a/src/platform/plugins/shared/field_formats/common/types.ts +++ b/src/platform/plugins/shared/field_formats/common/types.ts @@ -15,9 +15,19 @@ import type { FieldFormatsRegistry } from './field_formats_registry'; /** * React converter options */ +export interface FieldFormatHighlightTags { + preTag: string; + postTag: string; +} + +export interface ReactContextTypeHit { + highlight?: Record; + inline_highlights?: Record; +} + export interface ReactContextTypeOptions { field?: { name: string }; - hit?: { highlight?: Record }; + hit?: ReactContextTypeHit; skipFormattingInStringifiedJSON?: boolean; } diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx index fe8dda60d3f79..3cfadbd5eec6f 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx +++ b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx @@ -11,7 +11,6 @@ import React from 'react'; import ReactDOM from 'react-dom/server'; import { highlightTags } from './highlight_tags'; import { getHighlightReact } from './highlight_react'; -import { type ESQLHighlightTags } from '@kbn/esql-utils'; /** Render the ReactNode to a plain HTML string for easy assertion. * " is decoded back to " since both are valid HTML and the difference is @@ -124,7 +123,7 @@ describe('getHighlightReact', () => { }); describe('Highlight with ES|QL inline tags', () => { - const defaultTags: ESQLHighlightTags = { + const defaultTags = { preTag: ``, postTag: '', }; diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.tsx b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.tsx index 0d66adb7eaea2..30a11fe6ae2c1 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.tsx +++ b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.tsx @@ -8,9 +8,8 @@ */ import React from 'react'; -import type { EsHitRecord } from '@kbn/discover-utils'; -import type { ESQLHighlightTags } from '@kbn/esql-utils'; import { highlightTags } from './highlight_tags'; +import type { FieldFormatHighlightTags, ReactContextTypeHit } from '../../types'; /** * Resolves the applicable highlight method for a field value. @@ -32,7 +31,7 @@ import { highlightTags } from './highlight_tags'; export function getHighlightReact( fieldValue: string, fieldName: string | undefined, - hit: EsHitRecord | undefined + hit: ReactContextTypeHit | undefined ): React.ReactNode { if (!fieldName || !hit) { return fieldValue; @@ -130,7 +129,7 @@ function highlightWithSubstrings( */ function highlightWithInlineTags( fieldValue: string, - tags: ESQLHighlightTags | undefined | null + tags: FieldFormatHighlightTags | undefined | null ): React.ReactNode { if (!tags?.preTag || !tags?.postTag) { return fieldValue; diff --git a/src/platform/plugins/shared/field_formats/common/utils/index.ts b/src/platform/plugins/shared/field_formats/common/utils/index.ts index 746db247cda73..71de8dc8931a1 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/index.ts +++ b/src/platform/plugins/shared/field_formats/common/utils/index.ts @@ -8,11 +8,7 @@ */ export { asPrettyString } from './as_pretty_string'; -export { - getHighlightReact, - getInlineEmSnippetHighlightReact, - getHighlightRequest, -} from './highlight'; +export { getHighlightReact, getHighlightRequest } from './highlight'; export { shortenDottedString } from './shorten_dotted_string'; export { formatReactArray } from './format_react_array'; export { formatTextArray } from './format_text_array'; From 7cb9b27df6aeed03d9af8efeb548657fdf2b3e44 Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Thu, 28 May 2026 10:46:59 +0200 Subject: [PATCH 16/21] fix types --- .../common/utils/highlight/highlight_react.test.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx index 3cfadbd5eec6f..c687e8a6081a6 100644 --- a/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx +++ b/src/platform/plugins/shared/field_formats/common/utils/highlight/highlight_react.test.tsx @@ -11,6 +11,7 @@ import React from 'react'; import ReactDOM from 'react-dom/server'; import { highlightTags } from './highlight_tags'; import { getHighlightReact } from './highlight_react'; +import type { FieldFormatHighlightTags } from '../../types'; /** Render the ReactNode to a plain HTML string for easy assertion. * " is decoded back to " since both are valid HTML and the difference is @@ -129,7 +130,7 @@ describe('getHighlightReact', () => { }; const inline = (word: string) => `${defaultTags.preTag}${word}${defaultTags.postTag}`; - const check = (value: string, tags: ESQLHighlightTags, expected: string) => { + const check = (value: string, tags: FieldFormatHighlightTags, expected: string) => { expect( render(getHighlightReact(value, 'myField', { inline_highlights: { myField: tags } })) ).toBe(expected); @@ -174,7 +175,7 @@ describe('getHighlightReact', () => { }); test('uses custom pre_tag and post_tag from inline highlight config', () => { - const customTags: ESQLHighlightTags = { preTag: '', postTag: '' }; + const customTags = { preTag: '', postTag: '' }; check('foo bar baz', customTags, `foo ${mark('bar')} baz`); }); From 0e9991ede6fc2ae8c4b454e14f9b2353f4a6f41a Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Thu, 28 May 2026 10:54:23 +0200 Subject: [PATCH 17/21] clean definitions files --- .../analytics_collection_utils/index.d.ts | 1 - .../analytics_collection_utils/src/index.d.ts | 1 - .../src/is_synthetics_monitor.d.ts | 5 - .../private/kbn-cps-common/index.d.ts | 3 - .../kbn-cps-common/src/common/constants.d.ts | 11 - .../common/get_space_default_npre_name.d.ts | 1 - .../private/kbn-panel-loader/index.d.ts | 6 - .../kbn-saved-objects-settings/index.d.ts | 2 - .../favorites/favorites_common/index.d.ts | 1 - .../favorites/favorites_server/index.d.ts | 1 - .../src/favorites_registry.d.ts | 12 - .../src/favorites_routes.d.ts | 21 - .../src/favorites_saved_object.d.ts | 9 - .../src/favorites_service.d.ts | 33 - .../src/favorites_usage_collection.d.ts | 6 - .../favorites/favorites_server/src/index.d.ts | 22 - .../shared/home/sample_data_card/index.d.ts | 6 - .../home/sample_data_card/src/constants.d.ts | 11 - .../src/footer/disabled_footer.d.ts | 11 - .../sample_data_card/src/footer/index.d.ts | 15 - .../src/footer/install_footer.d.ts | 11 - .../src/footer/remove_footer.d.ts | 13 - .../src/footer/view_button.d.ts | 11 - .../sample_data_card/src/hooks/index.d.ts | 4 - .../src/hooks/poll_sample_data_status.d.ts | 34 - .../src/hooks/use_install.d.ts | 17 - .../src/hooks/use_remove.d.ts | 17 - .../sample_data_card/src/mocks/index.d.ts | 75 - .../src/sample_data_card.component.d.ts | 16 - .../src/sample_data_card.d.ts | 16 - .../home/sample_data_card/src/services.d.ts | 67 - .../shared/home/sample_data_tab/index.d.ts | 2 - .../home/sample_data_tab/src/constants.d.ts | 19 - .../sample_data_tab/src/demo_env_panel.d.ts | 5 - .../home/sample_data_tab/src/hooks/index.d.ts | 1 - .../sample_data_tab/src/hooks/use_list.d.ts | 7 - .../src/sample_data_cards.d.ts | 13 - .../sample_data_tab/src/sample_data_tab.d.ts | 5 - .../home/sample_data_tab/src/services.d.ts | 52 - .../shared/kbn-apm-types-shared/index.d.ts | 3 - .../kbn-apm-types-shared/src/enums/index.d.ts | 1 - .../src/enums/processor_event.d.ts | 6 - .../src/interfaces/correlations.d.ts | 4 - .../src/interfaces/index.d.ts | 1 - .../src/types/common.d.ts | 1 - .../kbn-apm-types-shared/src/types/index.d.ts | 1 - .../kbn-content-management-utils/index.d.ts | 4 - .../src/saved_object_content_storage.d.ts | 63 - .../src/schema.d.ts | 265 --- .../src/types.d.ts | 316 ---- .../src/utils.d.ts | 7 - .../kbn-cps-utils/components/cps_icon.d.ts | 2 - .../components/project_list_item.d.ts | 9 - .../components/project_picker.d.ts | 16 - .../components/project_picker_container.d.ts | 12 - .../components/project_picker_content.d.ts | 10 - .../components/project_picker_settings.d.ts | 5 - .../kbn-cps-utils/components/strings.d.ts | 15 - .../components/use_cps_picker_access.d.ts | 23 - .../components/use_fetch_projects.d.ts | 13 - .../components/use_project_picker_tour.d.ts | 4 - .../use_route_based_cps_picker_access.d.ts | 14 - .../packages/shared/kbn-cps-utils/index.d.ts | 13 - .../packages/shared/kbn-cps-utils/types.d.ts | 52 - .../public/full_screen_bg_css.d.ts | 3 - .../kbn-css-utils/public/use_memo_css.d.ts | 23 - .../shared/kbn-data-service-server/index.d.ts | 2 - .../src/refresh_interval.d.ts | 4 - .../kbn-data-service-server/src/types.d.ts | 3 - .../shared/kbn-data-service/index.d.ts | 4 - .../kbn-data-service/src/constants.d.ts | 26 - .../src/es_query/get_es_query_config.d.ts | 7 - .../kbn-data-service/src/es_query/index.d.ts | 1 - .../src/search/tabify/index.d.ts | 1 - .../src/search/tabify/tabify_docs.d.ts | 35 - .../shared/kbn-data-service/src/types.d.ts | 11 - .../shared/kbn-data-view-utils/index.d.ts | 5 - .../kbn-data-view-utils/src/constants.d.ts | 4 - .../convert_to_data_view_field_spec.d.ts | 6 - .../src/utils/create_regexp_pattern_from.d.ts | 3 - .../utils/get_data_view_field_or_create.d.ts | 7 - .../test_pattern_against_allowed_list.d.ts | 1 - .../kbn-data-view-validation/index.d.ts | 3 - .../src/constants.d.ts | 16 - .../kbn-data-view-validation/src/types.d.ts | 5 - .../src/validation.d.ts | 8 - .../shared/kbn-discover-utils/index.d.ts | 6 - .../app_menu/app_menu_registry.d.ts | 47 - .../src/components/app_menu/types.d.ts | 60 - .../degraded_docs_control.d.ts | 11 - .../custom_control_columns/index.d.ts | 2 - .../stacktrace_control.d.ts | 6 - .../custom_control_columns/types.d.ts | 31 - .../error_callout/error_callout.d.ts | 14 - .../src/components/error_callout/index.d.ts | 2 - .../kbn-discover-utils/src/constants.d.ts | 23 - .../data_types/apm/apm_context_service.d.ts | 10 - .../apm/errors/errors_context_service.d.ts | 10 - .../src/data_types/apm/index.d.ts | 2 - .../src/data_types/index.d.ts | 4 - .../src/data_types/logs/components/index.d.ts | 1 - .../logs/components/log_level_badge.d.ts | 7 - .../src/data_types/logs/constants.d.ts | 27 - .../src/data_types/logs/index.d.ts | 8 - .../data_types/logs/logs_context_service.d.ts | 15 - .../recommended_fields/apache_error_logs.d.ts | 8 - .../logs/recommended_fields/default_logs.d.ts | 11 - .../logs/recommended_fields/index.d.ts | 5 - .../kubernetes_container_logs.d.ts | 8 - .../src/data_types/logs/types.d.ts | 99 -- .../utils/get_all_logs_data_view_spec.d.ts | 9 - .../utils/get_available_resource_fields.d.ts | 1 - .../utils/get_available_trace_fields.d.ts | 2 - .../utils/get_log_level_coalesed_value.d.ts | 16 - .../logs/utils/get_log_level_color.d.ts | 3 - .../src/data_types/logs/utils/index.d.ts | 5 - .../src/data_types/observability/index.d.ts | 1 - .../src/data_types/observability/types.d.ts | 7 - .../src/data_types/traces/index.d.ts | 2 - .../traces/traces_context_service.d.ts | 22 - .../src/data_types/traces/types.d.ts | 45 - .../src/field_constants.d.ts | 69 - .../kbn-discover-utils/src/hooks/index.d.ts | 1 - .../src/hooks/use_pager.d.ts | 13 - .../shared/kbn-discover-utils/src/index.d.ts | 10 - .../shared/kbn-discover-utils/src/types.d.ts | 151 -- .../src/utils/build_data_record.d.ts | 22 - .../src/utils/calc_field_counts.d.ts | 6 - .../src/utils/contains_index_pattern.d.ts | 1 - .../src/utils/convert_value_to_string.d.ts | 19 - .../src/utils/dismiss_flyouts.d.ts | 11 - .../src/utils/format_hit.d.ts | 13 - .../src/utils/format_value.d.ts | 63 - .../src/utils/get_doc_id.d.ts | 8 - .../src/utils/get_esql_data_view.d.ts | 8 - .../src/utils/get_field_value.d.ts | 2 - .../utils/get_field_value_with_fallback.d.ts | 24 - .../src/utils/get_flattened_fields.d.ts | 2 - .../src/utils/get_ignored_reason.d.ts | 17 - .../src/utils/get_log_document_overview.d.ts | 7 - ...et_log_event_type_field_with_fallback.d.ts | 12 - ...og_exception_type_field_with_fallback.d.ts | 12 - .../utils/get_log_field_with_fallback.d.ts | 15 - .../get_log_level_field_with_fallback.d.ts | 12 - .../get_message_field_with_fallbacks.d.ts | 14 - .../utils/get_should_show_field_handler.d.ts | 11 - .../src/utils/get_stack_trace_fields.d.ts | 2 - .../utils/get_trace_document_overview.d.ts | 2 - .../src/utils/get_visible_columns.d.ts | 5 - .../kbn-discover-utils/src/utils/index.d.ts | 26 - .../src/utils/is_esql_saved_search.d.ts | 19 - .../src/utils/local_storage_utils.d.ts | 38 - .../src/utils/nested_fields.d.ts | 38 - .../utils/prepare_data_view_for_editing.d.ts | 3 - .../src/utils/sorting/get_default_sort.d.ts | 7 - .../src/utils/sorting/get_es_query_sort.d.ts | 46 - .../src/utils/sorting/get_sort.d.ts | 21 - .../sorting/get_sort_for_search_source.d.ts | 16 - .../src/utils/sorting/index.d.ts | 5 - .../shared/kbn-discover-utils/types.d.ts | 1 - .../shared/kbn-elastic-agent-utils/index.d.ts | 5 - .../src/agent_guards.d.ts | 17 - .../src/agent_ingestion_path.d.ts | 1 - .../src/agent_names.d.ts | 23 - .../src/agent_sdk_name_and_language.d.ts | 6 - .../index.d.ts | 1 - .../encrypted_saved_objects_client_types.d.ts | 28 - .../packages/shared/kbn-es-types/index.d.ts | 1 - .../shared/kbn-es-types/src/index.d.ts | 17 - .../shared/kbn-es-types/src/search.d.ts | 575 ------- .../shared/kbn-esql-utils/constants.d.ts | 5 - .../packages/shared/kbn-esql-utils/index.d.ts | 2 - .../shared/kbn-esql-utils/src/index.d.ts | 29 - .../utils/append_to_query/append_limit.d.ts | 1 - .../append_to_query/append_metrics_info.d.ts | 7 - .../append_to_query/append_stats_by.d.ts | 1 - .../utils/append_to_query/append_where.d.ts | 12 - .../src/utils/append_to_query/utils.d.ts | 39 - .../utils/build_rename_source_field_map.d.ts | 7 - .../src/utils/callbacks/columns.d.ts | 19 - .../src/utils/callbacks/datasets.d.ts | 9 - .../src/utils/callbacks/extensions.d.ts | 27 - .../src/utils/callbacks/index.d.ts | 9 - .../src/utils/callbacks/inference.d.ts | 10 - .../src/utils/callbacks/lookup_indices.d.ts | 12 - .../src/utils/callbacks/policies.d.ts | 10 - .../src/utils/callbacks/sources.d.ts | 26 - .../utils/callbacks/timeseries_indices.d.ts | 4 - .../src/utils/callbacks/utils/cache.d.ts | 32 - .../src/utils/callbacks/views.d.ts | 9 - .../cascaded_documents_helpers/index.d.ts | 58 - .../cascaded_documents_helpers/utils.d.ts | 58 - .../src/utils/convert_filters_to_esql.d.ts | 13 - .../src/utils/convert_query_to_esql.d.ts | 9 - .../src/utils/esql_fields_utils.d.ts | 43 - .../src/utils/extract_categorize_tokens.d.ts | 8 - .../utils/get_columns_with_highlights.d.ts | 36 - .../src/utils/get_esql_adhoc_dataview.d.ts | 51 - .../src/utils/get_esql_controls.d.ts | 15 - .../utils/get_esql_time_field_from_query.d.ts | 13 - .../src/utils/get_esql_with_safe_limit.d.ts | 1 - .../utils/get_index_pattern_from_query.d.ts | 13 - .../src/utils/get_initial_esql_query.d.ts | 12 - .../src/utils/get_lookup_indices.d.ts | 7 - .../src/utils/get_query_summary.d.ts | 26 - .../src/utils/inject_where_after_source.d.ts | 15 - .../src/utils/query_cannot_be_sampled.d.ts | 18 - .../src/utils/query_parsing_helpers.d.ts | 104 -- .../src/utils/replace_index_pattern.d.ts | 1 - .../kbn-esql-utils/src/utils/run_query.d.ts | 48 - .../src/utils/sanitaze_input.d.ts | 1 - .../src/utils/set_instructions_helpers.d.ts | 14 - .../kbn-esql-utils/src/utils/sha256.d.ts | 1 - .../shared/kbn-interpreter/index.d.ts | 1 - .../kbn-interpreter/src/common/index.d.ts | 9 - .../kbn-interpreter/src/common/lib/arg.d.ts | 14 - .../src/common/lib/ast/ast.d.ts | 31 - .../src/common/lib/ast/compare.d.ts | 9 - .../src/common/lib/ast/from_expression.d.ts | 2 - .../src/common/lib/ast/index.d.ts | 4 - .../src/common/lib/ast/patch.d.ts | 2 - .../lib/ast/safe_element_from_expression.d.ts | 1 - .../src/common/lib/ast/to_expression.d.ts | 14 - .../kbn-interpreter/src/common/lib/cast.d.ts | 1 - .../kbn-interpreter/src/common/lib/fn.d.ts | 15 - .../src/common/lib/get_by_alias.d.ts | 6 - .../src/common/lib/get_type.d.ts | 1 - .../kbn-interpreter/src/common/lib/parse.d.ts | 14 - .../src/common/lib/registry.d.ts | 14 - .../src/common/registries.d.ts | 25 - .../shared/kbn-io-ts-utils/index.d.ts | 22 - .../src/array_to_string_rt/index.d.ts | 2 - .../kbn-io-ts-utils/src/date_rt/index.d.ts | 6 - .../src/datemath_string_rt/index.d.ts | 2 - .../kbn-io-ts-utils/src/decode_or_throw.d.ts | 7 - .../src/deep_exact_rt/index.d.ts | 3 - .../src/in_range_rt/index.d.ts | 7 - .../src/index_pattern_rt/index.d.ts | 10 - .../src/is_greater_or_equal/index.d.ts | 6 - .../src/iso_to_epoch_rt/index.d.ts | 2 - .../src/iso_to_epoch_secs_rt/index.d.ts | 2 - .../kbn-io-ts-utils/src/json_rt/index.d.ts | 2 - .../index.d.ts | 2 - .../kbn-io-ts-utils/src/merge_rt/index.d.ts | 13 - .../src/non_empty_string_rt/index.d.ts | 6 - .../src/parseable_types/index.d.ts | 4 - .../src/route_validation/index.d.ts | 4 - .../src/strict_keys_rt/index.d.ts | 2 - .../src/time_key_rt/index.d.ts | 19 - .../src/to_boolean_rt/index.d.ts | 3 - .../src/to_json_schema/index.d.ts | 27 - .../src/to_number_rt/index.d.ts | 2 - .../autoops_promotion_callout/index.d.ts | 2 - .../src/callout.d.ts | 10 - .../cards_navigation/index.d.ts | 3 - .../src/cards_navigation.d.ts | 6 - .../cards_navigation/src/consts.d.ts | 3 - .../cards_navigation/src/index.d.ts | 3 - .../cards_navigation/src/types.d.ts | 82 - .../settings/setting_ids/index.d.ts | 159 -- .../kbn-object-versioning-utils/index.d.ts | 1 - .../lib/validate_version.d.ts | 9 - .../shared/kbn-object-versioning/index.d.ts | 2 - .../content_management_services_schemas.d.ts | 36 - ...ontent_management_services_versioning.d.ts | 47 - .../lib/content_management_types.d.ts | 118 -- .../kbn-object-versioning/lib/index.d.ts | 5 - .../lib/object_transform.d.ts | 42 - .../kbn-object-versioning/lib/types.d.ts | 34 - .../kbn-object-versioning/lib/utils.d.ts | 11 - .../shared/kbn-react-query/index.d.ts | 10 - .../shared/kbn-resizable-layout/index.d.ts | 3 - .../src/panels_resizable.d.ts | 16 - .../src/panels_static.d.ts | 10 - .../src/resizable_layout.d.ts | 55 - .../kbn-resizable-layout/src/utils.d.ts | 4 - .../shared/kbn-resizable-layout/types.d.ts | 34 - .../packages/shared/kbn-rison/index.d.ts | 10 - .../packages/shared/kbn-rison/kbn_rison.d.ts | 61 - .../packages/shared/kbn-rrule/index.d.ts | 3 - .../packages/shared/kbn-rrule/rrule.d.ts | 21 - .../packages/shared/kbn-rrule/sanitize.d.ts | 18 - .../packages/shared/kbn-rrule/types.d.ts | 44 - .../packages/shared/kbn-rrule/validate.d.ts | 2 - .../shared/kbn-rule-data-utils/index.d.ts | 11 - .../src/alerts_as_data_cases.d.ts | 1 - .../src/alerts_as_data_rbac.d.ts | 55 - .../src/alerts_as_data_severity.d.ts | 14 - .../src/alerts_as_data_status.d.ts | 6 - .../src/default_alerts_as_data.d.ts | 115 -- .../src/legacy_alerts_as_data.d.ts | 34 - .../src/routes/stack_rule_paths.d.ts | 13 - .../src/rule_constants.d.ts | 1 - .../src/rule_locator_params.d.ts | 22 - .../src/rule_types/index.d.ts | 5 - .../src/rule_types/o11y_rules.d.ts | 54 - .../src/rule_types/stack_rules.d.ts | 10 - .../src/technical_field_names.d.ts | 116 -- .../shared/kbn-search-errors/index.d.ts | 4 - .../src/create_es_error.d.ts | 9 - .../kbn-search-errors/src/es_error.d.ts | 16 - .../kbn-search-errors/src/painless_error.d.ts | 14 - .../src/render_search_error.d.ts | 6 - .../kbn-search-errors/src/tsdb_error.d.ts | 10 - .../shared/kbn-search-errors/src/types.d.ts | 3 - .../kbn-search-response-warnings/index.d.ts | 5 - .../search_response_warnings/badge.d.ts | 7 - .../badge_popover_content.d.ts | 8 - .../search_response_warnings/callout.d.ts | 7 - .../empty_prompt.d.ts | 7 - .../search_response_warnings/i18n_utils.d.ts | 5 - .../search_response_warnings/index.d.ts | 6 - .../view_details_popover.d.ts | 8 - .../src/extract_warnings.d.ts | 8 - .../src/handle_warnings.d.ts | 27 - ...orted_downsampled_aggregation_failure.d.ts | 2 - .../src/types.d.ts | 44 - .../shared/kbn-search-types/index.d.ts | 3 - .../kbn-search-types/src/es_search_types.d.ts | 9 - .../src/kibana_search_types.d.ts | 52 - .../shared/kbn-search-types/src/types.d.ts | 96 -- .../index.d.ts | 3 - .../src/format_request.d.ts | 5 - .../src/parse_endpoint.d.ts | 5 - .../src/typings.d.ts | 98 -- .../kbn-server-route-repository/index.d.ts | 7 - .../src/create_server_route_factory.d.ts | 3 - .../src/decode_request_params.d.ts | 7 - .../src/make_zod_validation_object.d.ts | 7 - .../src/register_routes.d.ts | 10 - .../src/strip_nullish_request_parameters.d.ts | 11 - .../src/validate_and_decode_params.d.ts | 3 - .../src/validation_objects.d.ts | 11 - .../shared/kbn-sse-utils-server/index.d.ts | 2 - .../observable_into_event_source_stream.d.ts | 29 - .../src/supertest_to_observable.d.ts | 20 - .../src/types/index.d.ts | 1 - .../src/types/presentable.d.ts | 57 - .../shared/kbn-use-tracked-promise/index.d.ts | 1 - .../use_tracked_promise.d.ts | 96 -- .../presentation_publishing/constants.d.ts | 1 - .../embeddable_api_context.d.ts | 8 - .../presentation_publishing/index.d.ts | 55 - .../interfaces/can_access_view_mode.d.ts | 16 - .../interfaces/can_lock_hover_actions.d.ts | 9 - .../can_override_hover_actions.d.ts | 12 - .../containers/can_add_new_panel.d.ts | 15 - .../containers/can_add_new_section.d.ts | 4 - .../containers/can_focus_panel.d.ts | 10 - .../interfaces/containers/child_state.d.ts | 4 - .../children_unsaved_changes.d.ts | 11 - .../container_state/initialize_state_api.d.ts | 9 - .../containers/last_saved_child_state.d.ts | 6 - .../containers/panel_capabilities.d.ts | 17 - .../containers/panel_management.d.ts | 21 - .../containers/performance_trackers.d.ts | 7 - .../containers/presentation_container.d.ts | 54 - .../containers/publishes_settings.d.ts | 5 - .../interfaces/fetch/applies_filters.d.ts | 15 - .../fetch/bwc/time_range_transforms.d.ts | 7 - .../interfaces/fetch/fetch.d.ts | 4 - .../interfaces/fetch/fetch_context.d.ts | 21 - .../fetch/publishes_pause_fetch.d.ts | 9 - .../fetch/publishes_project_routing.d.ts | 14 - .../interfaces/fetch/publishes_reload.d.ts | 5 - .../fetch/publishes_search_session.d.ts | 6 - .../fetch/publishes_unified_search.d.ts | 43 - .../interfaces/fetch/time_range_manager.d.ts | 6 - .../interfaces/has_app_context.d.ts | 11 - .../interfaces/has_disable_triggers.d.ts | 5 - .../interfaces/has_edit_capabilities.d.ts | 18 - .../interfaces/has_execution_context.d.ts | 5 - .../interfaces/has_library_transforms.d.ts | 40 - .../interfaces/has_parent_api.d.ts | 7 - .../has_read_only_capabilities.d.ts | 18 - .../interfaces/has_serializable_state.d.ts | 21 - .../interfaces/has_supported_triggers.d.ts | 4 - .../interfaces/has_type.d.ts | 9 - .../interfaces/has_uuid.d.ts | 4 - .../interfaces/publishes_blocking_error.d.ts | 6 - .../interfaces/publishes_data_loading.d.ts | 5 - .../interfaces/publishes_data_views.d.ts | 12 - .../publishes_disabled_action_ids.d.ts | 11 - .../interfaces/publishes_phase_events.d.ts | 16 - .../interfaces/publishes_rendered.d.ts | 5 - .../interfaces/publishes_saved_object_id.d.ts | 11 - .../interfaces/publishes_unsaved_changes.d.ts | 5 - .../interfaces/publishes_view_mode.d.ts | 21 - .../titles/bwc/titles_transforms.d.ts | 7 - .../titles/publishes_description.d.ts | 11 - .../titles/publishes_hide_border.d.ts | 9 - .../interfaces/titles/publishes_title.d.ts | 13 - .../interfaces/titles/title_manager.d.ts | 14 - .../publishing_subject/index.d.ts | 3 - .../publishing_batcher.d.ts | 10 - .../publishing_subject.d.ts | 12 - .../publishing_subject/types.d.ts | 13 - .../state_manager/index.d.ts | 4 - .../state_manager/state_comparators.d.ts | 10 - .../state_manager/state_diff_logger.d.ts | 5 - .../state_manager/state_manager.d.ts | 8 - .../state_manager/types.d.ts | 29 - .../utils/snake_case.d.ts | 7 - .../presentation_publishing/utils/types.d.ts | 14 - .../presentation/presentation_util/index.d.ts | 2 - .../presentation_util/src/focus_helpers.d.ts | 1 - .../presentation_util/src/loading_flyout.d.ts | 2 - .../src/open_lazy_flyout.d.ts | 35 - .../src/tracks_overlays.d.ts | 47 - .../shared/react/kibana_mount/index.d.ts | 5 - .../kibana_mount/mount_point_portal.d.ts | 14 - .../react/kibana_mount/to_mount_point.d.ts | 17 - .../shared/react/kibana_mount/utils.d.ts | 1 - .../shared-ux/avatar/solution/index.d.ts | 2 - .../avatar/solution/src/solution_avatar.d.ts | 24 - .../shared-ux/avatar/solution/src/types.d.ts | 1 - .../shared-ux/card/no_data/impl/index.d.ts | 3 - .../src/elastic_agent_card_illustration.d.ts | 2 - .../impl/src/no_data_card.component.d.ts | 4 - .../card/no_data/impl/src/no_data_card.d.ts | 3 - .../card/no_data/impl/src/services.d.ts | 14 - .../shared-ux/card/no_data/types/index.d.ts | 85 - .../code_editor/impl/code_editor.d.ts | 147 -- .../code_editor/impl/editor.styles.d.ts | 9 - .../shared-ux/code_editor/impl/index.d.ts | 17 - .../rebroadcast_mouse_down_events.d.ts | 7 - .../mods/hooks/use_context_menu_utils.d.ts | 18 - .../code_editor/impl/mods/hooks/use_copy.d.ts | 8 - .../impl/mods/hooks/use_fit_content.d.ts | 9 - .../impl/mods/hooks/use_fullscreen.d.ts | 15 - .../impl/mods/hooks/use_placeholder.d.ts | 8 - .../code_editor/impl/mods/index.d.ts | 6 - .../impl/react_monaco_editor/editor.d.ts | 97 -- .../impl/react_monaco_editor/index.d.ts | 1 - .../languages/supported.d.ts | 1 - .../impl/utils/placeholder_widget.d.ts | 13 - .../impl/utils/remeasure_fonts.d.ts | 5 - .../link/redirect_app/impl/index.d.ts | 3 - ...precated_redirect_app_links.component.d.ts | 37 - .../shared/shared-ux/modal/tabbed/index.d.ts | 1 - .../modal/tabbed/src/context/index.d.ts | 38 - .../modal/tabbed/src/tabbed_modal.d.ts | 34 - .../page/kibana_template/impl/index.d.ts | 3 - .../impl/src/page_template.d.ts | 14 - .../impl/src/page_template_inner.d.ts | 27 - .../kibana_template/impl/src/services.d.ts | 10 - .../page/kibana_template/types/index.d.ts | 32 - .../shared-ux/page/no_data/impl/index.d.ts | 3 - .../page/no_data/impl/src/action_card.d.ts | 6 - .../page/no_data/impl/src/no_data_page.d.ts | 3 - .../page/no_data/impl/src/services.d.ts | 10 - .../shared-ux/page/no_data/types/index.d.ts | 23 - .../page/no_data_config/impl/index.d.ts | 3 - .../no_data_config/impl/src/constants.d.ts | 1 - .../impl/src/no_data_config_page.d.ts | 19 - .../no_data_config/impl/src/services.d.ts | 10 - .../page/no_data_config/types/index.d.ts | 18 - .../shared-ux/page/solution_nav/index.d.ts | 3 - .../solution_nav/src/collapse_button.d.ts | 12 - .../page/solution_nav/src/solution_nav.d.ts | 51 - .../solution_nav/src/with_solution_nav.d.ts | 18 - .../src/with_solution_nav.styles.d.ts | 2 - .../shared-ux/prompt/not_found/index.d.ts | 1 - .../not_found/src/not_found_prompt.d.ts | 13 - .../shared/shared-ux/table_persist/index.d.ts | 2 - .../table_persist/src/constants.d.ts | 3 - .../shared-ux/table_persist/src/index.d.ts | 4 - .../shared-ux/table_persist/src/storage.d.ts | 13 - .../table_persist/src/table_persist_hoc.d.ts | 26 - .../shared-ux/table_persist/src/types.d.ts | 8 - .../table_persist/src/use_table_persist.d.ts | 43 - .../src/validate_persist_data.d.ts | 11 - .../public/forward_app/forward_app.d.ts | 3 - .../public/forward_app/index.d.ts | 1 - .../navigate_to_legacy_kibana_url.d.ts | 5 - .../public/forward_app/normalize_path.d.ts | 1 - .../private/url_forwarding/public/index.d.ts | 4 - .../private/url_forwarding/public/plugin.d.ts | 60 - .../content_management/common/constants.d.ts | 2 - .../content_management/common/index.d.ts | 2 - .../common/rpc/bulk_get.d.ts | 33 - .../content_management/common/rpc/common.d.ts | 4 - .../common/rpc/constants.d.ts | 3 - .../content_management/common/rpc/create.d.ts | 24 - .../content_management/common/rpc/delete.d.ts | 24 - .../content_management/common/rpc/get.d.ts | 31 - .../content_management/common/rpc/index.d.ts | 11 - .../common/rpc/msearch.d.ts | 48 - .../content_management/common/rpc/rpc.d.ts | 138 -- .../content_management/common/rpc/search.d.ts | 79 - .../content_management/common/rpc/types.d.ts | 12 - .../content_management/common/rpc/update.d.ts | 26 - .../content_management/common/schemas.d.ts | 1 - .../public/content_client/content_client.d.ts | 38 - .../content_client_context.d.ts | 6 - .../content_client_mutation_hooks.d.ts | 4 - .../content_client_query_hooks.d.ts | 18 - .../public/content_client/index.d.ts | 4 - .../content_client/query_observable.d.ts | 3 - .../public/crud_client/crud_client.d.ts | 9 - .../public/crud_client/index.d.ts | 1 - .../content_management/public/index.d.ts | 5 - .../content_management/public/plugin.d.ts | 19 - .../public/registry/content_type.d.ts | 12 - .../registry/content_type_definition.d.ts | 34 - .../public/registry/index.d.ts | 3 - .../public/registry/registry.d.ts | 8 - .../public/rpc_client/index.d.ts | 1 - .../public/rpc_client/rpc_client.d.ts | 25 - .../content_management/public/types.d.ts | 13 - .../server/content_client/content_client.d.ts | 20 - .../content_client_factory.d.ts | 28 - .../server/content_client/index.d.ts | 2 - .../server/content_client/types.d.ts | 39 - .../server/core/content_type.d.ts | 17 - .../content_management/server/core/core.d.ts | 50 - .../content_management/server/core/crud.d.ts | 41 - .../server/core/event_bus.d.ts | 56 - .../server/core/event_types.d.ts | 74 - .../content_management/server/core/index.d.ts | 6 - .../server/core/msearch.d.ts | 19 - .../server/core/registry.d.ts | 34 - .../content_management/server/core/types.d.ts | 80 - .../content_management/server/index.d.ts | 4 - .../content_management/server/plugin.d.ts | 20 - .../content_management/server/rpc/index.d.ts | 5 - .../server/rpc/procedures/all_procedures.d.ts | 5 - .../server/rpc/procedures/bulk_get.d.ts | 5 - .../server/rpc/procedures/create.d.ts | 4 - .../server/rpc/procedures/delete.d.ts | 4 - .../server/rpc/procedures/get.d.ts | 4 - .../server/rpc/procedures/index.d.ts | 5 - .../server/rpc/procedures/msearch.d.ts | 5 - .../server/rpc/procedures/search.d.ts | 4 - .../server/rpc/procedures/update.d.ts | 4 - .../server/rpc/routes/error_wrapper.d.ts | 2 - .../server/rpc/routes/index.d.ts | 1 - .../server/rpc/routes/routes.d.ts | 11 - .../server/rpc/rpc_service.d.ts | 12 - .../content_management/server/rpc/types.d.ts | 10 - .../content_management/server/types.d.ts | 18 - .../server/utils/index.d.ts | 2 - .../utils/services_transforms_factory.d.ts | 13 - .../server/utils/utils.d.ts | 16 - .../plugins/shared/cps/public/index.d.ts | 4 - .../plugins/shared/cps/public/plugin.d.ts | 10 - .../cps/public/services/async_services.d.ts | 7 - .../cps/public/services/cps_manager.d.ts | 84 - .../cps/public/services/project_fetcher.d.ts | 17 - .../plugins/shared/cps/public/types.d.ts | 17 - .../custom_integrations/common/index.d.ts | 76 - .../common/language_integrations.d.ts | 11 - .../server/custom_integration_registry.d.ts | 20 - .../server/external_integration/index.d.ts | 15 - .../custom_integrations/server/index.d.ts | 7 - .../server/language_clients/index.d.ts | 3 - .../custom_integrations/server/plugin.d.ts | 11 - .../server/routes/define_routes.d.ts | 3 - .../custom_integrations/server/types.d.ts | 14 - .../plugins/shared/data/common/constants.d.ts | 7 - .../datatable_utilities_service.d.ts | 44 - .../common/datatable_utilities/index.d.ts | 1 - .../shared/data/common/es_query/index.d.ts | 1 - .../shared/data/common/exports/constants.d.ts | 4 - .../data/common/exports/escape_value.d.ts | 18 - .../data/common/exports/export_csv.d.ts | 13 - .../data/common/exports/formula_checks.d.ts | 3 - .../shared/data/common/exports/index.d.ts | 4 - .../plugins/shared/data/common/index.d.ts | 20 - .../data/common/kbn_field_types/index.d.ts | 2 - .../data/common/kbn_field_types/types.d.ts | 4 - .../query/filters/persistable_state.d.ts | 11 - .../shared/data/common/query/index.d.ts | 6 - .../shared/data/common/query/is_query.d.ts | 2 - .../data/common/query/persistable_state.d.ts | 26 - .../shared/data/common/query/query_state.d.ts | 17 - .../query/text_based_query_state_to_ast.d.ts | 21 - ...ed_query_state_to_ast_with_validation.d.ts | 20 - .../common/query/timefilter/get_time.d.ts | 18 - .../data/common/query/timefilter/index.d.ts | 2 - .../query/timefilter/is_time_range.d.ts | 2 - .../data/common/query/timefilter/types.d.ts | 10 - .../shared/data/common/query/types.d.ts | 21 - .../data/common/search/aggs/agg_config.d.ts | 129 -- .../data/common/search/aggs/agg_configs.d.ts | 143 -- .../data/common/search/aggs/agg_groups.d.ts | 12 - .../data/common/search/aggs/agg_params.d.ts | 26 - .../data/common/search/aggs/agg_type.d.ts | 210 --- .../data/common/search/aggs/agg_types.d.ts | 408 ----- .../search/aggs/agg_types_registry.d.ts | 22 - .../data/common/search/aggs/aggs_service.d.ts | 29 - .../aggs/buckets/_interval_options.d.ts | 12 - .../aggs/buckets/_terms_order_helper.d.ts | 3 - .../buckets/_terms_other_bucket_helper.d.ts | 27 - .../search/aggs/buckets/bucket_agg_type.d.ts | 37 - .../search/aggs/buckets/bucket_agg_types.d.ts | 19 - .../buckets/create_filter/date_histogram.d.ts | 2 - .../buckets/create_filter/date_range.d.ts | 3 - .../aggs/buckets/create_filter/filters.d.ts | 22 - .../aggs/buckets/create_filter/histogram.d.ts | 4 - .../aggs/buckets/create_filter/ip_prefix.d.ts | 3 - .../aggs/buckets/create_filter/ip_range.d.ts | 3 - .../buckets/create_filter/multi_terms.d.ts | 6 - .../aggs/buckets/create_filter/range.d.ts | 4 - .../aggs/buckets/create_filter/terms.d.ts | 3 - .../search/aggs/buckets/date_histogram.d.ts | 29 - .../aggs/buckets/date_histogram_fn.d.ts | 16 - .../search/aggs/buckets/date_range.d.ts | 11 - .../search/aggs/buckets/date_range_fn.d.ts | 15 - .../aggs/buckets/diversified_sampler.d.ts | 22 - .../aggs/buckets/diversified_sampler_fn.d.ts | 9 - .../common/search/aggs/buckets/filter.d.ts | 13 - .../common/search/aggs/buckets/filter_fn.d.ts | 16 - .../common/search/aggs/buckets/filters.d.ts | 10 - .../search/aggs/buckets/filters_fn.d.ts | 15 - .../common/search/aggs/buckets/geo_tile.d.ts | 8 - .../search/aggs/buckets/geo_tile_fn.d.ts | 10 - .../common/search/aggs/buckets/histogram.d.ts | 29 - .../search/aggs/buckets/histogram_fn.d.ts | 15 - .../common/search/aggs/buckets/index.d.ts | 46 - .../common/search/aggs/buckets/ip_prefix.d.ts | 8 - .../search/aggs/buckets/ip_prefix_fn.d.ts | 15 - .../common/search/aggs/buckets/ip_range.d.ts | 16 - .../search/aggs/buckets/ip_range_fn.d.ts | 16 - .../search/aggs/buckets/lib/cidr_mask.d.ts | 14 - .../search/aggs/buckets/lib/date_range.d.ts | 2 - .../lib/histogram_calculate_interval.d.ts | 15 - .../search/aggs/buckets/lib/ip_prefix.d.ts | 7 - .../search/aggs/buckets/lib/ip_range.d.ts | 11 - .../lib/time_buckets/calc_auto_interval.d.ts | 28 - .../lib/time_buckets/calc_es_interval.d.ts | 23 - .../lib/time_buckets/i18n_messages.d.ts | 8 - .../aggs/buckets/lib/time_buckets/index.d.ts | 2 - .../lib/time_buckets/time_buckets.d.ts | 133 -- .../migrate_include_exclude_format.d.ts | 7 - .../search/aggs/buckets/multi_field_key.d.ts | 23 - .../search/aggs/buckets/multi_terms.d.ts | 20 - .../search/aggs/buckets/multi_terms_fn.d.ts | 14 - .../common/search/aggs/buckets/range.d.ts | 12 - .../common/search/aggs/buckets/range_fn.d.ts | 15 - .../common/search/aggs/buckets/range_key.d.ts | 35 - .../search/aggs/buckets/rare_terms.d.ts | 7 - .../search/aggs/buckets/rare_terms_fn.d.ts | 10 - .../common/search/aggs/buckets/sampler.d.ts | 13 - .../search/aggs/buckets/sampler_fn.d.ts | 9 - .../search/aggs/buckets/shard_delay.d.ts | 7 - .../search/aggs/buckets/shard_delay_fn.d.ts | 10 - .../aggs/buckets/significant_terms.d.ts | 10 - .../aggs/buckets/significant_terms_fn.d.ts | 11 - .../search/aggs/buckets/significant_text.d.ts | 11 - .../aggs/buckets/significant_text_fn.d.ts | 11 - .../common/search/aggs/buckets/terms.d.ts | 29 - .../common/search/aggs/buckets/terms_fn.d.ts | 14 - .../search/aggs/buckets/time_series.d.ts | 5 - .../search/aggs/buckets/time_series_fn.d.ts | 10 - .../shared/data/common/search/aggs/index.d.ts | 12 - .../data/common/search/aggs/metrics/avg.d.ts | 6 - .../common/search/aggs/metrics/avg_fn.d.ts | 10 - .../search/aggs/metrics/bucket_avg.d.ts | 11 - .../search/aggs/metrics/bucket_avg_fn.d.ts | 15 - .../search/aggs/metrics/bucket_max.d.ts | 11 - .../search/aggs/metrics/bucket_max_fn.d.ts | 15 - .../search/aggs/metrics/bucket_min.d.ts | 11 - .../search/aggs/metrics/bucket_min_fn.d.ts | 15 - .../search/aggs/metrics/bucket_sum.d.ts | 11 - .../search/aggs/metrics/bucket_sum_fn.d.ts | 15 - .../search/aggs/metrics/cardinality.d.ts | 8 - .../search/aggs/metrics/cardinality_fn.d.ts | 10 - .../common/search/aggs/metrics/count.d.ts | 6 - .../common/search/aggs/metrics/count_fn.d.ts | 10 - .../search/aggs/metrics/cumulative_sum.d.ts | 13 - .../aggs/metrics/cumulative_sum_fn.d.ts | 14 - .../search/aggs/metrics/derivative.d.ts | 13 - .../search/aggs/metrics/derivative_fn.d.ts | 14 - .../search/aggs/metrics/filtered_metric.d.ts | 14 - .../aggs/metrics/filtered_metric_fn.d.ts | 15 - .../search/aggs/metrics/geo_bounds.d.ts | 6 - .../search/aggs/metrics/geo_bounds_fn.d.ts | 10 - .../search/aggs/metrics/geo_centroid.d.ts | 6 - .../search/aggs/metrics/geo_centroid_fn.d.ts | 10 - .../common/search/aggs/metrics/index.d.ts | 58 - .../aggs/metrics/lib/create_filter.d.ts | 4 - .../lib/get_response_agg_config_class.d.ts | 19 - .../aggs/metrics/lib/make_nested_label.d.ts | 2 - .../aggs/metrics/lib/nested_agg_helpers.d.ts | 18 - .../aggs/metrics/lib/ordinal_suffix.d.ts | 1 - .../lib/parent_pipeline_agg_helper.d.ts | 7 - .../lib/parent_pipeline_agg_writer.d.ts | 3 - .../lib/sibling_pipeline_agg_helper.d.ts | 7 - .../lib/sibling_pipeline_agg_writer.d.ts | 2 - .../data/common/search/aggs/metrics/max.d.ts | 6 - .../common/search/aggs/metrics/max_fn.d.ts | 10 - .../common/search/aggs/metrics/median.d.ts | 6 - .../common/search/aggs/metrics/median_fn.d.ts | 10 - .../search/aggs/metrics/metric_agg_type.d.ts | 28 - .../search/aggs/metrics/metric_agg_types.d.ts | 29 - .../data/common/search/aggs/metrics/min.d.ts | 6 - .../common/search/aggs/metrics/min_fn.d.ts | 10 - .../search/aggs/metrics/moving_avg.d.ts | 15 - .../search/aggs/metrics/moving_avg_fn.d.ts | 14 - .../search/aggs/metrics/percentile_ranks.d.ts | 13 - .../aggs/metrics/percentile_ranks_fn.d.ts | 10 - .../search/aggs/metrics/percentiles.d.ts | 9 - .../search/aggs/metrics/percentiles_fn.d.ts | 10 - .../aggs/metrics/percentiles_get_value.d.ts | 2 - .../data/common/search/aggs/metrics/rate.d.ts | 7 - .../common/search/aggs/metrics/rate_fn.d.ts | 10 - .../search/aggs/metrics/serial_diff.d.ts | 13 - .../search/aggs/metrics/serial_diff_fn.d.ts | 14 - .../aggs/metrics/single_percentile.d.ts | 7 - .../aggs/metrics/single_percentile_fn.d.ts | 10 - .../aggs/metrics/single_percentile_rank.d.ts | 8 - .../metrics/single_percentile_rank_fn.d.ts | 10 - .../search/aggs/metrics/std_deviation.d.ts | 17 - .../search/aggs/metrics/std_deviation_fn.d.ts | 10 - .../data/common/search/aggs/metrics/sum.d.ts | 7 - .../common/search/aggs/metrics/sum_fn.d.ts | 10 - .../common/search/aggs/metrics/top_hit.d.ts | 20 - .../search/aggs/metrics/top_hit_fn.d.ts | 10 - .../search/aggs/metrics/top_metrics.d.ts | 19 - .../search/aggs/metrics/top_metrics_fn.d.ts | 10 - .../search/aggs/metrics/value_count.d.ts | 8 - .../search/aggs/metrics/value_count_fn.d.ts | 10 - .../common/search/aggs/param_types/agg.d.ts | 7 - .../common/search/aggs/param_types/base.d.ts | 32 - .../common/search/aggs/param_types/field.d.ts | 23 - .../common/search/aggs/param_types/index.d.ts | 6 - .../common/search/aggs/param_types/json.d.ts | 4 - .../search/aggs/param_types/optioned.d.ts | 12 - .../search/aggs/param_types/string.d.ts | 4 - .../shared/data/common/search/aggs/types.d.ts | 191 --- .../utils/calculate_auto_time_expression.d.ts | 8 - .../date_histogram_interval.d.ts | 25 - .../aggs/utils/date_interval_utils/index.d.ts | 8 - .../invalid_es_calendar_interval_error.d.ts | 8 - .../invalid_es_interval_format_error.d.ts | 4 - .../is_valid_es_interval.d.ts | 10 - .../is_valid_interval.d.ts | 1 - .../least_common_interval.d.ts | 13 - .../least_common_multiple.d.ts | 11 - .../parse_es_interval.d.ts | 26 - .../date_interval_utils/parse_interval.d.ts | 7 - .../to_absolute_dates.d.ts | 5 - .../search/aggs/utils/get_aggs_formats.d.ts | 15 - .../data/common/search/aggs/utils/index.d.ts | 7 - .../search/aggs/utils/infer_time_zone.d.ts | 6 - .../common/search/aggs/utils/ip_address.d.ts | 5 - .../search/aggs/utils/parse_time_shift.d.ts | 49 - .../common/search/aggs/utils/prop_filter.d.ts | 10 - .../common/search/aggs/utils/sampler.d.ts | 12 - .../common/search/aggs/utils/time_splits.d.ts | 251 --- .../expressions/aggregate_query_to_ast.d.ts | 9 - .../data/common/search/expressions/cidr.d.ts | 7 - .../search/expressions/cidr_to_ast.d.ts | 2 - .../common/search/expressions/date_range.d.ts | 8 - .../search/expressions/date_range_to_ast.d.ts | 2 - .../data/common/search/expressions/eql.d.ts | 24 - .../search/expressions/eql_raw_response.d.ts | 36 - .../search/expressions/es_raw_response.d.ts | 10 - .../search/expressions/esaggs/esaggs_fn.d.ts | 32 - .../search/expressions/esaggs/index.d.ts | 1 - .../expressions/esaggs/request_handler.d.ts | 26 - .../data/common/search/expressions/esdsl.d.ts | 22 - .../data/common/search/expressions/esql.d.ts | 37 - .../data/common/search/expressions/essql.d.ts | 27 - .../search/expressions/exists_filter.d.ts | 9 - .../search/expressions/extended_bounds.d.ts | 8 - .../expressions/extended_bounds_to_ast.d.ts | 2 - .../data/common/search/expressions/field.d.ts | 10 - .../search/expressions/filters_to_ast.d.ts | 2 - .../search/expressions/geo_bounding_box.d.ts | 72 - .../expressions/geo_bounding_box_to_ast.d.ts | 2 - .../common/search/expressions/geo_point.d.ts | 15 - .../search/expressions/geo_point_to_ast.d.ts | 2 - .../data/common/search/expressions/index.d.ts | 43 - .../common/search/expressions/ip_prefix.d.ts | 8 - .../search/expressions/ip_prefix_to_ast.d.ts | 2 - .../common/search/expressions/ip_range.d.ts | 8 - .../search/expressions/ip_range_to_ast.d.ts | 2 - .../common/search/expressions/kibana.d.ts | 5 - .../search/expressions/kibana_context.d.ts | 11 - .../expressions/kibana_context_type.d.ts | 10 - .../search/expressions/kibana_filter.d.ts | 10 - .../data/common/search/expressions/kql.d.ts | 8 - .../common/search/expressions/lucene.d.ts | 8 - .../search/expressions/numerical_range.d.ts | 9 - .../expressions/numerical_range_to_ast.d.ts | 2 - .../search/expressions/phrase_filter.d.ts | 10 - .../search/expressions/query_filter.d.ts | 15 - .../expressions/query_filter_to_ast.d.ts | 2 - .../search/expressions/query_to_ast.d.ts | 2 - .../data/common/search/expressions/range.d.ts | 11 - .../search/expressions/range_filter.d.ts | 11 - .../search/expressions/remove_filter.d.ts | 10 - .../search/expressions/select_filter.d.ts | 10 - .../common/search/expressions/timerange.d.ts | 5 - .../search/expressions/timerange_to_ast.d.ts | 2 - .../expressions/utils/filters_adapter.d.ts | 3 - .../expressions/utils/function_wrapper.d.ts | 6 - .../search/expressions/utils/index.d.ts | 3 - .../utils/requests_side_effects.d.ts | 2 - .../shared/data/common/search/index.d.ts | 12 - .../data/common/search/poll_search.d.ts | 4 - .../search_source/create_search_source.d.ts | 22 - .../search_source/extract_references.d.ts | 5 - .../fetch/get_search_params.d.ts | 8 - .../search/search_source/fetch/index.d.ts | 3 - .../search_source/fetch/request_error.d.ts | 12 - .../search/search_source/fetch/types.d.ts | 34 - .../common/search/search_source/index.d.ts | 10 - .../search_source/inject_references.d.ts | 5 - .../search/search_source/inspect/index.d.ts | 1 - .../inspect/inspector_stats.d.ts | 7 - .../search_source/migrate_legacy_query.d.ts | 10 - .../search_source/normalize_sort_request.d.ts | 53 - .../search/search_source/parse_json.d.ts | 2 - .../search/search_source/query_to_fields.d.ts | 8 - .../search/search_source/search_source.d.ts | 205 --- .../search_source/search_source_service.d.ts | 30 - .../common/search/search_source/types.d.ts | 184 -- .../data/common/search/session/ebt_utils.d.ts | 5 - .../data/common/search/session/index.d.ts | 4 - .../data/common/search/session/status.d.ts | 12 - .../data/common/search/session/types.d.ts | 115 -- .../search/strategies/eql_search/index.d.ts | 1 - .../search/strategies/eql_search/types.d.ts | 12 - .../search/strategies/es_search/index.d.ts | 2 - .../strategies/es_search/response_utils.d.ts | 38 - .../search/strategies/es_search/types.d.ts | 1 - .../search/strategies/ese_search/index.d.ts | 1 - .../search/strategies/ese_search/types.d.ts | 13 - .../search/strategies/esql_search/index.d.ts | 1 - .../search/strategies/esql_search/types.d.ts | 3 - .../search/strategies/sql_search/index.d.ts | 1 - .../search/strategies/sql_search/types.d.ts | 16 - .../data/common/search/tabify/buckets.d.ts | 12 - .../common/search/tabify/get_columns.d.ts | 9 - .../data/common/search/tabify/index.d.ts | 3 - .../common/search/tabify/response_writer.d.ts | 31 - .../data/common/search/tabify/tabify.d.ts | 7 - .../data/common/search/tabify/types.d.ts | 33 - .../shared/data/common/search/utils.d.ts | 14 - .../data/common/serializable_field.d.ts | 23 - .../shared/data/common/serialize_utils.d.ts | 27 - .../plugins/shared/data/common/types.d.ts | 4 - ...create_filters_from_multi_value_click.d.ts | 7 - .../create_filters_from_range_select.d.ts | 10 - .../create_filters_from_value_click.d.ts | 30 - .../data/public/actions/filters/index.d.ts | 6 - .../shared/data/public/actions/index.d.ts | 3 - .../actions/multi_value_click_action.d.ts | 24 - .../public/actions/select_range_action.d.ts | 17 - .../public/actions/value_click_action.d.ts | 22 - .../plugins/shared/data/public/index.d.ts | 88 - .../data/public/now_provider/index.d.ts | 2 - .../lib/get_force_now_from_url.d.ts | 2 - .../data/public/now_provider/lib/index.d.ts | 1 - .../public/now_provider/now_provider.d.ts | 14 - .../plugins/shared/data/public/plugin.d.ts | 13 - .../query/filter_manager/filter_manager.d.ts | 50 - .../public/query/filter_manager/index.d.ts | 5 - .../filter_manager/lib/generate_filters.d.ts | 15 - .../lib/generate_mapping_chain.d.ts | 2 - .../filter_manager/lib/get_display_value.d.ts | 4 - .../lib/get_index_pattern_from_filter.d.ts | 2 - .../lib/map_and_flatten_filters.d.ts | 2 - .../query/filter_manager/lib/map_filter.d.ts | 2 - .../lib/mappers/map_combined.d.ts | 6 - .../lib/mappers/map_default.d.ts | 7 - .../lib/mappers/map_exists.d.ts | 7 - .../lib/mappers/map_match_all.d.ts | 7 - .../lib/mappers/map_phrase.d.ts | 12 - .../lib/mappers/map_phrases.d.ts | 9 - .../lib/mappers/map_query_string.d.ts | 7 - .../filter_manager/lib/mappers/map_range.d.ts | 11 - .../lib/mappers/map_spatial_filter.d.ts | 7 - .../filter_manager/lib/sort_filters.d.ts | 10 - .../shared/data/public/query/index.d.ts | 9 - .../public/query/lib/add_to_query_log.d.ts | 9 - .../public/query/lib/get_default_query.d.ts | 6 - .../data/public/query/lib/get_query_log.d.ts | 5 - .../shared/data/public/query/lib/index.d.ts | 3 - .../public/query/persisted_log/index.d.ts | 1 - .../query/persisted_log/persisted_log.d.ts | 28 - .../data/public/query/query_service.d.ts | 83 - .../shared/data/public/query/query_state.d.ts | 10 - .../data/public/query/query_string/index.d.ts | 2 - .../query_string/query_string_manager.d.ts | 28 - .../data/public/query/saved_query/index.d.ts | 2 - .../saved_query/saved_query_service.d.ts | 17 - .../data/public/query/saved_query/types.d.ts | 19 - .../state_sync/connect_to_query_state.d.ts | 15 - .../create_query_state_observable.d.ts | 15 - .../data/public/query/state_sync/index.d.ts | 4 - .../query/state_sync/sync_state_with_url.d.ts | 18 - .../data/public/query/state_sync/types.d.ts | 20 - .../data/public/query/timefilter/index.d.ts | 9 - .../timefilter/lib/auto_refresh_loop.d.ts | 16 - .../timefilter/lib/diff_time_picker_vals.d.ts | 4 - .../query/timefilter/lib/page_visibility.d.ts | 2 - .../timefilter/lib/validate_timerange.d.ts | 2 - .../public/query/timefilter/time_history.d.ts | 11 - .../public/query/timefilter/timefilter.d.ts | 111 -- .../query/timefilter/timefilter_service.d.ts | 25 - .../data/public/query/timefilter/types.d.ts | 13 - .../query/timefilter/use_timefilter.d.ts | 38 - .../data/public/search/aggs/aggs_service.d.ts | 46 - .../shared/data/public/search/aggs/index.d.ts | 2 - .../shared/data/public/search/aggs/types.d.ts | 3 - .../collectors/create_usage_collector.d.ts | 4 - .../data/public/search/collectors/index.d.ts | 3 - .../data/public/search/collectors/types.d.ts | 77 - .../shared/data/public/search/constants.d.ts | 3 - .../data/public/search/expressions/eql.d.ts | 19 - .../public/search/expressions/esaggs.d.ts | 35 - .../data/public/search/expressions/esdsl.d.ts | 19 - .../data/public/search/expressions/esql.d.ts | 18 - .../data/public/search/expressions/essql.d.ts | 18 - .../data/public/search/expressions/index.d.ts | 6 - .../shared/data/public/search/index.d.ts | 9 - .../create_request_hash.d.ts | 21 - .../search/search_interceptor/index.d.ts | 2 - .../search_abort_controller.d.ts | 15 - .../search_interceptor.d.ts | 84 - .../search_response_cache.d.ts | 30 - .../search_session_incomplete_warning.d.ts | 3 - .../search_interceptor/timeout_error.d.ts | 19 - .../to_partial_response.d.ts | 8 - .../data/public/search/search_service.d.ts | 46 - .../session/background_search_notifier.d.ts | 17 - .../data/public/search/session/constants.d.ts | 2 - .../search/session/ebt_manager/constants.d.ts | 4 - .../search/session/ebt_manager/index.d.ts | 3 - .../search_session_ebt_manager.d.ts | 30 - ...rch_session_ebt_manager_registrations.d.ts | 2 - .../session/get_session_redirect_url.d.ts | 16 - .../data/public/search/session/i18n.d.ts | 5 - .../search/session/in_progress_session.d.ts | 4 - .../data/public/search/session/index.d.ts | 10 - .../session/lib/session_name_formatter.d.ts | 4 - .../search/session/search_session_state.d.ts | 167 -- .../search/session/session_helpers.d.ts | 19 - .../search/session/session_service.d.ts | 243 --- .../search/session/sessions_client.d.ts | 31 - .../sessions_mgmt/application/index.d.ts | 15 - .../sessions_mgmt/application/render.d.ts | 2 - .../sessions_mgmt/components/index.d.ts | 11 - .../components/inspect_flyout/index.d.ts | 1 - .../inspect_flyout/inspect_flyout.d.ts | 7 - .../sessions_mgmt/components/main.d.ts | 20 - .../sessions_mgmt/components/status.d.ts | 10 - .../table/actions/delete_button.d.ts | 5 - .../table/actions/extend_button.d.ts | 5 - .../components/table/actions/get_action.d.ts | 6 - .../components/table/actions/index.d.ts | 2 - .../table/actions/inspect_button.d.ts | 5 - .../table/actions/popover_actions.d.ts | 15 - .../table/actions/rename_button.d.ts | 5 - .../components/table/actions/types.d.ts | 8 - .../components/table/columns/actions.d.ts | 12 - .../components/table/columns/app_id.d.ts | 3 - .../components/table/columns/get_columns.d.ts | 16 - .../components/table/columns/index.d.ts | 4 - .../components/table/columns/name.d.ts | 10 - .../components/table/columns/status.d.ts | 3 - .../sessions_mgmt/components/table/index.d.ts | 2 - .../sessions_mgmt/components/table/table.d.ts | 39 - .../components/table/utils/get_actions.d.ts | 3 - .../table/utils/get_app_filter.d.ts | 3 - .../table/utils/get_status_filter.d.ts | 3 - .../table/utils/map_to_ui_session.d.ts | 8 - .../sessions_mgmt/flyout/constants.d.ts | 1 - .../session/sessions_mgmt/flyout/flyout.d.ts | 22 - .../sessions_mgmt/flyout/get_columns.d.ts | 4 - .../sessions_mgmt/flyout/get_flyout.d.ts | 25 - .../search/session/sessions_mgmt/index.d.ts | 36 - .../search/session/sessions_mgmt/lib/api.d.ts | 31 - .../sessions_mgmt/lib/date_string.d.ts | 1 - .../lib/get_expiration_status.d.ts | 5 - .../search/session/sessions_mgmt/types.d.ts | 41 - .../shared/data/public/search/types.d.ts | 100 -- .../plugins/shared/data/public/services.d.ts | 7 - .../plugins/shared/data/public/types.d.ts | 83 - .../components/data_table.d.ts | 15 - .../components/data_table_selector.d.ts | 20 - .../components/data_view.d.ts | 33 - .../components/data_view_wrapper.d.ts | 11 - .../components/download_options.d.ts | 27 - .../utils/table_inspector_view/index.d.ts | 11 - .../utils/table_inspector_view/types.d.ts | 15 - .../plugins/shared/data/server/config.d.ts | 211 --- .../shared/data_views/common/constants.d.ts | 62 - .../common/content_management/index.d.ts | 1 - .../content_management/v1/constants.d.ts | 7 - .../common/content_management/v1/index.d.ts | 4 - .../common/content_management/v1/types.d.ts | 20 - .../data_views/abstract_data_views.d.ts | 242 --- .../common/data_views/data_view.d.ts | 160 -- .../common/data_views/data_view_lazy.d.ts | 104 -- .../data_views/data_view_lazy_util.d.ts | 2 - .../common/data_views/data_views.d.ts | 511 ------ .../common/data_views/flatten_hit.d.ts | 8 - .../data_views/common/data_views/index.d.ts | 6 - .../data_views/meta_units_to_formatter.d.ts | 5 - .../common/data_views/persistable_state.d.ts | 3 - .../data_views/common/data_views/utils.d.ts | 8 - .../data_view_saved_object_conflict.d.ts | 10 - .../errors/duplicate_index_pattern.d.ts | 11 - .../data_views/common/errors/index.d.ts | 3 - .../common/errors/insufficient_access.d.ts | 12 - .../data_views/common/expressions/index.d.ts | 1 - .../expressions/load_index_pattern.d.ts | 32 - .../common/fields/data_view_field.d.ts | 228 --- .../data_views/common/fields/field_list.d.ts | 66 - .../data_views/common/fields/index.d.ts | 3 - .../data_views/common/fields/utils.d.ts | 23 - .../shared/data_views/common/index.d.ts | 16 - .../shared/data_views/common/lib/errors.d.ts | 7 - .../shared/data_views/common/lib/index.d.ts | 2 - .../shared/data_views/common/types.d.ts | 521 ------ .../shared/data_views/common/utils.d.ts | 10 - .../public/content_management_wrapper.d.ts | 12 - .../data_views/data_views_api_client.d.ts | 63 - .../data_views/public/data_views/index.d.ts | 2 - .../data_views/public/data_views/sha256.d.ts | 1 - .../public/data_views_service_public.d.ts | 58 - .../data_views/public/debounce_by_key.d.ts | 9 - .../data_views/public/expressions/index.d.ts | 1 - .../expressions/load_index_pattern.d.ts | 35 - .../shared/data_views/public/index.d.ts | 16 - .../shared/data_views/public/plugin.d.ts | 12 - .../public/services/get_indices.d.ts | 17 - .../data_views/public/services/has_data.d.ts | 39 - .../data_views/public/services/index.d.ts | 10 - .../shared/data_views/public/types.d.ts | 175 -- .../public/ui_settings_wrapper.d.ts | 10 - .../common/ast/build_expression.d.ts | 68 - .../common/ast/build_function.d.ts | 116 -- .../shared/expressions/common/ast/format.d.ts | 2 - .../common/ast/format_expression.d.ts | 7 - .../shared/expressions/common/ast/index.d.ts | 7 - .../shared/expressions/common/ast/parse.d.ts | 2 - .../common/ast/parse_expression.d.ts | 7 - .../shared/expressions/common/ast/types.d.ts | 51 - .../common/execution/container.d.ts | 32 - .../common/execution/execution.d.ts | 109 -- .../common/execution/execution_contract.d.ts | 42 - .../expressions/common/execution/index.d.ts | 4 - .../expressions/common/execution/types.d.ts | 75 - .../common/executor/container.d.ts | 22 - .../expressions/common/executor/executor.d.ts | 83 - .../expressions/common/executor/index.d.ts | 2 - .../expression_functions/arguments.d.ts | 109 -- .../expression_function.d.ts | 59 - .../expression_function_parameter.d.ts | 19 - .../common/expression_functions/index.d.ts | 6 - .../series_calculation_helpers.d.ts | 20 - .../expression_functions/specs/clog.d.ts | 3 - .../specs/create_table.d.ts | 8 - .../specs/cumulative_sum.d.ts | 37 - .../specs/cumulative_sum_fn.d.ts | 3 - .../specs/derivative.d.ts | 38 - .../specs/derivative_fn.d.ts | 31 - .../expression_functions/specs/font.d.ts | 17 - .../expression_functions/specs/index.d.ts | 18 - .../specs/map_column.d.ts | 10 - .../expression_functions/specs/math.d.ts | 8 - .../specs/math_column.d.ts | 11 - .../expression_functions/specs/math_fn.d.ts | 8 - .../specs/moving_average.d.ts | 36 - .../specs/moving_average_fn.d.ts | 28 - .../specs/overall_metric.d.ts | 37 - .../specs/overall_metric_fn.d.ts | 29 - .../expression_functions/specs/theme.d.ts | 9 - .../specs/ui_setting.d.ts | 35 - .../expression_functions/specs/var.d.ts | 7 - .../expression_functions/specs/var_set.d.ts | 9 - .../common/expression_functions/types.d.ts | 111 -- .../expression_renderer.d.ts | 11 - .../expression_renderer_registry.d.ts | 10 - .../common/expression_renderers/index.d.ts | 3 - .../common/expression_renderers/types.d.ts | 79 - .../expression_types/expression_type.d.ts | 28 - .../common/expression_types/get_type.d.ts | 1 - .../common/expression_types/index.d.ts | 6 - .../expression_types/serialize_provider.d.ts | 6 - .../expression_types/specs/boolean.d.ts | 2 - .../expression_types/specs/datatable.d.ts | 128 -- .../common/expression_types/specs/error.d.ts | 15 - .../common/expression_types/specs/filter.d.ts | 15 - .../common/expression_types/specs/image.d.ts | 9 - .../common/expression_types/specs/index.d.ts | 17 - .../common/expression_types/specs/null.d.ts | 4 - .../common/expression_types/specs/num.d.ts | 5 - .../common/expression_types/specs/number.d.ts | 4 - .../expression_types/specs/pointseries.d.ts | 35 - .../common/expression_types/specs/range.d.ts | 10 - .../common/expression_types/specs/render.d.ts | 17 - .../common/expression_types/specs/shape.d.ts | 5 - .../common/expression_types/specs/string.d.ts | 4 - .../common/expression_types/specs/style.d.ts | 5 - .../expression_types/specs/ui_setting.d.ts | 6 - .../common/expression_types/types.d.ts | 26 - .../unbox_expression_value.d.ts | 2 - .../shared/expressions/common/fonts.d.ts | 141 -- .../shared/expressions/common/index.d.ts | 20 - .../common/service/expressions_fork.d.ts | 53 - .../common/service/expressions_services.d.ts | 292 ---- .../expressions/common/service/index.d.ts | 1 - .../expressions/common/types/common.d.ts | 29 - .../expressions/common/types/index.d.ts | 3 - .../expressions/common/types/registry.d.ts | 5 - .../expressions/common/types/style.d.ts | 111 -- .../create_default_inspector_adapters.d.ts | 2 - .../expressions/common/util/create_error.d.ts | 10 - .../util/expressions_inspector_adapter.d.ts | 7 - .../expressions/common/util/get_by_alias.d.ts | 13 - .../shared/expressions/common/util/index.d.ts | 6 - .../common/util/tables_adapter.d.ts | 13 - .../expressions/common/util/test_utils.d.ts | 2 - .../public/expression_functions/index.d.ts | 1 - .../expression_functions/ui_setting.d.ts | 2 - .../shared/expressions/public/index.d.ts | 13 - .../shared/expressions/public/loader.d.ts | 34 - .../shared/expressions/public/plugin.d.ts | 25 - .../react_expression_renderer/index.d.ts | 2 - .../react_expression_renderer.d.ts | 13 - .../use_debounced_value.d.ts | 1 - .../use_expression_renderer.d.ts | 24 - .../use_shallow_memo.d.ts | 1 - .../react_expression_renderer_wrapper.d.ts | 3 - .../shared/expressions/public/render.d.ts | 39 - .../public/render_error_handler.d.ts | 2 - .../public/services/expressions_services.d.ts | 5 - .../expressions/public/services/index.d.ts | 6 - .../expressions/public/types/index.d.ts | 57 - .../plugins/shared/home/common/constants.d.ts | 8 - .../home/common/instruction_variant.d.ts | 29 - .../home/public/application/application.d.ts | 2 - .../components/add_data/add_data.d.ts | 10 - .../components/add_data/index.d.ts | 1 - .../components/app_navigation_handler.d.ts | 2 - .../public/application/components/home.d.ts | 33 - .../application/components/home_app.d.ts | 7 - .../components/manage_data/index.d.ts | 1 - .../components/manage_data/manage_data.d.ts | 10 - .../components/move_data/index.d.ts | 1 - .../components/move_data/move_data.d.ts | 6 - .../components/sample_data/index.d.ts | 8 - .../setup_cloud_connect/callout_skeleton.d.ts | 2 - .../components/setup_cloud_connect/index.d.ts | 2 - .../setup_cloud_connect.d.ts | 8 - .../components/solutions_section/index.d.ts | 1 - .../solutions_section/solution_panel.d.ts | 8 - .../solutions_section/solutions_section.d.ts | 8 - .../application/components/synopsis.d.ts | 13 - .../components/tutorial/content.d.ts | 6 - .../components/tutorial/footer.d.ts | 7 - .../components/tutorial/instruction.d.ts | 8 - .../components/tutorial/instruction_set.d.ts | 18 - .../components/tutorial/introduction.d.ts | 20 - .../tutorial/replace_template_strings.d.ts | 1 - .../tutorial/status_check_states.d.ts | 5 - .../components/tutorial/tutorial.d.ts | 16 - .../components/tutorial_directory.d.ts | 13 - .../application/components/welcome.d.ts | 10 - .../shared/home/public/application/index.d.ts | 1 - .../public/application/kibana_services.d.ts | 44 - .../public/application/load_tutorials.d.ts | 3 - .../plugins/shared/home/public/index.d.ts | 7 - .../plugins/shared/home/public/plugin.d.ts | 60 - .../services/add_data/add_data_service.d.ts | 31 - .../home/public/services/add_data/index.d.ts | 2 - .../services/environment/environment.d.ts | 35 - .../public/services/environment/index.d.ts | 2 - .../feature_catalogue_registry.d.ts | 68 - .../services/feature_catalogue/index.d.ts | 2 - .../shared/home/public/services/index.d.ts | 10 - .../home/public/services/tutorials/index.d.ts | 2 - .../services/tutorials/tutorial_service.d.ts | 50 - .../home/public/services/tutorials/types.d.ts | 7 - .../home/public/services/welcome/index.d.ts | 2 - .../services/welcome/welcome_service.d.ts | 19 - .../home/server/capabilities_provider.d.ts | 10 - .../plugins/shared/home/server/config.d.ts | 5 - .../plugins/shared/home/server/index.d.ts | 8 - .../plugins/shared/home/server/plugin.d.ts | 28 - .../server/routes/fetch_es_hits_status.d.ts | 2 - .../shared/home/server/routes/index.d.ts | 2 - .../home/server/saved_objects/index.d.ts | 1 - .../saved_objects/sample_data_telemetry.d.ts | 2 - .../shared/home/server/services/index.d.ts | 5 - .../data_sets/ecommerce/field_mappings.d.ts | 202 --- .../data_sets/ecommerce/index.d.ts | 2 - .../data_sets/ecommerce/saved_objects.d.ts | 2 - .../data_sets/flights/field_mappings.d.ts | 83 - .../sample_data/data_sets/flights/index.d.ts | 2 - .../data_sets/flights/saved_objects.d.ts | 2 - .../services/sample_data/data_sets/index.d.ts | 4 - .../data_sets/logs/field_mappings.d.ts | 155 -- .../sample_data/data_sets/logs/index.d.ts | 2 - .../data_sets/logs/saved_objects.d.ts | 2 - .../data_sets/logs_tsdb/field_mappings.d.ts | 141 -- .../data_sets/logs_tsdb/index.d.ts | 3 - .../data_sets/logs_tsdb/saved_objects.d.ts | 2 - .../server/services/sample_data/errors.d.ts | 4 - .../server/services/sample_data/index.d.ts | 3 - .../sample_data/lib/create_index_name.d.ts | 1 - .../sample_data/lib/find_sample_objects.d.ts | 21 - .../lib/insert_data_into_index.d.ts | 9 - .../services/sample_data/lib/load_data.d.ts | 1 - .../lib/register_with_integrations.d.ts | 3 - .../lib/sample_dataset_registry_types.d.ts | 56 - .../lib/sample_dataset_schema.d.ts | 46 - .../sample_data/lib/translate_timestamp.d.ts | 3 - .../services/sample_data/lib/utils.d.ts | 2 - .../services/sample_data/routes/index.d.ts | 3 - .../services/sample_data/routes/install.d.ts | 5 - .../services/sample_data/routes/list.d.ts | 3 - .../sample_data/routes/uninstall.d.ts | 5 - .../services/sample_data/routes/utils.d.ts | 12 - .../sample_data/sample_data_installer.d.ts | 32 - .../sample_data/sample_data_registry.d.ts | 55 - .../services/sample_data/usage/collector.d.ts | 2 - .../sample_data/usage/collector_fetch.d.ts | 11 - .../services/sample_data/usage/index.d.ts | 2 - .../services/sample_data/usage/usage.d.ts | 6 - .../home/server/services/tutorials/index.d.ts | 4 - .../tutorials/lib/tutorial_schema.d.ts | 268 --- .../lib/tutorials_registry_types.d.ts | 16 - .../tutorials/tutorials_registry.d.ts | 22 - .../server/tutorials/activemq_logs/index.d.ts | 2 - .../tutorials/activemq_metrics/index.d.ts | 2 - .../tutorials/aerospike_metrics/index.d.ts | 2 - .../server/tutorials/apache_logs/index.d.ts | 2 - .../tutorials/apache_metrics/index.d.ts | 2 - .../server/tutorials/auditbeat/index.d.ts | 2 - .../server/tutorials/auditd_logs/index.d.ts | 2 - .../home/server/tutorials/aws_logs/index.d.ts | 2 - .../server/tutorials/aws_metrics/index.d.ts | 2 - .../server/tutorials/azure_logs/index.d.ts | 2 - .../server/tutorials/azure_metrics/index.d.ts | 2 - .../tutorials/barracuda_logs/index.d.ts | 2 - .../server/tutorials/bluecoat_logs/index.d.ts | 2 - .../home/server/tutorials/cef_logs/index.d.ts | 2 - .../server/tutorials/ceph_metrics/index.d.ts | 2 - .../tutorials/checkpoint_logs/index.d.ts | 2 - .../server/tutorials/cisco_logs/index.d.ts | 2 - .../tutorials/cockroachdb_metrics/index.d.ts | 2 - .../tutorials/consul_metrics/index.d.ts | 2 - .../server/tutorials/coredns_logs/index.d.ts | 2 - .../tutorials/coredns_metrics/index.d.ts | 2 - .../tutorials/couchbase_metrics/index.d.ts | 2 - .../tutorials/couchdb_metrics/index.d.ts | 2 - .../tutorials/crowdstrike_logs/index.d.ts | 2 - .../server/tutorials/cylance_logs/index.d.ts | 2 - .../tutorials/docker_metrics/index.d.ts | 2 - .../tutorials/dropwizard_metrics/index.d.ts | 2 - .../tutorials/elasticsearch_logs/index.d.ts | 2 - .../elasticsearch_metrics/index.d.ts | 2 - .../tutorials/envoyproxy_logs/index.d.ts | 2 - .../tutorials/envoyproxy_metrics/index.d.ts | 2 - .../server/tutorials/etcd_metrics/index.d.ts | 2 - .../home/server/tutorials/f5_logs/index.d.ts | 2 - .../server/tutorials/fortinet_logs/index.d.ts | 2 - .../home/server/tutorials/gcp_logs/index.d.ts | 2 - .../server/tutorials/gcp_metrics/index.d.ts | 2 - .../tutorials/golang_metrics/index.d.ts | 2 - .../server/tutorials/gsuite_logs/index.d.ts | 2 - .../server/tutorials/haproxy_logs/index.d.ts | 2 - .../tutorials/haproxy_metrics/index.d.ts | 2 - .../server/tutorials/ibmmq_logs/index.d.ts | 2 - .../server/tutorials/ibmmq_metrics/index.d.ts | 2 - .../server/tutorials/icinga_logs/index.d.ts | 2 - .../home/server/tutorials/iis_logs/index.d.ts | 2 - .../server/tutorials/iis_metrics/index.d.ts | 2 - .../server/tutorials/imperva_logs/index.d.ts | 2 - .../server/tutorials/infoblox_logs/index.d.ts | 2 - .../instructions/auditbeat_instructions.d.ts | 246 --- .../instructions/cloud_instructions.d.ts | 2 - .../instructions/filebeat_instructions.d.ts | 282 --- .../get_space_id_for_beats_tutorial.d.ts | 8 - .../instructions/heartbeat_instructions.d.ts | 273 --- .../instructions/metricbeat_instructions.d.ts | 282 --- .../onprem_cloud_instructions.d.ts | 8 - .../instructions/winlogbeat_instructions.d.ts | 160 -- .../server/tutorials/iptables_logs/index.d.ts | 2 - .../server/tutorials/juniper_logs/index.d.ts | 2 - .../server/tutorials/kafka_logs/index.d.ts | 2 - .../server/tutorials/kafka_metrics/index.d.ts | 2 - .../server/tutorials/kibana_logs/index.d.ts | 2 - .../tutorials/kibana_metrics/index.d.ts | 2 - .../tutorials/kubernetes_metrics/index.d.ts | 2 - .../server/tutorials/logstash_logs/index.d.ts | 2 - .../tutorials/logstash_metrics/index.d.ts | 2 - .../tutorials/memcached_metrics/index.d.ts | 2 - .../tutorials/microsoft_logs/index.d.ts | 2 - .../server/tutorials/misp_logs/index.d.ts | 2 - .../server/tutorials/mongodb_logs/index.d.ts | 2 - .../tutorials/mongodb_metrics/index.d.ts | 2 - .../server/tutorials/mssql_logs/index.d.ts | 2 - .../server/tutorials/mssql_metrics/index.d.ts | 2 - .../server/tutorials/munin_metrics/index.d.ts | 2 - .../server/tutorials/mysql_logs/index.d.ts | 2 - .../server/tutorials/mysql_metrics/index.d.ts | 2 - .../server/tutorials/nats_logs/index.d.ts | 2 - .../server/tutorials/nats_metrics/index.d.ts | 2 - .../server/tutorials/netflow_logs/index.d.ts | 2 - .../server/tutorials/netscout_logs/index.d.ts | 2 - .../server/tutorials/nginx_logs/index.d.ts | 2 - .../server/tutorials/nginx_metrics/index.d.ts | 2 - .../server/tutorials/o365_logs/index.d.ts | 2 - .../server/tutorials/okta_logs/index.d.ts | 2 - .../tutorials/openmetrics_metrics/index.d.ts | 2 - .../tutorials/oracle_metrics/index.d.ts | 2 - .../server/tutorials/osquery_logs/index.d.ts | 2 - .../server/tutorials/panw_logs/index.d.ts | 2 - .../tutorials/php_fpm_metrics/index.d.ts | 2 - .../tutorials/postgresql_logs/index.d.ts | 2 - .../tutorials/postgresql_metrics/index.d.ts | 2 - .../tutorials/prometheus_metrics/index.d.ts | 2 - .../server/tutorials/rabbitmq_logs/index.d.ts | 2 - .../tutorials/rabbitmq_metrics/index.d.ts | 2 - .../server/tutorials/radware_logs/index.d.ts | 2 - .../server/tutorials/redis_logs/index.d.ts | 2 - .../server/tutorials/redis_metrics/index.d.ts | 2 - .../redisenterprise_metrics/index.d.ts | 2 - .../home/server/tutorials/register.d.ts | 2 - .../server/tutorials/santa_logs/index.d.ts | 2 - .../tutorials/sonicwall_logs/index.d.ts | 2 - .../server/tutorials/sophos_logs/index.d.ts | 2 - .../server/tutorials/stan_metrics/index.d.ts | 2 - .../tutorials/statsd_metrics/index.d.ts | 3 - .../server/tutorials/suricata_logs/index.d.ts | 2 - .../server/tutorials/system_logs/index.d.ts | 2 - .../tutorials/system_metrics/index.d.ts | 2 - .../server/tutorials/tomcat_logs/index.d.ts | 2 - .../server/tutorials/traefik_logs/index.d.ts | 2 - .../tutorials/traefik_metrics/index.d.ts | 3 - .../tutorials/uptime_monitors/index.d.ts | 2 - .../server/tutorials/uwsgi_metrics/index.d.ts | 2 - .../tutorials/vsphere_metrics/index.d.ts | 2 - .../tutorials/windows_event_logs/index.d.ts | 2 - .../tutorials/windows_metrics/index.d.ts | 2 - .../server/tutorials/zeek_logs/index.d.ts | 2 - .../tutorials/zookeeper_metrics/index.d.ts | 2 - .../server/tutorials/zscaler_logs/index.d.ts | 2 - .../inspector/common/adapters/index.d.ts | 2 - .../common/adapters/request/index.d.ts | 4 - .../move_request_params_to_top_level.d.ts | 2 - .../adapters/request/request_adapter.d.ts | 34 - .../adapters/request/request_responder.d.ts | 16 - .../common/adapters/request/types.d.ts | 46 - .../inspector/common/adapters/types.d.ts | 8 - .../shared/inspector/common/index.d.ts | 2 - .../adapters/has_inspector_adapters.d.ts | 5 - .../inspector/public/async_services.d.ts | 2 - .../shared/inspector/public/index.d.ts | 8 - .../shared/inspector/public/plugin.d.ts | 48 - .../shared/inspector/public/types.d.ts | 57 - .../inspector/public/ui/inspector_panel.d.ts | 39 - .../public/ui/inspector_view_chooser.d.ts | 20 - .../inspector/public/view_registry.d.ts | 36 - .../shared/inspector/public/views/index.d.ts | 1 - .../clusters_health/cluster_health.d.ts | 9 - .../clusters_health/clusters_health.d.ts | 7 - .../clusters_health/gradient.d.ts | 7 - .../clusters_view/clusters_health/index.d.ts | 2 - .../clusters_table/cluster_view.d.ts | 7 - .../clusters_table/clusters_table.d.ts | 7 - .../clusters_view/clusters_table/index.d.ts | 1 - .../clusters_table/shards_view/index.d.ts | 2 - .../open_shard_failure_flyout_button.d.ts | 7 - .../shards_view/shard_failure_details.d.ts | 20 - .../shards_view/shard_failure_flyout.d.ts | 8 - .../shards_view/shard_failure_table.d.ts | 7 - .../shards_view/shards_view.d.ts | 8 - .../details/clusters_view/clusters_view.d.ts | 16 - .../details/clusters_view/find_clusters.d.ts | 4 - .../details/clusters_view/index.d.ts | 1 - .../details/clusters_view/local_cluster.d.ts | 16 - .../requests/components/details/index.d.ts | 5 - .../components/details/req_code_viewer.d.ts | 14 - .../details/req_details_request.d.ts | 7 - .../details/req_details_request_content.d.ts | 9 - .../details/req_details_response.d.ts | 8 - .../components/details/req_details_stats.d.ts | 7 - .../requests/components/details/types.d.ts | 4 - .../disambiguate_request_names.d.ts | 2 - .../requests/components/get_next_tab.d.ts | 2 - .../requests/components/request_details.d.ts | 8 - .../requests/components/request_selector.d.ts | 14 - .../requests/components/requests_view.d.ts | 17 - .../views/requests/components/types.d.ts | 15 - .../public/views/requests/index.d.ts | 2 - .../kibana_react/public/context/context.d.ts | 12 - .../kibana_react/public/context/index.d.ts | 2 - .../kibana_react/public/context/types.d.ts | 16 - .../public/dark_mode/use_dark_mode.d.ts | 7 - .../shared/kibana_react/public/index.d.ts | 26 - .../kibana_react/public/markdown/index.d.ts | 5 - .../public/markdown/markdown.d.ts | 21 - .../public/markdown/markdownStyles.d.ts | 2 - .../public/markdown/markdown_simple.d.ts | 6 - .../overlays/create_react_overlays.d.ts | 3 - .../kibana_react/public/overlays/index.d.ts | 2 - .../kibana_react/public/overlays/types.d.ts | 6 - .../public/overview_page/index.d.ts | 2 - .../overview_page_actions/index.d.ts | 1 - .../overview_page_actions.d.ts | 13 - .../overview_page_footer/index.d.ts | 1 - .../overview_page_footer.d.ts | 12 - .../public/page_template/index.d.ts | 2 - .../action_cards/action_cards.d.ts | 8 - .../no_data_page/action_cards/index.d.ts | 1 - .../page_template/no_data_page/index.d.ts | 2 - .../no_data_card/elastic_agent_card.d.ts | 9 - .../no_data_page/no_data_card/index.d.ts | 3 - .../no_data_card/no_data_card.d.ts | 3 - .../no_data_page/no_data_page.d.ts | 47 - .../no_data_page_body/no_data_page_body.d.ts | 9 - .../page_template/solution_nav/index.d.ts | 2 - .../solution_nav/solution_nav_avatar.d.ts | 12 - .../public/react_router_navigate/index.d.ts | 1 - .../react_router_navigate.d.ts | 15 - .../shared/kibana_react/public/theme.d.ts | 11 - .../public/ui_settings/index.d.ts | 1 - .../public/ui_settings/use_ui_setting.d.ts | 50 - .../public/url_template_editor/index.d.ts | 1 - .../url_template_editor.d.ts | 20 - .../public/use_execution_context/index.d.ts | 1 - .../use_execution_context.d.ts | 7 - .../kibana_react/public/util/index.d.ts | 18 - .../public/validated_range/index.d.ts | 2 - .../validated_range/is_range_valid.d.ts | 5 - .../validated_range/validated_dual_range.d.ts | 36 - .../kibana_utils/common/abort_utils.d.ts | 36 - .../common/calculate_object_hash.d.ts | 3 - .../common/create_getter_setter.d.ts | 3 - .../shared/kibana_utils/common/defer.d.ts | 18 - ...inct_until_changed_with_initial_value.d.ts | 2 - .../kibana_utils/common/errors/errors.d.ts | 53 - .../kibana_utils/common/errors/index.d.ts | 2 - .../kibana_utils/common/errors/types.d.ts | 5 - .../kibana_utils/common/field_wildcard.d.ts | 3 - .../shared/kibana_utils/common/index.d.ts | 18 - .../shared/kibana_utils/common/now.d.ts | 5 - .../shared/kibana_utils/common/of.d.ts | 10 - .../common/persistable_state/index.d.ts | 3 - .../merge_migration_function_map.d.ts | 4 - .../persistable_state/migrate_to_latest.d.ts | 3 - .../common/persistable_state/types.d.ts | 146 -- .../create_state_container.d.ts | 47 - .../create_state_container_react_helpers.d.ts | 38 - .../common/state_containers/index.d.ts | 10 - .../common/state_containers/types.d.ts | 148 -- .../common/state_management/encode_state.d.ts | 1 - .../common/state_management/format.d.ts | 3 - .../common/state_management/parse.d.ts | 2 - .../set_state_to_kbn_url.d.ts | 25 - .../common/state_management/state_hash.d.ts | 2 - .../common/url/encode_uri_query.d.ts | 22 - .../shared/kibana_utils/common/url/index.d.ts | 8 - .../kibana_utils/common/url/validate_url.d.ts | 5 - .../core/create_start_service_getter.d.ts | 51 - .../kibana_utils/public/core/index.d.ts | 2 - .../public/history/get_query_params.d.ts | 3 - .../public/history/history_observable.d.ts | 23 - .../kibana_utils/public/history/index.d.ts | 4 - .../public/history/redirect_when_missing.d.ts | 36 - .../public/history/remove_query_param.d.ts | 2 - .../shared/kibana_utils/public/index.d.ts | 23 - .../shared/kibana_utils/public/plugin.d.ts | 12 - .../public/render_complete/index.d.ts | 1 - .../render_complete_dispatcher.d.ts | 23 - .../public/resize_checker/index.d.ts | 1 - .../public/resize_checker/resize_checker.d.ts | 26 - .../state_encoder/encode_decode_state.d.ts | 3 - .../state_management/state_encoder/index.d.ts | 1 - .../state_management/state_hash/index.d.ts | 1 - .../state_hash/state_hash.d.ts | 2 - .../public/state_management/url/errors.d.ts | 20 - .../state_management/url/hash_unhash_url.d.ts | 14 - .../public/state_management/url/index.d.ts | 6 - .../state_management/url/kbn_url_storage.d.ts | 115 -- .../state_management/url/kbn_url_tracker.d.ts | 93 - .../state_management/url/url_tracker.d.ts | 11 - .../state_management/utils/diff_object.d.ts | 7 - .../kibana_utils/public/state_sync/index.d.ts | 24 - .../public/state_sync/state_sync.d.ts | 111 -- .../create_kbn_url_state_storage.d.ts | 44 - .../create_session_storage_state_storage.d.ts | 18 - .../state_sync_state_storage/index.d.ts | 5 - .../state_sync_state_storage/types.d.ts | 29 - .../kibana_utils/public/state_sync/types.d.ts | 43 - .../hashed_item_store/hashed_item_store.d.ts | 22 - .../storage/hashed_item_store/index.d.ts | 3 - .../kibana_utils/public/storage/index.d.ts | 2 - .../kibana_utils/public/storage/storage.d.ts | 9 - .../kibana_utils/public/storage/types.d.ts | 12 - .../kibana_utils/public/theme/index.d.ts | 1 - .../public/theme/kibana_theme_provider.d.ts | 14 - .../kibana_utils/public/ui/configurable.d.ts | 36 - .../shared/kibana_utils/public/ui/index.d.ts | 1 - .../shared/management/common/contants.d.ts | 1 - .../shared/management/common/locator.d.ts | 15 - .../shared/management/public/application.d.ts | 3 - .../landing/classic_empty_prompt.d.ts | 6 - .../public/components/landing/index.d.ts | 1 - .../public/components/landing/landing.d.ts | 7 - .../landing/solution_empty_prompt.d.ts | 8 - .../components/management_app/index.d.ts | 2 - .../management_app/management_app.d.ts | 28 - .../management_app/management_context.d.ts | 8 - .../management_app/management_router.d.ts | 13 - .../management_app_wrapper/index.d.ts | 1 - .../management_app_wrapper.d.ts | 22 - .../components/management_sections.d.ts | 69 - .../management_sidebar_nav.d.ts | 11 - .../shared/management/public/index.d.ts | 7 - .../public/management_sections_service.d.ts | 13 - .../shared/management/public/plugin.d.ts | 40 - .../shared/management/public/types.d.ts | 110 -- .../management/public/utils/breadcrumbs.d.ts | 7 - .../shared/management/public/utils/index.d.ts | 5 - .../public/utils/management_app.d.ts | 13 - .../public/utils/management_item.d.ts | 19 - .../public/utils/management_section.d.ts | 15 - .../screenshot_mode/common/constants.d.ts | 1 - .../screenshot_mode/common/context.d.ts | 20 - .../shared/screenshot_mode/common/index.d.ts | 3 - .../shared/screenshot_mode/common/mode.d.ts | 26 - .../shared/screenshot_mode/public/index.d.ts | 4 - .../shared/screenshot_mode/public/plugin.d.ts | 8 - .../shared/screenshot_mode/public/types.d.ts | 19 - .../share/common/anonymous_access/index.d.ts | 1 - .../share/common/anonymous_access/types.d.ts | 29 - .../shared/share/common/constants.d.ts | 2 - .../plugins/shared/share/common/index.d.ts | 3 - .../share/common/url_service/index.d.ts | 3 - .../common/url_service/locators/index.d.ts | 5 - .../locators/legacy_short_url_locator.d.ts | 10 - .../common/url_service/locators/locator.d.ts | 39 - .../url_service/locators/locator_client.d.ts | 46 - .../redirect/format_search_params.d.ts | 5 - .../url_service/locators/redirect/index.d.ts | 4 - .../redirect/parse_search_params.d.ts | 14 - .../locators/redirect/space_url_parser.d.ts | 1 - .../url_service/locators/redirect/types.d.ts | 27 - .../locators/short_url_assert_valid.d.ts | 1 - .../locators/short_url_redirect_locator.d.ts | 13 - .../common/url_service/locators/types.d.ts | 143 -- .../url_service/locators/use_locator_url.d.ts | 4 - .../common/url_service/short_urls/index.d.ts | 1 - .../common/url_service/short_urls/types.d.ts | 103 -- .../share/common/url_service/url_service.d.ts | 18 - .../draft_mode_callout.d.ts | 15 - .../common/draft_mode_callout/index.d.ts | 2 - .../public/components/context/index.d.ts | 146 -- .../export_integrations.d.ts | 24 - .../components/export_integrations/index.d.ts | 1 - .../share/public/components/share_tabs.d.ts | 6 - .../components/tabs/embed/embed_content.d.ts | 8 - .../public/components/tabs/embed/index.d.ts | 7 - .../share/public/components/tabs/index.d.ts | 2 - .../public/components/tabs/link/index.d.ts | 8 - .../components/tabs/link/link_content.d.ts | 8 - .../tabs/link/time_type_section.d.ts | 12 - .../plugins/shared/share/public/index.d.ts | 14 - .../shared/share/public/lib/download_as.d.ts | 21 - .../share/public/lib/get_home_href.d.ts | 2 - .../share/public/lib/registrations.d.ts | 8 - .../shared/share/public/lib/time_utils.d.ts | 15 - .../plugins/shared/share/public/plugin.d.ts | 59 - .../shared/share/public/services/index.d.ts | 2 - .../public/services/share_menu_manager.d.ts | 38 - .../public/services/share_menu_registry.d.ts | 39 - .../plugins/shared/share/public/types.d.ts | 362 ---- .../share/public/url_service/index.d.ts | 1 - .../redirect/components/empty_prompt.d.ts | 10 - .../url_service/redirect/components/page.d.ts | 14 - .../redirect/components/spinner.d.ts | 4 - .../public/url_service/redirect/index.d.ts | 1 - .../redirect/redirect_manager.d.ts | 19 - .../public/url_service/redirect/render.d.ts | 2 - .../short_urls/short_url_client.d.ts | 45 - .../short_urls/short_url_client_factory.d.ts | 10 - .../plugins/shared/share/server/config.d.ts | 13 - .../server/unused_urls_task/constants.d.ts | 5 - .../share/server/unused_urls_task/index.d.ts | 3 - .../register_delete_unused_urls_route.d.ts | 11 - .../register_unused_urls_task_routes.d.ts | 10 - .../share/server/unused_urls_task/task.d.ts | 40 - .../shared/ui_actions/common/trigger_ids.d.ts | 48 - .../ui_actions/public/actions/action.d.ts | 161 -- .../public/actions/action_internal.d.ts | 30 - .../public/actions/create_action.d.ts | 2 - .../actions/incompatible_action_error.d.ts | 4 - .../ui_actions/public/actions/index.d.ts | 4 - .../build_eui_context_menu_panels.d.ts | 22 - .../ui_actions/public/context_menu/index.d.ts | 2 - .../context_menu/open_context_menu.d.ts | 44 - .../shared/ui_actions/public/index.d.ts | 12 - .../shared/ui_actions/public/plugin.d.ts | 16 - .../ui_actions/public/service/index.d.ts | 1 - .../service/ui_actions_execution_service.d.ts | 15 - .../public/service/ui_actions_service.d.ts | 42 - .../shared/ui_actions/public/services.d.ts | 6 - .../shared/ui_actions/public/triggers.d.ts | 4 - .../shared/ui_actions/public/types.d.ts | 47 - .../common/application_usage.d.ts | 5 - .../usage_collection/common/constants.d.ts | 4 - .../shared/usage_collection/common/index.d.ts | 1 - .../usage_collection/common/types/index.d.ts | 3 - .../common/types/stats/core_metrics.d.ts | 200 --- .../common/types/stats/index.d.ts | 2 - .../common/types/stats/latest.d.ts | 2 - .../common/types/stats/v1.d.ts | 57 - .../common/types/ui_counters/index.d.ts | 2 - .../common/types/ui_counters/latest.d.ts | 1 - .../common/types/ui_counters/v1.d.ts | 36 - .../common/types/usage_counters/index.d.ts | 2 - .../common/types/usage_counters/latest.d.ts | 1 - .../common/types/usage_counters/v1.d.ts | 32 - .../public/components/index.d.ts | 2 - .../track_application_view/index.d.ts | 2 - .../track_application_view.d.ts | 11 - .../track_application_view_component.d.ts | 14 - .../track_application_view/types.d.ts | 17 - .../shared/usage_collection/public/index.d.ts | 6 - .../usage_collection/public/plugin.d.ts | 77 - .../public/services/application_usage.d.ts | 3 - .../public/services/create_reporter.d.ts | 11 - .../public/services/index.d.ts | 2 - .../server/collector/collector.d.ts | 14 - .../server/collector/collector_set.d.ts | 64 - .../collector/collector_stats/index.d.ts | 1 - .../collector/collector_stats/schema.d.ts | 3 - .../usage_collector_stats_collector.d.ts | 44 - .../server/collector/index.d.ts | 4 - .../server/collector/measure_duration.d.ts | 10 - .../server/collector/types.d.ts | 153 -- .../server/collector/usage_collector.d.ts | 13 - .../usage_collection/server/config.d.ts | 17 - .../shared/usage_collection/server/index.d.ts | 7 - .../usage_collection/server/plugin.d.ts | 17 - .../usage_collection/server/report/index.d.ts | 2 - .../server/report/schema.d.ts | 34 - .../report/store_application_usage.d.ts | 7 - .../server/report/store_ui_report.d.ts | 10 - .../usage_collection/server/routes/index.d.ts | 24 - .../server/routes/stats/index.d.ts | 1 - .../server/routes/stats/stats.d.ts | 21 - .../server/routes/ui_counters.d.ts | 3 - .../usage_counters/common/kuery_utils.d.ts | 3 - .../server/usage_counters/index.d.ts | 7 - .../usage_counters/rollups/constants.d.ts | 12 - .../server/usage_counters/rollups/index.d.ts | 1 - .../rollups/register_rollups.d.ts | 9 - .../usage_counters/rollups/rollups.d.ts | 9 - .../server/usage_counters/saved_objects.d.ts | 41 - .../server/usage_counters/search/index.d.ts | 1 - .../server/usage_counters/search/search.d.ts | 3 - .../server/usage_counters/types.d.ts | 81 - .../server/usage_counters/usage_counter.d.ts | 36 - .../usage_counters_service.d.ts | 36 - .../kbn-alerting-state-types/index.d.ts | 7 - .../src/alert_instance.d.ts | 4 - .../src/lifecycle_state.d.ts | 45 - .../src/rule_task_instance.d.ts | 11 - .../src/task_state/index.d.ts | 374 ---- .../src/task_state/lib/index.d.ts | 6 - .../src/task_state/v1/index.d.ts | 101 -- .../src/task_state/v1/migration.d.ts | 12 - .../src/task_state/v1/schema.d.ts | 100 -- .../src/task_state/v2/index.d.ts | 104 -- .../src/task_state/v2/migration.d.ts | 5 - .../src/task_state/v2/schema.d.ts | 52 - .../src/task_state/v3/index.d.ts | 101 -- .../src/task_state/v3/migration.d.ts | 5 - .../src/task_state/v3/schema.d.ts | 50 - .../index_management_shared_types/index.d.ts | 5 - .../src/constants.d.ts | 7 - .../src/home_sections.d.ts | 46 - .../src/index_templates.d.ts | 56 - .../src/services/extensions_service.d.ts | 45 - .../src/services/index.d.ts | 2 - .../src/services/public_api_service.d.ts | 31 - .../src/types.d.ts | 141 -- .../shared/kbn-apm-types/es_fields.d.ts | 3 - .../shared/kbn-apm-types/es_schemas_raw.d.ts | 2 - .../shared/kbn-apm-types/es_schemas_ui.d.ts | 2 - .../packages/shared/kbn-apm-types/index.d.ts | 48 - .../kbn-apm-types/src/agent_explorer.d.ts | 16 - .../kbn-apm-types/src/aggregation_type.d.ts | 5 - .../shared/kbn-apm-types/src/annotations.d.ts | 9 - .../src/anomaly_detector_type.d.ts | 5 - .../shared/kbn-apm-types/src/apm_event.d.ts | 11 - .../shared/kbn-apm-types/src/apm_ml_job.d.ts | 26 - .../kbn-apm-types/src/apm_telemetry.d.ts | 254 --- .../kbn-apm-types/src/apm_timeseries.d.ts | 64 - .../shared/kbn-apm-types/src/connections.d.ts | 56 - .../kbn-apm-types/src/container_type.d.ts | 1 - .../shared/kbn-apm-types/src/coordinate.d.ts | 5 - .../kbn-apm-types/src/correlations.d.ts | 100 -- .../kbn-apm-types/src/custom_dashboards.d.ts | 11 - .../shared/kbn-apm-types/src/custom_link.d.ts | 25 - .../shared/kbn-apm-types/src/data_source.d.ts | 12 - .../shared/kbn-apm-types/src/diagnostics.d.ts | 13 - .../kbn-apm-types/src/document_type.d.ts | 11 - .../src/downstream_dependencies.d.ts | 17 - .../src/environment_filter_values.d.ts | 24 - .../kbn-apm-types/src/environment_rt.d.ts | 6 - .../shared/kbn-apm-types/src/errors.d.ts | 37 - .../kbn-apm-types/src/es_fields/apm.d.ts | 193 --- .../kbn-apm-types/src/es_fields/common.d.ts | 1 - .../kbn-apm-types/src/es_fields/otel.d.ts | 12 - .../src/es_schemas/raw/apm_base_doc.d.ts | 18 - .../src/es_schemas/raw/error_raw.d.ts | 53 - .../src/es_schemas/raw/event_raw.d.ts | 17 - .../src/es_schemas/raw/fields/cloud.d.ts | 26 - .../src/es_schemas/raw/fields/container.d.ts | 6 - .../es_schemas/raw/fields/event_outcome.d.ts | 1 - .../src/es_schemas/raw/fields/faas.d.ts | 9 - .../src/es_schemas/raw/fields/host.d.ts | 9 - .../src/es_schemas/raw/fields/http.d.ts | 9 - .../src/es_schemas/raw/fields/index.d.ts | 18 - .../src/es_schemas/raw/fields/kubernetes.d.ts | 17 - .../src/es_schemas/raw/fields/observer.d.ts | 9 - .../src/es_schemas/raw/fields/otel/index.d.ts | 1 - .../raw/fields/otel/status_code.d.ts | 1 - .../src/es_schemas/raw/fields/page.d.ts | 3 - .../src/es_schemas/raw/fields/process.d.ts | 6 - .../src/es_schemas/raw/fields/server.d.ts | 4 - .../src/es_schemas/raw/fields/service.d.ts | 20 - .../src/es_schemas/raw/fields/span_links.d.ts | 12 - .../src/es_schemas/raw/fields/stackframe.d.ts | 33 - .../es_schemas/raw/fields/timestamp_us.d.ts | 3 - .../src/es_schemas/raw/fields/url.d.ts | 7 - .../src/es_schemas/raw/fields/user.d.ts | 3 - .../src/es_schemas/raw/fields/user_agent.d.ts | 13 - .../src/es_schemas/raw/index.d.ts | 6 - .../src/es_schemas/raw/metric_raw.d.ts | 100 -- .../src/es_schemas/raw/span_raw.d.ts | 87 - .../src/es_schemas/raw/transaction_raw.d.ts | 81 - .../src/es_schemas/ui/apm_error.d.ts | 5 - .../src/es_schemas/ui/event.d.ts | 5 - .../src/es_schemas/ui/fields/agent.d.ts | 7 - .../src/es_schemas/ui/fields/index.d.ts | 1 - .../src/es_schemas/ui/index.d.ts | 5 - .../src/es_schemas/ui/metric.d.ts | 2 - .../kbn-apm-types/src/es_schemas/ui/span.d.ts | 5 - .../src/es_schemas/ui/transaction.d.ts | 11 - .../src/focused_trace_waterfall.d.ts | 6 - .../src/full_trace_waterfall.d.ts | 36 - .../shared/kbn-apm-types/src/ilm_types.d.ts | 14 - .../shared/kbn-apm-types/src/instances.d.ts | 10 - .../src/latency_aggregation_types.d.ts | 7 - .../src/latency_distribution.d.ts | 10 - .../src/latency_distribution_chart_types.d.ts | 9 - .../kbn-apm-types/src/mobile_types.d.ts | 7 - .../kbn-apm-types/src/processor_event.d.ts | 10 - .../shared/kbn-apm-types/src/rollup.d.ts | 6 - .../shared/kbn-apm-types/src/serverless.d.ts | 4 - .../kbn-apm-types/src/service_anomalies.d.ts | 10 - .../src/service_anomaly_stats.d.ts | 6 - .../src/service_anomaly_timeseries.d.ts | 18 - .../kbn-apm-types/src/service_groups.d.ts | 10 - .../src/service_health_status.d.ts | 6 - .../kbn-apm-types/src/service_inventory.d.ts | 2 - .../shared/kbn-apm-types/src/service_map.d.ts | 215 --- .../src/service_map_diagnostic_types.d.ts | 48 - .../shared/kbn-apm-types/src/span_links.d.ts | 19 - .../src/storage_explorer_types.d.ts | 5 - .../src/time_range_metadata.d.ts | 8 - .../shared/kbn-apm-types/src/timeseries.d.ts | 41 - .../shared/kbn-apm-types/src/traces.d.ts | 80 - .../packages/shared/kbn-slo-schema/index.d.ts | 3 - .../shared/kbn-slo-schema/src/constants.d.ts | 1 - .../kbn-slo-schema/src/models/duration.d.ts | 23 - .../kbn-slo-schema/src/models/index.d.ts | 2 - .../kbn-slo-schema/src/models/pagination.d.ts | 10 - .../kbn-slo-schema/src/rest_specs/common.d.ts | 8 - .../kbn-slo-schema/src/rest_specs/index.d.ts | 4 - .../src/rest_specs/indicators.d.ts | 19 - .../src/rest_specs/routes/bulk_delete.d.ts | 28 - .../rest_specs/routes/bulk_purge_rollup.d.ts | 31 - .../composite_slo_batch_get.d.ts | 62 - .../composite_slo/composite_slo_create.d.ts | 75 - .../composite_slo/composite_slo_delete.d.ts | 7 - .../composite_slo/composite_slo_find.d.ts | 56 - .../composite_slo/composite_slo_get.d.ts | 61 - .../composite_slo_historical_summary.d.ts | 24 - .../composite_slo_summary_refresh.d.ts | 10 - .../composite_slo/composite_slo_update.d.ts | 56 - .../src/rest_specs/routes/create.d.ts | 642 ------- .../src/rest_specs/routes/delete.d.ts | 7 - .../rest_specs/routes/delete_instance.d.ts | 15 - .../routes/fetch_historical_summary.d.ts | 62 - .../src/rest_specs/routes/find.d.ts | 695 -------- .../rest_specs/routes/find_definition.d.ts | 1339 --------------- .../src/rest_specs/routes/find_group.d.ts | 64 - .../src/rest_specs/routes/find_instances.d.ts | 30 - .../src/rest_specs/routes/get.d.ts | 690 -------- .../src/rest_specs/routes/get_burn_rates.d.ts | 25 - .../rest_specs/routes/get_grouped_stats.d.ts | 46 - .../rest_specs/routes/get_preview_data.d.ts | 653 ------- .../src/rest_specs/routes/get_slo_health.d.ts | 38 - .../routes/get_slo_stats_overview.d.ts | 21 - .../rest_specs/routes/get_suggestions.d.ts | 11 - .../src/rest_specs/routes/health_scan.d.ts | 80 - .../src/rest_specs/routes/index.d.ts | 34 - .../src/rest_specs/routes/manage.d.ts | 9 - .../rest_specs/routes/purge_instances.d.ts | 31 - .../src/rest_specs/routes/put_settings.d.ts | 28 - .../src/rest_specs/routes/repair.d.ts | 22 - .../src/rest_specs/routes/reset.d.ts | 649 ------- .../routes/search_slo_definitions.d.ts | 25 - .../src/rest_specs/routes/slo_templates.d.ts | 28 - .../src/rest_specs/routes/update.d.ts | 1278 -------------- .../kbn-slo-schema/src/rest_specs/slo.d.ts | 674 -------- .../kbn-slo-schema/src/schema/common.d.ts | 69 - .../src/schema/composite_slo.d.ts | 136 -- .../schema/composite_slo_summary_index.d.ts | 35 - .../kbn-slo-schema/src/schema/duration.d.ts | 4 - .../kbn-slo-schema/src/schema/health.d.ts | 17 - .../kbn-slo-schema/src/schema/index.d.ts | 10 - .../kbn-slo-schema/src/schema/indicators.d.ts | 1518 ----------------- .../kbn-slo-schema/src/schema/settings.d.ts | 19 - .../shared/kbn-slo-schema/src/schema/slo.d.ts | 1313 -------------- .../src/schema/slo_template.d.ts | 633 ------- .../src/schema/time_window.d.ts | 20 - .../index.d.ts | 1 - .../src/uiam_api_key_provisioning_status.d.ts | 9 - .../response-ops/scheduling-types/index.d.ts | 1 - .../scheduling-types/schedule_types.d.ts | 55 - .../security/plugin_types_common/index.d.ts | 6 - .../src/api_keys/api_key.d.ts | 106 -- .../src/authentication/index.d.ts | 1 - .../authorization/features_privileges.d.ts | 3 - .../src/authorization/index.d.ts | 3 - .../authorization/raw_kibana_privileges.d.ts | 11 - .../src/authorization/role.d.ts | 60 - .../src/licensing/index.d.ts | 2 - .../src/licensing/license.d.ts | 12 - .../src/licensing/license_features.d.ts | 69 - .../plugin_types_common/src/roles/index.d.ts | 13 - .../src/user_profile/index.d.ts | 1 - .../security/plugin_types_server/index.d.ts | 10 - .../src/audit/audit_service.d.ts | 29 - .../plugin_types_server/src/audit/index.d.ts | 2 - .../src/authentication/api_keys/api_keys.d.ts | 129 -- .../src/authentication/api_keys/index.d.ts | 1 - .../authentication_service.d.ts | 10 - .../authentication/client_authentication.d.ts | 16 - .../src/authentication/index.d.ts | 4 - .../src/authorization/actions/actions.d.ts | 21 - .../src/authorization/actions/alerting.d.ts | 3 - .../src/authorization/actions/api.d.ts | 9 - .../src/authorization/actions/app.d.ts | 3 - .../src/authorization/actions/cases.d.ts | 3 - .../src/authorization/actions/index.d.ts | 8 - .../authorization/actions/saved_object.d.ts | 3 - .../src/authorization/actions/space.d.ts | 3 - .../src/authorization/actions/ui.d.ts | 4 - .../authorization/authorization_service.d.ts | 20 - .../src/authorization/check_privileges.d.ts | 123 -- .../check_privileges_dynamically.d.ts | 4 - .../check_saved_objects_privileges.d.ts | 4 - .../src/authorization/constants.d.ts | 1 - .../src/authorization/deprecations.d.ts | 13 - .../src/authorization/es_security_config.d.ts | 5 - .../src/authorization/index.d.ts | 10 - .../src/authorization/mode.d.ts | 4 - .../src/authorization/role_schema.d.ts | 62 - .../plugin_types_server/src/plugin.d.ts | 45 - .../src/user_profile/index.d.ts | 1 - .../common/config_schema.d.ts | 33 - .../shared/apm_sources_access/public/api.d.ts | 7 - .../apm_sources_access/public/index.d.ts | 6 - .../apm_sources_access/public/plugin.d.ts | 28 - .../public/register_services.d.ts | 34 - .../apm_sources_access/server/config.d.ts | 6 - .../apm_sources_access/server/constants.d.ts | 3 - .../apm_sources_access/server/index.d.ts | 9 - .../apm_sources_access/server/plugin.d.ts | 59 - .../server/routes/index.d.ts | 29 - .../server/routes/settings.d.ts | 19 - .../server/saved_objects/apm_indices.d.ts | 26 - .../update_apm_oss_index_paths.d.ts | 13 - .../shared/cloud/common/constants.d.ts | 10 - .../shared/cloud/common/decode_cloud_id.d.ts | 8 - .../shared/cloud/common/is_cloud_enabled.d.ts | 1 - ...rse_deployment_id_from_deployment_url.d.ts | 1 - .../parse_onboarding_default_solution.d.ts | 9 - ...cloud_deployment_id_analytics_context.d.ts | 16 - .../plugins/shared/cloud/common/types.d.ts | 30 - .../plugins/shared/cloud/common/utils.d.ts | 1 - .../plugins/shared/cloud/public/index.d.ts | 5 - .../plugins/shared/cloud/public/plugin.d.ts | 52 - .../plugins/shared/cloud/public/types.d.ts | 287 ---- .../plugins/shared/cloud/public/urls.d.ts | 25 - .../plugins/shared/cloud/public/utils.d.ts | 2 - .../shared/cloud/server/cloud_data/index.d.ts | 1 - .../server/cloud_data/persist_token.d.ts | 10 - .../collectors/cloud_usage_collector.d.ts | 28 - .../shared/cloud/server/collectors/index.d.ts | 1 - .../plugins/shared/cloud/server/config.d.ts | 44 - .../plugins/shared/cloud/server/env.d.ts | 1 - .../plugins/shared/cloud/server/index.d.ts | 5 - .../plugins/shared/cloud/server/plugin.d.ts | 206 --- .../shared/cloud/server/routes/constants.d.ts | 1 - .../server/routes/elasticsearch_route.d.ts | 7 - .../server/routes/get_cloud_data_route.d.ts | 2 - .../shared/cloud/server/routes/index.d.ts | 9 - .../server/routes/set_cloud_data_route.d.ts | 2 - .../shared/cloud/server/routes/types.d.ts | 5 - .../cloud/server/saved_objects/index.d.ts | 4 - .../common/has_license_info_changed.d.ts | 6 - .../shared/licensing/common/license.d.ts | 40 - .../licensing/common/license_update.d.ts | 6 - .../register_analytics_context_provider.d.ts | 4 - .../licensing/public/expired_banner.d.ts | 8 - .../shared/licensing/public/index.d.ts | 4 - .../shared/licensing/public/plugin.d.ts | 56 - .../services/feature_usage_service.d.ts | 31 - .../licensing/public/services/index.d.ts | 2 - .../shared/licensing/public/types.d.ts | 41 - .../shared/licensing/server/index.d.ts | 7 - .../licensing/server/license_fetcher.d.ts | 9 - .../licensing/server/licensing_config.d.ts | 9 - .../licensing_route_handler_context.d.ts | 10 - .../server/on_pre_response_handler.d.ts | 4 - .../shared/licensing/server/plugin.d.ts | 39 - .../licensing/server/plugin_status.d.ts | 4 - .../server/routes/feature_usage.d.ts | 4 - .../shared/licensing/server/routes/index.d.ts | 5 - .../shared/licensing/server/routes/info.d.ts | 2 - .../server/routes/internal/index.d.ts | 2 - .../routes/internal/notify_feature_usage.d.ts | 2 - .../routes/internal/register_feature.d.ts | 3 - .../services/feature_usage_service.d.ts | 33 - .../licensing/server/services/index.d.ts | 2 - .../shared/licensing/server/types.d.ts | 81 - .../server/wrap_route_with_license_check.d.ts | 11 - .../services/log_sources_service/types.d.ts | 8 - .../services/log_sources_service/utils.d.ts | 2 - .../shared/logs_data_access/common/types.d.ts | 1 - .../components/logs_sources_setting.d.ts | 8 - .../public/hooks/use_log_sources.d.ts | 21 - .../shared/logs_data_access/public/index.d.ts | 7 - .../logs_data_access/public/plugin.d.ts | 15 - .../services/log_data_service/index.d.ts | 2 - .../log_data_service/log_data_service.d.ts | 6 - .../services/log_data_service/types.d.ts | 9 - .../services/log_sources_service/index.d.ts | 3 - .../public/services/register_services.d.ts | 12 - .../shared/logs_data_access/public/types.d.ts | 6 - .../shared/serverless/public/index.d.ts | 3 - .../serverless/public/navigation/index.d.ts | 1 - .../public/navigation/nav_cards.d.ts | 3 - .../shared/serverless/public/plugin.d.ts | 8 - .../shared/serverless/public/types.d.ts | 17 - .../shared/task_manager/common/constants.d.ts | 4 - .../shared/task_manager/common/index.d.ts | 1 - .../api_key_strategy/api_key_strategy.d.ts | 27 - .../create_api_key_strategy.d.ts | 4 - .../es_and_uiam_api_key_strategy.d.ts | 16 - .../api_key_strategy/es_api_key_strategy.d.ts | 12 - .../server/api_key_strategy/index.d.ts | 5 - .../server/buffered_task_store.d.ts | 19 - .../shared/task_manager/server/config.d.ts | 95 -- .../shared/task_manager/server/constants.d.ts | 15 - .../shared/task_manager/server/index.d.ts | 21 - .../invalidate_api_keys_task.d.ts | 45 - .../invalidate_api_keys/lib/constants.d.ts | 1 - .../lib/get_api_key_ids_to_invalidate.d.ts | 27 - .../lib/get_find_filter.d.ts | 7 - .../server/invalidate_api_keys/lib/index.d.ts | 1 - .../lib/invalidate_api_keys.d.ts | 13 - .../invalidate_api_keys_and_delete_so.d.ts | 19 - .../lib/query_for_api_keys_in_use.d.ts | 10 - .../lib/run_invalidate.d.ts | 24 - .../delete_inactive_nodes_task.d.ts | 19 - .../kibana_discovery_service/index.d.ts | 1 - .../kibana_discovery_service.d.ts | 34 - .../server/lib/adhoc_task_counter.d.ts | 17 - .../server/lib/api_key_utils.d.ts | 23 - .../server/lib/assign_pod_partitions.d.ts | 14 - .../server/lib/bulk_operation_buffer.d.ts | 22 - .../server/lib/calculate_health_status.d.ts | 8 - .../server/lib/correct_deprecated_fields.d.ts | 3 - .../lib/create_managed_configuration.d.ts | 20 - .../server/lib/errors/bulk_update_error.d.ts | 14 - .../task_manager/server/lib/errors/index.d.ts | 3 - .../server/lib/errors/msearch_error.d.ts | 6 - .../errors/task_already_running_error.d.ts | 3 - .../server/lib/execution_context.d.ts | 16 - .../task_manager/server/lib/fill_pool.d.ts | 31 - .../server/lib/get_default_capacity.d.ts | 10 - .../lib/get_es_and_so_availability.d.ts | 9 - .../server/lib/get_execution_id.d.ts | 1 - .../server/lib/get_first_run_at.d.ts | 6 - .../server/lib/get_next_run_at.d.ts | 7 - .../task_manager/server/lib/get_retry_at.d.ts | 9 - .../server/lib/identify_es_error.d.ts | 29 - .../task_manager/server/lib/intervals.d.ts | 47 - .../server/lib/is_task_not_found_error.d.ts | 1 - .../server/lib/log_health_metrics.d.ts | 7 - .../task_manager/server/lib/middleware.d.ts | 20 - .../server/lib/millis_to_nanos.d.ts | 1 - .../server/lib/remove_if_exists.d.ts | 9 - .../task_manager/server/lib/result_type.d.ts | 23 - .../server/lib/retryable_bulk_update.d.ts | 15 - .../lib/runtime_statistics_aggregator.d.ts | 7 - .../server/lib/task_partitioner.d.ts | 25 - .../server/lib/wrapped_logger.d.ts | 7 - .../server/license_subscriber.d.ts | 10 - .../server/metrics/create_aggregator.d.ts | 17 - .../task_manager/server/metrics/index.d.ts | 15 - .../server/metrics/lib/counter.d.ts | 7 - .../metrics/lib/get_task_type_group.d.ts | 1 - .../server/metrics/lib/index.d.ts | 5 - .../metrics/lib/metric_counter_service.d.ts | 13 - .../server/metrics/lib/simple_histogram.d.ts | 21 - .../server/metrics/lib/unflatten_object.d.ts | 5 - .../server/metrics/metrics_stream.d.ts | 31 - .../task_claim_metrics_aggregator.d.ts | 26 - .../metrics/task_metrics_collector.d.ts | 32 - .../task_overdue_metrics_aggregator.d.ts | 28 - .../metrics/task_run_metrics_aggregator.d.ts | 53 - .../task_manager/server/metrics/types.d.ts | 7 - ...ackground_task_utilization_statistics.d.ts | 38 - .../monitoring/capacity_estimation.d.ts | 24 - .../monitoring/configuration_statistics.d.ts | 15 - .../task_manager/server/monitoring/index.d.ts | 21 - .../monitoring/monitoring_stats_stream.d.ts | 46 - .../monitoring/task_run_calculators.d.ts | 22 - .../monitoring/task_run_statistics.d.ts | 82 - .../monitoring/workload_statistics.d.ts | 202 --- .../shared/task_manager/server/plugin.d.ts | 79 - .../polling/delay_on_claim_conflicts.d.ts | 6 - .../task_manager/server/polling/index.d.ts | 2 - .../server/polling/task_poller.d.ts | 44 - .../server/polling_lifecycle.d.ts | 74 - ...ate_task_overdue_percentiles_for_type.d.ts | 6 - .../mark_available_tasks_as_claimed.d.ts | 31 - .../queries/oldest_idle_action_task.d.ts | 7 - .../server/queries/query_clauses.d.ts | 42 - .../server/queries/task_claiming.d.ts | 77 - .../mark_removed_tasks_as_unrecognized.d.ts | 18 - .../routes/background_task_utilization.d.ts | 26 - .../task_manager/server/routes/health.d.ts | 42 - .../task_manager/server/routes/index.d.ts | 3 - .../task_manager/server/routes/metrics.d.ts | 17 - .../server/saved_objects/index.d.ts | 6 - .../server/saved_objects/mappings.d.ts | 4 - .../server/saved_objects/migrations.d.ts | 2 - .../api_key_to_invalidate_model_versions.d.ts | 2 - .../background_task_node_model_versions.d.ts | 2 - .../saved_objects/model_versions/index.d.ts | 3 - .../model_versions/task_model_versions.d.ts | 2 - .../schemas/api_key_to_invalidate.d.ts | 11 - .../schemas/background_task_node.d.ts | 6 - .../saved_objects/schemas/rrule/index.d.ts | 3 - .../saved_objects/schemas/rrule/v1.d.ts | 69 - .../saved_objects/schemas/rrule/v2.d.ts | 111 -- .../saved_objects/schemas/rrule/v3.d.ts | 85 - .../server/saved_objects/schemas/task.d.ts | 895 ---------- .../shared/task_manager/server/task.d.ts | 414 ----- .../server/task_claimers/index.d.ts | 37 - .../task_claimers/lib/get_task_cost.d.ts | 3 - .../lib/task_selector_by_capacity.d.ts | 10 - .../server/task_claimers/strategy_mget.d.ts | 3 - .../strategy_update_by_query.d.ts | 2 - .../task_manager/server/task_events.d.ts | 70 - .../server/task_pool/cost_capacity.d.ts | 23 - .../task_manager/server/task_pool/index.d.ts | 2 - .../server/task_pool/task_pool.d.ts | 72 - .../task_manager/server/task_pool/types.d.ts | 16 - .../task_manager/server/task_pool/utils.d.ts | 2 - .../server/task_pool/worker_capacity.d.ts | 23 - .../server/task_running/errors.d.ts | 18 - .../server/task_running/index.d.ts | 2 - .../server/task_running/task_runner.d.ts | 219 --- .../task_manager/server/task_scheduling.d.ts | 88 - .../task_manager/server/task_store.d.ts | 251 --- .../server/task_type_dictionary.d.ts | 91 - .../task_manager/server/task_validator.d.ts | 28 - .../uiam_api_key_provisioning/constants.d.ts | 26 - .../event_based_telemetry.d.ts | 12 - .../uiam_api_key_provisioning/index.d.ts | 6 - .../lib/build_provisioning_run_telemetry.d.ts | 13 - ...ld_saved_object_bulk_updates_for_uiam.d.ts | 28 - .../lib/classify_task.d.ts | 30 - .../lib/create_provisioning_run_context.d.ts | 9 - .../create_uiam_provisioning_task_runner.d.ts | 27 - .../lib/deferred_non_running_tasks_query.d.ts | 16 - .../lib/error_utils.d.ts | 2 - ...fetch_first_batch_of_tasks_to_convert.d.ts | 19 - .../lib/get_exclude_tasks_filter.d.ts | 10 - ..._uiam_convert_response_to_key_results.d.ts | 7 - ...us_and_orphaned_keys_from_bulk_update.d.ts | 23 - ...iam_provisioning_observability_status.d.ts | 52 - ...m_provisioning_feature_flag_scheduler.d.ts | 16 - .../uiam_api_key_provisioning/task_state.d.ts | 24 - .../uiam_api_key_provisioning/types.d.ts | 95 -- .../uiam_api_key_provisioning_task.d.ts | 35 - ...keys_provisioning_status_saved_object.d.ts | 19 - .../task_manager/server/usage/index.d.ts | 1 - .../usage/task_manager_usage_collector.d.ts | 7 - .../task_manager/server/usage/types.d.ts | 13 - 2112 files changed, 55800 deletions(-) delete mode 100644 src/platform/packages/private/analytics/utils/analytics_collection_utils/index.d.ts delete mode 100644 src/platform/packages/private/analytics/utils/analytics_collection_utils/src/index.d.ts delete mode 100644 src/platform/packages/private/analytics/utils/analytics_collection_utils/src/is_synthetics_monitor.d.ts delete mode 100644 src/platform/packages/private/kbn-cps-common/index.d.ts delete mode 100644 src/platform/packages/private/kbn-cps-common/src/common/constants.d.ts delete mode 100644 src/platform/packages/private/kbn-cps-common/src/common/get_space_default_npre_name.d.ts delete mode 100644 src/platform/packages/private/kbn-panel-loader/index.d.ts delete mode 100644 src/platform/packages/private/kbn-saved-objects-settings/index.d.ts delete mode 100644 src/platform/packages/shared/content-management/favorites/favorites_common/index.d.ts delete mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/index.d.ts delete mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_registry.d.ts delete mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.d.ts delete mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_saved_object.d.ts delete mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_service.d.ts delete mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_usage_collection.d.ts delete mode 100644 src/platform/packages/shared/content-management/favorites/favorites_server/src/index.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/index.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/constants.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/disabled_footer.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/index.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/install_footer.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/remove_footer.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/footer/view_button.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/hooks/index.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/hooks/poll_sample_data_status.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/hooks/use_install.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/hooks/use_remove.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/mocks/index.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/sample_data_card.component.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/sample_data_card.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_card/src/services.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_tab/index.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_tab/src/constants.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_tab/src/demo_env_panel.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_tab/src/hooks/index.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_tab/src/hooks/use_list.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_tab/src/sample_data_cards.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_tab/src/sample_data_tab.d.ts delete mode 100644 src/platform/packages/shared/home/sample_data_tab/src/services.d.ts delete mode 100644 src/platform/packages/shared/kbn-apm-types-shared/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/enums/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/enums/processor_event.d.ts delete mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/correlations.d.ts delete mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/types/common.d.ts delete mode 100644 src/platform/packages/shared/kbn-apm-types-shared/src/types/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-content-management-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-content-management-utils/src/saved_object_content_storage.d.ts delete mode 100644 src/platform/packages/shared/kbn-content-management-utils/src/schema.d.ts delete mode 100644 src/platform/packages/shared/kbn-content-management-utils/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-content-management-utils/src/utils.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/cps_icon.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_list_item.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_picker.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_picker_container.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_picker_content.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/project_picker_settings.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/strings.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/use_cps_picker_access.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/use_fetch_projects.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/use_project_picker_tour.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/components/use_route_based_cps_picker_access.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-cps-utils/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-css-utils/public/full_screen_bg_css.d.ts delete mode 100644 src/platform/packages/shared/kbn-css-utils/public/use_memo_css.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service-server/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service-server/src/refresh_interval.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service-server/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service/src/constants.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service/src/es_query/get_es_query_config.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service/src/es_query/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service/src/search/tabify/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service/src/search/tabify/tabify_docs.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-service/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/constants.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/utils/create_regexp_pattern_from.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/utils/get_data_view_field_or_create.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-utils/src/utils/test_pattern_against_allowed_list.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-validation/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-validation/src/constants.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-validation/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-data-view-validation/src/validation.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/app_menu_registry.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/degraded_docs_control.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/stacktrace_control.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/error_callout.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/constants.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/apm_context_service.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/errors/errors_context_service.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/log_level_badge.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/constants.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/logs_context_service.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/apache_error_logs.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/default_logs.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/kubernetes_container_logs.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_all_logs_data_view_spec.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_resource_fields.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_fields.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_coalesed_value.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/traces_context_service.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/field_constants.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/hooks/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/hooks/use_pager.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/build_data_record.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/calc_field_counts.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/contains_index_pattern.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/convert_value_to_string.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/dismiss_flyouts.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_doc_id.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_esql_data_view.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value_with_fallback.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_flattened_fields.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_ignored_reason.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_document_overview.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_event_type_field_with_fallback.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_exception_type_field_with_fallback.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_field_with_fallback.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_level_field_with_fallback.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_message_field_with_fallbacks.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_should_show_field_handler.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_stack_trace_fields.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_trace_document_overview.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/get_visible_columns.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/is_esql_saved_search.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/local_storage_utils.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/nested_fields.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/prepare_data_view_for_editing.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_default_sort.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_es_query_sort.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort_for_search_source.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-discover-utils/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_guards.d.ts delete mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_ingestion_path.d.ts delete mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_names.d.ts delete mode 100644 src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_sdk_name_and_language.d.ts delete mode 100644 src/platform/packages/shared/kbn-encrypted-saved-objects-shared/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-encrypted-saved-objects-shared/src/encrypted_saved_objects_client_types.d.ts delete mode 100644 src/platform/packages/shared/kbn-es-types/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-es-types/src/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-es-types/src/search.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/constants.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_limit.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_metrics_info.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_stats_by.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_where.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/utils.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/build_rename_source_field_map.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/columns.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/datasets.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/extensions.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/inference.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/lookup_indices.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/policies.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/sources.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/timeseries_indices.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/utils/cache.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/views.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/utils.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/convert_filters_to_esql.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/convert_query_to_esql.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/esql_fields_utils.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/extract_categorize_tokens.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_adhoc_dataview.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_controls.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_time_field_from_query.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_with_safe_limit.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_index_pattern_from_query.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_initial_esql_query.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_lookup_indices.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/get_query_summary.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/inject_where_after_source.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/query_cannot_be_sampled.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/replace_index_pattern.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/sanitaze_input.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/set_instructions_helpers.d.ts delete mode 100644 src/platform/packages/shared/kbn-esql-utils/src/utils/sha256.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/arg.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/ast.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/compare.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/from_expression.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/patch.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/safe_element_from_expression.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/to_expression.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/cast.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/fn.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/get_by_alias.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/get_type.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/parse.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/lib/registry.d.ts delete mode 100644 src/platform/packages/shared/kbn-interpreter/src/common/registries.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/array_to_string_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/date_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/datemath_string_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/decode_or_throw.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/deep_exact_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/in_range_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/index_pattern_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/is_greater_or_equal/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_secs_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/json_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/literal_value_from_undefined_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/merge_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/non_empty_string_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/parseable_types/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/route_validation/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/strict_keys_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/time_key_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/to_boolean_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/to_json_schema/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-io-ts-utils/src/to_number_rt/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-management/autoops_promotion_callout/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-management/autoops_promotion_callout/src/callout.d.ts delete mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/src/cards_navigation.d.ts delete mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/src/consts.d.ts delete mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/src/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-management/cards_navigation/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-management/settings/setting_ids/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning-utils/lib/validate_version.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_schemas.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_versioning.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/content_management_types.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/object_transform.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-object-versioning/lib/utils.d.ts delete mode 100644 src/platform/packages/shared/kbn-react-query/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-resizable-layout/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-resizable-layout/src/panels_resizable.d.ts delete mode 100644 src/platform/packages/shared/kbn-resizable-layout/src/panels_static.d.ts delete mode 100644 src/platform/packages/shared/kbn-resizable-layout/src/resizable_layout.d.ts delete mode 100644 src/platform/packages/shared/kbn-resizable-layout/src/utils.d.ts delete mode 100644 src/platform/packages/shared/kbn-resizable-layout/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-rison/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-rison/kbn_rison.d.ts delete mode 100644 src/platform/packages/shared/kbn-rrule/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-rrule/rrule.d.ts delete mode 100644 src/platform/packages/shared/kbn-rrule/sanitize.d.ts delete mode 100644 src/platform/packages/shared/kbn-rrule/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-rrule/validate.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_constants.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_locator_params.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.d.ts delete mode 100644 src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-errors/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-errors/src/create_es_error.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-errors/src/es_error.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-errors/src/painless_error.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-errors/src/render_search_error.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-errors/src/tsdb_error.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-errors/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge_popover_content.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/callout.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/empty_prompt.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/i18n_utils.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/view_details_popover.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/extract_warnings.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/handle_warnings.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/has_unsupported_downsampled_aggregation_failure.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-response-warnings/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-types/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-types/src/es_search_types.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-types/src/kibana_search_types.d.ts delete mode 100644 src/platform/packages/shared/kbn-search-types/src/types.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository-utils/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository-utils/src/format_request.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository-utils/src/parse_endpoint.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository-utils/src/typings.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/create_server_route_factory.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/decode_request_params.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/make_zod_validation_object.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/register_routes.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/strip_nullish_request_parameters.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/validate_and_decode_params.d.ts delete mode 100644 src/platform/packages/shared/kbn-server-route-repository/src/validation_objects.d.ts delete mode 100644 src/platform/packages/shared/kbn-sse-utils-server/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-sse-utils-server/src/observable_into_event_source_stream.d.ts delete mode 100644 src/platform/packages/shared/kbn-sse-utils-server/src/supertest_to_observable.d.ts delete mode 100644 src/platform/packages/shared/kbn-ui-actions-browser/src/types/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-ui-actions-browser/src/types/presentable.d.ts delete mode 100644 src/platform/packages/shared/kbn-use-tracked-promise/index.d.ts delete mode 100644 src/platform/packages/shared/kbn-use-tracked-promise/use_tracked_promise.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/constants.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/index.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_override_hover_actions.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_panel.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_section.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_focus_panel.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/child_state.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/children_unsaved_changes.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/initialize_state_api.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/last_saved_child_state.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_capabilities.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_management.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/performance_trackers.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/presentation_container.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/publishes_settings.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/applies_filters.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/bwc/time_range_transforms.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch_context.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_pause_fetch.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_project_routing.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/time_range_manager.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_read_only_capabilities.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_serializable_state.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/bwc/titles_transforms.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_description.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_hide_border.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_title.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/title_manager.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/index.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_comparators.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_diff_logger.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_manager.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/state_manager/types.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/utils/snake_case.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_publishing/utils/types.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_util/index.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_util/src/focus_helpers.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_util/src/loading_flyout.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_util/src/open_lazy_flyout.d.ts delete mode 100644 src/platform/packages/shared/presentation/presentation_util/src/tracks_overlays.d.ts delete mode 100644 src/platform/packages/shared/react/kibana_mount/index.d.ts delete mode 100644 src/platform/packages/shared/react/kibana_mount/mount_point_portal.d.ts delete mode 100644 src/platform/packages/shared/react/kibana_mount/to_mount_point.d.ts delete mode 100644 src/platform/packages/shared/react/kibana_mount/utils.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/avatar/solution/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/avatar/solution/src/solution_avatar.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/avatar/solution/src/types.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/src/elastic_agent_card_illustration.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.component.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/card/no_data/impl/src/services.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/card/no_data/types/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/code_editor.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/editor.styles.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/components/rebroadcast_mouse_down_events.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_context_menu_utils.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_copy.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fit_content.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fullscreen.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_placeholder.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/mods/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/editor.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/languages/supported.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/utils/placeholder_widget.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/code_editor/impl/utils/remeasure_fonts.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/link/redirect_app/impl/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/deprecated_redirect_app_links.component.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/modal/tabbed/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/modal/tabbed/src/context/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/modal/tabbed/src/tabbed_modal.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/impl/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/services.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/kibana_template/types/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data/impl/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data/impl/src/action_card.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data/impl/src/no_data_page.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data/impl/src/services.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data/types/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/impl/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/constants.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/no_data_config_page.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/services.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/no_data_config/types/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/src/collapse_button.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/src/solution_nav.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.styles.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/prompt/not_found/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/prompt/not_found/src/not_found_prompt.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/table_persist/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/constants.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/index.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/storage.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/table_persist_hoc.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/types.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/use_table_persist.d.ts delete mode 100644 src/platform/packages/shared/shared-ux/table_persist/src/validate_persist_data.d.ts delete mode 100644 src/platform/plugins/private/url_forwarding/public/forward_app/forward_app.d.ts delete mode 100644 src/platform/plugins/private/url_forwarding/public/forward_app/index.d.ts delete mode 100644 src/platform/plugins/private/url_forwarding/public/forward_app/navigate_to_legacy_kibana_url.d.ts delete mode 100644 src/platform/plugins/private/url_forwarding/public/forward_app/normalize_path.d.ts delete mode 100644 src/platform/plugins/private/url_forwarding/public/index.d.ts delete mode 100644 src/platform/plugins/private/url_forwarding/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/constants.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/bulk_get.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/common.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/constants.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/create.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/delete.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/get.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/msearch.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/rpc.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/search.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/types.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/rpc/update.d.ts delete mode 100644 src/platform/plugins/shared/content_management/common/schemas.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/content_client/content_client.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/content_client/content_client_context.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/content_client/content_client_mutation_hooks.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/content_client/content_client_query_hooks.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/content_client/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/content_client/query_observable.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/crud_client/crud_client.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/crud_client/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/registry/content_type.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/registry/content_type_definition.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/registry/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/registry/registry.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/rpc_client/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/rpc_client/rpc_client.d.ts delete mode 100644 src/platform/plugins/shared/content_management/public/types.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/content_client/content_client.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/content_client/content_client_factory.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/content_client/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/content_client/types.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/content_type.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/core.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/crud.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/event_bus.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/event_types.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/msearch.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/registry.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/core/types.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/plugin.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/all_procedures.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/bulk_get.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/create.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/delete.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/get.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/msearch.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/search.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/procedures/update.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/routes/error_wrapper.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/routes/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/routes/routes.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/rpc_service.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/rpc/types.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/types.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/utils/index.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/utils/services_transforms_factory.d.ts delete mode 100644 src/platform/plugins/shared/content_management/server/utils/utils.d.ts delete mode 100644 src/platform/plugins/shared/cps/public/index.d.ts delete mode 100644 src/platform/plugins/shared/cps/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/cps/public/services/async_services.d.ts delete mode 100644 src/platform/plugins/shared/cps/public/services/cps_manager.d.ts delete mode 100644 src/platform/plugins/shared/cps/public/services/project_fetcher.d.ts delete mode 100644 src/platform/plugins/shared/cps/public/types.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/common/index.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/common/language_integrations.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/server/custom_integration_registry.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/server/external_integration/index.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/server/index.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/server/language_clients/index.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/server/plugin.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/server/routes/define_routes.d.ts delete mode 100644 src/platform/plugins/shared/custom_integrations/server/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/constants.d.ts delete mode 100644 src/platform/plugins/shared/data/common/datatable_utilities/datatable_utilities_service.d.ts delete mode 100644 src/platform/plugins/shared/data/common/datatable_utilities/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/es_query/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/exports/constants.d.ts delete mode 100644 src/platform/plugins/shared/data/common/exports/escape_value.d.ts delete mode 100644 src/platform/plugins/shared/data/common/exports/export_csv.d.ts delete mode 100644 src/platform/plugins/shared/data/common/exports/formula_checks.d.ts delete mode 100644 src/platform/plugins/shared/data/common/exports/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/kbn_field_types/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/kbn_field_types/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/filters/persistable_state.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/is_query.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/persistable_state.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/query_state.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast_with_validation.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/timefilter/get_time.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/timefilter/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/timefilter/is_time_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/timefilter/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/query/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_config.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_configs.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_groups.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_params.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_type.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/agg_types_registry.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/aggs_service.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/_interval_options.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_order_helper.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_other_bucket_helper.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_type.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_histogram.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/filters.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/histogram.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_prefix.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/multi_terms.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/terms.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/date_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/date_range_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/filter_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/filters.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/filters_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/histogram.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/histogram_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/cidr_mask.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/date_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/histogram_calculate_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_prefix.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/migrate_include_exclude_format.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/multi_field_key.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/range_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/range_key.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/sampler.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/sampler_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/terms.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/terms_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/time_series.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/buckets/time_series_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/avg.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/avg_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/count.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/count_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/derivative.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/derivative_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/create_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/get_response_agg_config_class.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/make_nested_label.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/nested_agg_helpers.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/ordinal_suffix.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_writer.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_writer.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/max.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/max_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/median.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/median_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_type.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/min.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/min_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_get_value.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/rate.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/rate_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/sum.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/sum_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/value_count.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/metrics/value_count_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/agg.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/base.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/field.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/json.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/optioned.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/param_types/string.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/calculate_auto_time_expression.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_interval_format_error.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_multiple.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_interval.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/get_aggs_formats.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/infer_time_zone.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/ip_address.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/parse_time_shift.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/prop_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/sampler.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/aggs/utils/time_splits.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/aggregate_query_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/cidr.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/cidr_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/date_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/date_range_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/eql.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/eql_raw_response.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/es_raw_response.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/esaggs/esaggs_fn.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/esaggs/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/esaggs/request_handler.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/esdsl.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/esql.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/essql.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/exists_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/extended_bounds.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/extended_bounds_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/field.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/filters_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/geo_point.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/geo_point_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/ip_prefix.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/ip_prefix_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/ip_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/ip_range_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/kibana.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/kibana_context.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/kibana_context_type.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/kibana_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/kql.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/lucene.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/numerical_range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/numerical_range_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/phrase_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/query_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/query_filter_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/query_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/range.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/range_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/remove_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/select_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/timerange.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/timerange_to_ast.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/utils/filters_adapter.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/utils/function_wrapper.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/utils/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/expressions/utils/requests_side_effects.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/poll_search.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/create_search_source.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/extract_references.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/fetch/get_search_params.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/fetch/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/fetch/request_error.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/fetch/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/inject_references.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/inspect/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/inspect/inspector_stats.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/migrate_legacy_query.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/normalize_sort_request.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/parse_json.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/query_to_fields.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/search_source.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/search_source_service.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/search_source/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/session/ebt_utils.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/session/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/session/status.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/session/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/eql_search/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/eql_search/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/es_search/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/es_search/response_utils.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/es_search/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/ese_search/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/ese_search/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/esql_search/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/esql_search/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/sql_search/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/strategies/sql_search/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/tabify/buckets.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/tabify/get_columns.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/tabify/index.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/tabify/response_writer.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/tabify/tabify.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/tabify/types.d.ts delete mode 100644 src/platform/plugins/shared/data/common/search/utils.d.ts delete mode 100644 src/platform/plugins/shared/data/common/serializable_field.d.ts delete mode 100644 src/platform/plugins/shared/data/common/serialize_utils.d.ts delete mode 100644 src/platform/plugins/shared/data/common/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/actions/filters/create_filters_from_multi_value_click.d.ts delete mode 100644 src/platform/plugins/shared/data/public/actions/filters/create_filters_from_range_select.d.ts delete mode 100644 src/platform/plugins/shared/data/public/actions/filters/create_filters_from_value_click.d.ts delete mode 100644 src/platform/plugins/shared/data/public/actions/filters/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/actions/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/actions/multi_value_click_action.d.ts delete mode 100644 src/platform/plugins/shared/data/public/actions/select_range_action.d.ts delete mode 100644 src/platform/plugins/shared/data/public/actions/value_click_action.d.ts delete mode 100644 src/platform/plugins/shared/data/public/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/now_provider/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.d.ts delete mode 100644 src/platform/plugins/shared/data/public/now_provider/lib/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/now_provider/now_provider.d.ts delete mode 100644 src/platform/plugins/shared/data/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/filter_manager.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_filters.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_mapping_chain.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/get_display_value.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/get_index_pattern_from_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/map_and_flatten_filters.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/map_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_combined.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_default.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_exists.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_match_all.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrase.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_query_string.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_spatial_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/filter_manager/lib/sort_filters.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/lib/add_to_query_log.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/lib/get_default_query.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/lib/get_query_log.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/lib/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/persisted_log/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/persisted_log/persisted_log.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/query_service.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/query_state.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/query_string/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/query_string/query_string_manager.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/saved_query/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/saved_query/saved_query_service.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/saved_query/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/state_sync/connect_to_query_state.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/state_sync/create_query_state_observable.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/state_sync/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/state_sync/sync_state_with_url.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/state_sync/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/lib/auto_refresh_loop.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/lib/diff_time_picker_vals.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/lib/page_visibility.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/lib/validate_timerange.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/time_history.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/timefilter.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/timefilter_service.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/query/timefilter/use_timefilter.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/aggs/aggs_service.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/aggs/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/aggs/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/collectors/create_usage_collector.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/collectors/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/collectors/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/constants.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/expressions/eql.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/expressions/esaggs.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/expressions/esdsl.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/expressions/esql.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/expressions/essql.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/expressions/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/create_request_hash.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/search_abort_controller.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/search_response_cache.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/search_session_incomplete_warning.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/timeout_error.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_interceptor/to_partial_response.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/search_service.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/background_search_notifier.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/constants.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/ebt_manager/constants.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/ebt_manager/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager_registrations.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/get_session_redirect_url.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/i18n.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/in_progress_session.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/lib/session_name_formatter.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/search_session_state.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/session_helpers.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/session_service.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_client.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/render.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/inspect_flyout.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/main.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/status.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/delete_button.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/extend_button.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/get_action.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/inspect_button.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/popover_actions.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/actions.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/app_id.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/get_columns.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/name.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/status.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/table.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_actions.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_app_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_status_filter.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/map_to_ui_session.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/constants.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/flyout.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_columns.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_flyout.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/date_string.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/get_expiration_status.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/session/sessions_mgmt/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/search/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/services.d.ts delete mode 100644 src/platform/plugins/shared/data/public/types.d.ts delete mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.d.ts delete mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table_selector.d.ts delete mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view.d.ts delete mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view_wrapper.d.ts delete mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/components/download_options.d.ts delete mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/index.d.ts delete mode 100644 src/platform/plugins/shared/data/public/utils/table_inspector_view/types.d.ts delete mode 100644 src/platform/plugins/shared/data/server/config.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/constants.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/content_management/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/content_management/v1/constants.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/content_management/v1/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/content_management/v1/types.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/data_view.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/data_view_lazy.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/data_view_lazy_util.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/data_views.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/flatten_hit.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/meta_units_to_formatter.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/persistable_state.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/data_views/utils.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/errors/data_view_saved_object_conflict.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/errors/duplicate_index_pattern.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/errors/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/errors/insufficient_access.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/expressions/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/expressions/load_index_pattern.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/fields/data_view_field.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/fields/field_list.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/fields/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/fields/utils.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/lib/errors.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/lib/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/types.d.ts delete mode 100644 src/platform/plugins/shared/data_views/common/utils.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/content_management_wrapper.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/data_views/data_views_api_client.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/data_views/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/data_views/sha256.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/data_views_service_public.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/debounce_by_key.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/expressions/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/expressions/load_index_pattern.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/services/get_indices.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/services/has_data.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/services/index.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/types.d.ts delete mode 100644 src/platform/plugins/shared/data_views/public/ui_settings_wrapper.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/ast/build_expression.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/ast/build_function.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/ast/format.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/ast/format_expression.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/ast/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/ast/parse.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/ast/parse_expression.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/ast/types.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/execution/container.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/execution/execution.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/execution/execution_contract.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/execution/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/execution/types.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/executor/container.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/executor/executor.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/executor/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/arguments.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/expression_function.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/expression_function_parameter.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/series_calculation_helpers.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/clog.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/create_table.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum_fn.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative_fn.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/font.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/map_column.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/math.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/math_column.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/math_fn.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average_fn.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric_fn.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/theme.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/ui_setting.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/var.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/specs/var_set.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_functions/types.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer_registry.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_renderers/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_renderers/types.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/expression_type.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/get_type.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/serialize_provider.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/boolean.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/error.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/filter.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/image.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/null.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/num.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/number.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/pointseries.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/range.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/render.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/shape.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/string.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/style.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/specs/ui_setting.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/types.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/expression_types/unbox_expression_value.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/fonts.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/service/expressions_fork.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/service/expressions_services.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/service/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/types/common.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/types/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/types/registry.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/types/style.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/util/create_default_inspector_adapters.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/util/create_error.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/util/expressions_inspector_adapter.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/util/get_by_alias.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/util/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/util/tables_adapter.d.ts delete mode 100644 src/platform/plugins/shared/expressions/common/util/test_utils.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/expression_functions/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/expression_functions/ui_setting.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/loader.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/react_expression_renderer.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/use_debounced_value.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer/use_shallow_memo.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/react_expression_renderer_wrapper.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/render.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/render_error_handler.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/services/expressions_services.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/services/index.d.ts delete mode 100644 src/platform/plugins/shared/expressions/public/types/index.d.ts delete mode 100644 src/platform/plugins/shared/home/common/constants.d.ts delete mode 100644 src/platform/plugins/shared/home/common/instruction_variant.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/application.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/add_data/add_data.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/add_data/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/app_navigation_handler.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/home.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/home_app.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/manage_data/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/manage_data/manage_data.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/move_data/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/move_data/move_data.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/sample_data/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/callout_skeleton.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/setup_cloud_connect.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/solutions_section/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/solutions_section/solution_panel.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/solutions_section/solutions_section.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/synopsis.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/content.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/footer.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/instruction.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/instruction_set.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/introduction.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/status_check_states.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial/tutorial.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/tutorial_directory.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/components/welcome.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/kibana_services.d.ts delete mode 100644 src/platform/plugins/shared/home/public/application/load_tutorials.d.ts delete mode 100644 src/platform/plugins/shared/home/public/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/add_data/add_data_service.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/add_data/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/environment/environment.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/environment/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/feature_catalogue/feature_catalogue_registry.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/feature_catalogue/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/tutorials/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/tutorials/tutorial_service.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/tutorials/types.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/welcome/index.d.ts delete mode 100644 src/platform/plugins/shared/home/public/services/welcome/welcome_service.d.ts delete mode 100644 src/platform/plugins/shared/home/server/capabilities_provider.d.ts delete mode 100644 src/platform/plugins/shared/home/server/config.d.ts delete mode 100644 src/platform/plugins/shared/home/server/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/plugin.d.ts delete mode 100644 src/platform/plugins/shared/home/server/routes/fetch_es_hits_status.d.ts delete mode 100644 src/platform/plugins/shared/home/server/routes/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/saved_objects/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/saved_objects/sample_data_telemetry.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/field_mappings.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/saved_objects.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/field_mappings.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/saved_objects.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/field_mappings.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/saved_objects.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/field_mappings.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/saved_objects.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/errors.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/create_index_name.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/find_sample_objects.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/insert_data_into_index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/load_data.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/register_with_integrations.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_schema.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/translate_timestamp.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/lib/utils.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/install.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/list.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/uninstall.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/routes/utils.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/sample_data_installer.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/sample_data_registry.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/usage/collector.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/usage/collector_fetch.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/usage/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/sample_data/usage/usage.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/tutorials/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/tutorials/lib/tutorials_registry_types.d.ts delete mode 100644 src/platform/plugins/shared/home/server/services/tutorials/tutorials_registry.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/activemq_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/activemq_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/aerospike_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/apache_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/apache_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/auditbeat/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/auditd_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/aws_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/aws_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/azure_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/azure_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/barracuda_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/bluecoat_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/cef_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/ceph_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/checkpoint_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/cisco_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/cockroachdb_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/consul_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/coredns_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/coredns_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/couchbase_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/couchdb_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/crowdstrike_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/cylance_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/docker_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/dropwizard_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/elasticsearch_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/elasticsearch_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/envoyproxy_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/envoyproxy_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/etcd_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/f5_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/fortinet_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/gcp_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/gcp_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/golang_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/gsuite_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/haproxy_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/haproxy_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/ibmmq_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/ibmmq_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/icinga_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/iis_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/iis_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/imperva_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/infoblox_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/auditbeat_instructions.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/cloud_instructions.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/filebeat_instructions.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/get_space_id_for_beats_tutorial.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/heartbeat_instructions.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/metricbeat_instructions.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/onprem_cloud_instructions.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/instructions/winlogbeat_instructions.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/iptables_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/juniper_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/kafka_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/kafka_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/kibana_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/kibana_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/kubernetes_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/logstash_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/logstash_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/memcached_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/microsoft_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/misp_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/mongodb_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/mongodb_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/mssql_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/mssql_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/munin_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/mysql_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/mysql_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/nats_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/nats_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/netflow_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/netscout_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/nginx_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/nginx_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/o365_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/okta_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/openmetrics_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/oracle_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/osquery_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/panw_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/php_fpm_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/postgresql_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/postgresql_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/prometheus_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/rabbitmq_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/rabbitmq_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/radware_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/redis_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/redis_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/redisenterprise_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/register.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/santa_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/sonicwall_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/sophos_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/stan_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/statsd_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/suricata_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/system_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/system_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/tomcat_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/traefik_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/traefik_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/uptime_monitors/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/uwsgi_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/vsphere_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/windows_event_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/windows_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/zeek_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/zookeeper_metrics/index.d.ts delete mode 100644 src/platform/plugins/shared/home/server/tutorials/zscaler_logs/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/common/adapters/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/move_request_params_to_top_level.d.ts delete mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/request_adapter.d.ts delete mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/request_responder.d.ts delete mode 100644 src/platform/plugins/shared/inspector/common/adapters/request/types.d.ts delete mode 100644 src/platform/plugins/shared/inspector/common/adapters/types.d.ts delete mode 100644 src/platform/plugins/shared/inspector/common/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/adapters/has_inspector_adapters.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/async_services.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/types.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/ui/inspector_panel.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/ui/inspector_view_chooser.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/view_registry.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/cluster_health.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/clusters_health.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/gradient.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/cluster_view.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/open_shard_failure_flyout_button.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_details.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_flyout.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shards_view.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_view.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/find_clusters.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/local_cluster.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/index.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_code_viewer.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request_content.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_response.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_stats.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/details/types.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/disambiguate_request_names.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/get_next_tab.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/request_details.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/request_selector.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/requests_view.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/components/types.d.ts delete mode 100644 src/platform/plugins/shared/inspector/public/views/requests/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/context/context.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/context/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/context/types.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/dark_mode/use_dark_mode.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/markdown/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/markdown/markdown.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/markdown/markdownStyles.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/markdown/markdown_simple.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/overlays/create_react_overlays.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/overlays/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/overlays/types.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/action_cards.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/no_data_card.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page_body/no_data_page_body.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/solution_nav_avatar.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/react_router_navigate/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/react_router_navigate/react_router_navigate.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/theme.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/ui_settings/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/ui_settings/use_ui_setting.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/url_template_editor/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/url_template_editor/url_template_editor.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/use_execution_context/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/use_execution_context/use_execution_context.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/util/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/validated_range/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/validated_range/is_range_valid.d.ts delete mode 100644 src/platform/plugins/shared/kibana_react/public/validated_range/validated_dual_range.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/abort_utils.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/calculate_object_hash.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/create_getter_setter.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/defer.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/distinct_until_changed_with_initial_value.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/errors/errors.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/errors/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/errors/types.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/field_wildcard.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/now.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/of.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/persistable_state/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/persistable_state/merge_migration_function_map.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/persistable_state/migrate_to_latest.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/persistable_state/types.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container_react_helpers.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_containers/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_containers/types.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/encode_state.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/format.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/parse.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/set_state_to_kbn_url.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/state_management/state_hash.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/url/encode_uri_query.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/url/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/common/url/validate_url.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/core/create_start_service_getter.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/core/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/history/get_query_params.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/history/history_observable.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/history/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/history/redirect_when_missing.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/history/remove_query_param.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/render_complete/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/render_complete/render_complete_dispatcher.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/resize_checker/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/encode_decode_state.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/state_hash.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/errors.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/hash_unhash_url.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_storage.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/url/url_tracker.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_management/utils/diff_object.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/types.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/state_sync/types.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/hashed_item_store.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/storage.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/storage/types.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/theme/index.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/theme/kibana_theme_provider.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/ui/configurable.d.ts delete mode 100644 src/platform/plugins/shared/kibana_utils/public/ui/index.d.ts delete mode 100644 src/platform/plugins/shared/management/common/contants.d.ts delete mode 100644 src/platform/plugins/shared/management/common/locator.d.ts delete mode 100644 src/platform/plugins/shared/management/public/application.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/landing/classic_empty_prompt.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/landing/index.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/landing/landing.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/landing/solution_empty_prompt.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/management_app/index.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/management_app/management_app.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/management_app/management_context.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/management_app/management_router.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/management_app_wrapper/index.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/management_app_wrapper/management_app_wrapper.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/management_sections.d.ts delete mode 100644 src/platform/plugins/shared/management/public/components/management_sidebar_nav/management_sidebar_nav.d.ts delete mode 100644 src/platform/plugins/shared/management/public/index.d.ts delete mode 100644 src/platform/plugins/shared/management/public/management_sections_service.d.ts delete mode 100644 src/platform/plugins/shared/management/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/management/public/types.d.ts delete mode 100644 src/platform/plugins/shared/management/public/utils/breadcrumbs.d.ts delete mode 100644 src/platform/plugins/shared/management/public/utils/index.d.ts delete mode 100644 src/platform/plugins/shared/management/public/utils/management_app.d.ts delete mode 100644 src/platform/plugins/shared/management/public/utils/management_item.d.ts delete mode 100644 src/platform/plugins/shared/management/public/utils/management_section.d.ts delete mode 100644 src/platform/plugins/shared/screenshot_mode/common/constants.d.ts delete mode 100644 src/platform/plugins/shared/screenshot_mode/common/context.d.ts delete mode 100644 src/platform/plugins/shared/screenshot_mode/common/index.d.ts delete mode 100644 src/platform/plugins/shared/screenshot_mode/common/mode.d.ts delete mode 100644 src/platform/plugins/shared/screenshot_mode/public/index.d.ts delete mode 100644 src/platform/plugins/shared/screenshot_mode/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/screenshot_mode/public/types.d.ts delete mode 100644 src/platform/plugins/shared/share/common/anonymous_access/index.d.ts delete mode 100644 src/platform/plugins/shared/share/common/anonymous_access/types.d.ts delete mode 100644 src/platform/plugins/shared/share/common/constants.d.ts delete mode 100644 src/platform/plugins/shared/share/common/index.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/index.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/index.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/legacy_short_url_locator.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/locator.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/locator_client.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/format_search_params.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/index.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/parse_search_params.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/space_url_parser.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/redirect/types.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/short_url_assert_valid.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/short_url_redirect_locator.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/types.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/locators/use_locator_url.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/short_urls/index.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/short_urls/types.d.ts delete mode 100644 src/platform/plugins/shared/share/common/url_service/url_service.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/common/draft_mode_callout/draft_mode_callout.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/common/draft_mode_callout/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/context/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/export_integrations/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/share_tabs.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/tabs/embed/embed_content.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/tabs/embed/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/tabs/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/tabs/link/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/tabs/link/link_content.d.ts delete mode 100644 src/platform/plugins/shared/share/public/components/tabs/link/time_type_section.d.ts delete mode 100644 src/platform/plugins/shared/share/public/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/lib/download_as.d.ts delete mode 100644 src/platform/plugins/shared/share/public/lib/get_home_href.d.ts delete mode 100644 src/platform/plugins/shared/share/public/lib/registrations.d.ts delete mode 100644 src/platform/plugins/shared/share/public/lib/time_utils.d.ts delete mode 100644 src/platform/plugins/shared/share/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/share/public/services/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/services/share_menu_manager.d.ts delete mode 100644 src/platform/plugins/shared/share/public/services/share_menu_registry.d.ts delete mode 100644 src/platform/plugins/shared/share/public/types.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/components/empty_prompt.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/components/page.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/components/spinner.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/index.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/redirect_manager.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/redirect/render.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client.d.ts delete mode 100644 src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client_factory.d.ts delete mode 100644 src/platform/plugins/shared/share/server/config.d.ts delete mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/constants.d.ts delete mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/index.d.ts delete mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/register_delete_unused_urls_route.d.ts delete mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/register_unused_urls_task_routes.d.ts delete mode 100644 src/platform/plugins/shared/share/server/unused_urls_task/task.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/common/trigger_ids.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/actions/action.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/actions/action_internal.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/actions/create_action.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/actions/incompatible_action_error.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/actions/index.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/context_menu/build_eui_context_menu_panels.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/context_menu/index.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/context_menu/open_context_menu.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/index.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/service/index.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/service/ui_actions_service.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/services.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/triggers.d.ts delete mode 100644 src/platform/plugins/shared/ui_actions/public/types.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/application_usage.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/constants.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/stats/core_metrics.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/stats/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/stats/latest.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/stats/v1.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/ui_counters/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/ui_counters/latest.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/ui_counters/v1.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/usage_counters/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/usage_counters/latest.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/common/types/usage_counters/v1.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/components/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/components/track_application_view/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view_component.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/components/track_application_view/types.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/plugin.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/services/application_usage.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/services/create_reporter.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/public/services/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector_set.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector_stats/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector_stats/schema.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/collector_stats/usage_collector_stats_collector.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/measure_duration.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/types.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/collector/usage_collector.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/config.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/plugin.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/report/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/report/schema.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/report/store_application_usage.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/report/store_ui_report.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/routes/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/routes/stats/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/routes/stats/stats.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/routes/ui_counters.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/common/kuery_utils.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/constants.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/register_rollups.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/rollups.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/saved_objects.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/search/index.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/search/search.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/types.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counter.d.ts delete mode 100644 src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counters_service.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/index.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/alert_instance.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/lifecycle_state.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/rule_task_instance.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/index.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/lib/index.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/index.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/migration.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/schema.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/index.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/migration.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/schema.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/index.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/migration.d.ts delete mode 100644 x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/schema.d.ts delete mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/index.d.ts delete mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/constants.d.ts delete mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/home_sections.d.ts delete mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/index_templates.d.ts delete mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/extensions_service.d.ts delete mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/index.d.ts delete mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/public_api_service.d.ts delete mode 100644 x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/es_fields.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/es_schemas_raw.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/es_schemas_ui.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/agent_explorer.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/aggregation_type.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/annotations.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/anomaly_detector_type.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/apm_event.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/apm_ml_job.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/apm_telemetry.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/apm_timeseries.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/connections.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/container_type.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/coordinate.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/correlations.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/custom_dashboards.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/custom_link.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/data_source.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/diagnostics.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/document_type.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/downstream_dependencies.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/environment_filter_values.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/environment_rt.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/errors.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/apm.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/common.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/otel.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/apm_base_doc.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/error_raw.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/event_raw.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/cloud.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/container.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/event_outcome.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/faas.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/host.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/http.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/kubernetes.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/observer.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/status_code.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/page.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/process.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/server.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/service.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/span_links.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/stackframe.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/timestamp_us.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/url.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user_agent.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/metric_raw.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/span_raw.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/transaction_raw.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/apm_error.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/event.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/agent.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/metric.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/span.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/transaction.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/focused_trace_waterfall.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/full_trace_waterfall.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/ilm_types.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/instances.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/latency_aggregation_types.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution_chart_types.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/mobile_types.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/processor_event.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/rollup.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/serverless.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_anomalies.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_stats.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_timeseries.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_groups.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_health_status.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_inventory.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_map.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/service_map_diagnostic_types.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/span_links.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/storage_explorer_types.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/time_range_metadata.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/timeseries.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-apm-types/src/traces.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/constants.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_delete.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_purge_rollup.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_batch_get.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_create.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_delete.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_find.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_get.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_historical_summary.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_summary_refresh.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_update.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_instances.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_grouped_stats.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_stats_overview.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/health_scan.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/purge_instances.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/repair.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/search_slo_definitions.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/slo_templates.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo_summary_index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo_template.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/index.d.ts delete mode 100644 x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/src/uiam_api_key_provisioning_status.d.ts delete mode 100644 x-pack/platform/packages/shared/response-ops/scheduling-types/index.d.ts delete mode 100644 x-pack/platform/packages/shared/response-ops/scheduling-types/schedule_types.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/api_keys/api_key.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authentication/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/features_privileges.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/raw_kibana_privileges.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/role.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license_features.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/roles/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_common/src/user_profile/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/audit/audit_service.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/audit/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/api_keys.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/authentication_service.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/client_authentication.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/actions.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/alerting.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/api.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/app.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/cases.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/saved_object.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/space.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/ui.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/authorization_service.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges_dynamically.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_saved_objects_privileges.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/constants.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/deprecations.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/es_security_config.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/index.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/mode.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/role_schema.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/plugin.d.ts delete mode 100644 x-pack/platform/packages/shared/security/plugin_types_server/src/user_profile/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/common/config_schema.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/public/api.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/public/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/public/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/public/register_services.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/config.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/constants.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/routes/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/routes/settings.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/apm_indices.d.ts delete mode 100644 x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/migrations/update_apm_oss_index_paths.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/common/constants.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/common/decode_cloud_id.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/common/is_cloud_enabled.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/common/parse_deployment_id_from_deployment_url.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/common/parse_onboarding_default_solution.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/common/register_cloud_deployment_id_analytics_context.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/common/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/common/utils.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/public/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/public/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/public/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/public/urls.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/public/utils.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/cloud_data/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/collectors/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/config.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/env.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/constants.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/elasticsearch_route.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/set_cloud_data_route.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/routes/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/cloud/server/saved_objects/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/common/has_license_info_changed.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/common/license.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/common/license_update.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/common/register_analytics_context_provider.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/public/expired_banner.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/public/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/public/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/public/services/feature_usage_service.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/public/services/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/public/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/license_fetcher.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/licensing_config.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/licensing_route_handler_context.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/on_pre_response_handler.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/plugin_status.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/feature_usage.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/info.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/internal/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/internal/notify_feature_usage.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/routes/internal/register_feature.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/services/feature_usage_service.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/services/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/licensing/server/wrap_route_with_license_check.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/utils.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/common/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/components/logs_sources_setting.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/hooks/use_log_sources.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/log_data_service.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/log_sources_service/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/services/register_services.d.ts delete mode 100644 x-pack/platform/plugins/shared/logs_data_access/public/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/serverless/public/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/serverless/public/navigation/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/serverless/public/navigation/nav_cards.d.ts delete mode 100644 x-pack/platform/plugins/shared/serverless/public/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/serverless/public/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/common/constants.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/common/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/api_key_strategy.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/create_api_key_strategy.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_and_uiam_api_key_strategy.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_api_key_strategy.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/buffered_task_store.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/config.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/constants.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/invalidate_api_keys_task.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/constants.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_api_key_ids_to_invalidate.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_find_filter.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys_and_delete_so.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/query_for_api_keys_in_use.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/run_invalidate.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/delete_inactive_nodes_task.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/kibana_discovery_service.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/adhoc_task_counter.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/api_key_utils.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/assign_pod_partitions.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/bulk_operation_buffer.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/calculate_health_status.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/correct_deprecated_fields.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/create_managed_configuration.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/errors/bulk_update_error.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/errors/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/errors/msearch_error.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/errors/task_already_running_error.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/execution_context.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/fill_pool.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_default_capacity.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_es_and_so_availability.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_execution_id.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_first_run_at.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_next_run_at.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/get_retry_at.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/identify_es_error.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/intervals.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/is_task_not_found_error.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/log_health_metrics.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/middleware.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/millis_to_nanos.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/remove_if_exists.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/result_type.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/retryable_bulk_update.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/runtime_statistics_aggregator.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/task_partitioner.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/lib/wrapped_logger.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/license_subscriber.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/create_aggregator.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/counter.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/get_task_type_group.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/metric_counter_service.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/simple_histogram.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/lib/unflatten_object.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/metrics_stream.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/task_claim_metrics_aggregator.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/task_metrics_collector.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/task_overdue_metrics_aggregator.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/task_run_metrics_aggregator.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/metrics/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/background_task_utilization_statistics.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/configuration_statistics.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/monitoring_stats_stream.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_calculators.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_statistics.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/plugin.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/polling/delay_on_claim_conflicts.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/polling/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/polling/task_poller.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/polling_lifecycle.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/mark_available_tasks_as_claimed.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/oldest_idle_action_task.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/query_clauses.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/queries/task_claiming.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/removed_tasks/mark_removed_tasks_as_unrecognized.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/routes/background_task_utilization.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/routes/health.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/routes/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/routes/metrics.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/mappings.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/migrations.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/api_key_to_invalidate_model_versions.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/background_task_node_model_versions.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/task_model_versions.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/api_key_to_invalidate.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/background_task_node.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v1.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v2.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v3.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/task.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/get_task_cost.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/task_selector_by_capacity.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_update_by_query.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_events.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/task_pool.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/utils.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_running/errors.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_running/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_running/task_runner.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_scheduling.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_store.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_type_dictionary.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/task_validator.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/constants.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/event_based_telemetry.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_provisioning_run_telemetry.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_saved_object_bulk_updates_for_uiam.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/classify_task.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_provisioning_run_context.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_uiam_provisioning_task_runner.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/deferred_non_running_tasks_query.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/error_utils.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/fetch_first_batch_of_tasks_to_convert.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/get_exclude_tasks_filter.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/map_uiam_convert_response_to_key_results.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_status_and_orphaned_keys_from_bulk_update.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_uiam_provisioning_observability_status.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/uiam_provisioning_feature_flag_scheduler.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/task_state.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/types.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_key_provisioning_task.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_keys_provisioning_status_saved_object.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/usage/index.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/usage/task_manager_usage_collector.d.ts delete mode 100644 x-pack/platform/plugins/shared/task_manager/server/usage/types.d.ts diff --git a/src/platform/packages/private/analytics/utils/analytics_collection_utils/index.d.ts b/src/platform/packages/private/analytics/utils/analytics_collection_utils/index.d.ts deleted file mode 100644 index e9d59e694971e..0000000000000 --- a/src/platform/packages/private/analytics/utils/analytics_collection_utils/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { isSyntheticsMonitor } from './src'; diff --git a/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/index.d.ts b/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/index.d.ts deleted file mode 100644 index 2e4064a42e0d3..0000000000000 --- a/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { isSyntheticsMonitor } from './is_synthetics_monitor'; diff --git a/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/is_synthetics_monitor.d.ts b/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/is_synthetics_monitor.d.ts deleted file mode 100644 index 32399ae29577f..0000000000000 --- a/src/platform/packages/private/analytics/utils/analytics_collection_utils/src/is_synthetics_monitor.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Returns whether the current navigation is performed by a Synthetics monitor - * (and hence, telemetry should not be collected). - */ -export declare function isSyntheticsMonitor(): boolean; diff --git a/src/platform/packages/private/kbn-cps-common/index.d.ts b/src/platform/packages/private/kbn-cps-common/index.d.ts deleted file mode 100644 index 863930fc2bc0c..0000000000000 --- a/src/platform/packages/private/kbn-cps-common/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { PROJECT_ROUTING } from './src/common/constants'; -export type { ProjectRoutingValue } from './src/common/constants'; -export { getSpaceDefaultNpreName } from './src/common/get_space_default_npre_name'; diff --git a/src/platform/packages/private/kbn-cps-common/src/common/constants.d.ts b/src/platform/packages/private/kbn-cps-common/src/common/constants.d.ts deleted file mode 100644 index 8474de18e398a..0000000000000 --- a/src/platform/packages/private/kbn-cps-common/src/common/constants.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Project routing constants for Cross-project search - * These are stored as strings in saved objects to explicitly override parent values - */ -export declare const PROJECT_ROUTING: { - /** Search across all linked projects */ - readonly ALL: "_alias:*"; - /** Search only the origin project */ - readonly ORIGIN: "_alias:_origin"; -}; -export type ProjectRoutingValue = (typeof PROJECT_ROUTING)[keyof typeof PROJECT_ROUTING]; diff --git a/src/platform/packages/private/kbn-cps-common/src/common/get_space_default_npre_name.d.ts b/src/platform/packages/private/kbn-cps-common/src/common/get_space_default_npre_name.d.ts deleted file mode 100644 index 61c85740b91e6..0000000000000 --- a/src/platform/packages/private/kbn-cps-common/src/common/get_space_default_npre_name.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getSpaceDefaultNpreName(spaceId: string): string; diff --git a/src/platform/packages/private/kbn-panel-loader/index.d.ts b/src/platform/packages/private/kbn-panel-loader/index.d.ts deleted file mode 100644 index 1ffe0ab1f9003..0000000000000 --- a/src/platform/packages/private/kbn-panel-loader/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from 'react'; -export declare const PanelLoader: (props: { - showShadow?: boolean; - showBorder?: boolean; - dataTestSubj?: string; -}) => React.JSX.Element; diff --git a/src/platform/packages/private/kbn-saved-objects-settings/index.d.ts b/src/platform/packages/private/kbn-saved-objects-settings/index.d.ts deleted file mode 100644 index e6ca0edde5afb..0000000000000 --- a/src/platform/packages/private/kbn-saved-objects-settings/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const PER_PAGE_SETTING = "savedObjects:perPage"; -export declare const LISTING_LIMIT_SETTING = "savedObjects:listingLimit"; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_common/index.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_common/index.d.ts deleted file mode 100644 index 50d9cfa1b7f94..0000000000000 --- a/src/platform/packages/shared/content-management/favorites/favorites_common/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const FAVORITES_LIMIT = 100; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/index.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/index.d.ts deleted file mode 100644 index 29bc8c186a3d5..0000000000000 --- a/src/platform/packages/shared/content-management/favorites/favorites_server/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { registerFavorites, type GetFavoritesResponse, type FavoritesSetup, type AddFavoriteResponse, type RemoveFavoriteResponse, } from './src'; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_registry.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_registry.d.ts deleted file mode 100644 index d0274c3778a11..0000000000000 --- a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_registry.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ObjectType } from '@kbn/config-schema'; -interface FavoriteTypeConfig { - typeMetadataSchema?: ObjectType; -} -export type FavoritesRegistrySetup = Pick; -export declare class FavoritesRegistry { - private favoriteTypes; - registerFavoriteType(type: string, config?: FavoriteTypeConfig): void; - hasType(type: string): boolean; - validateMetadata(type: string, metadata?: object): void; -} -export {}; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.d.ts deleted file mode 100644 index a5cefa1d1981d..0000000000000 --- a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_routes.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { CoreSetup, Logger } from '@kbn/core/server'; -import type { FavoritesRegistry } from './favorites_registry'; -/** - * @public - * Response for get favorites API - */ -export interface GetFavoritesResponse { - favoriteIds: string[]; - favoriteMetadata?: Record; -} -export interface AddFavoriteResponse { - favoriteIds: string[]; -} -export interface RemoveFavoriteResponse { - favoriteIds: string[]; -} -export declare function registerFavoritesRoutes({ core, logger, favoritesRegistry, }: { - core: CoreSetup; - logger: Logger; - favoritesRegistry: FavoritesRegistry; -}): void; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_saved_object.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_saved_object.d.ts deleted file mode 100644 index 403fe867574fe..0000000000000 --- a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_saved_object.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SavedObjectsType } from '@kbn/core/server'; -export interface FavoritesSavedObjectAttributes { - userId: string; - type: string; - favoriteIds: string[]; - favoriteMetadata?: Record; -} -export declare const favoritesSavedObjectName = "favorites"; -export declare const favoritesSavedObjectType: SavedObjectsType; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_service.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_service.d.ts deleted file mode 100644 index 9adc304c6fe77..0000000000000 --- a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_service.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import type { Logger } from '@kbn/core/server'; -import type { FavoritesRegistry } from './favorites_registry'; -export interface FavoritesState { - favoriteIds: string[]; - favoriteMetadata?: Record; -} -export declare class FavoritesService { - private readonly type; - private readonly userId; - private readonly deps; - constructor(type: string, userId: string, deps: { - savedObjectClient: SavedObjectsClientContract; - logger: Logger; - favoritesRegistry: FavoritesRegistry; - }); - getFavorites(): Promise; - /** - * @throws {FavoritesLimitExceededError} - */ - addFavorite({ id, metadata, }: { - id: string; - metadata?: object; - }): Promise; - removeFavorite({ id }: { - id: string; - }): Promise; - private getFavoritesSavedObject; - private getFavoriteSavedObjectId; -} -export declare class FavoritesLimitExceededError extends Error { - constructor(); -} diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_usage_collection.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_usage_collection.d.ts deleted file mode 100644 index 5caed768e6c45..0000000000000 --- a/src/platform/packages/shared/content-management/favorites/favorites_server/src/favorites_usage_collection.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CoreSetup } from '@kbn/core-lifecycle-server'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -export declare function registerFavoritesUsageCollection({ core, usageCollection, }: { - core: CoreSetup; - usageCollection: UsageCollectionSetup; -}): void; diff --git a/src/platform/packages/shared/content-management/favorites/favorites_server/src/index.d.ts b/src/platform/packages/shared/content-management/favorites/favorites_server/src/index.d.ts deleted file mode 100644 index 8e3acbb930de6..0000000000000 --- a/src/platform/packages/shared/content-management/favorites/favorites_server/src/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { CoreSetup, Logger } from '@kbn/core/server'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import type { FavoritesRegistrySetup } from './favorites_registry'; -export type { GetFavoritesResponse, AddFavoriteResponse, RemoveFavoriteResponse, } from './favorites_routes'; -/** - * @public - * Setup contract for the favorites feature. - */ -export type FavoritesSetup = FavoritesRegistrySetup; -/** - * @public - * Registers the favorites feature enabling favorites saved object type and api routes. - * - * @param logger - * @param core - * @param usageCollection - */ -export declare function registerFavorites({ logger, core, usageCollection, }: { - core: CoreSetup; - logger: Logger; - usageCollection?: UsageCollectionSetup; -}): FavoritesSetup; diff --git a/src/platform/packages/shared/home/sample_data_card/index.d.ts b/src/platform/packages/shared/home/sample_data_card/index.d.ts deleted file mode 100644 index 4a929cb7d2b9c..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { SampleDataCard } from './src/sample_data_card'; -export type { Props as SampleDataCardProps } from './src/sample_data_card'; -export { SampleDataCardKibanaProvider, SampleDataCardProvider } from './src/services'; -export type { Services as SampleDataCardServices, KibanaDependencies as SampleDataCardKibanaDependencies, } from './src/services'; -export { getStoryArgTypes as getSampleDataCardStoryArgTypes, getStoryServices as getSampleDataCardStoryServices, getMockDataSet as getSampleDataCardMockDataSet, } from './src/mocks'; -export type { Params as SampleDataCardStorybookParams } from './src/mocks'; diff --git a/src/platform/packages/shared/home/sample_data_card/src/constants.d.ts b/src/platform/packages/shared/home/sample_data_card/src/constants.d.ts deleted file mode 100644 index 46a79012ab3c7..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/constants.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * DataSetStatusType for an installed data set. - * @see src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types - */ -export declare const INSTALLED_STATUS = "installed"; -/** - * DataSetStatusType for a data set that is not installed yet. - * @see src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types - */ -export declare const UNINSTALLED_STATUS = "not_installed"; -export declare const SAMPLE_DATA_API = "/api/sample_data"; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/disabled_footer.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/disabled_footer.d.ts deleted file mode 100644 index e171e4708adb0..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/footer/disabled_footer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -/** - * Props for the `DisabledFooter` component. - */ -export type Props = Pick; -/** - * A footer for the `SampleDataCard` displayed when an unknown error or status prevents a person - * from installing the Sample Data Set. - */ -export declare const DisabledFooter: ({ id, name, statusMsg }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/index.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/index.d.ts deleted file mode 100644 index 80e227be3542f..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/footer/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; -import type { SampleDataSet, InstalledStatus } from '@kbn/home-sample-data-types'; -/** - * Props for the `Footer` component. - */ -export interface Props { - /** The Sample Data Set and its status. */ - sampleDataSet: SampleDataSet; - /** The handler to invoke when an action is performed upon the Sample Data Set. */ - onAction: (id: string, status: InstalledStatus) => void; -} -/** - * Displays the appropriate Footer component based on the status of the Sample Data Set. - */ -export declare const Footer: ({ sampleDataSet, onAction }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/install_footer.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/install_footer.d.ts deleted file mode 100644 index 21119ee66884e..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/footer/install_footer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -import type { UseInstallParams } from '../hooks'; -/** - * Props for the `InstallFooter` component. - */ -export type Props = Pick & UseInstallParams; -/** - * A footer displayed when a Sample Data Set is not installed, allowing a person to install it. - */ -export declare const InstallFooter: (params: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/remove_footer.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/remove_footer.d.ts deleted file mode 100644 index be97c6edae8f0..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/footer/remove_footer.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -import type { UseRemoveParams } from '../hooks'; -import type { Props as ViewButtonProps } from './view_button'; -/** - * Props for the `RemoveFooter` component. - */ -export type Props = Pick & UseRemoveParams & ViewButtonProps; -/** - * A footer displayed when a Sample Data Set is installed, allowing a person to remove it or view - * saved objects associated with it in their related solutions. - */ -export declare const RemoveFooter: (props: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/footer/view_button.d.ts b/src/platform/packages/shared/home/sample_data_card/src/footer/view_button.d.ts deleted file mode 100644 index 4b2b22d5eeffd..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/footer/view_button.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -/** - * Props for the `ViewButton` component. - */ -export type Props = Pick; -/** - * A button displayed when a Sample Data Set is installed, allowing a person to view the overview dashboard, - * and, if included, a number of actions to navigate to other solutions. - */ -export declare const ViewButton: ({ id, name, overviewDashboard, appLinks }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/hooks/index.d.ts b/src/platform/packages/shared/home/sample_data_card/src/hooks/index.d.ts deleted file mode 100644 index 1aa0927980d5b..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/hooks/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { useInstall } from './use_install'; -export type { Params as UseInstallParams } from './use_install'; -export { useRemove } from './use_remove'; -export type { Params as UseRemoveParams } from './use_remove'; diff --git a/src/platform/packages/shared/home/sample_data_card/src/hooks/poll_sample_data_status.d.ts b/src/platform/packages/shared/home/sample_data_card/src/hooks/poll_sample_data_status.d.ts deleted file mode 100644 index c9211916d01b3..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/hooks/poll_sample_data_status.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -/** - * Options for polling sample data status after installation or removal. - */ -export interface PollOptions { - /** - * Maximum number of retry attempts (default: 10) - */ - maxAttempts?: number; - /** - * Initial delay before first check in milliseconds - */ - initialDelayMs?: number; - /** - * Minimum time between poll attempts in milliseconds - */ - minTimeout?: number; - /** - * Factor for exponential backoff (default: 1.5) - */ - factor?: number; - /** - * Callback for logging failed attempts - */ - onFailedAttempt?: (error: Error, attemptNumber: number) => void; -} -/** - * Poll the sample data list endpoint until the dataset shows as installed. - */ -export declare function pollForInstallation(id: string, fetchSampleDataSets: () => Promise, options?: PollOptions): Promise; -/** - * Poll the sample data list endpoint until the dataset shows as uninstalled. - */ -export declare function pollForRemoval(id: string, fetchSampleDataSets: () => Promise, options?: PollOptions): Promise; diff --git a/src/platform/packages/shared/home/sample_data_card/src/hooks/use_install.d.ts b/src/platform/packages/shared/home/sample_data_card/src/hooks/use_install.d.ts deleted file mode 100644 index 86378e388e621..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/hooks/use_install.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -/** - * Parameters for the `useInstall` React hook. - */ -export type Params = Pick & { - /** Handler to invoke when the Sample Data Set is successfully installed. */ - onInstall: (id: string) => void; -}; -/** - * A React hook that allows a component to install a sample data set, handling success and - * failure in the Kibana UI. It also provides a boolean that indicates if the data set is - * in the process of being installed. - * - * After installation, this hook polls the status endpoint until the data is confirmed - * as installed - */ -export declare const useInstall: ({ id, defaultIndex, name, onInstall, }: Params) => [() => void, boolean]; diff --git a/src/platform/packages/shared/home/sample_data_card/src/hooks/use_remove.d.ts b/src/platform/packages/shared/home/sample_data_card/src/hooks/use_remove.d.ts deleted file mode 100644 index 671da707f995d..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/hooks/use_remove.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -/** - * Parameters for the `useRemove` React hook. - */ -export type Params = Pick & { - /** Handler to invoke when the Sample Data Set is successfully removed. */ - onRemove: (id: string) => void; -}; -/** - * A React hook that allows a component to remove a sample data set, handling success and - * failure in the Kibana UI. It also provides a boolean that indicates if the data set is - * in the process of being removed. - * - * After removal, this hook polls the status endpoint until the data is confirmed - * as uninstalled - */ -export declare const useRemove: ({ id, defaultIndex, name, onRemove }: Params) => [() => void, boolean]; diff --git a/src/platform/packages/shared/home/sample_data_card/src/mocks/index.d.ts b/src/platform/packages/shared/home/sample_data_card/src/mocks/index.d.ts deleted file mode 100644 index edc89fc6f3cf1..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/mocks/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -import type { Services } from '../services'; -/** - * A set of e-commerce images for use in Storybook stories. - */ -export declare const ecommerceImages: { - previewImagePath: any; - darkPreviewImagePath: any; - iconPath: any; -}; -/** - * A mocked sample data set for use in Storybook stories. - */ -export declare const mockDataSet: SampleDataSet; -/** - * Customize the Sample Data Set mock. - */ -export declare const getMockDataSet: (params?: Partial) => { - appLinks: import("@kbn/home-sample-data-types").AppLink[]; - defaultIndex: string; - description: string; - id: string; - name: string; - overviewDashboard: string; - previewImagePath: string; - darkPreviewImagePath?: string; - iconPath?: string; - status?: import("@kbn/home-sample-data-types").InstalledStatus; - statusMsg?: string; -}; -/** - * Parameters drawn from the Storybook arguments collection that customize a component story. - */ -export type Params = Record, any>; -/** - * Returns Storybook-compatible service abstractions for the `SampleDataCard` Provider. - */ -export declare const getStoryServices: (params: Params) => Services; -/** - * Returns the Storybook arguments for `SampleDataCard`, for its stories and for - * consuming component stories. - */ -export declare const getStoryArgTypes: () => { - name: { - control: { - type: string; - }; - defaultValue: string; - }; - description: { - control: { - type: string; - }; - defaultValue: string; - }; - status: { - options: (string | undefined)[]; - control: { - type: string; - }; - defaultValue: import("@kbn/home-sample-data-types").InstalledStatus | undefined; - }; - includeAppLinks: { - control: string; - defaultValue: boolean; - }; - simulateErrors: { - control: string; - defaultValue: boolean; - }; -}; -/** - * Returns the Jest-compatible service abstractions for the `NoDataCard` Provider. - */ -export declare const getMockServices: (params?: Partial) => Services; diff --git a/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.component.d.ts b/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.component.d.ts deleted file mode 100644 index cf546aa7964bc..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.component.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import type { SampleDataSet, InstalledStatus } from '@kbn/home-sample-data-types'; -export interface Props { - /** A Sample Data Set to display. */ - sampleDataSet: SampleDataSet; - /** A resolved, themed image to display in the card. */ - imagePath: string; - /** A handler to invoke when the status of a Sample Data Set is changed. */ - onStatusChange: (id: string, status: InstalledStatus) => void; -} -/** - * A pure implementation of the `SampleDataCard` component that itself - * does not depend on any Kibana services. Still requires a - * `SampleDataCardProvider` for its dependencies to render and function. - */ -export declare const SampleDataCard: ({ sampleDataSet, imagePath: image, onStatusChange: onAction, }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.d.ts b/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.d.ts deleted file mode 100644 index f21cb8d5fa17a..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/sample_data_card.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -import type { Props as ComponentProps } from './sample_data_card.component'; -/** - * Props for the `SampleDataCard` component. - */ -export interface Props extends Pick { - /** A Sample Data Set to display. */ - sampleDataSet: SampleDataSet; -} -/** - * A card representing a Sample Data Set that can be installed. Uses Kibana services to - * display and install the data set. Requires a `SampleDataCardProvider` to render and - * function. - */ -export declare const SampleDataCard: ({ sampleDataSet, onStatusChange }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_card/src/services.d.ts b/src/platform/packages/shared/home/sample_data_card/src/services.d.ts deleted file mode 100644 index b92cc369716bc..0000000000000 --- a/src/platform/packages/shared/home/sample_data_card/src/services.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type { FC, PropsWithChildren, MouseEventHandler } from 'react'; -import type { EuiGlobalToastListToast as EuiToast } from '@elastic/eui'; -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -type NavigateToUrl = (url: string) => Promise | void; -type UnmountCallback = () => void; -type MountPoint = (element: T) => UnmountCallback; -type ValidNotifyString = string | MountPoint; -type NotifyInputFields = Pick> & { - title?: ValidNotifyString; - text?: ValidNotifyString; -}; -type NotifyInput = string | NotifyInputFields; -type NotifyFn = (notification: NotifyInput) => void; -/** - * A list of services that are consumed by this component. - */ -export interface Services { - addBasePath: (path: string) => string; - fetchSampleDataSets: () => Promise; - getAppNavigationHandler: (path: string) => MouseEventHandler; - installSampleDataSet: (id: string, defaultIndex: string) => Promise; - notifyError: NotifyFn; - notifySuccess: NotifyFn; - removeSampleDataSet: (id: string, defaultIndex: string) => Promise; -} -/** - * A Context Provider that provides services to the component and its dependencies. - */ -export declare const SampleDataCardProvider: FC>; -export interface KibanaDependencies { - coreStart: { - application: { - navigateToUrl: NavigateToUrl; - }; - http: { - basePath: { - prepend: (path: string) => string; - }; - delete: (path: string) => Promise; - get: (path: string) => Promise; - post: (path: string) => Promise; - }; - notifications: { - toasts: { - addDanger: NotifyFn; - addSuccess: NotifyFn; - }; - }; - uiSettings: { - get: (key: string, defaultOverride?: any) => any; - isDefault: (key: string) => boolean; - set: (key: string, value: any) => Promise; - }; - }; - dataViews: { - clearCache: () => void; - }; -} -/** - * Kibana-specific Provider that maps dependencies to services. - */ -export declare const SampleDataCardKibanaProvider: FC>; -/** - * React hook for accessing pre-wired services. - */ -export declare function useServices(): Services; -export {}; diff --git a/src/platform/packages/shared/home/sample_data_tab/index.d.ts b/src/platform/packages/shared/home/sample_data_tab/index.d.ts deleted file mode 100644 index 24030c2e86071..0000000000000 --- a/src/platform/packages/shared/home/sample_data_tab/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { SampleDataTab } from './src/sample_data_tab'; -export { SampleDataTabKibanaProvider, SampleDataTabProvider } from './src/services'; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/constants.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/constants.d.ts deleted file mode 100644 index 242c08647a4df..0000000000000 --- a/src/platform/packages/shared/home/sample_data_tab/src/constants.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export declare const URL_SAMPLE_DATA_API = "/api/sample_data"; -export declare const URL_DEMO_ENV = "https://ela.st/demo"; -/** - * Test Subject name for the Demo Environment button. - */ -export declare const DATA_TEST_SUBJ_DEMO_ENV_BUTTON = "goToDemoEnvButton"; -/** - * Test Subject name for the sample data accordion button. - */ -/** - * Test Subject name for the sample data accordion button. - */ -/** - * Metric name for counting number of clicks of the Demo Environment button. - */ -export declare const METRIC_CLICK_DEMO_ENV_BUTTON = "sample_data__demo_env_button"; -/** - * Metric name for counting number of clicks of the sample data accordion button. - */ diff --git a/src/platform/packages/shared/home/sample_data_tab/src/demo_env_panel.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/demo_env_panel.d.ts deleted file mode 100644 index 35d92fd1fe9b6..0000000000000 --- a/src/platform/packages/shared/home/sample_data_tab/src/demo_env_panel.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -export interface Props { - demoUrl: string; -} -export declare const DemoEnvironmentPanel: ({ demoUrl }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/hooks/index.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/hooks/index.d.ts deleted file mode 100644 index e0894854f7499..0000000000000 --- a/src/platform/packages/shared/home/sample_data_tab/src/hooks/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { useList } from './use_list'; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/hooks/use_list.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/hooks/use_list.d.ts deleted file mode 100644 index 1bb8750c01757..0000000000000 --- a/src/platform/packages/shared/home/sample_data_tab/src/hooks/use_list.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -/** - * A React hook that fetches a list of Sample Data Sets from Kibana, as well as failure - * indicators in the Kibana UI. It also provides a boolean that indicates if the list is - * currently being fetched, as well as a method to refresh the list on demand. - */ -export declare const useList: () => [SampleDataSet[], () => Promise, boolean]; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/sample_data_cards.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/sample_data_cards.d.ts deleted file mode 100644 index 05415f485b8f8..0000000000000 --- a/src/platform/packages/shared/home/sample_data_tab/src/sample_data_cards.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import type { EuiFlexGridProps } from '@elastic/eui'; -/** - * Props for the `SampleDataCards` component. - */ -export interface Props { - /** Number of columns, defaults to 3. */ - columns?: EuiFlexGridProps['columns']; -} -/** - * Fetches and displays a collection of Sample Data Sets in a grid. - */ -export declare const SampleDataCards: ({ columns }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/sample_data_tab.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/sample_data_tab.d.ts deleted file mode 100644 index 78f6125bb094e..0000000000000 --- a/src/platform/packages/shared/home/sample_data_tab/src/sample_data_tab.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -/** - * The content for the Sample Data Tab in the `home` plugin. - */ -export declare const SampleDataTab: () => React.JSX.Element; diff --git a/src/platform/packages/shared/home/sample_data_tab/src/services.d.ts b/src/platform/packages/shared/home/sample_data_tab/src/services.d.ts deleted file mode 100644 index 3973b92e0de8f..0000000000000 --- a/src/platform/packages/shared/home/sample_data_tab/src/services.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import type { EuiGlobalToastListToast as EuiToast } from '@elastic/eui'; -import type { SampleDataSet } from '@kbn/home-sample-data-types'; -import type { SampleDataCardServices, SampleDataCardKibanaDependencies } from '@kbn/home-sample-data-card'; -type UnmountCallback = () => void; -type MountPoint = (element: T) => UnmountCallback; -type ValidNotifyString = string | MountPoint; -type NotifyInputFields = Pick> & { - title?: ValidNotifyString; - text?: ValidNotifyString; -}; -type NotifyInput = string | NotifyInputFields; -type NotifyFn = (notification: NotifyInput) => void; -interface Services { - fetchSampleDataSets: () => Promise; - notifyError: NotifyFn; - logClick: (metric: string) => void; -} -/** - * A list of services that are consumed by this component. - */ -export type SampleDataTabServices = Services & SampleDataCardServices; -/** - * A Context Provider that provides services to the component and its dependencies. - */ -export declare const SampleDataTabProvider: FC>; -interface KibanaDependencies { - coreStart: { - http: { - get: (path: string) => Promise; - }; - notifications: { - toasts: { - addDanger: NotifyFn; - }; - }; - }; - trackUiMetric: (type: string, eventNames: string | string[], count?: number) => void; -} -/** - * Services that are consumed by this component and its dependencies. - */ -export type SampleDataTabKibanaDependencies = KibanaDependencies & SampleDataCardKibanaDependencies; -/** - * Kibana-specific Provider that maps dependencies to services. - */ -export declare const SampleDataTabKibanaProvider: FC>; -/** - * React hook for accessing pre-wired services. - */ -export declare function useServices(): Services; -export {}; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/index.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/index.d.ts deleted file mode 100644 index eca6b09def5b7..0000000000000 --- a/src/platform/packages/shared/kbn-apm-types-shared/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './src/enums'; -export type * from './src/types'; -export type * from './src/interfaces'; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/enums/index.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/enums/index.d.ts deleted file mode 100644 index fc934e84244fc..0000000000000 --- a/src/platform/packages/shared/kbn-apm-types-shared/src/enums/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './processor_event'; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/enums/processor_event.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/enums/processor_event.d.ts deleted file mode 100644 index ea57681ddd04e..0000000000000 --- a/src/platform/packages/shared/kbn-apm-types-shared/src/enums/processor_event.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare enum ProcessorEvent { - transaction = "transaction", - error = "error", - metric = "metric", - span = "span" -} diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/correlations.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/correlations.d.ts deleted file mode 100644 index b36d6ce9c9bb5..0000000000000 --- a/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/correlations.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface HistogramItem { - key: number; - doc_count: number; -} diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/index.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/index.d.ts deleted file mode 100644 index 9800c79d2fd21..0000000000000 --- a/src/platform/packages/shared/kbn-apm-types-shared/src/interfaces/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './correlations'; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/types/common.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/types/common.d.ts deleted file mode 100644 index fc44aea9bfd8b..0000000000000 --- a/src/platform/packages/shared/kbn-apm-types-shared/src/types/common.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type Maybe = T | null | undefined; diff --git a/src/platform/packages/shared/kbn-apm-types-shared/src/types/index.d.ts b/src/platform/packages/shared/kbn-apm-types-shared/src/types/index.d.ts deleted file mode 100644 index 00f66a7e09881..0000000000000 --- a/src/platform/packages/shared/kbn-apm-types-shared/src/types/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './common'; diff --git a/src/platform/packages/shared/kbn-content-management-utils/index.d.ts b/src/platform/packages/shared/kbn-content-management-utils/index.d.ts deleted file mode 100644 index 5b64d38d3caa4..0000000000000 --- a/src/platform/packages/shared/kbn-content-management-utils/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type * from './src/types'; -export * from './src/schema'; -export * from './src/saved_object_content_storage'; -export * from './src/utils'; diff --git a/src/platform/packages/shared/kbn-content-management-utils/src/saved_object_content_storage.d.ts b/src/platform/packages/shared/kbn-content-management-utils/src/saved_object_content_storage.d.ts deleted file mode 100644 index 648bfa787f64b..0000000000000 --- a/src/platform/packages/shared/kbn-content-management-utils/src/saved_object_content_storage.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type { SearchQuery, SearchIn } from '@kbn/content-management-plugin/common'; -import type { ContentStorage, StorageContext, MSearchConfig } from '@kbn/content-management-plugin/server'; -import type { SavedObject, SavedObjectReference, SavedObjectsFindOptions, SavedObjectsCreateOptions, SavedObjectsUpdateOptions, SavedObjectsFindResult } from '@kbn/core-saved-objects-api-server'; -import type { Logger } from '@kbn/logging'; -import type { CMCrudTypes, ServicesDefinitionSet } from './types'; -export type PartialSavedObject = Omit>, 'references'> & { - references: SavedObjectReference[] | undefined; -}; -export interface SearchArgsToSOFindOptionsOptionsDefault { - fields?: string[]; - searchFields?: string[]; -} -export declare const searchArgsToSOFindOptionsDefault: (params: SearchIn) => SavedObjectsFindOptions; -export declare const createArgsToSoCreateOptionsDefault: (params: SavedObjectsCreateOptions) => SavedObjectsCreateOptions; -export declare const updateArgsToSoUpdateOptionsDefault: (params: SavedObjectsUpdateOptions) => SavedObjectsUpdateOptions; -export type CreateArgsToSoCreateOptions = (params: Types['CreateOptions']) => SavedObjectsCreateOptions; -export type SearchArgsToSOFindOptions = (params: Types['SearchIn']) => SavedObjectsFindOptions; -export type UpdateArgsToSoUpdateOptions = (params: Types['UpdateOptions']) => SavedObjectsUpdateOptions; -export interface SOContentStorageConstructorParams { - savedObjectType: string; - cmServicesDefinition: ServicesDefinitionSet; - allowedSavedObjectAttributes: Array; - createArgsToSoCreateOptions?: CreateArgsToSoCreateOptions; - updateArgsToSoUpdateOptions?: UpdateArgsToSoUpdateOptions; - searchArgsToSOFindOptions?: SearchArgsToSOFindOptions; - /** - * MSearch is a feature that allows searching across multiple content types - * (for example, could be used in a general content finder or the like) - * - * defaults to false - */ - enableMSearch?: boolean; - mSearchAdditionalSearchFields?: string[]; - logger: Logger; - throwOnResultValidationError: boolean; -} -export declare abstract class SOContentStorage implements ContentStorage> { - constructor({ savedObjectType, cmServicesDefinition, createArgsToSoCreateOptions, updateArgsToSoUpdateOptions, searchArgsToSOFindOptions, enableMSearch, allowedSavedObjectAttributes, mSearchAdditionalSearchFields, logger, throwOnResultValidationError, }: SOContentStorageConstructorParams); - protected static getSOClientFromRequest: (ctx: StorageContext) => Promise; - protected readonly throwOnResultValidationError: boolean; - protected readonly logger: Logger; - protected readonly savedObjectType: SOContentStorageConstructorParams['savedObjectType']; - protected readonly cmServicesDefinition: SOContentStorageConstructorParams['cmServicesDefinition']; - protected readonly createArgsToSoCreateOptions: CreateArgsToSoCreateOptions; - protected readonly updateArgsToSoUpdateOptions: UpdateArgsToSoUpdateOptions; - protected readonly searchArgsToSOFindOptions: SearchArgsToSOFindOptions; - protected readonly allowedSavedObjectAttributes: Array; - protected savedObjectToItem(savedObject: SavedObject): Types['Item']; - protected savedObjectToItem(savedObject: PartialSavedObject, partial: true): Types['PartialItem']; - mSearch?: { - savedObjectType: string; - toItemResult: (ctx: StorageContext, savedObject: SavedObjectsFindResult) => Types['Item']; - additionalSearchFields?: string[]; - }; - get(ctx: StorageContext, id: string): Promise; - bulkGet(): Promise; - create(ctx: StorageContext, data: Types['Attributes'], options: Types['CreateOptions']): Promise; - update(ctx: StorageContext, id: string, data: Types['Attributes'], options: Types['UpdateOptions']): Promise; - delete(ctx: StorageContext, id: string, options?: { - force: boolean; - }): Promise; - search(ctx: StorageContext, query: SearchQuery, options?: Types['SearchOptions']): Promise; -} diff --git a/src/platform/packages/shared/kbn-content-management-utils/src/schema.d.ts b/src/platform/packages/shared/kbn-content-management-utils/src/schema.d.ts deleted file mode 100644 index ec862f952bd3f..0000000000000 --- a/src/platform/packages/shared/kbn-content-management-utils/src/schema.d.ts +++ /dev/null @@ -1,265 +0,0 @@ -import type { ObjectType } from '@kbn/config-schema'; -export declare const apiError: ObjectType<{ - error: import("@kbn/config-schema").Type; - message: import("@kbn/config-schema").Type; - statusCode: import("@kbn/config-schema").Type; - metadata: ObjectType<{}>; -}>; -export declare const referenceSchema: ObjectType<{ - name: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - id: import("@kbn/config-schema").Type; -}>; -export declare const referencesSchema: import("@kbn/config-schema").Type[]>; -export declare const savedObjectSchema: >(attributesSchema: T) => ObjectType<{ - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; - updatedAt: import("@kbn/config-schema").Type; - createdBy: import("@kbn/config-schema").Type; - updatedBy: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - statusCode: number; - }> | undefined>; - attributes: T; - references: import("@kbn/config-schema").Type[]>; - namespaces: import("@kbn/config-schema").Type; - originId: import("@kbn/config-schema").Type; - managed: import("@kbn/config-schema").Type; -}>; -export declare const objectTypeToGetResultSchema: >(soSchema: T) => ObjectType<{ - item: T; - meta: ObjectType<{ - outcome: import("@kbn/config-schema").Type<"conflict" | "exactMatch" | "aliasMatch">; - aliasTargetId: import("@kbn/config-schema").Type; - aliasPurpose: import("@kbn/config-schema").Type<"savedObjectConversion" | "savedObjectImport" | undefined>; - }>; -}>; -export declare const createOptionsSchemas: { - id: import("@kbn/config-schema").Type; - references: import("@kbn/config-schema").Type[] | undefined>; - overwrite: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - refresh: import("@kbn/config-schema").Type; - initialNamespaces: import("@kbn/config-schema").Type; - managed: import("@kbn/config-schema").Type; -}; -export declare const schemaAndOr: import("@kbn/config-schema").Type<"AND" | "OR">; -export declare const searchOptionsSchemas: { - page: import("@kbn/config-schema").Type; - perPage: import("@kbn/config-schema").Type; - sortField: import("@kbn/config-schema").Type; - sortOrder: import("@kbn/config-schema").Type<"desc" | "asc" | undefined>; - fields: import("@kbn/config-schema").Type; - search: import("@kbn/config-schema").Type; - searchFields: import("@kbn/config-schema").Type; - rootSearchFields: import("@kbn/config-schema").Type; - hasReference: import("@kbn/config-schema").Type | Readonly<{} & { - id: string; - name: string; - type: string; - }>[] | undefined>; - hasReferenceOperator: import("@kbn/config-schema").Type<"AND" | "OR" | undefined>; - hasNoReference: import("@kbn/config-schema").Type | Readonly<{} & { - id: string; - name: string; - type: string; - }>[] | undefined>; - hasNoReferenceOperator: import("@kbn/config-schema").Type<"AND" | "OR" | undefined>; - defaultSearchOperator: import("@kbn/config-schema").Type<"AND" | "OR" | undefined>; - namespaces: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - filter: import("@kbn/config-schema").Type; - pit: import("@kbn/config-schema").Type | undefined>; -}; -export declare const updateOptionsSchema: { - references: import("@kbn/config-schema").Type[] | undefined>; - version: import("@kbn/config-schema").Type; - refresh: import("@kbn/config-schema").Type; - upsert: >(attributesSchema: T) => import("@kbn/config-schema").Type ? "attributes" : never) extends infer T_1 extends keyof { - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; - updatedAt: import("@kbn/config-schema").Type; - createdBy: import("@kbn/config-schema").Type; - updatedBy: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - statusCode: number; - }> | undefined>; - attributes: T; - references: import("@kbn/config-schema").Type[]>; - namespaces: import("@kbn/config-schema").Type; - originId: import("@kbn/config-schema").Type; - managed: import("@kbn/config-schema").Type; - } ? { [P in T_1]: { - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; - updatedAt: import("@kbn/config-schema").Type; - createdBy: import("@kbn/config-schema").Type; - updatedBy: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - statusCode: number; - }> | undefined>; - attributes: T; - references: import("@kbn/config-schema").Type[]>; - namespaces: import("@kbn/config-schema").Type; - originId: import("@kbn/config-schema").Type; - managed: import("@kbn/config-schema").Type; - }[P]; } : never)]?: import("@kbn/config-schema").TypeOf<{ - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; - updatedAt: import("@kbn/config-schema").Type; - createdBy: import("@kbn/config-schema").Type; - updatedBy: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - statusCode: number; - }> | undefined>; - attributes: T; - references: import("@kbn/config-schema").Type[]>; - namespaces: import("@kbn/config-schema").Type; - originId: import("@kbn/config-schema").Type; - managed: import("@kbn/config-schema").Type; - }[K]> | undefined; } & { [K_1 in keyof ("id" | "type" | "references" | (undefined extends import("@kbn/config-schema").TypeOf ? never : "attributes") extends infer T_2 extends keyof { - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; - updatedAt: import("@kbn/config-schema").Type; - createdBy: import("@kbn/config-schema").Type; - updatedBy: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - statusCode: number; - }> | undefined>; - attributes: T; - references: import("@kbn/config-schema").Type[]>; - namespaces: import("@kbn/config-schema").Type; - originId: import("@kbn/config-schema").Type; - managed: import("@kbn/config-schema").Type; - } ? { [P_1 in T_2]: { - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; - updatedAt: import("@kbn/config-schema").Type; - createdBy: import("@kbn/config-schema").Type; - updatedBy: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - statusCode: number; - }> | undefined>; - attributes: T; - references: import("@kbn/config-schema").Type[]>; - namespaces: import("@kbn/config-schema").Type; - originId: import("@kbn/config-schema").Type; - managed: import("@kbn/config-schema").Type; - }[P_1]; } : never)]: import("@kbn/config-schema").TypeOf<{ - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; - updatedAt: import("@kbn/config-schema").Type; - createdBy: import("@kbn/config-schema").Type; - updatedBy: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - statusCode: number; - }> | undefined>; - attributes: T; - references: import("@kbn/config-schema").Type[]>; - namespaces: import("@kbn/config-schema").Type; - originId: import("@kbn/config-schema").Type; - managed: import("@kbn/config-schema").Type; - }[K_1]>; }> | undefined>; - retryOnConflict: import("@kbn/config-schema").Type; - mergeAttributes: import("@kbn/config-schema").Type; -}; -export declare const createResultSchema: >(soSchema: T) => ObjectType<{ - item: T; -}>; -export declare const searchResultSchema: , M extends ObjectType = never>(soSchema: T, meta?: M) => ObjectType<{ - meta?: M | undefined; - hits: import("@kbn/config-schema").Type[]>; - pagination: ObjectType<{ - total: import("@kbn/config-schema").Type; - cursor: import("@kbn/config-schema").Type; - }>; -}>; diff --git a/src/platform/packages/shared/kbn-content-management-utils/src/types.d.ts b/src/platform/packages/shared/kbn-content-management-utils/src/types.d.ts deleted file mode 100644 index bed2ccb4802b8..0000000000000 --- a/src/platform/packages/shared/kbn-content-management-utils/src/types.d.ts +++ /dev/null @@ -1,316 +0,0 @@ -import type { GetIn, GetResult, CreateIn, CreateResult, SearchIn, SearchResult, UpdateIn, UpdateResult, DeleteIn, DeleteResult } from '@kbn/content-management-plugin/common'; -import type { ContentManagementServicesDefinition as ServicesDefinition, Version } from '@kbn/object-versioning'; -export interface ServicesDefinitionSet { - [version: Version]: ServicesDefinition; -} -import type { SortOrder, AggregationsAggregationContainer, SortResults } from '@elastic/elasticsearch/lib/api/types'; -import type { MutatingOperationRefreshSetting, SavedObjectsPitParams, SavedObjectsFindOptionsReference } from '@kbn/core-saved-objects-api-server'; -type KueryNode = any; -export interface Reference { - type: string; - id: string; - name: string; -} -/** Saved Object create options - Pick and Omit to customize */ -export interface SavedObjectCreateOptions { - /** (not recommended) Specify an id for the document */ - id?: string; - /** Overwrite existing documents (defaults to false) */ - overwrite?: boolean; - /** - * An opaque version number which changes on each successful write operation. - * Can be used in conjunction with `overwrite` for implementing optimistic concurrency control. - **/ - version?: string; - /** Array of referenced saved objects. */ - references?: Reference[]; - /** The Elasticsearch Refresh setting for this operation */ - refresh?: boolean; - /** - * Optional initial namespaces for the object to be created in. If this is defined, it will supersede the namespace ID that is in - * {@link SavedObjectsCreateOptions}. - * - * * For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, - * including the "All spaces" identifier (`'*'`). - * * For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only - * be used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed. - * * For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used. - */ - initialNamespaces?: string[]; - /** - * Whether the object is managed by the application. - */ - managed?: boolean; -} -/** Saved Object search options - Pick and Omit to customize */ -export interface SavedObjectSearchOptions { - /** the page of results to return */ - page?: number; - /** the number of objects per page */ - perPage?: number; - /** which field to sort by */ - sortField?: string; - /** sort order, ascending or descending */ - sortOrder?: SortOrder; - /** - * An array of fields to include in the results - * @example - * SavedObjects.find({type: 'dashboard', fields: ['attributes.name', 'attributes.location']}) - */ - fields?: string[]; - /** Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String `query` argument for more information */ - search?: string; - /** The fields to perform the parsed query against. See Elasticsearch Simple Query String `fields` argument for more information */ - searchFields?: string[]; - /** - * Use the sort values from the previous page to retrieve the next page of results. - */ - searchAfter?: SortResults; - /** - * The fields to perform the parsed query against. Unlike the `searchFields` argument, these are expected to be root fields and will not - * be modified. If used in conjunction with `searchFields`, both are concatenated together. - */ - rootSearchFields?: string[]; - /** - * Search for documents having a reference to the specified objects. - * Use `hasReferenceOperator` to specify the operator to use when searching for multiple references. - */ - hasReference?: SavedObjectsFindOptionsReference | SavedObjectsFindOptionsReference[]; - /** - * The operator to use when searching by multiple references using the `hasReference` option. Defaults to `OR` - */ - hasReferenceOperator?: 'AND' | 'OR'; - /** - * Search for documents *not* having a reference to the specified objects. - * Use `hasNoReferenceOperator` to specify the operator to use when searching for multiple references. - */ - hasNoReference?: SavedObjectsFindOptionsReference | SavedObjectsFindOptionsReference[]; - /** - * The operator to use when searching by multiple references using the `hasNoReference` option. Defaults to `OR` - */ - hasNoReferenceOperator?: 'AND' | 'OR'; - /** - * The search operator to use with the provided filter. Defaults to `OR` - */ - defaultSearchOperator?: 'AND' | 'OR'; - /** filter string for the search query */ - filter?: string | KueryNode; - /** - * A record of aggregations to perform. - * The API currently only supports a limited set of metrics and bucket aggregation types. - * Additional aggregation types can be contributed to Core. - * - * @example - * Aggregating on SO attribute field - * ```ts - * const aggs = { latest_version: { max: { field: 'dashboard.attributes.version' } } }; - * return client.find({ type: 'dashboard', aggs }) - * ``` - * - * @example - * Aggregating on SO root field - * ```ts - * const aggs = { latest_update: { max: { field: 'dashboard.updated_at' } } }; - * return client.find({ type: 'dashboard', aggs }) - * ``` - * - * @alpha - */ - aggs?: Record; - /** array of namespaces to search */ - namespaces?: string[]; - /** - * Search against a specific Point In Time (PIT) that you've opened with {@link SavedObjectsClient.openPointInTimeForType}. - */ - pit?: SavedObjectsPitParams; -} -/** Saved Object update options - Pick and Omit to customize */ -export interface SavedObjectUpdateOptions { - /** Array of referenced saved objects. */ - references?: Reference[]; - version?: string; - /** The Elasticsearch Refresh setting for this operation */ - refresh?: MutatingOperationRefreshSetting; - /** If specified, will be used to perform an upsert if the object doesn't exist */ - upsert?: Attributes; - /** - * The Elasticsearch `retry_on_conflict` setting for this operation. - * Defaults to `0` when `version` is provided, `3` otherwise. - */ - retryOnConflict?: number; - /** - * By default, update will merge the provided attributes with the ones present on the document - * (performing a standard partial update). Setting this option to `false` will change the behavior, performing - * a "full" update instead, where the provided attributes will fully replace the existing ones. - * Defaults to `true`. - */ - mergeAttributes?: boolean; -} -/** Return value for Saved Object get, T is item returned */ -export type GetResultSO = GetResult; -/** - * Saved object with metadata - */ -export interface SOWithMetadata { - id: string; - type: string; - version?: string; - createdAt?: string; - updatedAt?: string; - createdBy?: string; - updatedBy?: string; - error?: { - error: string; - message: string; - statusCode: number; - metadata?: Record; - }; - managed?: boolean; - attributes: Attributes; - references: Reference[]; - namespaces?: string[]; - originId?: string; -} -export type SOWithMetadataPartial = Omit, 'attributes' | 'references'> & { - attributes: Partial; - references: Reference[] | undefined; -}; -export interface CMCrudTypes { - /** - * Saved object attributes - */ - Attributes: object; - /** - * Complete saved object - */ - Item: SOWithMetadata; - /** - * Partial saved object, used as output for update - */ - PartialItem: SOWithMetadataPartial; - /** - * Get item params - */ - GetIn: GetIn; - /** - * Get item result - */ - GetOut: GetResultSO; - /** - * Create item params - */ - CreateIn: CreateIn; - /** - * Create item result - */ - CreateOut: CreateResult; - /** - * - */ - CreateOptions: object; - /** - * Search item params - */ - SearchIn: SearchIn; - /** - * Search item result - */ - SearchOut: SearchResult; - /** - * - */ - SearchOptions: object; - /** - * Update item params - */ - UpdateIn: UpdateIn; - /** - * Update item result - */ - UpdateOut: UpdateResult; - /** - * - */ - UpdateOptions: object; - /** - * Delete item params - */ - DeleteIn: DeleteIn; - /** - * Delete item result - */ - DeleteOut: DeleteResult; -} -/** - * Types used by content management storage - * @argument ContentType - content management type. assumed to be the same as saved object type - * @argument Attributes - attributes of the saved object - */ -export interface ContentManagementCrudTypes { - Attributes: Attributes; - /** - * Complete saved object - */ - Item: SOWithMetadata; - /** - * Partial saved object, used as output for update - */ - PartialItem: SOWithMetadataPartial; - /** - * Create options - */ - CreateOptions: CreateOptions; - /** - * Update options - */ - UpdateOptions: UpdateOptions; - /** - * Search options - */ - SearchOptions: SearchOptions; - /** - * Get item params - */ - GetIn: GetIn; - /** - * Get item result - */ - GetOut: GetResultSO>; - /** - * Create item params - */ - CreateIn: CreateIn; - /** - * Create item result - */ - CreateOut: CreateResult>; - /** - * Search item params - */ - SearchIn: SearchIn; - /** - * Search item result - */ - SearchOut: SearchResult>; - /** - * Update item params - */ - UpdateIn: UpdateIn, UpdateOptions>; - /** - * Update item result - */ - UpdateOut: UpdateResult>; - /** - * Delete item params - */ - DeleteIn: DeleteIn; - /** - * Delete item result - */ - DeleteOut: DeleteResult; -} -export {}; diff --git a/src/platform/packages/shared/kbn-content-management-utils/src/utils.d.ts b/src/platform/packages/shared/kbn-content-management-utils/src/utils.d.ts deleted file mode 100644 index 1e191db54711b..0000000000000 --- a/src/platform/packages/shared/kbn-content-management-utils/src/utils.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare const tagsToFindOptions: ({ included, excluded, }?: { - included?: string[]; - excluded?: string[]; -}) => { - hasReference: import("@kbn/core-saved-objects-api-server").SavedObjectsFindOptionsReference[] | undefined; - hasNoReference: import("@kbn/core-saved-objects-api-server").SavedObjectsFindOptionsReference[] | undefined; -}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/cps_icon.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/cps_icon.d.ts deleted file mode 100644 index 685b679624393..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/cps_icon.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import React from 'react'; -export declare const CPSIconDisabled: () => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_list_item.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_list_item.d.ts deleted file mode 100644 index 2e5f840b00053..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/project_list_item.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import type { CPSProject } from '../types'; -interface ProjectListItemProps { - project: CPSProject; - index: number; - isOriginProject?: boolean; -} -export declare const ProjectListItem: ({ project, index, isOriginProject }: ProjectListItemProps) => React.JSX.Element; -export {}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_picker.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_picker.d.ts deleted file mode 100644 index 42ec02ba771e5..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/project_picker.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import type { ProjectRouting } from '@kbn/es-query'; -import type { UseFetchProjectsResult } from './use_fetch_projects'; -export interface ProjectPickerProps { - projectRouting?: ProjectRouting; - onProjectRoutingChange: (projectRouting: ProjectRouting) => void; - projects: UseFetchProjectsResult; - totalProjectCount: number; - isReadonly?: boolean; - settingsComponent?: React.ReactNode; -} -export declare const ProjectPicker: ({ projectRouting, onProjectRoutingChange, projects, totalProjectCount, isReadonly, settingsComponent, }: ProjectPickerProps) => React.JSX.Element | null; -export declare const ProjectPickerSkeleton: () => React.JSX.Element; -export declare const DisabledProjectPicker: ({ totalProjectCount }: { - totalProjectCount: number; -}) => React.JSX.Element | null; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_container.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_container.d.ts deleted file mode 100644 index 770293dd3a6ad..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_container.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import type { ICPSManager } from '../types'; -interface ProjectPickerContainerProps { - cpsManager: ICPSManager; -} -/** - * Container component that connects ProjectPicker to CPSManager. - * Delegates to ActiveProjectPicker or DisabledProjectPicker based on access level, - * so the fetch hook only runs when the picker is actually active. - */ -export declare const ProjectPickerContainer: React.FC; -export {}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_content.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_content.d.ts deleted file mode 100644 index 26694305b0aa1..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_content.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import type { ProjectRouting } from '@kbn/es-query'; -import type { UseFetchProjectsResult } from './use_fetch_projects'; -export interface ProjectPickerContentProps { - projectRouting?: ProjectRouting; - onProjectRoutingChange: (projectRouting: ProjectRouting) => void; - projects: UseFetchProjectsResult; - isReadonly?: boolean; -} -export declare const ProjectPickerContent: ({ projectRouting, onProjectRoutingChange, projects, isReadonly, }: ProjectPickerContentProps) => React.JSX.Element | null; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_settings.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/project_picker_settings.d.ts deleted file mode 100644 index 2720151df3459..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/project_picker_settings.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -export interface ProjectPickerSettingsProps { - onResetToDefaults: () => void; -} -export declare const ProjectPickerSettings: ({ onResetToDefaults }: ProjectPickerSettingsProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/strings.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/strings.d.ts deleted file mode 100644 index 930bc4f99b606..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/strings.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export declare const strings: { - allButtonLabel: () => string; - getProjectPickerButtonAriaLabel: () => string; - getProjectPickerButtonLabel: (numberOfProjects: number, totalProjects: number) => string; - getProjectPickerPopoverTitle: () => string; - getManageCrossProjectSearchLabel: () => string; - getOriginProjectLabel: () => string; - getProjectPickerTourTitle: () => string; - getProjectPickerTourContent: () => string; - getProjectPickerTourCloseButton: () => string; - getProjectPickerDisabledTooltip: () => string; - getProjectPickerReadonlyCallout: () => string; - getProjectPickerReadonlyLensCallout: () => string; - getProjectPickerFetchError: () => string; -}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/use_cps_picker_access.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/use_cps_picker_access.d.ts deleted file mode 100644 index f23ddaa70c8b5..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/use_cps_picker_access.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { ICPSManager, CPSAppAccessResolver } from '../types'; -interface UseCpsPickerAccessParams { - /** The access resolver function - called to determine access for a given location */ - resolver: CPSAppAccessResolver; - /** Observable of the current app ID */ - currentAppId$: Observable; - /** The CPS manager instance (may be undefined if CPS is disabled) */ - cpsManager?: ICPSManager; -} -/** - * Registers a CPS picker access resolver for the current app. - * Automatically cleans up (sets DISABLED) on unmount. - * - * Consumers are responsible for providing their own resolver logic - * based on their routing patterns. - * - * NOTE: Call this hook only once per rendered page (at the top-level page component). - * Calling it in nested sub-routes or sub-components risks the cleanup of an inner instance - * overwriting the CPS state set by an outer one. - */ -export declare const useCpsPickerAccess: ({ resolver, currentAppId$, cpsManager, }: UseCpsPickerAccessParams) => void; -export {}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/use_fetch_projects.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/use_fetch_projects.d.ts deleted file mode 100644 index a1b9e3d45f7a9..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/use_fetch_projects.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ProjectRouting } from '@kbn/es-query'; -import type { CPSProject, ProjectsData } from '../types'; -export interface UseFetchProjectsResult { - originProject: CPSProject | null; - linkedProjects: CPSProject[]; - isLoading: boolean; - error: Error | null; -} -/** - * Hook for fetching projects data from CPSManager. - * Uses a single state object to batch all updates into one re-render per fetch cycle. - */ -export declare const useFetchProjects: (fetchProjects: (routing?: ProjectRouting) => Promise, routing?: ProjectRouting) => UseFetchProjectsResult; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/use_project_picker_tour.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/use_project_picker_tour.d.ts deleted file mode 100644 index 473e97f2e0ab4..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/use_project_picker_tour.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const useProjectPickerTour: () => { - isTourOpen: boolean; - closeTour: () => void; -}; diff --git a/src/platform/packages/shared/kbn-cps-utils/components/use_route_based_cps_picker_access.d.ts b/src/platform/packages/shared/kbn-cps-utils/components/use_route_based_cps_picker_access.d.ts deleted file mode 100644 index 8d35b1f6b76d8..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/components/use_route_based_cps_picker_access.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { ICPSManager } from '../types'; -import { ProjectRoutingAccess } from '../types'; -interface ApplicationService { - currentAppId$: Observable; -} -interface CpsService { - cpsManager?: ICPSManager; -} -export declare const useRouteBasedCpsPickerAccess: (access: ProjectRoutingAccess, { application, cps }: { - application: ApplicationService; - cps?: CpsService; -}) => void; -export {}; diff --git a/src/platform/packages/shared/kbn-cps-utils/index.d.ts b/src/platform/packages/shared/kbn-cps-utils/index.d.ts deleted file mode 100644 index 0536b2bed664b..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export type { ProjectPickerProps } from './components/project_picker'; -export type { ProjectPickerContentProps } from './components/project_picker_content'; -export type { UseFetchProjectsResult } from './components/use_fetch_projects'; -export type { CPSProject, ProjectTagsResponse, ICPSManager, ProjectsData, CPSAppAccessResolver, } from './types'; -export type { ProjectRoutingValue } from '@kbn/cps-common'; -export { ProjectPicker } from './components/project_picker'; -export { ProjectPickerContent } from './components/project_picker_content'; -export { ProjectPickerContainer } from './components/project_picker_container'; -export { useFetchProjects } from './components/use_fetch_projects'; -export { useCpsPickerAccess } from './components/use_cps_picker_access'; -export { useRouteBasedCpsPickerAccess } from './components/use_route_based_cps_picker_access'; -export { PROJECT_ROUTING } from '@kbn/cps-common'; -export { ProjectRoutingAccess } from './types'; diff --git a/src/platform/packages/shared/kbn-cps-utils/types.d.ts b/src/platform/packages/shared/kbn-cps-utils/types.d.ts deleted file mode 100644 index ef1d17b12b798..0000000000000 --- a/src/platform/packages/shared/kbn-cps-utils/types.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { ProjectRouting } from '@kbn/es-query'; -import type { Observable } from 'rxjs'; -/** - * Access levels for project routing picker - */ -export declare enum ProjectRoutingAccess { - /** Cannot interact with picker - picker is disabled */ - DISABLED = "disabled", - /** Can view but not edit - shows read-only message */ - READONLY = "readonly", - /** Full functionality - can change project scope */ - EDITABLE = "editable" -} -/** - * Function that determines the project picker access level for a given location. - * Apps register one of these via `registerAppAccess` to control picker behavior - * based on runtime conditions (feature flags, config values, route patterns, etc.). - */ -export type CPSAppAccessResolver = (location: string) => ProjectRoutingAccess; -export interface CPSProject { - _id: string; - _alias: string; - _type: string; - _organisation: string; - _csp?: string; - _region?: string; - [key: string]: string | undefined; -} -export interface ProjectTagsResponse { - origin: Record; - linked_projects: Record; -} -export interface ProjectsData { - origin: CPSProject | null; - linkedProjects: CPSProject[]; -} -export interface ICPSManager { - whenReady(): Promise; - fetchProjects(projectRouting?: ProjectRouting): Promise; - getTotalProjectCount(): number; - getProjectRouting$(): Observable; - setProjectRouting(projectRouting: ProjectRouting | undefined): void; - /** - * Returns an explicit override value when provided, regardless of picker access mode. - * Otherwise resolves routing based on current picker access and CPS state. - */ - getProjectRouting(overrideValue?: ProjectRouting): ProjectRouting | undefined; - getDefaultProjectRouting(): ProjectRouting; - updateDefaultProjectRouting(projectRouting?: ProjectRouting): void; - getProjectPickerAccess$(): Observable; - registerAppAccess(appId: string, resolver: CPSAppAccessResolver): void; -} diff --git a/src/platform/packages/shared/kbn-css-utils/public/full_screen_bg_css.d.ts b/src/platform/packages/shared/kbn-css-utils/public/full_screen_bg_css.d.ts deleted file mode 100644 index 4790d825ac821..0000000000000 --- a/src/platform/packages/shared/kbn-css-utils/public/full_screen_bg_css.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { UseEuiTheme } from '@elastic/eui'; -export declare const kbnFullScreenBgCss: ({ euiTheme, colorMode }: UseEuiTheme) => import("@emotion/react").SerializedStyles; -export declare const useKbnFullScreenBgCss: () => import("@emotion/react").SerializedStyles; diff --git a/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.d.ts b/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.d.ts deleted file mode 100644 index 294e7e9e53cf5..0000000000000 --- a/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { CSSInterpolation } from '@emotion/serialize'; -import type { UseEuiTheme } from '@elastic/eui'; -export type EmotionStyles = Record CSSInterpolation)>; -/** - * Custom hook to reduce boilerplate when working with Emotion styles that may depend on - * the EUI theme. - * - * Accepts a map of styles where each entry is either a static Emotion style (via `css`) - * or a function that returns styles based on the current `euiTheme`. - * - * It returns a memoized version of the style map with all values resolved to static - * Emotion styles, allowing components to use a clean and unified object for styling. - * - * This helps simplify component code by centralizing theme-aware style logic. - * - * Example usage: - * const componentStyles = { - * container: css({ overflow: hidden }), - * leftPane: ({ euiTheme }) => css({ paddingTop: euiTheme.size.m }), - * } - * const styles = useMemoCss(componentStyles); - */ -export declare const useMemoCss: (styleMap: T) => { [K in keyof T]: CSSInterpolation; }; diff --git a/src/platform/packages/shared/kbn-data-service-server/index.d.ts b/src/platform/packages/shared/kbn-data-service-server/index.d.ts deleted file mode 100644 index c3c5a02dffbb6..0000000000000 --- a/src/platform/packages/shared/kbn-data-service-server/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { refreshIntervalSchema } from './src/refresh_interval'; -export type { RefreshInterval } from './src/types'; diff --git a/src/platform/packages/shared/kbn-data-service-server/src/refresh_interval.d.ts b/src/platform/packages/shared/kbn-data-service-server/src/refresh_interval.d.ts deleted file mode 100644 index 132c74ae8471a..0000000000000 --- a/src/platform/packages/shared/kbn-data-service-server/src/refresh_interval.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const refreshIntervalSchema: import("@kbn/config-schema").ObjectType<{ - pause: import("@kbn/config-schema").Type; - value: import("@kbn/config-schema").Type; -}>; diff --git a/src/platform/packages/shared/kbn-data-service-server/src/types.d.ts b/src/platform/packages/shared/kbn-data-service-server/src/types.d.ts deleted file mode 100644 index d66a9736f67c5..0000000000000 --- a/src/platform/packages/shared/kbn-data-service-server/src/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -import type { refreshIntervalSchema } from './refresh_interval'; -export type RefreshInterval = TypeOf; diff --git a/src/platform/packages/shared/kbn-data-service/index.d.ts b/src/platform/packages/shared/kbn-data-service/index.d.ts deleted file mode 100644 index 1557ba50e5657..0000000000000 --- a/src/platform/packages/shared/kbn-data-service/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { GetConfigFn } from './src/types'; -export { UI_SETTINGS } from './src/constants'; -export { getEsQueryConfig } from './src/es_query'; -export { tabifyDocs, flattenHit, getFlattenedFieldsComparator, type FlattenedFieldsComparator, } from './src/search/tabify'; diff --git a/src/platform/packages/shared/kbn-data-service/src/constants.d.ts b/src/platform/packages/shared/kbn-data-service/src/constants.d.ts deleted file mode 100644 index 55728832f9d56..0000000000000 --- a/src/platform/packages/shared/kbn-data-service/src/constants.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export declare const UI_SETTINGS: { - readonly META_FIELDS: "metaFields"; - readonly DOC_HIGHLIGHT: "doc_table:highlight"; - readonly QUERY_STRING_OPTIONS: "query:queryString:options"; - readonly QUERY_ALLOW_LEADING_WILDCARDS: "query:allowLeadingWildcards"; - readonly SEARCH_QUERY_LANGUAGE: "search:queryLanguage"; - readonly SORT_OPTIONS: "sort:options"; - readonly COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: "courier:ignoreFilterIfFieldNotInIndex"; - readonly COURIER_SET_REQUEST_PREFERENCE: "courier:setRequestPreference"; - readonly COURIER_CUSTOM_REQUEST_PREFERENCE: "courier:customRequestPreference"; - readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: "courier:maxConcurrentShardRequests"; - readonly SEARCH_INCLUDE_FROZEN: "search:includeFrozen"; - readonly SEARCH_TIMEOUT: "search:timeout"; - readonly HISTOGRAM_BAR_TARGET: "histogram:barTarget"; - readonly HISTOGRAM_MAX_BARS: "histogram:maxBars"; - readonly HISTORY_LIMIT: "history:limit"; - readonly TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: "timepicker:refreshIntervalDefaults"; - readonly TIMEPICKER_QUICK_RANGES: "timepicker:quickRanges"; - readonly TIMEPICKER_TIME_DEFAULTS: "timepicker:timeDefaults"; - readonly FILTERS_PINNED_BY_DEFAULT: "filters:pinnedByDefault"; - readonly FILTERS_EDITOR_SUGGEST_VALUES: "filterEditor:suggestValues"; - readonly AUTOCOMPLETE_USE_TIMERANGE: "autocomplete:useTimeRange"; - readonly AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: "autocomplete:valueSuggestionMethod"; - readonly DATE_FORMAT: "dateFormat"; - readonly DATEFORMAT_TZ: "dateFormat:tz"; -}; diff --git a/src/platform/packages/shared/kbn-data-service/src/es_query/get_es_query_config.d.ts b/src/platform/packages/shared/kbn-data-service/src/es_query/get_es_query_config.d.ts deleted file mode 100644 index 42c0412656ed0..0000000000000 --- a/src/platform/packages/shared/kbn-data-service/src/es_query/get_es_query_config.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { EsQueryConfig } from '@kbn/es-query'; -import type { GetConfigFn } from '../types'; -interface KibanaConfig { - get: GetConfigFn; -} -export declare function getEsQueryConfig(config: KibanaConfig): EsQueryConfig; -export {}; diff --git a/src/platform/packages/shared/kbn-data-service/src/es_query/index.d.ts b/src/platform/packages/shared/kbn-data-service/src/es_query/index.d.ts deleted file mode 100644 index 3396c858bf007..0000000000000 --- a/src/platform/packages/shared/kbn-data-service/src/es_query/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { getEsQueryConfig } from './get_es_query_config'; diff --git a/src/platform/packages/shared/kbn-data-service/src/search/tabify/index.d.ts b/src/platform/packages/shared/kbn-data-service/src/search/tabify/index.d.ts deleted file mode 100644 index cfb81aa99db7a..0000000000000 --- a/src/platform/packages/shared/kbn-data-service/src/search/tabify/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { tabifyDocs, flattenHit, getFlattenedFieldsComparator, type FlattenedFieldsComparator, } from './tabify_docs'; diff --git a/src/platform/packages/shared/kbn-data-service/src/search/tabify/tabify_docs.d.ts b/src/platform/packages/shared/kbn-data-service/src/search/tabify/tabify_docs.d.ts deleted file mode 100644 index cefb6cc8ba445..0000000000000 --- a/src/platform/packages/shared/kbn-data-service/src/search/tabify/tabify_docs.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { Datatable } from '@kbn/expressions-plugin/common'; -import type { DataView } from '@kbn/data-views-plugin/common'; -interface TabifyDocsOptions { - shallow?: boolean; - /** - * If set to `false` the _source of the document, if requested, won't be - * merged into the flattened document. - */ - source?: boolean; - /** - * If set to `true` values that have been ignored in ES (ignored_field_values) - * will be merged into the flattened document. This will only have an effect if - * the `hit` has been retrieved using the `fields` option. - */ - includeIgnoredValues?: boolean; -} -type Hit = Partial> & { - ignored_field_values?: Record; -}; -/** - * Flattens an individual hit (from an ES response) into an object. This will - * create flattened field names, like `user.name`. - * - * @param hit The hit from an ES reponse's hits.hits[] - * @param indexPattern The index pattern for the requested index if available. - * @param params Parameters how to flatten the hit - */ -export declare function flattenHit(hit: Hit, indexPattern?: DataView, params?: TabifyDocsOptions & { - flattenedFieldsComparator?: FlattenedFieldsComparator; -}): Record; -export declare const getFlattenedFieldsComparator: (indexPattern?: DataView) => (a: string | symbol, b: string | symbol) => 0 | 1 | -1; -export type FlattenedFieldsComparator = ReturnType; -export declare const tabifyDocs: (esResponse: estypes.SearchResponse, index?: DataView, params?: TabifyDocsOptions) => Datatable; -export {}; diff --git a/src/platform/packages/shared/kbn-data-service/src/types.d.ts b/src/platform/packages/shared/kbn-data-service/src/types.d.ts deleted file mode 100644 index b247bf07b1b91..0000000000000 --- a/src/platform/packages/shared/kbn-data-service/src/types.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * If a service is being shared on both the client and the server, and - * the client code requires synchronous access to uiSettings, both client - * and server should wrap the core uiSettings services in a function - * matching this signature. - * - * This matches the signature of the public `core.uiSettings.get`, and - * should only be used in scenarios where async access to uiSettings is - * not possible. - */ -export type GetConfigFn = (key: string, defaultOverride?: T) => T; diff --git a/src/platform/packages/shared/kbn-data-view-utils/index.d.ts b/src/platform/packages/shared/kbn-data-view-utils/index.d.ts deleted file mode 100644 index 4569ce7bb874f..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-utils/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './src/constants'; -export { convertDatatableColumnToDataViewFieldSpec } from './src/utils/convert_to_data_view_field_spec'; -export { getDataViewFieldOrCreateFromColumnMeta } from './src/utils/get_data_view_field_or_create'; -export { createRegExpPatternFrom } from './src/utils/create_regexp_pattern_from'; -export { testPatternAgainstAllowedList } from './src/utils/test_pattern_against_allowed_list'; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/constants.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/constants.d.ts deleted file mode 100644 index 47d9a98e56d1f..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-utils/src/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * ESQL type constant - */ -export declare const ESQL_TYPE = "esql"; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.d.ts deleted file mode 100644 index b3e513c7b7160..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DatatableColumn } from '@kbn/expressions-plugin/common'; -import type { FieldSpec } from '@kbn/data-views-plugin/common'; -/** - * Convert a datatable column to a DataViewFieldSpec - */ -export declare function convertDatatableColumnToDataViewFieldSpec(column: DatatableColumn): FieldSpec; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/utils/create_regexp_pattern_from.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/utils/create_regexp_pattern_from.d.ts deleted file mode 100644 index 981217efd8a38..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-utils/src/utils/create_regexp_pattern_from.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -type Selector = 'data' | 'failures' | '*'; -export declare const createRegExpPatternFrom: (basePatterns: string | string[], selector: Selector) => RegExp; -export {}; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/utils/get_data_view_field_or_create.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/utils/get_data_view_field_or_create.d.ts deleted file mode 100644 index 623fdb0be6234..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-utils/src/utils/get_data_view_field_or_create.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/public'; -import type { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; -export declare const getDataViewFieldOrCreateFromColumnMeta: ({ dataView, fieldName, columnMeta, }: { - dataView: DataView; - fieldName: string; - columnMeta?: DatatableColumnMeta; -}) => import("@kbn/data-views-plugin/public").DataViewField | undefined; diff --git a/src/platform/packages/shared/kbn-data-view-utils/src/utils/test_pattern_against_allowed_list.d.ts b/src/platform/packages/shared/kbn-data-view-utils/src/utils/test_pattern_against_allowed_list.d.ts deleted file mode 100644 index 3b07e275d9e75..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-utils/src/utils/test_pattern_against_allowed_list.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const testPatternAgainstAllowedList: (allowedList: Array) => (value: string) => boolean; diff --git a/src/platform/packages/shared/kbn-data-view-validation/index.d.ts b/src/platform/packages/shared/kbn-data-view-validation/index.d.ts deleted file mode 100644 index ff59335c40674..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-validation/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './src/constants'; -export * from './src/validation'; -export type * from './src/types'; diff --git a/src/platform/packages/shared/kbn-data-view-validation/src/constants.d.ts b/src/platform/packages/shared/kbn-data-view-validation/src/constants.d.ts deleted file mode 100644 index c973ce2c6bbbb..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-validation/src/constants.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Error code for when an index pattern contains illegal characters - */ -export declare const ILLEGAL_CHARACTERS_KEY: "ILLEGAL_CHARACTERS"; -/** - * Error code for when an index pattern contains spaces - */ -export declare const CONTAINS_SPACES_KEY: "CONTAINS_SPACES"; -/** - * Characters disallowed in index patterns that are visible. - */ -export declare const ILLEGAL_CHARACTERS_VISIBLE: string[]; -/** - * All characters disallowed in index patterns. - */ -export declare const ILLEGAL_CHARACTERS: string[]; diff --git a/src/platform/packages/shared/kbn-data-view-validation/src/types.d.ts b/src/platform/packages/shared/kbn-data-view-validation/src/types.d.ts deleted file mode 100644 index 85f2d6b41acbb..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-validation/src/types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ILLEGAL_CHARACTERS_KEY, CONTAINS_SPACES_KEY } from './constants'; -export interface ValidationErrors { - [ILLEGAL_CHARACTERS_KEY]?: string[]; - [CONTAINS_SPACES_KEY]?: boolean; -} diff --git a/src/platform/packages/shared/kbn-data-view-validation/src/validation.d.ts b/src/platform/packages/shared/kbn-data-view-validation/src/validation.d.ts deleted file mode 100644 index c125d31f93f86..0000000000000 --- a/src/platform/packages/shared/kbn-data-view-validation/src/validation.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ValidationErrors } from './types'; -/** - * Validate index pattern strings - * @public - * @param indexPattern string to validate - * @returns errors object - */ -export declare function validateDataView(indexPattern: string): ValidationErrors; diff --git a/src/platform/packages/shared/kbn-discover-utils/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/index.d.ts deleted file mode 100644 index 946cc4fb77e21..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { CONTEXT_DEFAULT_SIZE_SETTING, CONTEXT_STEP_SETTING, CONTEXT_TIE_BREAKER_FIELDS_SETTING, DEFAULT_ALLOWED_LOGS_BASE_PATTERNS, DEFAULT_COLUMNS_SETTING, DOC_HIDE_TIME_COLUMN_SETTING, FIELDS_LIMIT_SETTING, HIDE_ANNOUNCEMENTS, IS_ESQL_DEFAULT_FEATURE_FLAG_KEY, MAX_DOC_FIELDS_DISPLAYED, MODIFY_COLUMNS_ON_SWITCH, ROW_HEIGHT_OPTION, SAMPLE_ROWS_PER_PAGE_SETTING, SAMPLE_SIZE_SETTING, SEARCH_EMBEDDABLE_TYPE, SEARCH_ON_PAGE_LOAD_SETTING, SHOW_FIELD_STATISTICS, SHOW_MULTIFIELDS, SORT_DEFAULT_ORDER_SETTING, DataGridDensity, IgnoredReason, buildDataTableRecord, buildDataTableRecordList, convertValueToString, createLogsContextService, createApmContextService, createDegradedDocsControl, createStacktraceControl, fieldConstants, formatFieldValueReact, formatFieldValueText, formatFieldStringValueWithHighlights, formatHitReact, getDocId, getLogDocumentOverview, getFlattenedTraceDocumentOverview, getIgnoredReason, getMessageFieldWithFallbacks, getChartHidden, getTableHidden, getTopPanelHeight, getBreakdownField, getAvailableResourceFields, getAvailableTraceFields, getLogLevelFieldWithFallback, getLogEventTypeFieldWithFallback, getLogExceptionTypeFieldWithFallback, getShouldShowFieldHandler, isEsqlSavedSearch, isNestedFieldParent, usePager, calcFieldCounts, getLogLevelColor, getLogLevelCoalescedValue, getLogLevelCoalescedValueLabel, LogLevelCoalescedValue, getFieldValue, getVisibleColumns, canPrependTimeFieldColumn, DiscoverFlyouts, AppMenuRegistry, dismissAllFlyoutsExceptFor, dismissFlyouts, ErrorCallout, prepareDataViewForEditing, getEsqlDataView, setChartHidden, setTableHidden, setTopPanelHeight, setBreakdownField, LogLevelBadge, getDefaultSort, getSort, getSortArray, getSortForSearchSource, getEsQuerySort, getTieBreakerFieldName, severityOrder, CHART_HIDDEN_KEY, TABLE_HIDDEN_KEY, HISTOGRAM_HEIGHT_KEY, HISTOGRAM_BREAKDOWN_FIELD_KEY, } from './src'; -export type { LogsContextService, ApmContextService, SortOrder, SortInput, SortPair, ErrorCalloutProps, DiscoverSessionFinderAttributes, } from './src'; -export * from './src/types'; -export * from './src/data_types/logs/constants'; -export { ALL_RECOMMENDED_FIELDS_FOR_ESQL, APACHE_ERROR_LOGS_PROFILE, DEFAULT_LOGS_PROFILE, KUBERNETES_CONTAINER_LOGS_PROFILE, } from './src/data_types/logs'; -export type { ApacheErrorLogsProfile, DefaultLogsProfile, KubernetesContainerLogsProfile, } from './src/data_types/logs'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/app_menu_registry.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/app_menu_registry.d.ts deleted file mode 100644 index 4091907962013..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/app_menu_registry.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { DiscoverAppMenuConfig, DiscoverAppMenuItemType, DiscoverAppMenuPopoverItem, DiscoverAppMenuPrimaryActionItem } from '../../types'; -/** - * Registry for managing AppMenuConfig items with Discover-specific types. - * All run actions automatically receive DiscoverAppMenuRunActionParams with guaranteed onFinishAction. - */ -export declare class AppMenuRegistry { - static CUSTOM_ITEMS_LIMIT: number; - private items; - private primaryActionItem?; - /** - * Register a custom menu item. - * @param item The menu item to register - */ - registerCustomItem(item: DiscoverAppMenuItemType): void; - /** - * Register a custom popover item under a parent menu item. - * @param parentId The ID of the parent menu item - * @param popoverItem The popover item to register - */ - registerCustomPopoverItem(parentId: string, popoverItem: DiscoverAppMenuPopoverItem): void; - /** - * Register a menu item. - * @param item The menu item to register - */ - registerItem(item: DiscoverAppMenuItemType): void; - /** - * Register multiple menu items at once. - * @param items Array of menu items to register - */ - registerItems(items: DiscoverAppMenuItemType[]): void; - /** - * Set the primary action item for the app menu. - * @param item The primary action item - */ - setPrimaryActionItem(item: DiscoverAppMenuPrimaryActionItem): void; - /** - * Register a popover item for a specific parent menu item. - * @param parentId The ID of the parent menu item - * @param popoverItem The popover item to register - */ - registerPopoverItem(parentId: string, popoverItem: DiscoverAppMenuPopoverItem): void; - /** - * Get the complete AppMenuConfig. - * Items with registered popover items will have their items property populated. - */ - getAppMenuConfig(): DiscoverAppMenuConfig; -} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/types.d.ts deleted file mode 100644 index c4995abab51a4..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/components/app_menu/types.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import type { AppMenuItemType, AppMenuPopoverItem, AppMenuPrimaryActionItem, AppMenuRunActionParams } from '@kbn/core-chrome-app-menu-components'; -import type { ReactElement, ReactNode } from 'react'; -export declare enum AppMenuActionId { - new = "new", - open = "open", - share = "share", - export = "export", - alerts = "alerts", - inspect = "inspect", - switchLanguageMode = "switchLanguageMode", - createRule = "createRule", - backgroundsearch = "backgroundSearch", - manageRulesAndConnectors = "manageRulesAndConnectors" -} -/** - * Discover-specific context that's always available in app menu run actions - */ -export interface DiscoverAppMenuContext extends Record { - onFinishAction: () => void; -} -/** - * Typed params for Discover app menu actions with guaranteed context - */ -export interface DiscoverAppMenuRunActionParams extends AppMenuRunActionParams { - context: DiscoverAppMenuContext; -} -/** - * Discover-specific run action that always receives DiscoverAppMenuRunActionParams - */ -export type DiscoverAppMenuRunAction = (params: DiscoverAppMenuRunActionParams) => ReactElement | void | null | ReactNode | Promise; -/** - * Discover-specific popover item with typed run action and nested items - */ -export type DiscoverAppMenuPopoverItem = Omit & { - run?: DiscoverAppMenuRunAction; - /** - * Sub-items for nested submenus (e.g., "Create legacy rules" submenu) - */ - items?: DiscoverAppMenuPopoverItem[]; -}; -/** - * Discover-specific menu item type with typed run action and items - */ -export type DiscoverAppMenuItemType = Omit & { - run?: DiscoverAppMenuRunAction; - items?: DiscoverAppMenuPopoverItem[]; -}; -/** - * Discover-specific primary action item with typed run action - */ -export type DiscoverAppMenuPrimaryActionItem = Omit & { - run?: DiscoverAppMenuRunAction; -}; -/** - * Discover-specific app menu config with typed menu items - */ -export interface DiscoverAppMenuConfig { - items?: DiscoverAppMenuItemType[]; - primaryActionItem?: DiscoverAppMenuPrimaryActionItem; -} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/degraded_docs_control.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/degraded_docs_control.d.ts deleted file mode 100644 index 985d1160dcf72..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/degraded_docs_control.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { RowControlColumn, RowControlProps } from './types'; -interface DegradedDocsControlProps extends Partial { - enabled?: boolean; - addIgnoredMetadataToQuery?: () => void; -} -/** - * Degraded docs control factory function. - * @param props Optional props for the generated Control component, useful to override onClick, etc - */ -export declare const createDegradedDocsControl: (props?: DegradedDocsControlProps) => RowControlColumn; -export {}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/index.d.ts deleted file mode 100644 index b72870621d729..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { createDegradedDocsControl } from './degraded_docs_control'; -export { createStacktraceControl } from './stacktrace_control'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/stacktrace_control.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/stacktrace_control.d.ts deleted file mode 100644 index a46428c05f863..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/stacktrace_control.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RowControlColumn, RowControlProps } from './types'; -/** - * Stacktrace control factory function. - * @param props Optional props for the generated Control component, useful to override onClick, etc - */ -export declare const createStacktraceControl: (props?: Partial) => RowControlColumn; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/types.d.ts deleted file mode 100644 index cd1c71231f705..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/components/custom_control_columns/types.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { EuiButtonIconProps, IconType } from '@elastic/eui'; -import type { Interpolation, Theme } from '@emotion/react'; -import type { FC, ReactElement } from 'react'; -import type React from 'react'; -import type { DataTableRecord } from '../../types'; -export interface RowControlRowProps { - rowIndex: number; - record: DataTableRecord; -} -export interface RowControlProps { - color?: EuiButtonIconProps['color']; - css?: Interpolation; - 'data-test-subj'?: string; - disabled?: boolean; - iconType: IconType; - label: string; - onClick: ((props: RowControlRowProps) => void) | undefined; - tooltipContent?: React.ReactNode; -} -export type RowControlComponent = FC; -export interface RowControlColumn { - id: string; - /** - * Optional predicate called per-row before the inline/menu split. - * Returning `false` removes this action from the row entirely. - * If omitted, the action is always included. - */ - isAvailable?: (props: RowControlRowProps) => boolean; - render: (Control: RowControlComponent, props: RowControlRowProps) => ReactElement; - width?: number; -} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/error_callout.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/error_callout.d.ts deleted file mode 100644 index 842da88451e9c..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/error_callout.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -export interface ErrorCalloutProps { - title: string; - error: Error; - isEsqlMode?: boolean; - /** When set, renders the "View details" action (non-ES|QL mode only). */ - showErrorDialog?: (args: { - title: string; - error: Error; - }) => void; - /** Doc link for the ES|QL reference button. Used when `isEsqlMode` is true. */ - esqlReferenceHref?: string; -} -export declare const ErrorCallout: ({ title, error, isEsqlMode, showErrorDialog, esqlReferenceHref, }: ErrorCalloutProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/index.d.ts deleted file mode 100644 index 9652b2d918916..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/components/error_callout/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ErrorCallout } from './error_callout'; -export type { ErrorCalloutProps } from './error_callout'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/constants.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/constants.d.ts deleted file mode 100644 index f6bd949336ad5..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/constants.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export declare const CONTEXT_DEFAULT_SIZE_SETTING = "context:defaultSize"; -export declare const CONTEXT_STEP_SETTING = "context:step"; -export declare const CONTEXT_TIE_BREAKER_FIELDS_SETTING = "context:tieBreakerFields"; -export declare const DEFAULT_COLUMNS_SETTING = "defaultColumns"; -export declare const DOC_HIDE_TIME_COLUMN_SETTING = "doc_table:hideTimeColumn"; -export declare const FIELDS_LIMIT_SETTING = "fields:popularLimit"; -export declare const HIDE_ANNOUNCEMENTS = "hideAnnouncements"; -export declare const IS_ESQL_DEFAULT_FEATURE_FLAG_KEY = "discover.isEsqlDefault"; -export declare const MAX_DOC_FIELDS_DISPLAYED = "discover:maxDocFieldsDisplayed"; -export declare const MODIFY_COLUMNS_ON_SWITCH = "discover:modifyColumnsOnSwitch"; -export declare const ROW_HEIGHT_OPTION = "discover:rowHeightOption"; -export declare const SAMPLE_ROWS_PER_PAGE_SETTING = "discover:sampleRowsPerPage"; -export declare const SAMPLE_SIZE_SETTING = "discover:sampleSize"; -export declare const SEARCH_EMBEDDABLE_TYPE = "discover_session"; -export declare const SEARCH_ON_PAGE_LOAD_SETTING = "discover:searchOnPageLoad"; -export declare const SHOW_FIELD_STATISTICS = "discover:showFieldStatistics"; -export declare const SHOW_MULTIFIELDS = "discover:showMultiFields"; -export declare const SORT_DEFAULT_ORDER_SETTING = "discover:sort:defaultOrder"; -export declare enum DataGridDensity { - COMPACT = "compact", - EXPANDED = "expanded", - NORMAL = "normal" -} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/apm_context_service.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/apm_context_service.d.ts deleted file mode 100644 index 72c333359354c..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/apm_context_service.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ApmSourceAccessPluginStart } from '@kbn/apm-sources-access-plugin/public'; -import { type TracesContextService } from '../traces'; -import { type ErrorsContextService } from './errors/errors_context_service'; -export interface ApmContextService { - tracesService: TracesContextService; - errorsService: ErrorsContextService; -} -export declare const createApmContextService: ({ apmSourcesAccess, }: { - apmSourcesAccess?: ApmSourceAccessPluginStart; -}) => Promise; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/errors/errors_context_service.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/errors/errors_context_service.d.ts deleted file mode 100644 index 175f9ddc802d5..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/errors/errors_context_service.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { APMIndices } from '@kbn/apm-sources-access-plugin/public'; -export interface ErrorsContextService { - getErrorsIndexPattern(): string | undefined; -} -export declare const createErrorsContextService: ({ indices, }: { - indices: APMIndices | null; -}) => ErrorsContextService; -export declare const getErrorsContextService: (error?: string) => { - getErrorsIndexPattern: () => string | undefined; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/index.d.ts deleted file mode 100644 index 263ab49e157d7..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/apm/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './errors/errors_context_service'; -export * from './apm_context_service'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/index.d.ts deleted file mode 100644 index 0a775318d133a..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './logs'; -export * from './traces'; -export * from './apm'; -export type * from './observability'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/index.d.ts deleted file mode 100644 index 965b7c85e5c9f..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './log_level_badge'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/log_level_badge.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/log_level_badge.d.ts deleted file mode 100644 index 82328a74c4b5c..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/components/log_level_badge.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ReactElement } from 'react'; -import React from 'react'; -import type { EuiBadgeProps } from '@elastic/eui'; -export declare const LogLevelBadge: ({ logLevel, fallback, "data-test-subj": dataTestSubj, ...badgeProps }: Omit & { - logLevel: {}; - fallback?: ReactElement; -}) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/constants.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/constants.d.ts deleted file mode 100644 index 03ad155b34c40..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/constants.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { SmartFieldGridColumnOptions } from './types'; -export * from '../../field_constants'; -export declare const LOGS_EXPLORER_PROFILE_ID = "logs-explorer"; -export declare const CONTENT_FIELD = "content"; -export declare const RESOURCE_FIELD = "resource"; -export declare const DATA_GRID_COLUMN_WIDTH_SMALL = 240; -export declare const DATA_GRID_COLUMN_WIDTH_MEDIUM = 320; -export declare const ACTIONS_COLUMN_WIDTH = 80; -export declare const RESOURCE_FIELD_CONFIGURATION: SmartFieldGridColumnOptions; -export declare const CONTENT_FIELD_CONFIGURATION: SmartFieldGridColumnOptions; -export declare const SMART_FALLBACK_FIELDS: { - content: SmartFieldGridColumnOptions; - resource: SmartFieldGridColumnOptions; -}; -export declare const DEFAULT_COLUMNS: SmartFieldGridColumnOptions[]; -export declare const DEFAULT_ROWS_PER_PAGE = 100; -export declare const FILTER_OUT_FIELDS_PREFIXES_FOR_CONTENT: string[]; -export declare const FILTER_OUT_EXACT_FIELDS_FOR_CONTENT: string[]; -export declare const DEFAULT_ALLOWED_DATA_VIEWS: string[]; -export declare const DEFAULT_ALLOWED_LOGS_DATA_VIEWS: string[]; -export declare const LOG_LEVEL_FIELDS: string[]; -export declare const SERVICE_NAME_FIELDS: string[]; -export declare const AGENT_NAME_FIELD = "agent.name"; -export declare const LOG_LEVEL_REGEX: RegExp; -export declare const RESOURCE_FIELDS: readonly ["service.name", "container.name", "host.name", "orchestrator.resource.id", "orchestrator.cluster.name", "orchestrator.cluster.id", "container.id", "agent.name", "resource.attributes.telemetry.sdk.language"]; -export declare const TRACE_FIELDS: readonly ["service.name", "event.outcome", "transaction.name", "transaction.duration.us", "span.name", "span.duration.us", "agent.name"]; -export declare const DURATION_FIELDS: readonly string[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/index.d.ts deleted file mode 100644 index d49dfd8647c6a..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type * from './types'; -export * from './utils'; -export * from './logs_context_service'; -export * from './components'; -export { DEFAULT_LOGS_PROFILE, type DefaultLogsProfile } from './recommended_fields/default_logs'; -export { APACHE_ERROR_LOGS_PROFILE, type ApacheErrorLogsProfile, } from './recommended_fields/apache_error_logs'; -export { KUBERNETES_CONTAINER_LOGS_PROFILE, type KubernetesContainerLogsProfile, } from './recommended_fields/kubernetes_container_logs'; -export { ALL_RECOMMENDED_FIELDS_FOR_ESQL } from './recommended_fields'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/logs_context_service.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/logs_context_service.d.ts deleted file mode 100644 index f30772577b9d9..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/logs_context_service.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { LogsDataAccessPluginStart } from '@kbn/logs-data-access-plugin/public'; -export interface LogsContextService { - getAllLogsIndexPattern(): string | undefined; - isLogsIndexPattern(indexPattern: unknown): boolean; -} -export interface LogsContextServiceDeps { - logsDataAccess?: LogsDataAccessPluginStart; -} -export declare const DEFAULT_ALLOWED_LOGS_BASE_PATTERNS: string[]; -export declare const DEFAULT_ALLOWED_LOGS_BASE_PATTERNS_REGEXP: RegExp; -export declare const createLogsContextService: ({ logsDataAccess, }: LogsContextServiceDeps) => Promise; -export declare const getLogsContextService: ({ allLogsIndexPattern, allowedDataSources, }: { - allLogsIndexPattern: string | undefined; - allowedDataSources: Array; -}) => LogsContextService; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/apache_error_logs.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/apache_error_logs.d.ts deleted file mode 100644 index 33ee74017b491..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/apache_error_logs.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Configuration for Apache Error Logs profile recommended fields - */ -export declare const APACHE_ERROR_LOGS_PROFILE: { - readonly pattern: "logs-apache.error"; - readonly recommendedFields: readonly ["client.ip", "destination.ip", "http.request.method", "http.response.bytes", "http.response.status_code", "log.level", "message", "referrer", "source.ip", "url.path", "user.agent"]; -}; -export type ApacheErrorLogsProfile = typeof APACHE_ERROR_LOGS_PROFILE; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/default_logs.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/default_logs.d.ts deleted file mode 100644 index a921196d0c9a0..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/default_logs.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Configuration for Default Logs profile recommended fields. - * This is used as a fallback when no specific log sub-profile matches. - * The wildcard pattern 'logs-*' ensures these fields are available for - * any logs index that doesn't have more specific profile. - */ -export declare const DEFAULT_LOGS_PROFILE: { - readonly pattern: "logs-*"; - readonly recommendedFields: readonly ["event.dataset", "host.name", "log.level", "message", "service.name"]; -}; -export type DefaultLogsProfile = typeof DEFAULT_LOGS_PROFILE; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/index.d.ts deleted file mode 100644 index ab99c68838a06..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { RecommendedField } from '@kbn/esql-types'; -/** - * Merged list of all recommended fields for ES|QL autocomplete. - */ -export declare const ALL_RECOMMENDED_FIELDS_FOR_ESQL: RecommendedField[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/kubernetes_container_logs.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/kubernetes_container_logs.d.ts deleted file mode 100644 index 797245ebcf741..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/recommended_fields/kubernetes_container_logs.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Configuration for Kubernetes Container Logs profile recommended fields - */ -export declare const KUBERNETES_CONTAINER_LOGS_PROFILE: { - readonly pattern: "logs-kubernetes.container_logs"; - readonly recommendedFields: readonly ["container.image.name", "kubernetes.container.name", "kubernetes.namespace", "kubernetes.node.name", "kubernetes.pod.name", "log.level", "message", "orchestrator.resource.name"]; -}; -export type KubernetesContainerLogsProfile = typeof KUBERNETES_CONTAINER_LOGS_PROFILE; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.d.ts deleted file mode 100644 index 54c9f5c3f135c..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -import type { DataTableRecord } from '../../types'; -export interface LogDocument extends DataTableRecord { - flattened: { - '@timestamp': string; - 'log.level'?: [string]; - message?: [string]; - 'error.message'?: string; - 'event.original'?: string; - 'host.name'?: string; - 'service.name'?: string; - 'trace.id'?: string; - 'agent.name'?: string; - 'orchestrator.cluster.name'?: string; - 'orchestrator.cluster.id'?: string; - 'orchestrator.resource.id'?: string; - 'orchestrator.namespace'?: string; - 'container.name'?: string; - 'container.id'?: string; - 'cloud.provider'?: string; - 'cloud.region'?: string; - 'cloud.availability_zone'?: string; - 'cloud.project.id'?: string; - 'cloud.instance.id'?: string; - 'log.file.path'?: string; - 'data_stream.namespace': string; - 'data_stream.dataset': string; - 'error.stack_trace'?: string; - 'error.exception.stacktrace.abs_path'?: string; - 'error.log.stacktrace.abs_path'?: string; - }; -} -export interface LogFlyoutDoc { - '@timestamp': string; - 'log.level'?: string; - message?: string; - 'error.message'?: string; - 'event.original'?: string; - 'host.name'?: string; - 'service.name'?: string; - 'trace.id'?: string; - 'agent.name'?: string; - 'orchestrator.cluster.name'?: string; - 'orchestrator.cluster.id'?: string; - 'orchestrator.resource.id'?: string; - 'orchestrator.namespace'?: string; - 'container.name'?: string; - 'cloud.provider'?: string; - 'cloud.region'?: string; - 'cloud.availability_zone'?: string; - 'cloud.project.id'?: string; - 'cloud.instance.id'?: string; - 'log.file.path'?: string; - 'data_stream.namespace': string; - 'data_stream.dataset': string; -} -export interface ResourceFields { - 'service.name'?: string; - 'kubernetes.container.name'?: string; - 'k8s.container.name'?: string; - 'container.name'?: string; - 'kubernetes.node.name'?: string; - 'k8s.node.name'?: string; - 'host.name'?: string; - 'orchestrator.cluster.name'?: string; - 'k8s.cluster.name'?: string; - 'kubernetes.namespace'?: string; - 'k8s.namespace.name'?: string; - 'kubernetes.pod.name'?: string; - 'k8s.pod.name'?: string; - 'kubernetes.deployment.name'?: string; - 'k8s.deployment.name'?: string; - 'kubernetes.replicaset.name'?: string; - 'k8s.replicaset.name'?: string; - 'kubernetes.statefulset.name'?: string; - 'k8s.statefulset.name'?: string; - 'kubernetes.daemonset.name'?: string; - 'k8s.daemonset.name'?: string; - 'kubernetes.job.name'?: string; - 'k8s.job.name'?: string; - 'kubernetes.cronjob.name'?: string; - 'k8s.cronjob.name'?: string; - 'agent.name'?: string; - 'orchestrator.cluster.id'?: string; - 'orchestrator.resource.id'?: string; - 'orchestrator.namespace'?: string; - 'container.id'?: string; - 'cloud.instance.id'?: string; -} -export interface StackTraceFields { - 'error.stack_trace'?: string; - 'error.exception.stacktrace.abs_path'?: string; - 'error.log.stacktrace.abs_path'?: string; -} -export interface SmartFieldGridColumnOptions { - type: 'smart-field'; - smartField: 'content' | 'resource'; - fallbackFields: string[]; - width?: number; -} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_all_logs_data_view_spec.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_all_logs_data_view_spec.d.ts deleted file mode 100644 index c24ee9972b42e..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_all_logs_data_view_spec.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare const ALL_LOGS_DATA_VIEW_ID = "discover-observability-solution-all-logs"; -export declare const getAllLogsDataViewSpec: ({ allLogsIndexPattern, }: { - allLogsIndexPattern: string; -}) => { - id: string; - name: string; - title: string; - timeFieldName: string; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_resource_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_resource_fields.d.ts deleted file mode 100644 index b6be44f7aabea..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_resource_fields.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const getAvailableResourceFields: (resourceDoc: Record) => string[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_fields.d.ts deleted file mode 100644 index d1d5e496e55a1..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_fields.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TraceFields } from '../../..'; -export declare const getAvailableTraceFields: (traceDoc: TraceFields) => ("event.outcome" | "transaction.name" | "transaction.duration.us" | "span.name" | "span.duration.us" | "service.name")[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_coalesed_value.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_coalesed_value.d.ts deleted file mode 100644 index 84d98a3bdcde5..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_coalesed_value.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export declare enum LogLevelCoalescedValue { - trace = "trace", - debug = "debug", - info = "info", - notice = "notice", - warning = "warning", - error = "error", - critical = "critical", - alert = "alert", - emergency = "emergency", - fatal = "fatal" -} -export declare const severityOrder: LogLevelCoalescedValue[]; -export declare const logLevelSynonyms: Record; -export declare const getLogLevelCoalescedValue: (logLevel: string | string[] | unknown) => LogLevelCoalescedValue | undefined; -export declare const getLogLevelCoalescedValueLabel: (coalescedValue: LogLevelCoalescedValue) => string; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.d.ts deleted file mode 100644 index 78d4e906a06e4..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { EuiThemeComputed } from '@elastic/eui'; -import { LogLevelCoalescedValue } from './get_log_level_coalesed_value'; -export declare const getLogLevelColor: (logLevelCoalescedValue: LogLevelCoalescedValue, euiTheme: EuiThemeComputed) => string | undefined; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/index.d.ts deleted file mode 100644 index a4ca393e0a91c..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/utils/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './get_log_level_color'; -export * from './get_log_level_coalesed_value'; -export * from './get_available_resource_fields'; -export * from './get_all_logs_data_view_spec'; -export * from './get_available_trace_fields'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/index.d.ts deleted file mode 100644 index a2dddad7107a4..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './types'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/types.d.ts deleted file mode 100644 index dc15001c8d2b6..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/observability/types.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface ObservabilityIndexes { - logs?: string; - apm: { - errors?: string; - traces?: string; - }; -} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/index.d.ts deleted file mode 100644 index 7d8ff9eb2f4a1..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * from './types'; -export * from './traces_context_service'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/traces_context_service.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/traces_context_service.d.ts deleted file mode 100644 index bc2a1eb2d3596..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/traces_context_service.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { APMIndices, ApmSourceAccessPluginStart } from '@kbn/apm-sources-access-plugin/public'; -export interface TracesContextService { - getAllTracesIndexPattern(): string | undefined; - isTracesIndexPattern(indexPattern: unknown): boolean; - containsTracesIndexPattern(indexPattern: unknown): boolean; -} -export interface TracesContextServiceDeps { - apmSourcesAccess?: ApmSourceAccessPluginStart; -} -export declare const DEFAULT_ALLOWED_TRACES_BASE_PATTERNS: string[]; -export declare const DEFAULT_ALLOWED_TRACES_BASE_PATTERNS_REGEXP: RegExp; -export declare const createTracesContextService: ({ indices, }: { - indices: APMIndices | null; -}) => TracesContextService; -export declare const getTracesContextService: ({ tracesIndexPattern, allowedDataSources, }: { - tracesIndexPattern?: string; - allowedDataSources: Array; -}) => { - getAllTracesIndexPattern: () => string | undefined; - isTracesIndexPattern: (value: string) => boolean; - containsTracesIndexPattern: (indexPattern: unknown) => boolean; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/types.d.ts deleted file mode 100644 index 417ed181d8717..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/data_types/traces/types.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { DataTableRecord } from '../../types'; -export interface TraceFields { - 'service.name'?: string; - 'event.outcome'?: string; - 'transaction.name'?: string; - 'transaction.duration.us'?: string; - 'span.name'?: string; - 'span.duration.us'?: string; - 'agent.name'?: string; -} -export interface TraceDocument extends DataTableRecord { - flattened: { - '@timestamp': string; - 'log.level'?: [string]; - message?: [string]; - 'error.message'?: string; - 'event.original'?: string; - 'host.name'?: string; - 'service.name'?: string; - 'trace.id': string; - 'agent.name'?: string; - 'orchestrator.cluster.name'?: string; - 'orchestrator.cluster.id'?: string; - 'orchestrator.resource.id'?: string; - 'orchestrator.namespace'?: string; - 'container.name'?: string; - 'container.id'?: string; - 'cloud.provider'?: string; - 'cloud.region'?: string; - 'cloud.availability_zone'?: string; - 'cloud.project.id'?: string; - 'cloud.instance.id'?: string; - 'log.file.path'?: string; - 'data_stream.namespace': string; - 'data_stream.dataset': string; - 'error.stack_trace'?: string; - 'error.exception.stacktrace.abs_path'?: string; - 'error.log.stacktrace.abs_path'?: string; - 'event.outcome'?: string; - 'transaction.name'?: string; - 'transaction.duration.us'?: string; - 'span.name'?: string; - 'span.duration.us'?: string; - }; -} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/field_constants.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/field_constants.d.ts deleted file mode 100644 index 7f0aa4f882bef..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/field_constants.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -export declare const TIMESTAMP_FIELD = "@timestamp"; -export declare const HOST_NAME_FIELD = "host.name"; -export declare const LOG_LEVEL_FIELD = "log.level"; -export declare const ERROR_LOG_LEVEL_FIELD = "error.log.level"; -export declare const MESSAGE_FIELD = "message"; -export declare const OTEL_MESSAGE_FIELD = "body.text"; -export declare const EXCEPTION_MESSAGE_FIELD = "exception.message"; -export declare const ERROR_MESSAGE_FIELD = "error.message"; -export declare const EVENT_ORIGINAL_FIELD = "event.original"; -export declare const EVENT_OUTCOME_FIELD = "event.outcome"; -export declare const INDEX_FIELD = "_index"; -export declare const EVENT_CATEGORY_FIELD = "event.category"; -export declare const TRACE_ID_FIELD = "trace.id"; -export declare const PARENT_ID_FIELD = "parent.id"; -export declare const TRANSACTION_ID_FIELD = "transaction.id"; -export declare const TRANSACTION_TYPE_FIELD = "transaction.type"; -export declare const TRANSACTION_NAME_FIELD = "transaction.name"; -export declare const TRANSACTION_DURATION_FIELD = "transaction.duration.us"; -export declare const SPAN_NAME_FIELD = "span.name"; -export declare const SPAN_ID_FIELD = "span.id"; -export declare const SPAN_ACTION_FIELD = "span.action"; -export declare const SPAN_DURATION_FIELD = "span.duration.us"; -export declare const SPAN_TYPE_FIELD = "span.type"; -export declare const SPAN_SUBTYPE_FIELD = "span.subtype"; -export declare const SPAN_DESTINATION_SERVICE_RESOURCE_FIELD = "span.destination.service.resource"; -export declare const PROCESSOR_EVENT_FIELD = "processor.event"; -export declare const OTEL_SPAN_KIND = "kind"; -export declare const OTEL_DURATION = "duration"; -export declare const OTEL_STATUS_CODE = "status.code"; -export declare const OTEL_RESOURCE_ATTRIBUTES_TELEMETRY_SDK_LANGUAGE = "resource.attributes.telemetry.sdk.language"; -export declare const OTEL_ATTRIBUTES_EXCEPTION_MESSAGE = "attributes.exception.message"; -export declare const OTEL_ATTRIBUTES_EXCEPTION_STACKTRACE = "attributes.exception.stacktrace"; -export declare const OTEL_EVENT_NAME_FIELD = "event_name"; -export declare const LOG_FILE_PATH_FIELD = "log.file.path"; -export declare const DATASTREAM_NAMESPACE_FIELD = "data_stream.namespace"; -export declare const DATASTREAM_DATASET_FIELD = "data_stream.dataset"; -export declare const DATASTREAM_TYPE_FIELD = "data_stream.type"; -export declare const OTEL_LINKS_TRACE_ID = "links.trace_id"; -export declare const OTEL_LINKS_SPAN_ID = "links.span_id"; -export declare const SPAN_LINKS_TRACE_ID = "span.links.trace.id"; -export declare const SPAN_LINKS_SPAN_ID = "span.links.span.id"; -export declare const AGENT_NAME_FIELD = "agent.name"; -export declare const CLOUD_PROVIDER_FIELD = "cloud.provider"; -export declare const CLOUD_REGION_FIELD = "cloud.region"; -export declare const CLOUD_AVAILABILITY_ZONE_FIELD = "cloud.availability_zone"; -export declare const CLOUD_PROJECT_ID_FIELD = "cloud.project.id"; -export declare const CLOUD_INSTANCE_ID_FIELD = "cloud.instance.id"; -export declare const SERVICE_NAME_FIELD = "service.name"; -export declare const SERVICE_ENVIRONMENT_FIELD = "service.environment"; -export declare const ORCHESTRATOR_CLUSTER_NAME_FIELD = "orchestrator.cluster.name"; -export declare const ORCHESTRATOR_CLUSTER_ID_FIELD = "orchestrator.cluster.id"; -export declare const ORCHESTRATOR_RESOURCE_ID_FIELD = "orchestrator.resource.id"; -export declare const ORCHESTRATOR_NAMESPACE_FIELD = "orchestrator.namespace"; -export declare const CONTAINER_NAME_FIELD = "container.name"; -export declare const CONTAINER_ID_FIELD = "container.id"; -export declare const USER_AGENT_NAME_FIELD = "user_agent.name"; -export declare const USER_AGENT_VERSION_FIELD = "user_agent.version"; -export declare const HTTP_RESPONSE_STATUS_CODE_FIELD = "http.response.status_code"; -export declare const IGNORED_FIELD = "_ignored"; -export declare const IGNORED_FIELD_VALUES_FIELD = "ignored_field_values"; -export declare const DEGRADED_DOCS_FIELDS: readonly ["_ignored", "ignored_field_values"]; -export declare const ERROR_CULPRIT_FIELD = "error.culprit"; -export declare const ERROR_GROUPING_NAME_FIELD = "error.grouping_name"; -export declare const ERROR_EXCEPTION_MESSAGE = "error.exception.message"; -export declare const ERROR_EXCEPTION_TYPE_FIELD = "error.exception.type"; -export declare const OTEL_EXCEPTION_TYPE_FIELD = "exception.type"; -export declare const ERROR_STACK_TRACE = "error.stack_trace"; -export declare const ERROR_EXCEPTION_STACKTRACE_ABS_PATH = "error.exception.stacktrace.abs_path"; -export declare const ERROR_LOG_STACKTRACE_ABS_PATH = "error.log.stacktrace.abs_path"; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/hooks/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/hooks/index.d.ts deleted file mode 100644 index 22de6a6a13c54..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/hooks/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './use_pager'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/hooks/use_pager.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/hooks/use_pager.d.ts deleted file mode 100644 index efbb5cce0788b..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/hooks/use_pager.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare const usePager: ({ initialPageSize, initialPageIndex, totalItems, }: { - totalItems: number; - initialPageSize: number; - initialPageIndex?: number; -}) => { - curPageIndex: number; - pageSize: number; - changePageIndex: (pageIndex: number) => void; - changePageSize: (newPageSize: number) => void; - totalPages: number; - startIndex: number; - hasNextPage: boolean; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/index.d.ts deleted file mode 100644 index 0d67d84022424..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './constants'; -export * as fieldConstants from './field_constants'; -export * from './hooks'; -export * from './utils'; -export * from './data_types'; -export * from './components/custom_control_columns'; -export { ErrorCallout } from './components/error_callout'; -export type { ErrorCalloutProps } from './components/error_callout'; -export { AppMenuRegistry } from './components/app_menu/app_menu_registry'; -export type { DiscoverAppMenuItemType, DiscoverAppMenuPopoverItem, DiscoverAppMenuPrimaryActionItem, DiscoverAppMenuRunAction, DiscoverAppMenuRunActionParams, DiscoverAppMenuContext, DiscoverAppMenuConfig, } from './components/app_menu/types'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/types.d.ts deleted file mode 100644 index 4bc8faa70682f..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/types.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -import type { SearchHit } from '@elastic/elasticsearch/lib/api/types'; -import type { EsqlColumnsWithHighlights } from '@kbn/esql-utils'; -import type { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; -export type { IgnoredReason, ShouldShowFieldInTableHandler } from './utils'; -export type { RowControlColumn, RowControlComponent, RowControlProps, RowControlRowProps, } from './components/custom_control_columns/types'; -export type * from './components/app_menu/types'; -export { AppMenuActionId } from './components/app_menu/types'; -type DiscoverSearchHit = SearchHit>; -export interface EsHitRecord extends Omit { - _index?: DiscoverSearchHit['_index']; - _id?: DiscoverSearchHit['_id']; - _source?: DiscoverSearchHit['_source']; - /** - * As oposed to DSL, ES|QL highlights are inlined in the hit value. - * This record holds which columns have highlights and what tag was used for it. - */ - inline_highlights?: EsqlColumnsWithHighlights; -} -/** - * This is the record/row of data provided to our Data Table - */ -export interface DataTableRecord { - /** - * A unique id generated by index, id and routing of a record - */ - id: string; - /** - * The document returned by Elasticsearch for search queries - */ - raw: EsHitRecord; - /** - * A flattened version of the ES doc or data provided by SQL, aggregations ... - */ - flattened: Record; - /** - * Determines that the given doc is the anchor doc when rendering view surrounding docs - */ - isAnchor?: boolean; -} -/** - * Custom column types per column name - */ -export type DataTableColumnsMeta = Record; -import type { ReactNode } from 'react'; -type FormattedHitPair = readonly [ - fieldDisplayName: string, - formattedValue: ReactNode, - fieldName: string | null -]; -/** - * Pairs array for each field in the hit where values are ReactNodes - */ -export type FormattedHit = FormattedHitPair[]; -export interface LogDocumentOverview extends LogResourceFields, LogStackTraceFields, LogCloudFields, LogOtelStackTraceFields, Partial, Partial { - '@timestamp': string; - 'log.level'?: string; - message?: string; - 'body.text'?: string; - 'error.message'?: string; - 'event.original'?: string; - 'trace.id'?: string; - 'transaction.id'?: string; - 'span.id'?: string; - 'log.file.path'?: string; - 'data_stream.namespace': string; - 'data_stream.dataset': string; - 'exception.message'?: string; -} -export interface ApmErrorLogFields { - 'processor.event': string; - 'error.log.level'?: string; - 'error.exception.type'?: string; - 'error.exception.message'?: string; - 'error.culprit'?: string; - 'error.grouping_name'?: string; -} -export interface OtelExceptionLogFields { - event_name: string; - 'exception.type'?: string; -} -export interface LogResourceFields { - 'host.name'?: string; - 'service.name'?: string; - 'agent.name'?: string; - 'orchestrator.cluster.name'?: string; - 'orchestrator.cluster.id'?: string; - 'orchestrator.resource.id'?: string; - 'orchestrator.namespace'?: string; - 'container.name'?: string; - 'container.id'?: string; -} -export interface LogStackTraceFields { - 'error.stack_trace'?: string; - 'error.exception.stacktrace'?: string; - 'error.log.stacktrace'?: string; -} -export interface LogOtelStackTraceFields { - 'attributes.exception.stacktrace'?: string; - 'attributes.exception.type'?: string; - 'attributes.exception.message'?: string; -} -export interface LogCloudFields { - 'cloud.provider'?: string; - 'cloud.region'?: string; - 'cloud.availability_zone'?: string; - 'cloud.project.id'?: string; - 'cloud.instance.id'?: string; -} -export interface TraceDocumentOverview extends TraceFields, Partial, Partial, Partial, Partial { - duration?: number; - kind?: string; - 'resource.attributes.telemetry.sdk.language'?: string; - 'links.trace_id'?: string; - 'links.span_id'?: string; -} -export interface TraceFields { - '@timestamp': number; - 'trace.id': string; - 'processor.event'?: 'span' | 'transaction'; - 'parent.id'?: string; - 'http.response.status_code'?: number; -} -export interface ServiceFields { - 'service.name': string; - 'service.environment': string; - 'agent.name': string; -} -export interface TransactionFields { - 'transaction.id': string; - 'transaction.type': string; - 'transaction.name': string; - 'transaction.duration.us'?: number; -} -export interface SpanFields { - 'span.id': string; - 'span.name': string; - 'span.action': string; - 'span.duration.us': number; - 'span.type': string; - 'span.subtype': string; - 'span.destination.service.resource': string; - 'span.links.span.id'?: string; - 'span.links.trace.id'?: string; -} -export interface UserAgentFields { - 'user_agent.name': string; - 'user_agent.version': string; -} diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/build_data_record.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/build_data_record.d.ts deleted file mode 100644 index 0f49017349292..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/build_data_record.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/common'; -import { type FlattenedFieldsComparator } from '@kbn/data-service'; -import type { DataTableRecord, EsHitRecord } from '../types'; -/** - * Build a record for data grid - * @param doc the document returned from Elasticsearch - * @param dataView this current data view - * @param isAnchor determines if the given doc is the anchor doc when viewing surrounding documents - */ -export declare function buildDataTableRecord(doc: EsHitRecord, dataView?: DataView, isAnchor?: boolean, options?: { - flattenedFieldsComparator?: FlattenedFieldsComparator; -}): DataTableRecord; -/** - * Helper to build multiple DataTableRecords at once, saved a bit of testing code lines - * @param records Array of documents returned from Elasticsearch - * @param dataView this current data view - */ -export declare function buildDataTableRecordList({ records, dataView, processRecord, }: { - records: EsHitRecord[]; - dataView?: DataView; - processRecord?: (record: DataTableRecord) => T; -}): DataTableRecord[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/calc_field_counts.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/calc_field_counts.d.ts deleted file mode 100644 index c609ab4cddcb2..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/calc_field_counts.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DataTableRecord } from '../types'; -/** - * This function is calculating stats of the available fields, for usage in sidebar and sharing - * Note that this values aren't displayed, but used for internal calculations - */ -export declare function calcFieldCounts(rows?: DataTableRecord[]): Record; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/contains_index_pattern.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/contains_index_pattern.d.ts deleted file mode 100644 index 14ab7cd0d9336..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/contains_index_pattern.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const containsIndexPattern: (allowedDataSources: Array) => (indexPattern: unknown) => boolean; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/convert_value_to_string.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/convert_value_to_string.d.ts deleted file mode 100644 index 183d50d55bcc0..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/convert_value_to_string.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { DataView, DataViewField } from '@kbn/data-views-plugin/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { DataTableRecord } from '../../types'; -interface ConvertedResult { - formattedString: string; - withFormula: boolean; -} -export declare const convertValueToString: ({ dataView, dataViewField, flattenedValue, dataTableRecord, fieldFormats, options, }: { - dataView: DataView; - dataViewField?: DataViewField; - flattenedValue: unknown; - dataTableRecord: DataTableRecord; - fieldFormats: FieldFormatsStart; - options?: { - compatibleWithCSV?: boolean; - compatibleWithMarkdown?: boolean; - }; -}) => ConvertedResult; -export {}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/dismiss_flyouts.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/dismiss_flyouts.d.ts deleted file mode 100644 index 5cf2378da6571..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/dismiss_flyouts.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare enum DiscoverFlyouts { - lensEdit = "lensEdit", - docViewer = "docViewer", - esqlDocs = "esqlDocs", - metricInsights = "metricInsights", - esqlControls = "esqlControls", - lensAlertRule = "lensAlertRule", - inspectorPanel = "inspectorPanel" -} -export declare const dismissFlyouts: (selectedFlyouts?: DiscoverFlyouts[], excludedFlyout?: DiscoverFlyouts) => void; -export declare const dismissAllFlyoutsExceptFor: (excludedFlyout: DiscoverFlyouts) => void; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.d.ts deleted file mode 100644 index 55ddc2c0be05b..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { DataView } from '@kbn/data-views-plugin/public'; -import type { DataTableRecord, ShouldShowFieldInTableHandler, FormattedHit, DataTableColumnsMeta } from '../types'; -/** - * Returns a formatted document in form of key/value pairs where the value is a ReactNode - * @param hit - * @param dataView - * @param shouldShowFieldHandler - * @param maxEntries - * @param fieldFormats - * @param columnsMeta - */ -export declare function formatHitReact(hit: DataTableRecord, dataView: DataView, shouldShowFieldHandler: ShouldShowFieldInTableHandler, maxEntries: number, fieldFormats: FieldFormatsStart, columnsMeta: DataTableColumnsMeta | undefined): FormattedHit; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.d.ts deleted file mode 100644 index 0396441213bd3..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_value.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type { ReactNode } from 'react'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { DataView, DataViewField } from '@kbn/data-views-plugin/public'; -import type { ReactContextTypeOptions, TextContextTypeOptions } from '@kbn/field-formats-plugin/common/types'; -import type { EsHitRecord } from '../types'; -/** Base parameters for field value formatting functions */ -interface FormatFieldValueBaseParams { - value: unknown; - fieldFormats: FieldFormatsStart; - dataView?: DataView; - field?: DataViewField; -} -export interface FormatFieldValueReactParams extends FormatFieldValueBaseParams { - hit: EsHitRecord; - options?: ReactContextTypeOptions; -} -export interface FormatFieldValueTextParams extends FormatFieldValueBaseParams { - options?: TextContextTypeOptions; -} -/** - * React equivalent of formatFieldValueText. Returns a ReactNode rendered via convertToReact, - * which is safe to render directly without dangerouslySetInnerHTML. - * - * @returns A ReactNode that can be rendered directly - */ -export declare const formatFieldValueReact: ({ value, hit, fieldFormats, dataView, field, options, }: FormatFieldValueReactParams) => ReactNode; -/** - * Text equivalent of formatFieldValueReact. Returns a plain text string without HTML tags. - * Use this when you need string values for further processing (e.g., in LogDocumentOverview). - * - * Note: Unlike formatFieldValueReact, this does not accept `hit` because text formatters - * do not apply highlighting (highlighting requires HTML/React markup). - * - * @returns A plain text string - */ -export declare const formatFieldValueText: ({ value, fieldFormats, dataView, field, options, }: FormatFieldValueTextParams) => string; -export interface FormatFieldStringWithHighlightsParams { - value: unknown; - hit: EsHitRecord; - fieldFormats: FieldFormatsStart; - /** Optional data view to look up the field. If provided with fieldName, will attempt to get the DataViewField */ - dataView?: DataView; - /** The field name for highlight lookup. If dataView is provided, will attempt to get DataViewField from it */ - fieldName?: string; - options?: ReactContextTypeOptions; -} -/** - * Formats a value using the default string formatter with React output and search highlighting. - * - * This is a convenience function for formatting values when you only have a field name (not a DataViewField). - * It attempts to look up the field in the data view, falling back to a minimal field object with just the name. - * This fallback ensures search highlighting still works even for fields not in the data view (e.g., OTel body.text). - * - * @param value - The value to format - * @param hit - The ES hit record containing highlight information - * @param fieldFormats - Field formats service - * @param dataView - Optional data view to look up the field - * @param fieldName - The field name for highlight lookup - * @param options - Additional options for the formatter - * @returns A ReactNode that can be rendered directly - */ -export declare const formatFieldStringValueWithHighlights: ({ value, hit, fieldFormats, dataView, fieldName, options, }: FormatFieldStringWithHighlightsParams) => ReactNode; -export {}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_doc_id.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_doc_id.d.ts deleted file mode 100644 index 069caf7918ef1..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_doc_id.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { EsHitRecord } from '../types'; -/** - * Returning a generated id of a given ES document, since `_id` can be the same - * when using different indices and shard routing - */ -export declare const getDocId: (doc: EsHitRecord & { - _routing?: string; -}) => string; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_esql_data_view.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_esql_data_view.d.ts deleted file mode 100644 index 2b1c19c06cf21..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_esql_data_view.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AggregateQuery } from '@kbn/es-query'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { HttpStart } from '@kbn/core-http-browser'; -import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -export declare function getEsqlDataView(query: AggregateQuery, currentDataView: DataView | undefined, services: { - dataViews: DataViewsPublicPluginStart; - http: HttpStart; -}): Promise; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value.d.ts deleted file mode 100644 index a3a3bc342d9c4..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { DataTableRecord } from '../types'; -export declare const getFieldValue: (record: TRecord, field: TField & keyof TRecord["flattened"]) => TRecord["flattened"][TField]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value_with_fallback.d.ts deleted file mode 100644 index 17ccdc52aed1d..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_field_value_with_fallback.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Gets a field value from a document, checking both ECS and OpenTelemetry field names. - * First checks the primary ECS field, then falls back to OTel equivalent fields if defined. - * - * @param document - The document object (flattened) - * @param ecsFieldName - The ECS field name to look up - * @returns Object with the actual field name found and its value, or undefined field if not found - */ -export declare function getFieldValueWithFallback(document: Record, ecsFieldName: string): { - field: string | undefined; - value: unknown; -}; -/** - * Gets multiple field values with OTel fallbacks, returning the first non-undefined value. - * Useful for checking a ranked list of fields (e.g., message → error.message → event.original). - * - * @param document - The document object (flattened) - * @param ecsFieldNames - Array of ECS field names to check in order - * @returns Object with the actual field name and value that was found, or undefined field if none found - */ -export declare function getFirstAvailableFieldValue(document: Record, ecsFieldNames: readonly string[]): { - field: string | undefined; - value?: unknown; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_flattened_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_flattened_fields.d.ts deleted file mode 100644 index 67188f9595c2a..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_flattened_fields.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { DataTableRecord } from '../types'; -export declare function getFlattenedFields(doc: DataTableRecord, fields: Array): T; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_ignored_reason.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_ignored_reason.d.ts deleted file mode 100644 index ed4e837f93707..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_ignored_reason.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { SearchHit } from '@elastic/elasticsearch/lib/api/types'; -import type { DataViewField } from '@kbn/data-views-plugin/public'; -export declare enum IgnoredReason { - IGNORE_ABOVE = "ignore_above", - MALFORMED = "malformed", - UNKNOWN = "unknown" -} -/** - * Returns the reason why a specific field was ignored in the response. - * Will return undefined if the field had no ignored values in it. - * This implementation will make some assumptions based on specific types - * of ignored values can only happen with specific field types in Elasticsearch. - * - * @param field Either the data view field or the string name of it. - * @param ignoredFields The hit._ignored value of the hit to validate. - */ -export declare function getIgnoredReason(field: DataViewField | string, ignoredFields: SearchHit['_ignored']): IgnoredReason | undefined; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_document_overview.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_document_overview.d.ts deleted file mode 100644 index 8c355521572d8..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_document_overview.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { DataView } from '@kbn/data-views-plugin/public'; -import type { DataTableRecord, LogDocumentOverview } from '../..'; -export declare function getLogDocumentOverview(doc: DataTableRecord, { dataView, fieldFormats }: { - dataView: DataView; - fieldFormats: FieldFormatsStart; -}): LogDocumentOverview; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_event_type_field_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_event_type_field_with_fallback.d.ts deleted file mode 100644 index 8ef9e1028d232..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_event_type_field_with_fallback.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { LogDocumentOverview } from '../types'; -export declare const getLogEventTypeFieldWithFallback: (doc: LogDocumentOverview) => { - field: string; - value: string; - formattedValue: string | undefined; - originalValue: unknown; -} | { - field: undefined; - value?: undefined; - formattedValue?: undefined; - originalValue?: undefined; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_exception_type_field_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_exception_type_field_with_fallback.d.ts deleted file mode 100644 index 7a158cc7457b7..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_exception_type_field_with_fallback.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { LogDocumentOverview } from '../types'; -export declare const getLogExceptionTypeFieldWithFallback: (doc: Record | LogDocumentOverview) => { - field: string; - value: string; - formattedValue: string | undefined; - originalValue: unknown; -} | { - field: undefined; - value?: undefined; - formattedValue?: undefined; - originalValue?: undefined; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_field_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_field_with_fallback.d.ts deleted file mode 100644 index b19140a1fb722..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_field_with_fallback.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { LogDocumentOverview } from '../types'; -export declare const getLogFieldWithFallback: (doc: Record | LogDocumentOverview, rankingOrder: readonly T[], options?: { - includeFormattedValue?: boolean; - includeOriginalValue?: boolean; -}) => { - field: string; - value: string; - formattedValue: string | undefined; - originalValue: unknown; -} | { - field: undefined; - value?: undefined; - formattedValue?: undefined; - originalValue?: undefined; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_level_field_with_fallback.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_level_field_with_fallback.d.ts deleted file mode 100644 index 04220997c619a..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_log_level_field_with_fallback.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { LogDocumentOverview } from '../types'; -export declare const getLogLevelFieldWithFallback: (doc: LogDocumentOverview) => { - field: string; - value: string; - formattedValue: string | undefined; - originalValue: unknown; -} | { - field: undefined; - value?: undefined; - formattedValue?: undefined; - originalValue?: undefined; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_message_field_with_fallbacks.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_message_field_with_fallbacks.d.ts deleted file mode 100644 index d67b71d34ae8a..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_message_field_with_fallbacks.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { LogDocumentOverview } from '../types'; -export declare const getMessageFieldWithFallbacks: (doc: Record | LogDocumentOverview, { includeFormattedValue }?: { - includeFormattedValue?: boolean; -}) => { - field: string; - value: string; - formattedValue: string | undefined; - originalValue: unknown; -} | { - field: undefined; - value?: undefined; - formattedValue?: undefined; - originalValue?: undefined; -}; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_should_show_field_handler.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_should_show_field_handler.d.ts deleted file mode 100644 index 9d3abce09d6bd..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_should_show_field_handler.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/public'; -export type ShouldShowFieldInTableHandler = (fieldName: string) => boolean; -/** - * Returns a function for checking whether we should display a field in the Documents column of the data table - * If showMultiFields is set to false, it filters out multifields that have a parent, to prevent entries for multifields - * like this: field, field.keyword, field.whatever - * @param fields - * @param dataView - * @param showMultiFields - */ -export declare const getShouldShowFieldHandler: (fields: string[], dataView: DataView, showMultiFields: boolean) => ShouldShowFieldInTableHandler; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_stack_trace_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_stack_trace_fields.d.ts deleted file mode 100644 index 227fcda39b4d3..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_stack_trace_fields.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { LogDocument, StackTraceFields } from '..'; -export declare const getStacktraceFields: (doc: LogDocument) => StackTraceFields; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_trace_document_overview.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_trace_document_overview.d.ts deleted file mode 100644 index 92d572fe57be0..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_trace_document_overview.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { DataTableRecord, TraceDocumentOverview } from '../types'; -export declare function getFlattenedTraceDocumentOverview(doc: DataTableRecord): TraceDocumentOverview; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_visible_columns.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/get_visible_columns.d.ts deleted file mode 100644 index b27bb9e4fd331..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/get_visible_columns.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { DataTableColumnsMeta } from '../types'; -export declare function canPrependTimeFieldColumn(columns: string[] | undefined, timeFieldName: string | undefined, columnsMeta: DataTableColumnsMeta | undefined, showTimeCol: boolean, // based on Advanced Settings `doc_table:hideTimeColumn` -isESQLMode: boolean): boolean; -export declare function getVisibleColumns(columns: string[], dataView: DataView, shouldPrependTimeFieldColumn: boolean): string[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/index.d.ts deleted file mode 100644 index 5341d04d2f418..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export * from './build_data_record'; -export * from './calc_field_counts'; -export * from './contains_index_pattern'; -export * from './format_hit'; -export * from './format_value'; -export * from './get_doc_id'; -export * from './get_field_value_with_fallback'; -export * from './get_ignored_reason'; -export * from './get_log_document_overview'; -export * from './get_trace_document_overview'; -export * from './get_message_field_with_fallbacks'; -export * from './get_log_exception_type_field_with_fallback'; -export * from './get_log_level_field_with_fallback'; -export * from './get_log_event_type_field_with_fallback'; -export * from './get_should_show_field_handler'; -export * from './get_stack_trace_fields'; -export * from './is_esql_saved_search'; -export * from './nested_fields'; -export * from './get_field_value'; -export * from './get_visible_columns'; -export * from './convert_value_to_string'; -export * from './local_storage_utils'; -export * from './sorting'; -export { DiscoverFlyouts, dismissAllFlyoutsExceptFor, dismissFlyouts } from './dismiss_flyouts'; -export { prepareDataViewForEditing } from './prepare_data_view_for_editing'; -export { getEsqlDataView } from './get_esql_data_view'; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/is_esql_saved_search.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/is_esql_saved_search.d.ts deleted file mode 100644 index 8c37febb6a232..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/is_esql_saved_search.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @deprecated This should only be used in combination with {@link isEsqlSavedSearch} - */ -export interface DiscoverSessionFinderAttributes { - tabs?: Array<{ - attributes: { - isTextBasedQuery?: boolean; - }; - }>; -} -/** - * @deprecated This is only used in specific legacy conditions: - * - Within a `showSavedObject` callback passed to `SavedObjectFinder` - * - When the Discover session is being used as a legacy saved search - * - When the app does not support ES|QL saved searches (e.g. agg-based vis) - */ -export declare const isEsqlSavedSearch: (savedObject: { - attributes: DiscoverSessionFinderAttributes; -}) => boolean; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/local_storage_utils.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/local_storage_utils.d.ts deleted file mode 100644 index 6caaf83216cad..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/local_storage_utils.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { Storage } from '@kbn/kibana-utils-plugin/public'; -import type { ResizableLayoutProps } from '@kbn/resizable-layout'; -export declare const CHART_HIDDEN_KEY = "chartHidden"; -export declare const TABLE_HIDDEN_KEY = "tableHidden"; -export declare const HISTOGRAM_HEIGHT_KEY = "histogramHeight"; -export declare const HISTOGRAM_BREAKDOWN_FIELD_KEY = "histogramBreakdownField"; -/** - * Get the chart hidden state from local storage - */ -export declare const getChartHidden: (storage: Storage, localStorageKeyPrefix: string) => boolean | undefined; -/** - * Get the table hidden state from local storage - */ -export declare const getTableHidden: (storage: Storage, localStorageKeyPrefix: string) => boolean | undefined; -/** - * Get the top panel height from local storage - */ -export declare const getTopPanelHeight: (storage: Storage, localStorageKeyPrefix: string) => ResizableLayoutProps["fixedPanelSize"] | undefined; -/** - * Get the breakdown field from local storage - */ -export declare const getBreakdownField: (storage: Storage, localStorageKeyPrefix: string) => string | undefined; -/** - * Set the chart hidden state in local storage - */ -export declare const setChartHidden: (storage: Storage, localStorageKeyPrefix: string, chartHidden: boolean | undefined) => false | void; -/** - * Set the table hidden state in local storage - */ -export declare const setTableHidden: (storage: Storage, localStorageKeyPrefix: string, tableHidden: boolean | undefined) => false | void; -/** - * Set the top panel height in local storage - */ -export declare const setTopPanelHeight: (storage: Storage, localStorageKeyPrefix: string, topPanelHeight: ResizableLayoutProps["fixedPanelSize"]) => false | void; -/** - * Set the breakdown field in local storage - */ -export declare const setBreakdownField: (storage: Storage, localStorageKeyPrefix: string, breakdownField: string | undefined) => false | void; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/nested_fields.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/nested_fields.d.ts deleted file mode 100644 index fb4d94d0ae80b..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/nested_fields.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/public'; -/** - * This function checks if the given field in a given data view is a nested field's parent. - * Discover doesn't flatten arrays of objects, so for documents with an `object` or `nested` field that - * contains an array, Discover will only detect the top level root field. We want to detect when those - * root fields are `nested` so that we can display the proper icon and label. However, those root - * `nested` fields are not a part of the data view. Their children are though, and contain nested path - * info. So to detect nested fields we look through the data view for nested children - * whose path begins with the current field. There are edge cases where - * this could incorrectly identify a plain `object` field as `nested`. Say we had the following document - * where `foo` is a plain object field and `bar` is a nested field. - * { - * "foo": [ - * { - * "bar": [ - * { - * "baz": "qux" - * } - * ] - * }, - * { - * "bar": [ - * { - * "baz": "qux" - * } - * ] - * } - * ] - * } - * The following code will search for `foo`, find it at the beginning of the path to the nested child field - * `foo.bar.baz` and incorrectly mark `foo` as nested. Any time we're searching for the name of a plain object - * field that happens to match a segment of a nested path, we'll get a false positive. - * We're aware of this issue and we'll have to live with - * it in the short term. The long term fix will be to add info about the `nested` and `object` root fields - * to the data view, but that has its own complications which you can read more about in the following - * issue: https://github.com/elastic/kibana/issues/54957 - */ -export declare function isNestedFieldParent(fieldName: string, dataView: DataView): boolean; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/prepare_data_view_for_editing.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/prepare_data_view_for_editing.d.ts deleted file mode 100644 index 3e8dafb172361..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/prepare_data_view_for_editing.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/public'; -import type { DataViewsServicePublic } from '@kbn/data-views-plugin/public/types'; -export declare function prepareDataViewForEditing(dataView: DataView, dataViewsService: DataViewsServicePublic): Promise; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_default_sort.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_default_sort.d.ts deleted file mode 100644 index 4c641656d6b60..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_default_sort.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/public'; -import { type SortOrder } from './get_sort'; -/** - * use in case the user didn't manually sort. - * the default sort is returned depending on the data view or non for ES|QL queries - */ -export declare function getDefaultSort(dataView: DataView | Pick | undefined, defaultSortOrder: string | undefined, hidingTimeColumn: boolean | undefined, isEsqlMode: boolean): SortOrder[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_es_query_sort.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_es_query_sort.d.ts deleted file mode 100644 index 3296fa4014ab4..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_es_query_sort.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { EsQuerySortValue, SortDirection } from '@kbn/data-plugin/public'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; -/** - * Returns `EsQuerySort` which is used to sort records in the ES query - * https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html - * @param sortDir - * @param timeFieldName - * @param tieBreakerFieldName - * @param isTimeNanosBased - */ -export declare function getEsQuerySort({ sortDir, timeFieldName, tieBreakerFieldName, isTimeNanosBased, }: { - sortDir: SortDirection; - timeFieldName: string; - tieBreakerFieldName: string; - isTimeNanosBased: boolean; -}): [EsQuerySortValue, EsQuerySortValue]; -/** - * Prepares "sort" structure for a time field for next ES request - * @param sortDir - * @param timeFieldName - * @param isTimeNanosBased - */ -export declare function getESQuerySortForTimeField({ sortDir, timeFieldName, isTimeNanosBased, }: { - sortDir: SortDirection; - timeFieldName: string; - isTimeNanosBased: boolean; -}): EsQuerySortValue; -/** - * Prepares "sort" structure for a tie breaker for next ES request - * @param sortDir - * @param tieBreakerFieldName - */ -export declare function getESQuerySortForTieBreaker({ sortDir, tieBreakerFieldName, }: { - sortDir: SortDirection; - tieBreakerFieldName: string; -}): EsQuerySortValue; -/** - * The default tie breaker for Discover - */ -export declare const DEFAULT_TIE_BREAKER_NAME = "_doc"; -/** - * Returns a field from the intersection of the set of sortable fields in the - * given data view and a given set of candidate field names. - */ -export declare function getTieBreakerFieldName(dataView: DataView, uiSettings: Pick): any; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort.d.ts deleted file mode 100644 index b7b5090975e40..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/common'; -export type SortOrder = [string, string]; -export type SortPairObj = Record; -export type SortPair = SortOrder | SortPairObj; -export type SortInput = SortPair | SortPair[]; -export declare function isSortable(fieldName: string, dataView: DataView, isEsqlMode: boolean): boolean; -export declare function isLegacySort(sort: SortPair[] | SortPair): sort is SortPair; -/** - * Take a sorting array and make it into an object - * @param {array} sort two dimensional array [[fieldToSort, directionToSort]] - * or an array of objects [{fieldToSort: directionToSort}] - * @param {object} dataView used for determining default sort - * @param {boolean} isEsqlMode - * @returns Array<{object}> an array of sort objects - */ -export declare function getSort(sort: SortPair[] | SortPair, dataView: DataView, isEsqlMode: boolean): SortPairObj[]; -/** - * compared to getSort it doesn't return an array of objects, it returns an array of arrays - * [[fieldToSort: directionToSort]] - */ -export declare function getSortArray(sort: SortInput, dataView: DataView, isEsqlMode: boolean): SortOrder[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort_for_search_source.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort_for_search_source.d.ts deleted file mode 100644 index 12faae79995f1..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/get_sort_for_search_source.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { EsQuerySortValue } from '@kbn/data-plugin/common'; -import { type SortOrder } from './get_sort'; -/** - * Prepares sort for search source, that's sending the request to ES - * - Adds default sort if necessary - * - Handles the special case when there's sorting by date_nanos typed fields - * the addon of the numeric_type guarantees the right sort order - * when there are indices with date and indices with date_nanos field - */ -export declare function getSortForSearchSource({ sort, dataView, defaultSortDir, includeTieBreaker, }: { - sort: SortOrder[] | undefined; - dataView: DataView | undefined; - defaultSortDir: string; - includeTieBreaker?: boolean; -}): EsQuerySortValue[]; diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/index.d.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/index.d.ts deleted file mode 100644 index 929091241661f..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/sorting/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { getDefaultSort } from './get_default_sort'; -export { getSort, getSortArray } from './get_sort'; -export type { SortOrder, SortInput, SortPair } from './get_sort'; -export { getSortForSearchSource } from './get_sort_for_search_source'; -export { getEsQuerySort, getTieBreakerFieldName } from './get_es_query_sort'; diff --git a/src/platform/packages/shared/kbn-discover-utils/types.d.ts b/src/platform/packages/shared/kbn-discover-utils/types.d.ts deleted file mode 100644 index 04ee56438cd10..0000000000000 --- a/src/platform/packages/shared/kbn-discover-utils/types.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { DataTableRecord, DataTableColumnsMeta, EsHitRecord, IgnoredReason, ShouldShowFieldInTableHandler, FormattedHit, } from './src/types'; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/index.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/index.d.ts deleted file mode 100644 index edadc0e66d382..0000000000000 --- a/src/platform/packages/shared/kbn-elastic-agent-utils/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { getAgentName, isOpenTelemetryAgentName, isEDOTAgentName, isOTELAgentName, hasOpenTelemetryPrefix, isJavaAgentName, isRumAgentName, isMobileAgentName, isRumOrMobileAgentName, isIosAgentName, isAndroidAgentName, isJRubyAgentName, isServerlessAgentName, isAWSLambdaAgentName, isAzureFunctionsAgentName, } from './src/agent_guards'; -export { ELASTIC_AGENT_NAMES, OPEN_TELEMETRY_AGENT_NAMES, EDOT_AGENT_NAMES, OTEL_AGENT_NAMES, JAVA_AGENT_NAMES, RUM_AGENT_NAMES, SERVERLESS_TYPE, AGENT_NAMES, } from './src/agent_names'; -export { getIngestionPath } from './src/agent_ingestion_path'; -export { getSdkNameAndLanguage } from './src/agent_sdk_name_and_language'; -export type { ElasticAgentName, OpenTelemetryAgentName, JavaAgentName, RumAgentName, ServerlessType, AgentName, } from './src/agent_names'; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_guards.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_guards.d.ts deleted file mode 100644 index bce94652a12eb..0000000000000 --- a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_guards.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ElasticAgentName, JavaAgentName, OpenTelemetryAgentName, RumAgentName, ServerlessType } from './agent_names'; -export declare function getAgentName(agentName: string | null, telemetryAgentName: string | null, telemetrySdkName: string | null): string | null; -export declare function hasOpenTelemetryPrefix(agentName?: string, language?: string): boolean; -export declare function isOpenTelemetryAgentName(agentName: string): agentName is OpenTelemetryAgentName; -export declare const isElasticAgentName: (agentName: string) => agentName is ElasticAgentName; -export declare function isEDOTAgentName(agentName: string): agentName is OpenTelemetryAgentName; -export declare function isOTELAgentName(agentName: string): agentName is OpenTelemetryAgentName; -export declare function isJavaAgentName(agentName?: string): agentName is JavaAgentName; -export declare function isRumAgentName(agentName?: string): agentName is RumAgentName; -export declare function isMobileAgentName(agentName?: string): boolean; -export declare function isRumOrMobileAgentName(agentName?: string): boolean; -export declare function isIosAgentName(agentName?: string): boolean; -export declare function isAndroidAgentName(agentName?: string): boolean; -export declare function isJRubyAgentName(agentName?: string, runtimeName?: string): boolean; -export declare function isServerlessAgentName(serverlessType?: string): serverlessType is ServerlessType; -export declare function isAWSLambdaAgentName(serverlessType?: string): serverlessType is ServerlessType; -export declare function isAzureFunctionsAgentName(serverlessType?: string): serverlessType is ServerlessType; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_ingestion_path.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_ingestion_path.d.ts deleted file mode 100644 index 84901d68bbaff..0000000000000 --- a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_ingestion_path.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const getIngestionPath: (hasOpenTelemetryFields: boolean) => "otel_native" | "classic_apm"; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_names.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_names.d.ts deleted file mode 100644 index 9f639e7e852a0..0000000000000 --- a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_names.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * We cannot mark these arrays as const and derive their type - * because we need to be able to assign them as mutable entities for ES queries. - */ -export type ElasticAgentName = 'dotnet' | 'go' | 'iOS/swift' | 'java' | 'js-base' | 'nodejs' | 'php' | 'python' | 'ruby' | 'rum-js' | 'android/java'; -export declare const ELASTIC_AGENT_NAMES: ElasticAgentName[]; -export type OpenTelemetryAgentName = 'opentelemetry' | 'otlp' | `opentelemetry/${string}` | `otlp/${string}`; -export declare const OPEN_TELEMETRY_BASE_AGENT_NAMES: OpenTelemetryAgentName[]; -export declare const OPEN_TELEMETRY_AGENT_NAMES: OpenTelemetryAgentName[]; -export declare const EDOT_AGENT_NAMES: OpenTelemetryAgentName[]; -export declare const OTEL_AGENT_NAMES: OpenTelemetryAgentName[]; -export type JavaAgentName = 'java' | 'opentelemetry/java' | 'otlp/java'; -export declare const JAVA_AGENT_NAMES: JavaAgentName[]; -export type RumAgentName = 'js-base' | 'rum-js' | 'opentelemetry/webjs' | 'otlp/webjs'; -export declare const RUM_AGENT_NAMES: RumAgentName[]; -export type AndroidAgentName = 'android/java' | 'opentelemetry/android' | 'otlp/android'; -export declare const ANDROID_AGENT_NAMES: AndroidAgentName[]; -export type IOSAgentName = 'ios/swift' | 'opentelemetry/swift' | 'otlp/swift'; -export declare const IOS_AGENT_NAMES: IOSAgentName[]; -export type ServerlessType = 'aws.lambda' | 'azure.functions'; -export declare const SERVERLESS_TYPE: ServerlessType[]; -export type AgentName = ElasticAgentName | OpenTelemetryAgentName | JavaAgentName | RumAgentName | AndroidAgentName | IOSAgentName; -export declare const AGENT_NAMES: AgentName[]; diff --git a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_sdk_name_and_language.d.ts b/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_sdk_name_and_language.d.ts deleted file mode 100644 index 4bec38245cfa3..0000000000000 --- a/src/platform/packages/shared/kbn-elastic-agent-utils/src/agent_sdk_name_and_language.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -interface SdkNameAndLanguage { - sdkName?: 'apm' | 'edot' | 'otel_other'; - language?: string; -} -export declare const getSdkNameAndLanguage: (agentName: string) => SdkNameAndLanguage; -export {}; diff --git a/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/index.d.ts b/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/index.d.ts deleted file mode 100644 index 71a1537421a47..0000000000000 --- a/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './src/encrypted_saved_objects_client_types'; diff --git a/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/src/encrypted_saved_objects_client_types.d.ts b/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/src/encrypted_saved_objects_client_types.d.ts deleted file mode 100644 index ba20d53ad4c13..0000000000000 --- a/src/platform/packages/shared/kbn-encrypted-saved-objects-shared/src/encrypted_saved_objects_client_types.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { ISavedObjectsPointInTimeFinder, SavedObject, SavedObjectsBaseOptions, SavedObjectsCreatePointInTimeFinderDependencies, SavedObjectsCreatePointInTimeFinderOptions } from '@kbn/core/server'; -export interface EncryptedSavedObjectsClient { - getDecryptedAsInternalUser: (type: string, id: string, options?: SavedObjectsBaseOptions) => Promise>; - /** - * API method, that can be used to help page through large sets of saved objects and returns decrypted properties in result SO. - * Its interface matches interface of the corresponding Saved Objects API `createPointInTimeFinder` method: - * - * @example - * ```ts - * const finder = await this.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser({ - * filter, - * type: 'my-saved-object-type', - * perPage: 1000, - * }); - * for await (const response of finder.find()) { - * // process response - * } - * ``` - * - * @param findOptions matches interface of corresponding argument of Saved Objects API `createPointInTimeFinder` {@link SavedObjectsCreatePointInTimeFinderOptions} - * @param dependencies matches interface of corresponding argument of Saved Objects API `createPointInTimeFinder` {@link SavedObjectsCreatePointInTimeFinderDependencies} - * - */ - createPointInTimeFinderDecryptedAsInternalUser(findOptions: SavedObjectsCreatePointInTimeFinderOptions, dependencies?: SavedObjectsCreatePointInTimeFinderDependencies): Promise>; -} -export interface EncryptedSavedObjectsClientOptions { - includedHiddenTypes?: string[]; -} diff --git a/src/platform/packages/shared/kbn-es-types/index.d.ts b/src/platform/packages/shared/kbn-es-types/index.d.ts deleted file mode 100644 index 1f97bdcabb945..0000000000000 --- a/src/platform/packages/shared/kbn-es-types/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { AggregationOptionsByType, ESSearchOptions, SearchHit, ESSearchResponse, ESSearchRequest, ESSourceOptions, InferSearchResponseOf, AggregationResultOf, AggregationResultOfMap, ESFilter, MaybeReadonlyArray, ESQLColumn, ESQLRow, ESQLSearchResponse, ESQLSearchParams, SearchField, } from './src'; diff --git a/src/platform/packages/shared/kbn-es-types/src/index.d.ts b/src/platform/packages/shared/kbn-es-types/src/index.d.ts deleted file mode 100644 index 845d0822ece35..0000000000000 --- a/src/platform/packages/shared/kbn-es-types/src/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { InferSearchResponseOf, AggregateOf as AggregationResultOf, AggregateOfMap as AggregationResultOfMap, SearchHit, ESQLColumn, ESQLRow, ESQLSearchResponse, ESQLSearchParams, ChangePointType } from './search'; -export type ESFilter = estypes.QueryDslQueryContainer; -export type ESSearchRequest = estypes.SearchRequest; -export type AggregationOptionsByType = Required; -export type MaybeReadonlyArray = T[] | readonly T[]; -export type ESSourceOptions = boolean | string | string[]; -export interface ESSearchOptions { - restTotalHitsAsInt: boolean; -} -export type ESSearchResponse = InferSearchResponseOf; -export type SearchField = estypes.QueryDslFieldAndFormat | estypes.Field; -export type { InferSearchResponseOf, AggregationResultOf, AggregationResultOfMap, SearchHit, ESQLColumn, ESQLRow, ESQLSearchResponse, ESQLSearchParams, ChangePointType, }; diff --git a/src/platform/packages/shared/kbn-es-types/src/search.d.ts b/src/platform/packages/shared/kbn-es-types/src/search.d.ts deleted file mode 100644 index 696a6e5adc3de..0000000000000 --- a/src/platform/packages/shared/kbn-es-types/src/search.d.ts +++ /dev/null @@ -1,575 +0,0 @@ -import type { ValuesType, UnionToIntersection } from 'utility-types'; -import type { estypes } from '@elastic/elasticsearch'; -interface AggregationsAggregationContainer extends Record { - aggs?: any; - aggregations?: any; -} -type InvalidAggregationRequest = unknown; -type ValidAggregationKeysOf> = T extends T ? keyof T : never; -type KeyOfSource = { - [key in keyof T]: (T[key] extends Record ? null : never) | string | number; -}; -type KeysOfSources = UnionToIntersection>>>; -type CompositeKeysOf = TAggregationContainer extends { - composite: { - sources: [...infer TSource]; - }; -} ? KeysOfSources : unknown; -type Source = estypes.SearchSourceFilter | boolean | estypes.Fields; -type TopMetricKeysOf = TAggregationContainer extends { - top_metrics: { - metrics: { - field: infer TField; - }; - }; -} ? Extract : TAggregationContainer extends { - top_metrics: { - metrics: Array<{ - field: infer TField; - }>; - }; -} ? Extract : string; -type ValueTypeOfField = T extends Record ? ValuesType : T extends Array ? ValueTypeOfField : T extends { - field: estypes.Field; -} ? T['field'] : T extends string | number ? T : never; -type MaybeArray = T | T[]; -type Fields = Required['fields']; -type DocValueFields = MaybeArray; -export type ChangePointType = 'indeterminable' | 'dip' | 'distribution_change' | 'non_stationary' | 'spike' | 'stationary' | 'step_change' | 'trend_change'; -export type SearchHit = Omit & (TSource extends false ? {} : { - _source: TSource; -}) & (TFields extends Fields ? { - fields: Partial, unknown[]>>; -} : { - fields?: Record; -}) & (TDocValueFields extends DocValueFields ? { - fields: Partial, unknown[]>>; -} : {}); -type HitsOf = Array>; -type AggregationMap = Partial>; -type TopLevelAggregationRequest = Pick; -type MaybeKeyed = TAggregationContainer extends Record ? Record : { - buckets: TBucket[]; -}; -export type AggregateOf = ValuesType & { - adjacency_matrix: { - buckets: Array<{ - key: string; - doc_count: number; - } & SubAggregateOf>; - }; - auto_date_histogram: { - interval: string; - buckets: Array<{ - key: number; - key_as_string: string; - doc_count: number; - } & SubAggregateOf>; - }; - avg: { - value: number | null; - value_as_string?: string; - }; - avg_bucket: { - value: number | null; - }; - boxplot: { - min: number | null; - max: number | null; - q1: number | null; - q2: number | null; - q3: number | null; - }; - bucket_correlation: { - value: number | null; - }; - bucket_count_ks_test: { - less: number; - greater: number; - two_sided: number; - }; - bucket_script: { - value: unknown; - }; - categorize_text: { - buckets: Array<{ - doc_count: number; - key: string; - regex: string; - max_matching_length: number; - } & SubAggregateOf>; - }; - cardinality: { - value: number; - }; - change_point: { - bucket?: { - key: string; - }; - type: Record; - }; - children: { - doc_count: number; - } & SubAggregateOf; - composite: { - after_key: CompositeKeysOf; - buckets: Array<{ - doc_count: number; - key: CompositeKeysOf; - } & SubAggregateOf>; - }; - cumulative_cardinality: { - value: number; - }; - cumulative_sum: { - value: number; - }; - date_histogram: MaybeKeyed>; - date_range: MaybeKeyed & Partial<{ - to: string | number; - to_as_string: string; - }> & { - doc_count: number; - key: string; - }>; - derivative: { - value: number | null; - } | undefined; - extended_stats: { - count: number; - min: number | null; - max: number | null; - avg: number | null; - sum: number; - sum_of_squares: number | null; - variance: number | null; - variance_population: number | null; - variance_sampling: number | null; - std_deviation: number | null; - std_deviation_population: number | null; - std_deviation_sampling: number | null; - std_deviation_bounds: { - upper: number | null; - lower: number | null; - upper_population: number | null; - lower_population: number | null; - upper_sampling: number | null; - lower_sampling: number | null; - }; - } & ({ - min_as_string: string; - max_as_string: string; - avg_as_string: string; - sum_of_squares_as_string: string; - variance_population_as_string: string; - variance_sampling_as_string: string; - std_deviation_as_string: string; - std_deviation_population_as_string: string; - std_deviation_sampling_as_string: string; - std_deviation_bounds_as_string: { - upper: string; - lower: string; - upper_population: string; - lower_population: string; - upper_sampling: string; - lower_sampling: string; - }; - } | {}); - extended_stats_bucket: { - count: number; - min: number | null; - max: number | null; - avg: number | null; - sum: number | null; - sum_of_squares: number | null; - variance: number | null; - variance_population: number | null; - variance_sampling: number | null; - std_deviation: number | null; - std_deviation_population: number | null; - std_deviation_sampling: number | null; - std_deviation_bounds: { - upper: number | null; - lower: number | null; - upper_population: number | null; - lower_population: number | null; - upper_sampling: number | null; - lower_sampling: number | null; - }; - }; - filter: { - doc_count: number; - } & SubAggregateOf; - filters: { - buckets: TAggregationContainer extends { - filters: { - filters: any[]; - }; - } ? Array<{ - doc_count: number; - } & SubAggregateOf> : TAggregationContainer extends { - filters: { - filters: Record; - }; - } ? { - [key in keyof TAggregationContainer['filters']['filters']]: { - doc_count: number; - } & SubAggregateOf; - } & (TAggregationContainer extends { - filters: { - other_bucket_key: infer TOtherBucketKey; - }; - } ? Record> : unknown) & (TAggregationContainer extends { - filters: { - other_bucket: true; - }; - } ? { - _other: { - doc_count: number; - } & SubAggregateOf; - } : unknown) : unknown; - }; - geo_bounds: { - top_left: { - lat: number | null; - lon: number | null; - }; - bottom_right: { - lat: number | null; - lon: number | null; - }; - }; - geo_centroid: { - count: number; - location: { - lat: number; - lon: number; - }; - }; - geo_distance: MaybeKeyed>; - geo_hash: { - buckets: Array<{ - doc_count: number; - key: string; - } & SubAggregateOf>; - }; - geotile_grid: { - buckets: Array<{ - doc_count: number; - key: string; - } & SubAggregateOf>; - }; - global: { - doc_count: number; - } & SubAggregateOf; - histogram: MaybeKeyed>; - ip_range: MaybeKeyed; - }; - } ? TRangeType extends { - key: infer TKeys; - } ? TKeys : string : string>; - inference: { - value: number; - prediction_probability: number; - prediction_score: number; - }; - max: { - value: number | null; - value_as_string?: string; - }; - max_bucket: { - value: number | null; - }; - min: { - value: number | null; - value_as_string?: string; - }; - min_bucket: { - value: number | null; - }; - median_absolute_deviation: { - value: number | null; - }; - moving_avg: { - value: number | null; - } | undefined; - moving_fn: { - value: number | null; - }; - moving_percentiles: TAggregationContainer extends Record ? Array<{ - key: number; - value: number | null; - }> : Record | undefined; - missing: { - doc_count: number; - } & SubAggregateOf; - multi_terms: { - doc_count_error_upper_bound: number; - sum_other_doc_count: number; - buckets: Array<{ - doc_count: number; - key: string[]; - key_as_string: string; - } & SubAggregateOf>; - }; - nested: { - doc_count: number; - } & SubAggregateOf; - normalize: { - value: number | null; - value_as_string?: string; - }; - parent: { - doc_count: number; - } & SubAggregateOf; - percentiles: { - values: TAggregationContainer extends Record ? Array<{ - key: number; - value: number | null; - }> : Record; - }; - percentile_ranks: { - values: TAggregationContainer extends Record ? Array<{ - key: number; - value: number | null; - }> : Record; - }; - percentiles_bucket: { - values: TAggregationContainer extends Record ? Array<{ - key: number; - value: number | null; - }> : Record; - }; - range: MaybeKeyed; - }; - } ? TRangeType extends { - key: infer TKeys; - } ? TKeys : string : string>; - rare_terms: Array<{ - key: string | number; - doc_count: number; - } & SubAggregateOf>; - rate: { - value: number | null; - }; - reverse_nested: { - doc_count: number; - } & SubAggregateOf; - random_sampler: { - seed: number; - probability: number; - doc_count: number; - } & SubAggregateOf; - sampler: { - doc_count: number; - } & SubAggregateOf; - scripted_metric: { - value: unknown; - }; - serial_diff: { - value: number | null; - value_as_string?: string; - }; - significant_terms: { - doc_count: number; - bg_count: number; - buckets: Array<{ - key: string | number; - score: number; - doc_count: number; - bg_count: number; - } & SubAggregateOf>; - }; - significant_text: { - doc_count: number; - buckets: Array<{ - key: string; - doc_count: number; - score: number; - bg_count: number; - }>; - }; - stats: { - count: number; - min: number | null; - max: number | null; - avg: number | null; - sum: number; - } & ({ - min_as_string: string; - max_as_string: string; - avg_as_string: string; - sum_as_string: string; - } | {}); - stats_bucket: { - count: number; - min: number | null; - max: number | null; - avg: number | null; - sum: number; - }; - string_stats: { - count: number; - min_length: number | null; - max_length: number | null; - avg_length: number | null; - entropy: number | null; - distribution: Record; - }; - sum: { - value: number | null; - value_as_string?: string; - }; - sum_bucket: { - value: number | null; - }; - terms: { - doc_count_error_upper_bound: number; - sum_other_doc_count: number; - buckets: Array<{ - doc_count: number; - key: string | number; - key_as_string?: string; - } & SubAggregateOf>; - }; - top_hits: { - hits: { - total: { - value: number; - relation: 'eq' | 'gte'; - }; - max_score: number | null; - hits: TAggregationContainer extends { - top_hits: estypes.AggregationsTopHitsAggregation; - } ? HitsOf : estypes.SearchHitsMetadata; - }; - }; - top_metrics: { - top: Array<{ - sort: number[] | string[]; - metrics: Record, string | number | null>; - }>; - }; - weighted_avg: { - value: number | null; - }; - value_count: { - value: number; - }; -}, Exclude, 'aggs' | 'aggregations'> & string>>; -export type AggregateOfMap = { - [TAggregationName in keyof TAggregationMap]: Required[TAggregationName] extends AggregationsAggregationContainer ? AggregateOf[TAggregationName], TDocument> : never; -}; -type SubAggregateOf = TAggregationRequest extends { - aggs?: AggregationMap; -} ? AggregateOfMap : TAggregationRequest extends { - aggregations?: AggregationMap; -} ? AggregateOfMap : {}; -type SearchResponseOf = SubAggregateOf; -type WrapAggregationResponse = keyof UnionToIntersection extends never ? { - aggregations?: unknown; -} : { - aggregations?: T; -}; -export type InferSearchResponseOf = Omit, 'aggregations' | 'hits'> & (TSearchRequest extends TopLevelAggregationRequest ? WrapAggregationResponse> : { - aggregations?: InvalidAggregationRequest; -}) & { - hits: Omit['hits'], 'total' | 'hits'> & (TOptions['restTotalHitsAsInt'] extends true ? { - total: number; - } : { - total: { - value: number; - relation: 'eq' | 'gte'; - }; - }) & { - hits: HitsOf; - }; -}; -export interface ESQLColumn { - name: string; - type: string; - original_types?: string[]; -} -export type ESQLRow = unknown[]; -export interface ESQLSearchResponse { - columns: ESQLColumn[]; - all_columns?: ESQLColumn[]; - values: ESQLRow[]; - took?: number; - documents_found?: number; - _clusters?: estypes.ClusterStatistics; -} -export interface ESQLSearchParams { - time_zone?: string; - query: string; - filter?: unknown; - project_routing?: string; - locale?: string; - include_execution_metadata?: boolean; - dropNullColumns?: boolean; - params?: estypes.ScalarValue[] | Array | undefined>>; -} -export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/constants.d.ts b/src/platform/packages/shared/kbn-esql-utils/constants.d.ts deleted file mode 100644 index f15720d89694a..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/constants.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const ENABLE_ESQL = "enableESQL"; -/** - * Denotes placeholder value for property on a record that is not set. - */ -export declare const GROUP_NOT_SET_VALUE = "(null)"; diff --git a/src/platform/packages/shared/kbn-esql-utils/index.d.ts b/src/platform/packages/shared/kbn-esql-utils/index.d.ts deleted file mode 100644 index 417fe3990daeb..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { getESQLAdHocDataview, getESQLTimeFieldFromQuery, getIndexPatternFromESQLQuery, getSourceCommandFromESQLQuery, hasTransformationalCommand, getLimitFromESQLQuery, removeDropCommandsFromESQLQuery, getIndexForESQLQuery, getInitialESQLQuery, getESQLWithSafeLimit, appendToESQLQuery, appendWhereClauseToESQLQuery, appendStatsByToQuery, appendLimitToQuery, buildMetricsInfoQuery, getESQLQueryColumns, getESQLQueryColumnsRaw, getESQLResults, formatESQLColumns, getTimeFieldFromESQLQuery, getStartEndParams, hasStartEndParams, getNamedParams, prettifyQuery, retrieveMetadataColumns, getQueryColumnsFromESQLQuery, isESQLColumnSortable, isESQLColumnGroupable, isESQLFieldGroupable, sanitazeESQLInput, queryCannotBeSampled, mapVariableToColumn, getValuesFromQueryField, getESQLQueryVariables, fixESQLQueryWithVariables, replaceESQLQueryIndexPattern, getCategorizeColumns, getSparklineColumns, extractCategorizeTokens, getArgsFromRenameFunction, getCategorizeField, getKqlSearchQueries, getRemoteClustersFromESQLQuery, getLookupIndicesFromQuery, convertTimeseriesCommandToFrom, getESQLStatsQueryMeta, constructCascadeQuery, appendFilteringWhereClauseForCascadeLayout, getStatsGroupFieldType, getFieldParamDefinition, getESQLSources, getEsqlColumns, getEsqlPolicies, getJoinIndices, getTimeseriesIndices, getViews, getDatasets, getInferenceEndpoints, getEditorExtensions, getProjectRoutingFromEsqlQuery, hasOnlySourceCommand, hasTimeseriesInfoCommand, isComputedColumn, getQuerySummary, getColumnsWithHighlights, buildRenameSourceFieldMap, getEsqlControls, getAllEsqlControls, convertFiltersToESQLExpression, convertQueryToESQLExpression, injectWhereClauseAfterSourceCommand, type ESQLStatsQueryMeta, type EsqlColumnsWithHighlights, type ESQLHighlightTags, } from './src'; -export { ENABLE_ESQL, GROUP_NOT_SET_VALUE } from './constants'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/index.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/index.d.ts deleted file mode 100644 index 077ee7e09606a..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export { getESQLAdHocDataview, getIndexForESQLQuery } from './utils/get_esql_adhoc_dataview'; -export { getESQLTimeFieldFromQuery } from './utils/get_esql_time_field_from_query'; -export { getInitialESQLQuery } from './utils/get_initial_esql_query'; -export { getESQLWithSafeLimit } from './utils/get_esql_with_safe_limit'; -export { getLimitFromESQLQuery, removeDropCommandsFromESQLQuery, hasTransformationalCommand, getTimeFieldFromESQLQuery, prettifyQuery, retrieveMetadataColumns, getQueryColumnsFromESQLQuery, mapVariableToColumn, getValuesFromQueryField, getESQLQueryVariables, fixESQLQueryWithVariables, getCategorizeColumns, getSparklineColumns, getArgsFromRenameFunction, getCategorizeField, getKqlSearchQueries, getRemoteClustersFromESQLQuery, convertTimeseriesCommandToFrom, hasOnlySourceCommand, hasTimeseriesInfoCommand, } from './utils/query_parsing_helpers'; -export { getIndexPatternFromESQLQuery, getSourceCommandFromESQLQuery, } from './utils/get_index_pattern_from_query'; -export { queryCannotBeSampled } from './utils/query_cannot_be_sampled'; -export { appendToESQLQuery } from './utils/append_to_query/utils'; -export { appendStatsByToQuery } from './utils/append_to_query/append_stats_by'; -export { appendWhereClauseToESQLQuery } from './utils/append_to_query/append_where'; -export { appendLimitToQuery } from './utils/append_to_query/append_limit'; -export { buildMetricsInfoQuery } from './utils/append_to_query/append_metrics_info'; -export { getESQLQueryColumns, getESQLQueryColumnsRaw, getESQLResults, formatESQLColumns, getStartEndParams, hasStartEndParams, getNamedParams, } from './utils/run_query'; -export { isESQLColumnSortable, isESQLColumnGroupable, isESQLFieldGroupable, } from './utils/esql_fields_utils'; -export { sanitazeESQLInput } from './utils/sanitaze_input'; -export { replaceESQLQueryIndexPattern } from './utils/replace_index_pattern'; -export { extractCategorizeTokens } from './utils/extract_categorize_tokens'; -export { getLookupIndicesFromQuery } from './utils/get_lookup_indices'; -export { type ESQLStatsQueryMeta, getESQLStatsQueryMeta, constructCascadeQuery, appendFilteringWhereClauseForCascadeLayout, } from './utils/cascaded_documents_helpers'; -export { getStatsGroupFieldType, getFieldParamDefinition, } from './utils/cascaded_documents_helpers/utils'; -export { getProjectRoutingFromEsqlQuery } from './utils/set_instructions_helpers'; -export { isComputedColumn, getQuerySummary } from './utils/get_query_summary'; -export { getColumnsWithHighlights, type EsqlColumnsWithHighlights, type ESQLHighlightTags, } from './utils/get_columns_with_highlights'; -export { buildRenameSourceFieldMap } from './utils/build_rename_source_field_map'; -export { getAllEsqlControls, getEsqlControls } from './utils/get_esql_controls'; -export { convertFiltersToESQLExpression } from './utils/convert_filters_to_esql'; -export { convertQueryToESQLExpression } from './utils/convert_query_to_esql'; -export { injectWhereClauseAfterSourceCommand } from './utils/inject_where_after_source'; -export * from './utils/callbacks'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_limit.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_limit.d.ts deleted file mode 100644 index 44bafeffba26a..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_limit.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const appendLimitToQuery: (queryString: string, limit: number) => string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_metrics_info.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_metrics_info.d.ts deleted file mode 100644 index 8394658fa4a69..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_metrics_info.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Appends "| METRICS_INFO" to an ES|QL query if it has no transformational commands. - * SORT is removed from the query. LIMIT, if present, is appended after METRICS_INFO. - * @param esql the ES|QL query. - * @returns the query with "| METRICS_INFO" added, or an empty string if not allowed. - */ -export declare function buildMetricsInfoQuery(esql?: string, dimensions?: string[]): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_stats_by.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_stats_by.d.ts deleted file mode 100644 index cb73635a5f8ac..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_stats_by.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const appendStatsByToQuery: (queryString: string, column: string) => string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_where.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_where.d.ts deleted file mode 100644 index 2b447099be6b4..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/append_where.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type SupportedOperation } from './utils'; -/** - * Appends a WHERE clause to an existing ES|QL query string. - * @param baseESQLQuery the base ES|QL query to append the WHERE clause to. - * @param field the field to filter on. - * @param value the value to filter by. - * @param operation the operation to perform ('+', '-', 'is_not_null', 'is_null'). - * @param kibanaFieldType the type of the field being filtered (optional). - * @param esMappingType the ES mapping type of the field (optional, used to determine whether to use MV_CONTAINS). - * @returns the modified ES|QL query string with the appended WHERE clause, or undefined if no changes were made. - */ -export declare function appendWhereClauseToESQLQuery(baseESQLQuery: string, field: string, value: unknown, operation: SupportedOperation, kibanaFieldType?: string, esMappingType?: string): string | undefined; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/utils.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/utils.d.ts deleted file mode 100644 index 2a0fc80732016..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/append_to_query/utils.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { BinaryExpressionComparisonOperator, ESQLFunction } from '@elastic/esql/types'; -export type SupportedOperation = '+' | '-' | 'is_not_null' | 'is_null'; -export type SupportedOperators = Extract { - operator: SupportedOperators; - expressionType: "postfix-unary" | "binary"; -}; -/** - * Get the list of supported operators dynamically by mapping all possible operation inputs - */ -export declare function getSupportedOperators(): SupportedOperators[]; -/** - * Escapes a string value for use in ES|QL queries by escaping special characters - */ -export declare function escapeStringValue(val: string): string; -/** - * Append in a new line the appended text to take care of the case where the user adds a comment at the end of the query. - * In these cases a base query such as "from index // comment" will result in errors or wrong data if we don't append in a new line - */ -export declare function appendToESQLQuery(baseESQLQuery: string, appendedText: string): string; -/** - * Extracts field name and value from a MATCH function AST node - */ -export declare function extractMatchFunctionDetails(matchFunction: ESQLFunction): { - columnName: string; - literalValue: string; -} | null; -/** - * Extracts field name and values from an MV_CONTAINS function AST node, - * supporting both casted and uncast scalar or list values - */ -export declare function extractMvContainsFunctionDetails(mvContainsFunction: ESQLFunction): { - columnName: string; - literalValues: Array; -} | null; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/build_rename_source_field_map.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/build_rename_source_field_map.d.ts deleted file mode 100644 index c3b139bd68772..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/build_rename_source_field_map.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Pre-computes the rename source field resolution for every rename target in a single parse pass. - * Use this when resolving multiple columns for the same query (e.g. a full column list from an - * ES response). Only columns that actually resolve to a different source field are present in the - * returned map; callers should fall back to the column name for absent entries. - */ -export declare function buildRenameSourceFieldMap(query: string): Map; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/columns.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/columns.d.ts deleted file mode 100644 index 9fdac4c5dd5b4..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/columns.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { TimeRange } from '@kbn/es-query'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { ESQLControlVariable, ESQLFieldWithMetadata } from '@kbn/esql-types'; -/** - * Gets the columns of an ESQL query, formatted as ESQLFieldWithMetadata - * @param esqlQuery The ESQL query to execute - * @param search The search service to use - * @param variables Optional ESQL control variables to substitute in the query - * @param signal Optional AbortSignal to cancel the request - * @param timeRange Optional time range for the query - * @returns A promise that resolves to an array of ESQLFieldWithMetadata - */ -export declare const getEsqlColumns: ({ esqlQuery, search, variables, signal, timeRange, }: { - search: ISearchGeneric; - esqlQuery?: string; - variables?: ESQLControlVariable[]; - signal?: AbortSignal; - timeRange?: TimeRange; -}) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/datasets.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/datasets.d.ts deleted file mode 100644 index d10e2b4b2b247..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/datasets.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { EsqlDatasetsResult } from '@kbn/esql-types'; -/** - * Fetches all ES|QL datasets from the cluster (GET _query/dataset). - * @param http The HTTP service to use for the request. - * @returns A promise that resolves to the datasets list. - */ -export declare const getDatasets: (this: void | { - forceRefresh?: boolean; -} | undefined, http: import("@kbn/core/public").HttpSetup) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/extensions.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/extensions.d.ts deleted file mode 100644 index fdd077ba2839f..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/extensions.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { RecommendedField, RecommendedQuery, ESQLRegistrySolutionId } from '@kbn/esql-types'; -import type { HttpStart } from '@kbn/core/public'; -interface EditorExtensions { - recommendedQueries: RecommendedQuery[]; - recommendedFields: RecommendedField[]; -} -/** - * Single-pass analysis of the query string: parses the AST once and returns - * whether the source is complete, the index pattern, and the command name. - * Returns undefined when the source is incomplete or missing. - */ -export declare const analyzeSourceQuery: (queryString: string) => { - indexPattern: string; - commandName: string; -} | undefined; -/** - * Fetches editor extensions from the registry based on the provided query string and active solution ID. - * @param queryString The query string to search for extensions. - * @param activeSolutionId The active solution ID to filter extensions. - * @param http The HTTP service to use for the request. - * @returns A promise that resolves to the editor extensions. - * Results are cached by index pattern so they are computed once per source and reused - * across all consumers. While the user is still typing the source name the function - * returns an empty result immediately without making any HTTP requests. - */ -export declare const getEditorExtensions: (http: HttpStart, queryString: string, activeSolutionId: ESQLRegistrySolutionId) => Promise; -export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/index.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/index.d.ts deleted file mode 100644 index 871ae33dd5a39..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { getESQLSources } from './sources'; -export { getEsqlColumns } from './columns'; -export { getEsqlPolicies } from './policies'; -export { getJoinIndices } from './lookup_indices'; -export { getTimeseriesIndices } from './timeseries_indices'; -export { getViews } from './views'; -export { getDatasets } from './datasets'; -export { getInferenceEndpoints } from './inference'; -export { getEditorExtensions } from './extensions'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/inference.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/inference.d.ts deleted file mode 100644 index 88f32dfd9d00e..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/inference.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { InferenceEndpointsAutocompleteResult } from '@kbn/esql-types'; -/** - * Fetches inference endpoints based on the provided task type. - * @param http The HTTP service to use for the request. - * @param taskType The type of inference task to get endpoints for. - * @returns A promise that resolves to an InferenceEndpointsAutocompleteResult object. - */ -export declare const getInferenceEndpoints: (this: void | { - forceRefresh?: boolean; -} | undefined, http: import("@kbn/core/public").HttpSetup, taskType: string) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/lookup_indices.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/lookup_indices.d.ts deleted file mode 100644 index 5c106b5e495da..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/lookup_indices.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import type { IndicesAutocompleteResult } from '@kbn/esql-types'; -/** - * Fetches join indices based on the provided ESQL query. - * @param query The ESQL query string to extract remote clusters from. - * @param http The HTTP service to use for the request. - * @param cacheOptions Optional cache options to control cache behavior. - * @returns A promise that resolves to an IndicesAutocompleteResult object. - */ -export declare const getJoinIndices: (query: string, http: HttpStart, cacheOptions?: { - forceRefresh?: boolean; -}) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/policies.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/policies.d.ts deleted file mode 100644 index 79b2216b72c64..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/policies.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; -type EsqlPolicy = Omit; -/** - * Fetches the list of enrich policies from the server, formatted as EsqlPolicy objects. - * @param http The HTTP service to use for the request. - * @returns A promise that resolves to an array of EsqlPolicy objects. - */ -export declare const getEsqlPolicies: (http: HttpStart) => Promise; -export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/sources.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/sources.d.ts deleted file mode 100644 index 1289ab6f087b0..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/sources.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import { type ESQLSourceResult } from '@kbn/esql-types'; -import type { ILicense } from '@kbn/licensing-types'; -/** - * Fetches the list of indices, aliases, and data streams from the Elasticsearch cluster. - * @param core The core start contract to make HTTP requests. - * @param areRemoteIndicesAvailable A boolean indicating if remote indices should be included. - * @param signal Optional AbortSignal to cancel the request. - * @param projectRouting Optional CPS project routing value forwarded to the server so that index - * resolution reflects the project picker selection or an explicit `SET project_routing` - * pre-statement. `SET project_routing` takes precedence over the picker value. - * @returns A promise that resolves to an array of ESQLSourceResult objects. - */ -export declare const getIndicesList: (core: Pick, areRemoteIndicesAvailable: boolean, signal?: AbortSignal, projectRouting?: string) => Promise; -/** Fetches ESQL sources including indices, aliases, data streams, and integrations. - * @param core The core start contract to make HTTP requests and access application capabilities. - * @param getLicense An optional function to retrieve the current license information. - * @param enrichSources Optional function to enrich or transform the list of sources before - * returning them (e.g. to add stream descriptions, links, or custom types). - * @param signal Optional AbortSignal to cancel the request. - * @param projectRouting Optional CPS project routing value forwarded to the server so that index - * resolution reflects the project picker selection or an explicit `SET project_routing` - * pre-statement. `SET project_routing` takes precedence over the picker value. - * @returns A promise that resolves to an array of ESQLSourceResult objects. - */ -export declare const getESQLSources: (core: Pick, getLicense: (() => Promise) | undefined, enrichSources?: (sources: ESQLSourceResult[]) => Promise, signal?: AbortSignal, projectRouting?: string) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/timeseries_indices.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/timeseries_indices.d.ts deleted file mode 100644 index 80c54fce0e04e..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/timeseries_indices.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { IndicesAutocompleteResult } from '@kbn/esql-types'; -export declare const getTimeseriesIndices: (this: void | { - forceRefresh?: boolean; -} | undefined, http: import("@kbn/core/public").HttpSetup) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/utils/cache.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/utils/cache.d.ts deleted file mode 100644 index ce087137f228e..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/utils/cache.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Given a non-parametrized async function, returns a function which caches the - * result of that function. When a cached value is available, it returns - * immediately that value and refreshes the cache in the background. When the - * cached value is too old, it is discarded and the function is called again. - * - * @param fn Function to call to get the value. - * @param maxCacheDuration For how long to keep a value in the cache, - * in milliseconds. Defaults to 5 minutes. - * @param refreshAfter Minimum time between cache refreshes, in milliseconds. - * Defaults to 15 seconds. - * @param now Function which returns the current time in milliseconds, defaults to `Date.now`. - * @returns A function which returns the cached value. - */ -export declare const cacheNonParametrizedAsyncFunction: (fn: () => Promise, maxCacheDuration?: number, refreshAfter?: number, now?: () => number) => ({ forceRefresh }?: { - forceRefresh?: boolean; -}) => Promise; -/** - * Caches the result of an async function based on its arguments. - * - * @param fn Function to call to get the value. - * @param getKey Function to generate a unique cache key from the arguments. - * @param maxCacheDuration For how long to keep a value in the cache, - * in milliseconds. Defaults to 5 minutes. - * @param refreshAfter Minimum time between cache refreshes, in milliseconds. - * Defaults to 15 seconds. - * @param now Function which returns the current time in milliseconds, defaults to `Date.now`. - * @returns A function which returns the cached value. - */ -export declare const cacheParametrizedAsyncFunction: (fn: (...args: Args) => Promise, getKey?: (...args: Args) => string, maxCacheDuration?: number, refreshAfter?: number, now?: () => number) => (this: { - forceRefresh?: boolean; -} | undefined | void, ...args: Args) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/views.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/views.d.ts deleted file mode 100644 index fbb0a2fc2e994..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/callbacks/views.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { EsqlViewsResult } from '@kbn/esql-types'; -/** - * Fetches all ES|QL views from the cluster (GET _query/view). - * @param http The HTTP service to use for the request. - * @returns A promise that resolves to the views list. - */ -export declare const getViews: (this: void | { - forceRefresh?: boolean; -} | undefined, http: import("@kbn/core/public").HttpSetup) => Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/index.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/index.d.ts deleted file mode 100644 index de2404aed84d6..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { type AggregateQuery } from '@kbn/es-query'; -import type { DataView } from '@kbn/data-views-plugin/public'; -import type { ESQLControlVariable } from '@kbn/esql-types'; -import { type SupportedFieldTypes, type FieldValue } from './utils'; -type NodeType = 'group' | 'leaf'; -export interface AppliedStatsFunction { - identifier: string; - aggregation: string; -} -export interface ESQLStatsQueryMeta { - groupByFields: Array<{ - field: string; - type: string; - }>; - appliedFunctions: AppliedStatsFunction[]; -} -/** - * This method is used to get the metadata on STATS command to drive the cascade experience from an ESQL query, - * if a valid STATS command is found information about the group by fields and applied functions is returned. - * This method will exclude queries contain commands that are not valid for the cascade experience, - */ -export declare const getESQLStatsQueryMeta: (queryString: string) => ESQLStatsQueryMeta; -export interface CascadeQueryArgs { - /** - * data view for the query - */ - dataView: DataView; - /** - * anchor query for generating the next valid query - */ - query: AggregateQuery; - /** - * ESQL variables for the query - */ - esqlVariables: ESQLControlVariable[] | undefined; - /** - * Node type (group or leaf) for which we are constructing the cascade query - */ - nodeType: NodeType; - /** - * Node path for the current node in the cascade experience we'd like to generate a query for - */ - nodePath: string[]; - /** - * Mapping of node paths to their corresponding values, used to populate the query with literal values - */ - nodePathMap: Record; -} -/** - * Constructs a cascade query from the provided query, based on the node type, node path and node path map. - */ -export declare const constructCascadeQuery: ({ query, dataView, esqlVariables, nodeType, nodePath, nodePathMap, }: CascadeQueryArgs) => AggregateQuery | undefined; -/** - * Handles the computation and appending of a filtering where clause, - * for ES|QL query containing a stats command in the cascade layout experience - */ -export declare const appendFilteringWhereClauseForCascadeLayout: (query: string, esqlVariables: ESQLControlVariable[] | undefined, dataView: DataView, fieldName: string, value: T extends SupportedFieldTypes ? FieldValue : unknown, operation: "+" | "-" | "is_not_null" | "is_null", fieldType?: T extends SupportedFieldTypes ? T : string) => string; -export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/utils.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/utils.d.ts deleted file mode 100644 index 346ad3a1a3b49..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/cascaded_documents_helpers/utils.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { type DataView } from '@kbn/data-views-plugin/public'; -import { Builder } from '@elastic/esql'; -import type { EsqlQuery } from '@elastic/esql'; -import type { ESQLFunction, ESQLCommand } from '@elastic/esql/types'; -import type { FieldSummary } from '@kbn/esql-language/src/commands/registry/types'; -import type { ESQLControlVariable } from '@kbn/esql-types'; -import { type Terminal } from '../esql_fields_utils'; -export declare const SUPPORTED_STATS_COMMAND_OPTION_FUNCTIONS: "categorize"[]; -export type SupportedStatsFunction = (typeof SUPPORTED_STATS_COMMAND_OPTION_FUNCTIONS)[number]; -export declare const isSupportedStatsFunction: (fnName: string) => fnName is SupportedStatsFunction; -export type SupportedFieldTypes = Exclude; -export type FieldValue = Parameters<(typeof Builder.expression.literal)[T]>[0] | unknown; -export interface StatsCommandSummary { - command: ESQLCommand; - aggregates: Record; - grouping: Record; -} -export declare const isCategorizeFunctionWithFunctionArgument: (functionDefinition: ESQLFunction) => boolean; -export declare const removeBackticks: (str: string) => string; -/** - * constrains the field value type to be one of the supported field value types, else we process as a string literal when building the expression - */ -export declare const isSupportedFieldType: (fieldType: unknown) => fieldType is SupportedFieldTypes; -/** - * if value is a text or keyword field and it's not "aggregatable", we opt to use match phrase for the where command - */ -export declare const requiresMatchPhrase: (fieldName: string, dataViewFields: DataView["fields"]) => boolean | undefined; -/** - * Returns the stats command to operate on, we operate on the last stats command in the query - */ -export declare function getStatsCommandToOperateOn(esqlQuery: EsqlQuery): ({ - command: ESQLCommand; - grouping: Record; - aggregates: Record; -} & { - index: number; -}) | null; -/** - * Returns the data source command from the esql query, supports both the FROM and TS commands - */ -export declare function getESQLQueryDataSourceCommand(esqlQuery: EsqlQuery): ESQLCommand<'from' | 'ts'> | undefined; -/** - * Returns runtime fields that are created within the query by the STATS command in the query - */ -export declare function getStatsCommandRuntimeFields(esqlQuery: EsqlQuery): Set[]; -/** - * Returns the summary of the stats command at the given command index in the esql query - */ -export declare function getStatsCommandAtIndexSummary(esqlQuery: EsqlQuery, commandIndex: number): { - command: ESQLCommand; - grouping: Record; - aggregates: Record; -} | null; -/** - * Returns the param definition for the given field name - */ -export declare function getFieldParamDefinition(fieldName: string, fieldTerminals: Array, esqlVariables: ESQLControlVariable[] | undefined): string | number | (string | number)[] | undefined; -export declare function getStatsGroupFieldType(groupByFields: T): R; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_filters_to_esql.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_filters_to_esql.d.ts deleted file mode 100644 index 85076f2442e3a..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_filters_to_esql.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { type Filter } from '@kbn/es-query'; -export interface FilterTranslationResult { - /** Combined WHERE expression fragment (all translatable filters ANDed), empty string if none */ - esqlExpression: string; - /** Filters that could not be translated to ES|QL */ - untranslatableFilters: Filter[]; -} -/** - * Converts an array of Elasticsearch Query DSL filters to an ES|QL WHERE clause expression. - * Disabled filters are skipped. Negated filters are wrapped with NOT. - * Untranslatable filter types (custom, spatial, scripted) are returned separately. - */ -export declare const convertFiltersToESQLExpression: (filters: Filter[]) => FilterTranslationResult; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_query_to_esql.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_query_to_esql.d.ts deleted file mode 100644 index 6a754915aee9f..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/convert_query_to_esql.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type Query } from '@kbn/es-query'; -/** - * Converts a KQL or Lucene query into an ES|QL expression that can be used inside a WHERE - * clause. KQL maps to the `KQL(...)` function and Lucene maps to `QSTR(...)`. - * - * Returns an empty string when the query is missing, has no body, or uses an unsupported - * language. - */ -export declare const convertQueryToESQLExpression: (query?: Query) => string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/esql_fields_utils.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/esql_fields_utils.d.ts deleted file mode 100644 index 7bfe8f239dabd..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/esql_fields_utils.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { FieldSpec } from '@kbn/data-views-plugin/common'; -import type { ESQLColumn, ESQLList, ESQLLiteral, ESQLProperNode } from '@elastic/esql/types'; -import type { DatatableColumn } from '@kbn/expressions-plugin/common'; -/** - * Check if a column is sortable. - * - * @param column The DatatableColumn of the field. - * @returns True if the column is sortable, false otherwise. - */ -export declare const isESQLColumnSortable: (column: DatatableColumn) => boolean; -/** - * Check if a column is groupable (| STATS ... BY ). - * - * @param column The DatatableColumn of the field. - * @returns True if the column is groupable, false otherwise. - */ -export declare const isESQLColumnGroupable: (column: DatatableColumn) => boolean; -export declare const isESQLFieldGroupable: (field: FieldSpec) => boolean; -/** - * Returns the expression that defines the value of the field. - * - * If the field is defined using an assignement expression, it returns the right side of the assignment. - * i.e. in `STATS foo = bar + 1`, it returns `bar + 1`. - * - * If the field is not defined using an assignment, it returns the field argument itself. - * i.e. in `STATS count()`, it returns `count()`. - */ -export declare const getFieldDefinitionFromArg: (fieldArgument: ESQLProperNode) => ESQLProperNode; -export type Terminal = ESQLColumn | ESQLLiteral | ESQLList; -/** - * Retrieves a list of terminal nodes that were found in the field definition. - */ -export declare const getFieldTerminals: (fieldArgument: ESQLProperNode) => Terminal[]; -/** - * Retrieves a formatted list of field names which were used for the new field - * construction. For example, in the below example, `x` and `y` are the - * existing "used" fields: - * - * ``` - * STATS foo = agg(x) BY y, bar = x - * ``` - */ -export declare const getUsedFields: (fieldArgument: ESQLProperNode) => Set; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/extract_categorize_tokens.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/extract_categorize_tokens.d.ts deleted file mode 100644 index e97b67d235fee..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/extract_categorize_tokens.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Extracts "tokens" from a regex string (produced by the categorize function) by stripping leading/trailing '.*?' - * and splitting the remainder by '.+?'. - * - * @param {string} regexString The regular expression string. - * @returns {string[]} An array of extracted "keywords". - */ -export declare function extractCategorizeTokens(regexString: string): string[]; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.d.ts deleted file mode 100644 index b13486a8d70bb..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -export declare const DEFAULT_HIGHLIGHT_PRE_TAG = ""; -export declare const DEFAULT_HIGHLIGHT_POST_TAG = ""; -/** - * ES|QL functions that can produce highlight markup in output columns when - * called with `{ "highlight": true }`. - */ -export declare const FUNCTIONS_WITH_HIGHLIGHT_SUPPORT: string[]; -export interface ESQLHighlightTags { - preTag: string; - postTag: string; -} -export type EsqlColumnsWithHighlights = Record; -/** - * Returns columns built using a highlighting algorithm, - * including the opening and closing markup tags configured for each column. - * - * Example: - * ``` - * FROM books - * | EVAL snippets = TOP_SNIPPETS(description, "Tolkien", { "highlight": true }) - * | EVAL titles = TOP_SNIPPETS(title, "Tolkien", { "highlight": true, "pre_tag": "", "post_tag": "" }) - * ``` - * Will return the following map: - * ``` - * { - * snippets: { - * preTag: '', - * postTag: '', - * }, - * titles: { - * preTag: '', - * postTag: '', - * }, - * } - */ -export declare function getColumnsWithHighlights(query: string): EsqlColumnsWithHighlights; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_adhoc_dataview.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_adhoc_dataview.d.ts deleted file mode 100644 index 9dfcf541339f6..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_adhoc_dataview.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import type { HttpStart } from '@kbn/core/public'; -/** - * Creates an ad-hoc DataView for ES|QL queries. - * - * Some applications need to have a DataView to work properly with ES|QL queries. - * This helper creates an ad-hoc DataView with an ID constructed from the index pattern. - * Since there are no runtime fields, field formatters, or default time fields, - * the same ad-hoc DataView can be constructed/reused, which solves caching issues - * described in https://github.com/elastic/kibana/issues/168131. - * - * The function automatically detects the time field by making an HTTP request to determine - * if '@timestamp' exists across all indices in the query. If all indices contain the field, - * it sets '@timestamp' as the time field; otherwise, no time field is set. - * - * @param dataViewsService - The DataViews service instance used to create the DataView - * @param query - The ES|QL query string to extract the index pattern from - * @param options - Optional configuration for DataView creation - * @param options.allowNoIndex - Whether to allow creating a DataView for non-existent indices - * @param options.skipFetchFields - Whether to skip fetching fields for performance reasons - * @param options.createNewInstanceEvenIfCachedOneAvailable - Forces creation of a new instance by clearing the cached DataView instance and cached time field lookup for the query - * @param options.id - Explicit DataView ID. When provided, this ID is used as-is instead of generating one via SHA-256. Useful when the caller already knows the ID (e.g. from a persisted ad-hoc DataView spec) and wants the DataViewService cache to be populated under that exact key. - * @param options.idPrefix - Custom prefix for the DataView ID (defaults to 'esql'). Use a different prefix to avoid cache collisions between consumers. - * @param http - Optional HTTP service for fetching time field information. If not provided, no time field detection is performed - * - * @returns Promise that resolves to the created DataView with the detected time field (if any) - * - */ -export declare function getESQLAdHocDataview({ dataViewsService, query, options, http, }: { - dataViewsService: DataViewsPublicPluginStart; - query: string; - options?: { - allowNoIndex?: boolean; - createNewInstanceEvenIfCachedOneAvailable?: boolean; - skipFetchFields?: boolean; - id?: string; - idPrefix?: string; - }; - http?: HttpStart; -}): Promise; -/** - * Gets an initial index for a default ES|QL query by querying both local and remote (CCS) indices. - * Could be used during onboarding when data views to get a better index are not yet available. - * Can be used in combination with {@link getESQLAdHocDataview} to create a dataview for the index. - * - * Prefers a local `logs*` pattern if any local index starts with "logs", - * otherwise returns the first available non-hidden index (local or remote). - */ -export declare function getIndexForESQLQuery(deps: { - http: HttpStart; -}): Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_controls.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_controls.d.ts deleted file mode 100644 index 2a0b4ea36fef2..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_controls.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { AggregateQuery, Query } from '@kbn/es-query'; -import type { OptionsListESQLControlState } from '@kbn/controls-schemas'; -import { type PresentationContainer } from '@kbn/presentation-publishing'; -import { ESQL_CONTROL } from '@kbn/controls-constants'; -type EsqlControlState = OptionsListESQLControlState & { - type: typeof ESQL_CONTROL; -}; -interface EsqlControlsState { - [uuid: string]: EsqlControlState; -} -export declare function getAllEsqlControls(presentationContainer: PresentationContainer): EsqlControlsState; -export declare function getEsqlControls(presentationContainer: PresentationContainer, query: AggregateQuery | Query | undefined): { - [k: string]: EsqlControlState; -} | undefined; -export {}; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_time_field_from_query.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_time_field_from_query.d.ts deleted file mode 100644 index cbc572834462b..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_time_field_from_query.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -/** - * Resolves the default time field for an ES|QL query by calling the timefield API. - * - * When `http` is omitted, returns `undefined` (unless a prior successful request - * for the same query left a value in the in-memory cache). - * - * Concurrent requests for the same query share one HTTP request via an LRU-backed promise cache. - */ -export declare function getESQLTimeFieldFromQuery({ query, http, }: { - query: string; - http?: HttpStart; -}): Promise; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_with_safe_limit.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_with_safe_limit.d.ts deleted file mode 100644 index 6d4f3d8000b46..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_esql_with_safe_limit.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getESQLWithSafeLimit(esql: string, limit: number): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_index_pattern_from_query.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_index_pattern_from_query.d.ts deleted file mode 100644 index 2d72495b68c9d..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_index_pattern_from_query.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Retrieves the index pattern from an ES|QL query using AST parsing. - * Handles both main queries and subqueries within FROM/TS commands. - * - * @param esql - The ES|QL query string to parse - * @returns Comma-separated string of unique index names, or empty string if no sources found - */ -export declare function getIndexPatternFromESQLQuery(esql?: string): string; -/** - * @param esql - The ES|QL query string to parse - * @returns The source command name, or an empty string if not found - */ -export declare function getSourceCommandFromESQLQuery(esql?: string): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_initial_esql_query.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_initial_esql_query.d.ts deleted file mode 100644 index 3cef2be5488e0..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_initial_esql_query.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/public'; -import { type Filter, type Query } from '@kbn/es-query'; -/** - * Builds an ES|QL query for the provided dataView - * If there is @timestamp field in the index, we don't add the WHERE clause - * If there is no @timestamp and there is a dataView timeFieldName, we add the WHERE clause with the timeFieldName - * If the index pattern contains TSDB fields, we add the TS command, otherwise we add the FROM command - * @param dataView - * @param query - * @param filters - DSL filters to convert to ES|QL WHERE clauses - */ -export declare function getInitialESQLQuery(dataView: DataView, query?: Query, filters?: Filter[]): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_lookup_indices.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_lookup_indices.d.ts deleted file mode 100644 index 823be0aee7a60..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_lookup_indices.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Extracts and returns a list of unique lookup indices from the provided ESQL query by parsing the query and traversing its AST. - * - * @param {string} esqlQuery - The ESQL query string to parse and analyze for lookup indices. - * @return {string[]} An array of unique lookup index names found in the query. - */ -export declare function getLookupIndicesFromQuery(esqlQuery: string): string[]; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_query_summary.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_query_summary.d.ts deleted file mode 100644 index 6177c9425a1b0..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_query_summary.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { ESQLAstCommand } from '@elastic/esql/types'; -import { type ESQLCommandSummary } from '@kbn/esql-language'; -/** - * Analyzes the provided ES|QL query and returns a summary of new columns, - * renamed columns, and metadata columns introduced by the commands in the query. - * @param query The ES|QL query string to analyze. - * @returns An object containing sets of new columns, renamed column pairs, metadata columns, aggregates, and grouping. - */ -export declare function getQuerySummary(query: string): ESQLCommandSummary; -/** - * Returns an array of summaries, one for each command of the specified type. - * If there are multiple commands of the same type, each will have its own summary in the array. - */ -export declare function getQuerySummaryPerCommandType(query: string, commandType: string): ESQLCommandSummary[]; -/** - * Analyzes a specific command within an ES|QL query and returns a summary of it. - */ -export declare function getSummaryPerCommand(query: string, command: ESQLAstCommand): ESQLCommandSummary; -/** - * Checks if a given field name is a computed column (generated by the ES|QL query), - * excluding original index fields. - * @param fieldName The name of the field to check. - * @param summary The ES|QL query summary. - * @returns True if the field is computed by the query (not from index), false otherwise. - */ -export declare function isComputedColumn(fieldName: string, summary: ESQLCommandSummary): boolean; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/inject_where_after_source.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/inject_where_after_source.d.ts deleted file mode 100644 index 836b10a975c3f..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/inject_where_after_source.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Injects a WHERE clause immediately after the source command (FROM/TS/etc.) of an ES|QL query. - * - * Filters reference source-level fields, so a WHERE has to run before any transformational - * command (STATS, KEEP, DROP, RENAME) that may rename or remove those fields. Appending the - * WHERE to the end of the pipeline would break valid filters; injecting it right after the - * source keeps them at the earliest safe position. - * - * Returns the original query unchanged when the expression is empty or no source command - * can be found in the query. - * - * @param esql - The base ES|QL query - * @param whereExpression - The WHERE expression body (without the leading `WHERE`) - */ -export declare function injectWhereClauseAfterSourceCommand(esql: string, whereExpression: string): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_cannot_be_sampled.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_cannot_be_sampled.d.ts deleted file mode 100644 index 7e802115ae979..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_cannot_be_sampled.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { AggregateQuery, Query } from '@kbn/es-query'; -/** - * Check if the query contains any of the function names being passed in - * @param query - * @param functions list of function names to check for - * @returns - */ -export declare const queryContainsFunction: (query: AggregateQuery | Query | { - [key: string]: any; -} | undefined | null, functions: string[]) => boolean; -/** - * Check if the query contains any function that cannot be used after LIMIT clause - * @param query - * @returns - */ -export declare const queryCannotBeSampled: (query: AggregateQuery | Query | { - [key: string]: any; -} | undefined | null) => boolean; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.d.ts deleted file mode 100644 index 168bc2ac5d4f1..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -import type { ESQLFunction, ESQLColumn, ESQLAstQueryExpression } from '@elastic/esql/types'; -import { type ESQLControlVariable } from '@kbn/esql-types'; -import type { DatatableColumn } from '@kbn/expressions-plugin/common'; -import type { monaco } from '@kbn/monaco'; -export declare function getRemoteClustersFromESQLQuery(esql?: string): string[] | undefined; -/** - * Determines if an ES|QL query contains transformational commands. - * - * For ES|QL, we consider the following as transformational commands: - * - `stats`: Performs aggregations and transformations - * - `keep`: Filters and selects specific fields - * - `fork` commands where ALL branches contain only transformational commands - * - * @param esql - The ES|QL query string to analyze - * @returns true if the query contains transformational commands or fork commands with all transformational branches - * - * @example - * hasTransformationalCommand('from index | stats count() by field') // true - * hasTransformationalCommand('from index | keep field1, field2') // true - * hasTransformationalCommand('from index | fork (stats count()) (keep field)') // true - * hasTransformationalCommand('from index | fork (where x > 0) (eval y = x * 2)') // false - * hasTransformationalCommand('from index | where field > 0') // false - */ -export declare function hasTransformationalCommand(esql?: string): boolean; -export declare function getLimitFromESQLQuery(esql: string): number; -export declare function removeDropCommandsFromESQLQuery(esql?: string): string; -/** - * Converts timeseries (TS) commands to FROM commands in an ES|QL query - * @param esql - The ES|QL query string - * @returns The modified query with TS commands converted to FROM commands - */ -export declare function convertTimeseriesCommandToFrom(esql?: string): string; -/** - * When the ?_tstart and ?_tend params are used, we want to retrieve the timefield from the query. - * @param esql:string - * @returns string - */ -export declare const getTimeFieldFromESQLQuery: (esql: string) => string | undefined; -export declare const getKqlSearchQueries: (esql: string) => string[]; -/** - * Prettifies an ES|QL query with configurable line wrapping. - * @param src - The raw ES|QL query string - * @param lineWidth - Optional line width in characters; when provided, output is wrapped to fit. Otherwise uses the library default (80). - */ -export declare const prettifyQuery: (src: string, lineWidth?: number) => string; -export declare const retrieveMetadataColumns: (esql: string) => string[]; -export declare const getQueryColumnsFromESQLQuery: (esql: string) => string[]; -export declare const getESQLQueryVariables: (esql: string) => string[]; -/** - * This function is used to map the variables to the columns in the datatable - * @param esql:string - * @param variables:ESQLControlVariable[] - * @param columns:DatatableColumn[] - * @returns DatatableColumn[] - */ -export declare const mapVariableToColumn: (esql: string, variables: ESQLControlVariable[], columns: DatatableColumn[]) => DatatableColumn[]; -export declare const getQueryUpToCursor: (queryString: string, cursorPosition?: monaco.Position) => string; -/** - * Finds the column closest to the given cursor position within an array of columns. - * - * @param columns An array of ES|QL columns. - * @param cursorPosition The current cursor position. - * @returns The column object closest to the cursor, or null if the columns array is empty. - */ -export declare function findClosestColumn(columns: ESQLColumn[], cursorPosition?: monaco.Position): ESQLColumn | undefined; -export declare const getValuesFromQueryField: (queryString: string, cursorPosition?: monaco.Position) => string | undefined; -export declare const fixESQLQueryWithVariables: (queryString: string, esqlVariables?: ESQLControlVariable[]) => string; -export declare const getCategorizeColumns: (esql: string) => string[]; -export declare const getSparklineColumns: (esql: string) => string[]; -/** - * Extracts the original and renamed columns from a rename function. - * RENAME original AS renamed Vs RENAME renamed = original - * @param renameFunction - */ -export declare const getArgsFromRenameFunction: (renameFunction: ESQLFunction) => { - original: ESQLColumn; - renamed: ESQLColumn; -}; -/** - * Extracts the fields used in the CATEGORIZE function from an ESQL query. - * @param esql: string - The ESQL query string - */ -export declare const getCategorizeField: (esql: string) => string[]; -export declare const hasLimitBeforeAggregate: (esql: string) => boolean; -export declare const missingSortBeforeLimit: (esql: string) => boolean; -/** - * Checks if the ESQL query contains only source commands (e.g., FROM, TS). - * If the query contains PROMQL command, we will exclude it from this check. - * @param esql: string - The ESQL query string - * @returns true if the query contains only source commands, false otherwise - */ -export declare const hasOnlySourceCommand: (query: string) => boolean; -/** - * Determines if an ES|QL query contains the METRICS_INFO or TS_INFO commands. - * - * @param esql - The ES|QL query string to analyze - * @returns true if the query contains the METRICS_INFO or TS_INFO commands, false otherwise - */ -export declare const hasTimeseriesInfoCommand: (esql?: string) => boolean; -/** - * Given an array of column names, it returns a new array with corrected column names - * if any of the columns is renamed in the query. - */ -export declare const replaceColumnNamesIfRenamed: (root: ESQLAstQueryExpression, columnNames: string[]) => string[]; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/replace_index_pattern.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/replace_index_pattern.d.ts deleted file mode 100644 index c400f21d472db..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/replace_index_pattern.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function replaceESQLQueryIndexPattern(esql: string, replacements: Record): string; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.d.ts deleted file mode 100644 index 778e1d50b44d9..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/run_query.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { DatatableColumn } from '@kbn/expressions-plugin/common'; -import type { KibanaExecutionContext } from '@kbn/core/public'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { TimeRange } from '@kbn/es-query'; -import type { ESQLColumn, ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types'; -import { type ESQLControlVariable } from '@kbn/esql-types'; -export declare const hasStartEndParams: (query: string) => boolean; -export declare const getStartEndParams: (query: string, time?: TimeRange) => ({ - _tstart: string; - _tend?: undefined; -} | { - _tend: string; - _tstart?: undefined; -})[]; -export declare const getNamedParams: (query: string, timeRange?: TimeRange, variables?: ESQLControlVariable[]) => Record | undefined>[]; -export declare function formatESQLColumns(columns: ESQLColumn[]): DatatableColumn[]; -export declare function getESQLQueryColumnsRaw({ esqlQuery, search, signal, filter, dropNullColumns, timeRange, variables, }: { - esqlQuery: string; - search: ISearchGeneric; - signal?: AbortSignal; - dropNullColumns?: boolean; - filter?: unknown; - timeRange?: TimeRange; - variables?: ESQLControlVariable[]; -}): Promise; -export declare function getESQLQueryColumns({ esqlQuery, search, signal, filter, dropNullColumns, timeRange, variables, }: { - esqlQuery: string; - search: ISearchGeneric; - signal?: AbortSignal; - filter?: unknown; - dropNullColumns?: boolean; - timeRange?: TimeRange; - variables?: ESQLControlVariable[]; -}): Promise; -export declare function getESQLResults({ esqlQuery, search, signal, filter, dropNullColumns, timeRange, variables, timezone, executionContext, }: { - esqlQuery: string; - search: ISearchGeneric; - signal?: AbortSignal; - filter?: unknown; - dropNullColumns?: boolean; - timeRange?: TimeRange; - variables?: ESQLControlVariable[]; - timezone?: string; - executionContext?: KibanaExecutionContext; -}): Promise<{ - response: ESQLSearchResponse; - params: ESQLSearchParams; -}>; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/sanitaze_input.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/sanitaze_input.d.ts deleted file mode 100644 index 3514b9e138e3d..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/sanitaze_input.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function sanitazeESQLInput(input: string): string | undefined; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/set_instructions_helpers.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/set_instructions_helpers.d.ts deleted file mode 100644 index 5a2b8f72086c2..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/set_instructions_helpers.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Extracts the project routing value from an ES|QL query string. - * - * @param queryString - The ES|QL query string to parse - * @returns The project routing value if found, undefined otherwise - * - * @example - * getProjectRoutingFromEsqlQuery('SET project_routing = "_alias:*"; FROM my_index') - * // Returns: '_alias:*' - * - * getProjectRoutingFromEsqlQuery('FROM my_index') - * // Returns: undefined - */ -export declare function getProjectRoutingFromEsqlQuery(queryString: string): string | undefined; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/sha256.d.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/sha256.d.ts deleted file mode 100644 index d52b21c712424..0000000000000 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/sha256.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const sha256: (str: string) => Promise; diff --git a/src/platform/packages/shared/kbn-interpreter/index.d.ts b/src/platform/packages/shared/kbn-interpreter/index.d.ts deleted file mode 100644 index 587a861935990..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './src/common'; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/index.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/index.d.ts deleted file mode 100644 index f02cc7037c38e..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type { Ast, AstArgument, AstFunction, AstNode, AstWithMeta, AstArgumentWithMeta, AstFunctionWithMeta, } from './lib/ast'; -export { fromExpression, isAst, isAstWithMeta, toExpression, safeElementFromExpression, } from './lib/ast'; -export { Fn } from './lib/fn'; -export { getType } from './lib/get_type'; -export { castProvider } from './lib/cast'; -export { parse } from './lib/parse'; -export { getByAlias } from './lib/get_by_alias'; -export { Registry } from './lib/registry'; -export { addRegistries, register, registryFactory } from './registries'; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/arg.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/arg.d.ts deleted file mode 100644 index 738afcf3adc1f..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/arg.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export function Arg(config: any): void; -export class Arg { - constructor(config: any); - name: any; - required: any; - help: any; - types: any; - default: any; - aliases: any; - multi: any; - resolve: any; - options: any; - accepts: (type: any) => boolean; -} diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/ast.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/ast.d.ts deleted file mode 100644 index eae7e05c7c84c..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/ast.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export type AstNode = Ast | AstFunction | AstArgument; -export type Ast = { - type: 'expression'; - chain: AstFunction[]; -}; -export type AstFunction = { - type: 'function'; - function: string; - arguments: Record; -}; -export type AstArgument = string | boolean | number | Ast; -interface WithMeta { - start: number; - end: number; - text: string; - node: T; -} -type Replace = Pick> & R; -type WrapAstArgumentWithMeta = T extends Ast ? AstWithMeta : WithMeta; -export type AstArgumentWithMeta = WrapAstArgumentWithMeta; -export type AstFunctionWithMeta = WithMeta>; -export type AstWithMeta = WithMeta>; -export declare function isAstWithMeta(value: any): value is AstWithMeta; -export declare function isAst(value: any): value is Ast; -export {}; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/compare.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/compare.d.ts deleted file mode 100644 index 11faba06d4def..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/compare.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Ast, AstArgument, AstArgumentWithMeta } from './ast'; -export interface ValueChange { - type: 'value'; - source: AstArgumentWithMeta; - target: AstArgument; -} -export type Change = ValueChange; -export declare function isValueChange(value: any): value is ValueChange; -export declare function compare(expression: string, ast: Ast): Change[]; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/from_expression.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/from_expression.d.ts deleted file mode 100644 index 09f2fb91635fd..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/from_expression.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Ast } from './ast'; -export declare function fromExpression(expression: string, type?: string): Ast; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/index.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/index.d.ts deleted file mode 100644 index 3c55fe2285f22..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './ast'; -export * from './from_expression'; -export * from './safe_element_from_expression'; -export * from './to_expression'; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/patch.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/patch.d.ts deleted file mode 100644 index 4379a05aaeee8..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/patch.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Ast } from './ast'; -export declare function patch(expression: string, ast: Ast): string; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/safe_element_from_expression.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/safe_element_from_expression.d.ts deleted file mode 100644 index 37cb76c1f7aa4..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/safe_element_from_expression.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function safeElementFromExpression(expression: string): import("./ast").Ast; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/to_expression.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/to_expression.d.ts deleted file mode 100644 index 4f442a77752b1..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/ast/to_expression.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { AstNode } from './ast'; -interface Options { - /** - * Node type. - */ - type?: 'argument' | 'expression' | 'function'; - /** - * Original expression to apply the new AST to. - * At the moment, only arguments values changes are supported. - */ - source?: string; -} -export declare function toExpression(ast: AstNode, options?: string | Options): string; -export {}; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/cast.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/cast.d.ts deleted file mode 100644 index 2430d0c19f1fd..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/cast.d.ts +++ /dev/null @@ -1 +0,0 @@ -export function castProvider(types: any): (node: any, toTypeNames: any) => any; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/fn.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/fn.d.ts deleted file mode 100644 index a4836a63543bc..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export function Fn(config: any): void; -export class Fn { - constructor(config: any); - name: any; - type: any; - aliases: any; - fn: (...args: any[]) => Promise; - help: any; - args: { - [x: string]: Arg; - }; - context: any; - accepts: (type: any) => boolean; -} -import { Arg } from './arg'; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_by_alias.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_by_alias.d.ts deleted file mode 100644 index 70d555315ad49..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_by_alias.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * This is used for looking up function/argument definitions. It looks through - * the given object/array for a case-insensitive match, which could be either the - * `name` itself, or something under the `aliases` property. - */ -export function getByAlias(specs: any, name: any): any; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_type.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_type.d.ts deleted file mode 100644 index 2a5e3f7b4d736..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/get_type.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getType(node: any): string; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/parse.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/parse.d.ts deleted file mode 100644 index 2537be0cb446c..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/parse.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Ast, AstWithMeta } from './ast'; -import { parse } from './grammar.peggy'; -interface Options { - startRule?: string; -} -interface OptionsWithMeta extends Options { - addMeta: true; -} -export interface Parse { - (input: string, options?: Options): Ast; - (input: string, options: OptionsWithMeta): AstWithMeta; -} -declare const typedParse: typeof parse; -export { typedParse as parse }; diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/lib/registry.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/lib/registry.d.ts deleted file mode 100644 index a969e4c4b702c..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/lib/registry.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export declare class Registry { - private readonly _prop; - private _indexed; - constructor(prop?: string); - wrapper(obj: ItemSpec): Item; - register(fn: () => ItemSpec): void; - toJS(): { - [key: string]: any; - }; - toArray(): Item[]; - get(name: string): Item; - getProp(): string; - reset(): void; -} diff --git a/src/platform/packages/shared/kbn-interpreter/src/common/registries.d.ts b/src/platform/packages/shared/kbn-interpreter/src/common/registries.d.ts deleted file mode 100644 index 7de6b1581bb46..0000000000000 --- a/src/platform/packages/shared/kbn-interpreter/src/common/registries.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Add a new set of registries to an existing set of registries. - * - * @param {*} registries - The existing set of registries - * @param {*} newRegistries - The new set of registries - */ -export function addRegistries(registries: any, newRegistries: any): any; -/** - * Register a set of interpreter specs (functions, types, renderers, etc) - * - * @param {*} registries - The set of registries - * @param {*} specs - The specs to be regsitered (e.g. { types: [], browserFunctions: [] }) - */ -export function register(registries: any, specs: any): any; -/** - * A convenience function for exposing registries and register in a plugin-friendly way - * as a global in the browser, and as server.plugins.interpreter.register | registries - * on the server. - * - * @param {*} registries - The registries to wrap. - */ -export function registryFactory(registries: any): { - registries(): any; - register(specs: any): any; -}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/index.d.ts deleted file mode 100644 index df8a766ffe400..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export type { IndexPattern } from './src/index_pattern_rt'; -export type { NonEmptyString, NonEmptyStringBrand } from './src/non_empty_string_rt'; -export { arrayToStringRt } from './src/array_to_string_rt'; -export { deepExactRt } from './src/deep_exact_rt'; -export { indexPatternRt } from './src/index_pattern_rt'; -export { jsonRt } from './src/json_rt'; -export { mergeRt } from './src/merge_rt'; -export { strictKeysRt } from './src/strict_keys_rt'; -export { isoToEpochRt } from './src/iso_to_epoch_rt'; -export { isoToEpochSecsRt } from './src/iso_to_epoch_secs_rt'; -export { toNumberRt } from './src/to_number_rt'; -export { toBooleanRt } from './src/to_boolean_rt'; -export { toJsonSchema } from './src/to_json_schema'; -export { nonEmptyStringRt } from './src/non_empty_string_rt'; -export { createLiteralValueFromUndefinedRT } from './src/literal_value_from_undefined_rt'; -export { createRouteValidationFunction } from './src/route_validation'; -export { inRangeRt, type InRangeBrand, type InRange, inRangeFromStringRt } from './src/in_range_rt'; -export { dateRt } from './src/date_rt'; -export { isGreaterOrEqualRt, type IsGreaterOrEqualBrand, type IsGreaterOrEqual, } from './src/is_greater_or_equal'; -export { datemathStringRt } from './src/datemath_string_rt'; -export { createPlainError, decodeOrThrow, formatErrors, throwErrors } from './src/decode_or_throw'; -export { DateFromStringOrNumber, minimalTimeKeyRT, type MinimalTimeKey, type TimeKey, type UniqueTimeKey, } from './src/time_key_rt'; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/array_to_string_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/array_to_string_rt/index.d.ts deleted file mode 100644 index 6526c77708130..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/array_to_string_rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as rt from 'io-ts'; -export declare const arrayToStringRt: rt.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/date_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/date_rt/index.d.ts deleted file mode 100644 index d6479f9d2e643..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/date_rt/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as rt from 'io-ts'; -export interface DateBrand { - readonly Date: unique symbol; -} -export type Date = rt.Branded; -export declare const dateRt: rt.BrandC; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/datemath_string_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/datemath_string_rt/index.d.ts deleted file mode 100644 index c1ec9a3c840b5..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/datemath_string_rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as rt from 'io-ts'; -export declare const datemathStringRt: rt.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/decode_or_throw.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/decode_or_throw.d.ts deleted file mode 100644 index 62e6d5996647b..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/decode_or_throw.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Errors, Type, ValidationError } from 'io-ts'; -type ErrorFactory = (message: string) => Error; -export declare const formatErrors: (errors: ValidationError[]) => string; -export declare const createPlainError: (message: string) => Error; -export declare const throwErrors: (createError: ErrorFactory) => (errors: Errors) => never; -export declare const decodeOrThrow: (runtimeType: Type, createError?: ErrorFactory) => (inputValue: InputValue) => DecodedValue; -export {}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/deep_exact_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/deep_exact_rt/index.d.ts deleted file mode 100644 index 5fcda7be32f66..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/deep_exact_rt/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as t from 'io-ts'; -import type { ParseableType } from '../parseable_types'; -export declare function deepExactRt | ParseableType>(type: T): T; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/in_range_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/in_range_rt/index.d.ts deleted file mode 100644 index 9c382d6fc70a4..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/in_range_rt/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as rt from 'io-ts'; -export interface InRangeBrand { - readonly InRange: unique symbol; -} -export type InRange = rt.Branded; -export declare const inRangeRt: (start: number, end: number) => rt.Type; -export declare const inRangeFromStringRt: (start: number, end: number) => rt.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/index_pattern_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/index_pattern_rt/index.d.ts deleted file mode 100644 index 2438d5e586f7a..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/index_pattern_rt/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as rt from 'io-ts'; -export declare const isEmptyString: (value: string) => value is ""; -export declare const containsSpaces: (value: string) => boolean; -export declare const containsEmptyEntries: (value: string) => boolean; -export declare const validateIndexPattern: (indexPattern: string) => boolean; -export interface IndexPatternBrand { - readonly IndexPattern: unique symbol; -} -export type IndexPattern = rt.Branded; -export declare const indexPatternRt: rt.BrandC; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/is_greater_or_equal/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/is_greater_or_equal/index.d.ts deleted file mode 100644 index 4ba3cb4bbecce..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/is_greater_or_equal/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as rt from 'io-ts'; -export interface IsGreaterOrEqualBrand { - readonly IsGreaterOrEqual: unique symbol; -} -export type IsGreaterOrEqual = rt.Branded; -export declare const isGreaterOrEqualRt: (value: number) => rt.BrandC; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_rt/index.d.ts deleted file mode 100644 index 9202ecd3a60f1..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as t from 'io-ts'; -export declare const isoToEpochRt: t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_secs_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_secs_rt/index.d.ts deleted file mode 100644 index f1d33091647a6..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/iso_to_epoch_secs_rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as t from 'io-ts'; -export declare const isoToEpochSecsRt: t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/json_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/json_rt/index.d.ts deleted file mode 100644 index b50d01c655205..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/json_rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as t from 'io-ts'; -export declare const jsonRt: t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/literal_value_from_undefined_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/literal_value_from_undefined_rt/index.d.ts deleted file mode 100644 index aaf783143393e..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/literal_value_from_undefined_rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as rt from 'io-ts'; -export declare const createLiteralValueFromUndefinedRT: (literalValue: LiteralValue) => rt.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/merge_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/merge_rt/index.d.ts deleted file mode 100644 index 3016d129c4af3..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/merge_rt/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as t from 'io-ts'; -type PlainObject = Record; -type DeepMerge = U extends PlainObject ? T extends PlainObject ? Omit & { - [key in keyof U]: T extends { - [k in key]: any; - } ? DeepMerge : U[key]; -} : U : U; -export type MergeType = t.Type, t.TypeOf>, DeepMerge, t.OutputOf>> & { - _tag: 'MergeType'; - types: [T1, T2]; -}; -export declare function mergeRt(a: T1, b: T2): MergeType; -export {}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/non_empty_string_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/non_empty_string_rt/index.d.ts deleted file mode 100644 index c750474986976..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/non_empty_string_rt/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as t from 'io-ts'; -export interface NonEmptyStringBrand { - readonly NonEmptyString: unique symbol; -} -export type NonEmptyString = t.Branded; -export declare const nonEmptyStringRt: t.BrandC; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/parseable_types/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/parseable_types/index.d.ts deleted file mode 100644 index f068a45672c1c..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/parseable_types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type * as t from 'io-ts'; -import type { MergeType } from '../merge_rt'; -export type ParseableType = t.StringType | t.NumberType | t.BooleanType | t.ArrayType | t.RecordC | t.DictionaryType | t.InterfaceType | t.PartialType | t.UnionType | t.IntersectionType | MergeType; -export declare const isParsableType: (type: t.Type | ParseableType) => type is ParseableType; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/route_validation/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/route_validation/index.d.ts deleted file mode 100644 index 2d8b4b1304223..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/route_validation/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { RouteValidationFunction } from '@kbn/core/server'; -import type { Type, ValidationError } from 'io-ts'; -export declare const createRouteValidationFunction: (runtimeType: Type) => RouteValidationFunction; -export declare const formatErrors: (errors: ValidationError[]) => string; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/strict_keys_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/strict_keys_rt/index.d.ts deleted file mode 100644 index e294778637d95..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/strict_keys_rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as t from 'io-ts'; -export declare function strictKeysRt(type: T): t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/time_key_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/time_key_rt/index.d.ts deleted file mode 100644 index 6be73182698fa..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/time_key_rt/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as rt from 'io-ts'; -export declare const DateFromStringOrNumber: rt.Type; -export declare const minimalTimeKeyRT: rt.TypeC<{ - time: rt.Type; - tiebreaker: rt.NumberC; -}>; -export type MinimalTimeKey = rt.TypeOf; -declare const timeKeyRT: rt.IntersectionC<[rt.TypeC<{ - time: rt.Type; - tiebreaker: rt.NumberC; -}>, rt.PartialC<{ - gid: rt.StringC; - fromAutoReload: rt.BooleanC; -}>]>; -export type TimeKey = rt.TypeOf; -export interface UniqueTimeKey extends TimeKey { - gid: string; -} -export {}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/to_boolean_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/to_boolean_rt/index.d.ts deleted file mode 100644 index 0a1ba67dff50d..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/to_boolean_rt/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as t from 'io-ts'; -export declare function isPrimitive(value: unknown): value is string | number | boolean | null | undefined; -export declare const toBooleanRt: t.Type; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/to_json_schema/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/to_json_schema/index.d.ts deleted file mode 100644 index ee29e0a4c65af..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/to_json_schema/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type * as t from 'io-ts'; -import type { ParseableType } from '../parseable_types'; -interface JSONSchemaObject { - type: 'object'; - required?: string[]; - properties?: Record; - additionalProperties?: boolean | JSONSchema; -} -interface JSONSchemaOneOf { - oneOf: JSONSchema[]; -} -interface JSONSchemaAllOf { - allOf: JSONSchema[]; -} -interface JSONSchemaAnyOf { - anyOf: JSONSchema[]; -} -interface JSONSchemaArray { - type: 'array'; - items?: JSONSchema; -} -interface BaseJSONSchema { - type: string; -} -type JSONSchema = JSONSchemaObject | JSONSchemaArray | BaseJSONSchema | JSONSchemaOneOf | JSONSchemaAllOf | JSONSchemaAnyOf; -export declare const toJsonSchema: (type: t.Type | ParseableType) => JSONSchema; -export {}; diff --git a/src/platform/packages/shared/kbn-io-ts-utils/src/to_number_rt/index.d.ts b/src/platform/packages/shared/kbn-io-ts-utils/src/to_number_rt/index.d.ts deleted file mode 100644 index 47911d9742aa6..0000000000000 --- a/src/platform/packages/shared/kbn-io-ts-utils/src/to_number_rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as t from 'io-ts'; -export declare const toNumberRt: t.Type; diff --git a/src/platform/packages/shared/kbn-management/autoops_promotion_callout/index.d.ts b/src/platform/packages/shared/kbn-management/autoops_promotion_callout/index.d.ts deleted file mode 100644 index fed53fe0593c5..0000000000000 --- a/src/platform/packages/shared/kbn-management/autoops_promotion_callout/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { AutoOpsPromotionCalloutProps } from './src/callout'; -export { AutoOpsPromotionCallout } from './src/callout'; diff --git a/src/platform/packages/shared/kbn-management/autoops_promotion_callout/src/callout.d.ts b/src/platform/packages/shared/kbn-management/autoops_promotion_callout/src/callout.d.ts deleted file mode 100644 index 03cfbe19a12ee..0000000000000 --- a/src/platform/packages/shared/kbn-management/autoops_promotion_callout/src/callout.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import type { EuiCallOutProps } from '@elastic/eui'; -export interface AutoOpsPromotionCalloutProps { - cloudConnectUrl?: string; - onConnectClick?: (e: React.MouseEvent) => void; - hasCloudConnectPermission?: boolean; - overrideCalloutProps?: Partial>; -} -export declare const AUTOOPS_CALLOUT_DISMISSED_KEY = "kibana.autoOpsPromotionCallout.dismissed"; -export declare const AutoOpsPromotionCallout: ({ cloudConnectUrl, onConnectClick, hasCloudConnectPermission, overrideCalloutProps, }: AutoOpsPromotionCalloutProps) => React.JSX.Element | null; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/index.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/index.d.ts deleted file mode 100644 index baf306d147678..0000000000000 --- a/src/platform/packages/shared/kbn-management/cards_navigation/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { AppId, CardsNavigationComponentProps } from './src'; -export { appCategories, type CardNavExtensionDefinition } from './src/types'; -export { appIds, CardsNavigation } from './src'; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/src/cards_navigation.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/src/cards_navigation.d.ts deleted file mode 100644 index fde2b040f180d..0000000000000 --- a/src/platform/packages/shared/kbn-management/cards_navigation/src/cards_navigation.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from 'react'; -import type { CardsNavigationComponentProps, AppId, AppDefinition } from './types'; -type AggregatedCardNavDefinitions = NonNullable | Record; -export declare const getAppIdsByCategory: (category: string, appDefinitions: AggregatedCardNavDefinitions) => ("settings" | "spaces" | "dataViews" | "transform" | "objects" | "tags" | "ingest_pipelines" | "pipelines" | "index_management" | "jobsListLink" | "filesManagement" | "reporting" | "triggersActionsConnectors" | "triggersActions" | "maintenanceWindows" | "roles" | "api_keys" | "data_quality" | "data_usage" | "content_connectors")[]; -export declare const CardsNavigation: ({ sections, appBasePath, onCardClick, hideLinksTo, extendedCardNavigationDefinitions, }: CardsNavigationComponentProps) => React.JSX.Element; -export {}; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/src/consts.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/src/consts.d.ts deleted file mode 100644 index 5efefa5d157e6..0000000000000 --- a/src/platform/packages/shared/kbn-management/cards_navigation/src/consts.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AppId, AppDefinition } from './types'; -export { AppIds, appCategories } from './types'; -export declare const appDefinitions: Record; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/src/index.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/src/index.d.ts deleted file mode 100644 index bcbe914752a84..0000000000000 --- a/src/platform/packages/shared/kbn-management/cards_navigation/src/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { CardsNavigationComponentProps, AppId } from './types'; -export { AppIds as appIds } from './consts'; -export { CardsNavigation } from './cards_navigation'; diff --git a/src/platform/packages/shared/kbn-management/cards_navigation/src/types.d.ts b/src/platform/packages/shared/kbn-management/cards_navigation/src/types.d.ts deleted file mode 100644 index 9f941d8d8310f..0000000000000 --- a/src/platform/packages/shared/kbn-management/cards_navigation/src/types.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type { EuiIconProps } from '@elastic/eui'; -/** - * app ids shared by all solutions - */ -export declare enum AppIds { - INGEST_PIPELINES = "ingest_pipelines", - PIPELINES = "pipelines", - INDEX_MANAGEMENT = "index_management", - TRANSFORM = "transform", - ML = "jobsListLink", - SAVED_OBJECTS = "objects", - TAGS = "tags", - FILES_MANAGEMENT = "filesManagement", - DATA_VIEWS = "dataViews", - REPORTING = "reporting", - CONNECTORS = "triggersActionsConnectors", - RULES = "triggersActions", - MAINTENANCE_WINDOWS = "maintenanceWindows", - SERVERLESS_SETTINGS = "settings", - ROLES = "roles", - API_KEYS = "api_keys", - DATA_QUALITY = "data_quality", - SPACES = "spaces", - DATA_USAGE = "data_usage", - CONTENT_CONNECTORS = "content_connectors" -} -export type AppId = `${AppIds}`; -export declare const appCategories: { - readonly DATA: "data"; - readonly ACCESS: "access"; - readonly ALERTS: "alerts"; - readonly CONTENT: "content"; - readonly OTHER: "other"; -}; -export interface Application { - id: string; - title: string; - basePath: string; - enabled: boolean; -} -export interface AppRegistrySections { - id?: string; - title?: string; - apps: Application[]; -} -export interface CardsNavigationComponentProps { - sections: AppRegistrySections[]; - appBasePath: string; - onCardClick?: (e: React.MouseEvent) => void; - hideLinksTo?: AppId[]; - extendedCardNavigationDefinitions?: Record; -} -export interface ManagementAppProps { - id: string; - title: string; - href: string; -} -export interface AppDefinition { - category: (typeof appCategories)[keyof typeof appCategories]; - description: string; - icon: EuiIconProps['type']; -} -export type CardNavExtensionDefinition = AppDefinition & ({ - /** - * Optional prop that indicates if the card nav definition being declared, - * skips validation to ascertain it's key is a valid id for a management app. - */ - skipValidation?: false; -} | { - skipValidation: true; - /** - * Specify the url that the card nav being defined should route to, - * and is only expected when the value of {@link skipValidation} prop is passed true. - */ - href: string; - /** - * Defines the title of the card nav being defined, - * and is only expected when the {@link skipValidation} prop value is true. - */ - title: string; -}); -export type AppProps = ManagementAppProps & (AppDefinition | CardNavExtensionDefinition); diff --git a/src/platform/packages/shared/kbn-management/settings/setting_ids/index.d.ts b/src/platform/packages/shared/kbn-management/settings/setting_ids/index.d.ts deleted file mode 100644 index 5ba84806ec428..0000000000000 --- a/src/platform/packages/shared/kbn-management/settings/setting_ids/index.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -export declare const DISABLE_REQUEST_BATCHING_ID = "bfetch:disable"; -export declare const ELASTIC_CONSOLE_ENABLED_SETTING_ID = "elasticRamen:enabled"; -export declare const DISABLE_BATCH_COMPRESSION_ID = "bfetch:disableCompression"; -export declare const CSV_QUOTE_VALUES_ID = "csv:quoteValues"; -export declare const CSV_SEPARATOR_ID = "csv:separator"; -export declare const DATE_FORMAT_ID = "dateFormat"; -export declare const DATE_FORMAT_DOW_ID = "dateFormat:dow"; -export declare const DATE_FORMAT_SCALED_ID = "dateFormat:scaled"; -export declare const DATE_FORMAT_TZ_ID = "dateFormat:tz"; -export declare const DATE_FORMAT_NANOS_ID = "dateNanosFormat"; -export declare const DEFAULT_INDEX_ID = "defaultIndex"; -export declare const DEFAULT_ROUTE_ID = "defaultRoute"; -export declare const FIELDS_POPULAR_LIMIT_ID = "fields:popularLimit"; -export declare const FILE_UPLOAD_MAX_SIZE_ID = "fileUpload:maxFileSize"; -export declare const FILTER_EDITOR_SUGGEST_VALUES_ID = "filterEditor:suggestValues"; -export declare const FILTERS_PINNED_BY_DEFAULT_ID = "filters:pinnedByDefault"; -export declare const FORMAT_BYTES_DEFAULT_PATTERN_ID = "format:bytes:defaultPattern"; -export declare const FORMAT_CURRENCY_DEFAULT_PATTERN_ID = "format:currency:defaultPattern"; -export declare const FORMAT_DEFAULT_TYPE_MAP_ID = "format:defaultTypeMap"; -export declare const FORMAT_NUMBER_DEFAULT_LOCALE_ID = "format:number:defaultLocale"; -export declare const FORMAT_NUMBER_DEFAULT_PATTERN_ID = "format:number:defaultPattern"; -export declare const FORMAT_PERCENT_DEFAULT_PATTERN_ID = "format:percent:defaultPattern"; -export declare const HIDE_ANNOUNCEMENTS_ID = "hideAnnouncements"; -export declare const HISTOGRAM_BAR_TARGET_ID = "histogram:barTarget"; -export declare const HISTOGRAM_MAX_BARS_ID = "histogram:maxBars"; -export declare const HISTORY_LIMIT_ID = "history:limit"; -export declare const META_FIELDS_ID = "metaFields"; -export declare const METRICS_ALLOW_STRING_INDICES_ID = "metrics:allowStringIndices"; -export declare const METRICS_MAX_BUCKETS_ID = "metrics:max_buckets"; -export declare const QUERY_ALLOW_LEADING_WILDCARDS_ID = "query:allowLeadingWildcards"; -export declare const QUERY_STRING_OPTIONS_ID = "query:queryString:options"; -export declare const SAVED_OBJECTS_LISTING_LIMIT_ID = "savedObjects:listingLimit"; -export declare const SAVED_OBJECTS_PER_PAGE_ID = "savedObjects:perPage"; -export declare const SEARCH_QUERY_LANGUAGE_ID = "search:queryLanguage"; -export declare const SHORT_DOTS_ENABLE_ID = "shortDots:enable"; -export declare const SORT_OPTIONS_ID = "sort:options"; -export declare const STATE_STORE_IN_SESSION_STORAGE_ID = "state:storeInSessionStorage"; -export declare const THEME_DARK_MODE_ID = "theme:darkMode"; -export declare const THEME_NAME_ID = "theme:name"; -export declare const TIMEPICKER_QUICK_RANGES_ID = "timepicker:quickRanges"; -export declare const TIMEPICKER_REFRESH_INTERVAL_DEFAULTS_ID = "timepicker:refreshIntervalDefaults"; -export declare const TIMEPICKER_TIME_DEFAULTS_ID = "timepicker:timeDefaults"; -export declare const LABS_CANVAS_BY_VALUE_EMBEDDABLE_ID = "labs:canvas:byValueEmbeddable"; -export declare const LABS_CANVAS_ENABLE_UI_ID = "labs:canvas:enable_ui"; -export declare const LABS_DASHBOARD_DEFER_BELOW_FOLD_ID = "labs:dashboard:deferBelowFold"; -export declare const LABS_DASHBOARDS_ENABLE_UI_ID = "labs:dashboard:enable_ui"; -export declare const ACCESSIBILITY_DISABLE_ANIMATIONS_ID = "accessibility:disableAnimations"; -export declare const AGENT_BUILDER_NAV_ENABLED_SETTING_ID = "agentBuilder:navEnabled"; -export declare const AGENT_BUILDER_EXPERIMENTAL_FEATURES_SETTING_ID = "agentBuilder:experimentalFeatures"; -export declare const AGENT_BUILDER_PRE_PROMPT_WORKFLOW_IDS = "agentBuilder:prePromptWorkflowIds"; -export declare const AGENT_BUILDER_UIAM_OAUTH_CLIENT_MANAGEMENT_SETTING_ID = "agentBuilder:uiamOAuthClientManagement"; -export declare const AUTOCOMPLETE_USE_TIME_RANGE_ID = "autocomplete:useTimeRange"; -export declare const AUTOCOMPLETE_VALUE_SUGGESTION_METHOD_ID = "autocomplete:valueSuggestionMethod"; -export declare const BANNERS_PLACEMENT_ID = "banners:placement"; -export declare const BANNERS_TEXT_CONTENT_ID = "banners:textContent"; -export declare const BANNERS_TEXT_COLOR_ID = "banners:textColor"; -export declare const BANNERS_LINK_COLOR_ID = "banners:linkColor"; -export declare const BANNERS_BACKGROUND_COLOR_ID = "banners:backgroundColor"; -export declare const CONTEXT_DEFAULT_SIZE_ID = "context:defaultSize"; -export declare const CONTEXT_STEP_ID = "context:step"; -export declare const CONTEXT_TIE_BREAKER_FIELDS_ID = "context:tieBreakerFields"; -export declare const DEFAULT_COLUMNS_ID = "defaultColumns"; -export declare const ENABLE_ESQL_ID = "enableESQL"; -export declare const DISCOVER_MAX_DOC_FIELDS_DISPLAYED_ID = "discover:maxDocFieldsDisplayed"; -export declare const DISCOVER_MODIFY_COLUMNS_ON_SWITCH_ID = "discover:modifyColumnsOnSwitch"; -export declare const DISCOVER_ROW_HEIGHT_OPTION_ID = "discover:rowHeightOption"; -export declare const DISCOVER_SAMPLE_ROWS_PER_PAGE_ID = "discover:sampleRowsPerPage"; -export declare const DISCOVER_SAMPLE_SIZE_ID = "discover:sampleSize"; -export declare const DISCOVER_SEARCH_ON_PAGE_LOAD_ID = "discover:searchOnPageLoad"; -export declare const DISCOVER_SHOW_FIELD_STATISTICS_ID = "discover:showFieldStatistics"; -export declare const DISCOVER_SHOW_MULTI_FIELDS_ID = "discover:showMultiFields"; -export declare const DISCOVER_SORT_DEFAULT_ORDER_ID = "discover:sort:defaultOrder"; -export declare const DOC_TABLE_HIDE_TIME_COLUMNS_ID = "doc_table:hideTimeColumn"; -export declare const DOC_TABLE_HIGHLIGHT_ID = "doc_table:highlight"; -export declare const ML_ANOMALY_DETECTION_RESULTS_ENABLE_TIME_DEFAULTS_ID = "ml:anomalyDetection:results:enableTimeDefaults"; -export declare const ML_ANOMALY_DETECTION_RESULTS_TIME_DEFAULTS_ID = "ml:anomalyDetection:results:timeDefaults"; -export declare const NOTIFICATIONS_BANNER_ID = "notifications:banner"; -export declare const NOTIFICATIONS_LIFETIME_BANNER_ID = "notifications:lifetime:banner"; -export declare const NOTIFICATIONS_LIFETIME_ERROR_ID = "notifications:lifetime:error"; -export declare const NOTIFICATIONS_LIFETIME_INFO_ID = "notifications:lifetime:info"; -export declare const NOTIFICATIONS_LIFETIME_WARNING_ID = "notifications:lifetime:warning"; -export declare const OBSERVABILITY_APM_AWS_LAMBDA_PRICE_FACTOR_ID = "observability:apmAWSLambdaPriceFactor"; -export declare const OBSERVABILITY_APM_AWS_LAMBDA_REQUEST_COST_PER_MILLION_ID = "observability:apmAWSLambdaRequestCostPerMillion"; -export declare const OBSERVABILITY_APM_DEFAULT_SERVICE_ENVIRONMENT_ID = "observability:apmDefaultServiceEnvironment"; -export declare const OBSERVABILITY_APM_PROGRESSIVE_LOADING_ID = "observability:apmProgressiveLoading"; -export declare const OBSERVABILITY_APM_SERVICE_GROUP_MAX_NUMBER_OF_SERVICE_ID = "observability:apmServiceGroupMaxNumberOfServices"; -export declare const OBSERVABILITY_ENABLE_COMPARISON_BY_DEFAULT_ID = "observability:enableComparisonByDefault"; -export declare const OBSERVABILITY_ENABLE_INFRASTRUCTURE_ASSET_CUSTOM_DASHBOARDS_ID = "observability:enableInfrastructureAssetCustomDashboards"; -export declare const OBSERVABILITY_ENABLE_INSPECT_ES_QUERIES_ID = "observability:enableInspectEsQueries"; -export declare const OBSERVABILITY_MAX_SUGGESTIONS_ID = "observability:maxSuggestions"; -export declare const OBSERVABILITY_APM_ENABLE_TABLE_SEARCH_BAR = "observability:apmEnableTableSearchBar"; -export declare const OBSERVABILITY_APM_ENABLE_SERVICE_INVENTORY_TABLE_SEARCH_BAR = "observability:apmEnableServiceInventoryTableSearchBar"; -export declare const OBSERVABILITY_LOGS_SHARED_NEW_LOGS_OVERVIEW_ID = "observability:newLogsOverview"; -export declare const OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID = "observability:logSources"; -export declare const OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING = "observability:aiAssistantSimulatedFunctionCalling"; -export declare const OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN = "observability:aiAssistantSearchConnectorIndexPattern"; -export declare const GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR = "genAiSettings:defaultAIConnector"; -export declare const GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR_DEFAULT_ONLY = "genAiSettings:defaultAIConnectorOnly"; -export declare const GEN_AI_SETTINGS_TOKEN_USAGE_TRACKING = "genAiSettings:tokenUsageTracking"; -export declare const AI_ASSISTANT_PREFERRED_AI_ASSISTANT_TYPE = "aiAssistant:preferredAIAssistantType"; -export declare const AI_CHAT_EXPERIENCE_TYPE = "aiAssistant:preferredChatExperience"; -export declare const AI_ANONYMIZATION_SETTINGS = "ai:anonymizationSettings"; -export declare const OBSERVABILITY_SEARCH_EXCLUDED_DATA_TIERS = "observability:searchExcludedDataTiers"; -export declare const OBSERVABILITY_STREAMS_ENABLE_SIGNIFICANT_EVENTS = "observability:streamsEnableSignificantEvents"; -export declare const OBSERVABILITY_STREAMS_ENABLE_SIGNIFICANT_EVENTS_DISCOVERY = "observability:streamsEnableSignificantEventsDiscovery"; -export declare const OBSERVABILITY_STREAMS_ENABLE_GROUP_STREAMS = "observability:streamsEnableGroupStreams"; -export declare const OBSERVABILITY_STREAMS_ENABLE_QUERY_STREAMS = "observability:streamsEnableQueryStreams"; -export declare const OBSERVABILITY_STREAMS_ENABLE_CONTENT_PACKS = "observability:streamsEnableContentPacks"; -export declare const OBSERVABILITY_STREAMS_ENABLE_WIRED_STREAM_VIEWS = "observability:streamsEnableWiredStreamViews"; -export declare const OBSERVABILITY_STREAMS_ENABLE_DRAFT_STREAMS = "observability:streamsEnableDraftStreams"; -export declare const OBSERVABILITY_STREAMS_CONTINUOUS_KI_EXTRACTION_ENABLED = "observability:streamsContinuousKiExtractionEnabled"; -export declare const OBSERVABILITY_STREAMS_CONTINUOUS_KI_EXTRACTION_INTERVAL_HOURS = "observability:streamsContinuousKiExtractionIntervalHours"; -export declare const OBSERVABILITY_STREAMS_CONTINUOUS_KI_EXTRACTION_EXCLUDED_STREAM_PATTERNS = "observability:streamsContinuousKiExtractionExcludedStreamPatterns"; -export declare const OBSERVABILITY_STREAMS_SIG_EVENTS_INDEX_PATTERNS = "observability:streamsSigEventsIndexPatterns"; -export declare const OBSERVABILITY_STREAMS_SIG_EVENTS_TUNING_CONFIG = "observability:streamsSigEventsTuningConfig"; -export declare const OBSERVABILITY_STREAMS_ENABLE_MEMORY = "observability:streamsEnableMemory"; -export declare const OBSERVABILITY_STREAMS_ENABLE_SIGNIFICANT_EVENTS_ALERTING_V2 = "observability:streamsEnableSignificantEventsAlertingV2"; -export declare const OBSERVABILITY_ENABLE_DIAGNOSTIC_MODE = "observability:enableDiagnosticMode"; -export declare const XPACK_REPORTING_CUSTOM_PDF_LOGO_ID = "xpackReporting:customPdfLogo"; -export declare const ROLLUPS_ENABLE_INDEX_PATTERNS_ID = "rollups.enableIndexPatterns"; -export declare const COURIER_CUSTOM_REQUEST_PREFERENCE_ID = "courier:customRequestPreference"; -export declare const COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_ID = "courier:ignoreFilterIfFieldNotInIndex"; -export declare const COURIER_MAX_CONCURRENT_SHARD_REQUEST_ID = "courier:maxConcurrentShardRequests"; -export declare const COURIER_SET_REQUEST_PREFERENCE_ID = "courier:setRequestPreference"; -export declare const SEARCH_INCLUDE_FROZEN_ID = "search:includeFrozen"; -export declare const SEARCH_TIMEOUT_ID = "search:timeout"; -export declare const QUERY_ACTIVITY_MIN_RUNNING_TIME_ID = "query_activity:minRunningTime"; -export declare const SECURITY_SOLUTION_REFRESH_INTERVAL_DEFAULTS_ID = "securitySolution:refreshIntervalDefaults"; -export declare const SECURITY_SOLUTION_TIME_DEFAULTS_ID = "securitySolution:timeDefaults"; -export declare const SECURITY_SOLUTION_DEFAULT_INDEX_ID = "securitySolution:defaultIndex"; -export declare const SECURITY_SOLUTION_DEFAULT_THREAT_INDEX_ID = "securitySolution:defaultThreatIndex"; -export declare const SECURITY_SOLUTION_DEFAULT_ANOMALY_SCORE_ID = "securitySolution:defaultAnomalyScore"; -export declare const SECURITY_SOLUTION_ENABLE_GROUPED_NAV_ID = "securitySolution:enableGroupedNav"; -export declare const SECURITY_SOLUTION_RULES_TABLE_REFRESH_ID = "securitySolution:rulesTableRefresh"; -export declare const SECURITY_SOLUTION_ENABLE_NEWS_FEED_ID = "securitySolution:enableNewsFeed"; -export declare const SECURITY_SOLUTION_NEWS_FEED_URL_ID = "securitySolution:newsFeedUrl"; -export declare const SECURITY_SOLUTION_IP_REPUTATION_LINKS_ID = "securitySolution:ipReputationLinks"; -export declare const SECURITY_SOLUTION_SHOW_RELATED_INTEGRATIONS_ID = "securitySolution:showRelatedIntegrations"; -export declare const SECURITY_SOLUTION_SUPPRESSION_BEHAVIOR_ON_ALERT_CLOSURE_SETTING: "securitySolution:suppressionBehaviorOnAlertClosure"; -export declare const SECURITY_SOLUTION_DEFAULT_ALERT_TAGS_KEY: "securitySolution:alertTags"; -export declare const SECURITY_SOLUTION_EXCLUDED_GAP_REASONS_KEY: "securitySolution:excludedGapReasons"; -export declare const SECURITY_SOLUTION_INCLUDED_DATA_STREAM_NAMESPACES_FOR_RULE_EXECUTION: "securitySolution:includedDataStreamNamespacesForRuleExecution"; -/** This Kibana Advanced Setting allows users to enable/disable the Asset Criticality feature */ -export declare const SECURITY_SOLUTION_ENABLE_ASSET_CRITICALITY_SETTING: "securitySolution:enableAssetCriticality"; -export declare const SECURITY_SOLUTION_ENABLE_ASSET_INVENTORY_SETTING: "securitySolution:enableAssetInventory"; -export declare const SECURITY_SOLUTION_ENABLE_CLOUD_CONNECTOR_SETTING: "securitySolution:enableCloudConnector"; -export declare const SECURITY_SOLUTION_DEFAULT_VALUE_REPORT_MINUTES: "securitySolution:defaultValueReportMinutes"; -export declare const SECURITY_SOLUTION_DEFAULT_VALUE_REPORT_RATE: "securitySolution:defaultValueReportRate"; -export declare const SECURITY_SOLUTION_DEFAULT_VALUE_REPORT_TITLE: "securitySolution:defaultValueReportTitle"; -export declare const CASES_MAX_OPEN_CASES_PER_RULE_RUN_ID: "cases:maxOpenCasesPerRuleRun"; -export declare const TIMELION_ES_DEFAULT_INDEX_ID = "timelion:es.default_index"; -export declare const TIMELION_ES_TIME_FIELD_ID = "timelion:es.timefield"; -export declare const TIMELION_MAX_BUCKETS_ID = "timelion:max_buckets"; -export declare const TIMELION_MIN_INTERVAL_ID = "timelion:min_interval"; -export declare const TIMELION_TARGET_BUCKETS_ID = "timelion:target_buckets"; -export declare const VISUALIZATION_HEATMAP_MAX_BUCKETS_ID = "visualization:heatmap:maxBuckets"; -export declare const VISUALIZATION_LEGACY_GAUGE_CHARTS_LIBRARY_ID = "visualization:visualize:legacyGaugeChartsLibrary"; -export declare const VISUALIZATION_LEGACY_HEATMAP_CHARTS_LIBRARY_ID = "visualization:visualize:legacyHeatmapChartsLibrary"; -export declare const VISUALIZATION_ENABLE_LABS_ID = "visualize:enableLabs"; diff --git a/src/platform/packages/shared/kbn-object-versioning-utils/index.d.ts b/src/platform/packages/shared/kbn-object-versioning-utils/index.d.ts deleted file mode 100644 index 5ccfe387ce8e4..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning-utils/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { validateVersion } from './lib/validate_version'; diff --git a/src/platform/packages/shared/kbn-object-versioning-utils/lib/validate_version.d.ts b/src/platform/packages/shared/kbn-object-versioning-utils/lib/validate_version.d.ts deleted file mode 100644 index 1b25eb819a9de..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning-utils/lib/validate_version.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -type Version = number; -export declare const validateVersion: (version: unknown) => { - result: true; - value: Version; -} | { - result: false; - value: null; -}; -export {}; diff --git a/src/platform/packages/shared/kbn-object-versioning/index.d.ts b/src/platform/packages/shared/kbn-object-versioning/index.d.ts deleted file mode 100644 index 49cfdf0e57a03..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { initTransform, getContentManagementServicesTransforms, compileServiceDefinitions, } from './lib'; -export type { Version, VersionableObject, ObjectMigrationDefinition, ObjectTransform, ObjectTransforms, TransformReturn, ContentManagementServiceDefinitionVersioned, ContentManagementServiceTransforms, ContentManagementServicesDefinition, ContentManagementGetTransformsFn, } from './lib'; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_schemas.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_schemas.d.ts deleted file mode 100644 index 0925d32649b18..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_schemas.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { Type } from '@kbn/config-schema'; -export declare const serviceDefinitionSchema: import("@kbn/config-schema").ObjectType<{ - get: Type | undefined>; - bulkGet: Type | undefined>; - create: Type | undefined>; - update: Type | undefined>; - delete: Type | undefined>; - search: Type | undefined>; - mSearch: Type | undefined; - } & {}> | undefined; - } & {}> | undefined>; -}>; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_versioning.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_versioning.d.ts deleted file mode 100644 index 1cda14664e592..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_services_versioning.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { ObjectMigrationDefinition, Version } from './types'; -import type { ServiceDefinitionVersioned, ServiceTransforms } from './content_management_types'; -/** - * Convert a versionned service definition to a flattened service definition - * where _each object_ is versioned (at the leaf). - * - * @example - * - * ```ts - * From this - * { - * // Service definition version 1 - * 1: { - * get: { - * in: { - * options: { up: () => {} } - * } - * }, - * ... - * }, - * // Service definition version 2 - * 2: { - * get: { - * in: { - * options: { up: () => {} } - * } - * }, - * } - * } - * - * To this - * - * { - * 'get.in.options': { // Flattend path - * 1: { up: () => {} }, // 1 - * 2: { up: () => {} } // 2 - * } - * } - * ``` - */ -export declare const compile: (definitions: ServiceDefinitionVersioned) => { - [path: string]: ObjectMigrationDefinition; -}; -export declare const getTransforms: (definitions: ServiceDefinitionVersioned, requestVersion: Version, _compiled?: { - [path: string]: ObjectMigrationDefinition; -}) => ServiceTransforms; -export type GetTransformsFn = typeof getTransforms; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_types.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/content_management_types.d.ts deleted file mode 100644 index d160195160524..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning/lib/content_management_types.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { ObjectTransforms, Version, VersionableObject } from './types'; -export interface ServicesDefinition { - get?: { - in?: { - options?: VersionableObject; - }; - out?: { - result?: VersionableObject; - }; - }; - bulkGet?: { - in?: { - options?: VersionableObject; - }; - out?: { - result?: VersionableObject; - }; - }; - create?: { - in?: { - data?: VersionableObject; - options?: VersionableObject; - }; - out?: { - result?: VersionableObject; - }; - }; - update?: { - in?: { - data?: VersionableObject; - options?: VersionableObject; - }; - out?: { - result?: VersionableObject; - }; - }; - delete?: { - in?: { - options?: VersionableObject; - }; - out?: { - result?: VersionableObject; - }; - }; - search?: { - in?: { - options?: VersionableObject; - }; - out?: { - result?: VersionableObject; - }; - }; - mSearch?: { - out?: { - result?: VersionableObject; - }; - }; -} -export interface ServiceTransforms { - get: { - in: { - options: ObjectTransforms; - }; - out: { - result: ObjectTransforms; - }; - }; - bulkGet: { - in: { - options: ObjectTransforms; - }; - out: { - result: ObjectTransforms; - }; - }; - create: { - in: { - data: ObjectTransforms; - options: ObjectTransforms; - }; - out: { - result: ObjectTransforms; - }; - }; - update: { - in: { - data: ObjectTransforms; - options: ObjectTransforms; - }; - out: { - result: ObjectTransforms; - }; - }; - delete: { - in: { - options: ObjectTransforms; - }; - out: { - result: ObjectTransforms; - }; - }; - search: { - in: { - options: ObjectTransforms; - }; - out: { - result: ObjectTransforms; - }; - }; - mSearch: { - out: { - result: ObjectTransforms; - }; - }; -} -export interface ServiceDefinitionVersioned { - [version: Version]: ServicesDefinition; -} diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/index.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/index.d.ts deleted file mode 100644 index 76d6510a4026f..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning/lib/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { initTransform } from './object_transform'; -export { getTransforms as getContentManagementServicesTransforms, compile as compileServiceDefinitions, } from './content_management_services_versioning'; -export type { GetTransformsFn as ContentManagementGetTransformsFn } from './content_management_services_versioning'; -export type { Version, VersionableObject, ObjectMigrationDefinition, ObjectTransform, ObjectTransforms, TransformReturn, } from './types'; -export type { ServiceTransforms as ContentManagementServiceTransforms, ServicesDefinition as ContentManagementServicesDefinition, ServiceDefinitionVersioned as ContentManagementServiceDefinitionVersioned, } from './content_management_types'; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/object_transform.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/object_transform.d.ts deleted file mode 100644 index 2d3f2bcd7a648..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning/lib/object_transform.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { ObjectMigrationDefinition, Version } from './types'; -/** - * Initiate a transform for a specific request version. After we initiate the transforms - * for a specific version we can then pass different `ObjectMigrationDefinition` to the provided - * handler to start up/down transforming different object based on this request version. - * - * @example - * - * ```ts - * const transforms = initTransform(2); // start from version "2" - * const fooTransforms = transforms(fooMigrationDefinition); - * const barTransforms = transforms(barMigrationDefinition); - * - * // Up transform the objects to the latest, starting from version "2" - * const { value: fooOnLatest } = foo.up(); - * const { value: barOnLatest } = bar.up(); - * ``` - * - * @param requestVersion The starting version before up/down transforming - * @returns A handler to pass an object migration definition - */ -export declare const initTransform: (requestVersion: Version) => (migrationDefinition: ObjectMigrationDefinition) => { - up: (obj: I, to?: number | "latest", { validate }?: { - validate?: boolean; - }) => { - error: Error; - value: null; - } | { - value: O; - error: null; - }; - down: (obj: I, from?: number | "latest", { validate }?: { - validate?: boolean; - }) => { - error: Error; - value: null; - } | { - value: any; - error: null; - }; - validate: (value: unknown, version?: number) => Error | null; -}; diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/types.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/types.d.ts deleted file mode 100644 index 8e6326c97c9e2..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning/lib/types.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { z } from '@kbn/zod'; -import type { Type } from '@kbn/config-schema'; -export type Version = number; -export type ObjectTransform = (input: I) => O; -export interface VersionableObject { - /** - * Schema used to validate a versioned object before up/down transforms. - * Supports `@kbn/config-schema` or `@kbn/zod` schemas. - */ - schema?: Type | z.ZodTypeAny; - down?: ObjectTransform; - up?: ObjectTransform; -} -export interface ObjectMigrationDefinition { - [version: Version]: VersionableObject; -} -export type TransformReturn = { - value: T; - error: null; -} | { - value: null; - error: Error; -}; -export interface ObjectTransforms { - up: (obj: I, version?: Version | 'latest', options?: { - /** Validate the object _before_ up transform */ - validate?: boolean; - }) => TransformReturn; - down: (obj: I, version?: Version | 'latest', options?: { - /** Validate the object _before_ down transform */ - validate?: boolean; - }) => TransformReturn; - validate: (obj: any, version?: Version) => Error | null; -} diff --git a/src/platform/packages/shared/kbn-object-versioning/lib/utils.d.ts b/src/platform/packages/shared/kbn-object-versioning/lib/utils.d.ts deleted file mode 100644 index 0596226a56a04..0000000000000 --- a/src/platform/packages/shared/kbn-object-versioning/lib/utils.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { type ZodType } from '@kbn/zod'; -import type { Type } from '@kbn/config-schema'; -/** - * Validate an object based on a schema. - * - * @param obj The object to validate - * @param objSchema The schema to validate the object against - * @returns null, or Error - */ -export declare const validateObj: (obj: unknown, objSchema?: Type | ZodType) => Error | null; -export { validateVersion } from '@kbn/object-versioning-utils'; diff --git a/src/platform/packages/shared/kbn-react-query/index.d.ts b/src/platform/packages/shared/kbn-react-query/index.d.ts deleted file mode 100644 index 84999e91cb2b2..0000000000000 --- a/src/platform/packages/shared/kbn-react-query/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { QueryClientConfig } from '@tanstack/react-query'; -import { QueryClient as TanstackQueryClient } from '@tanstack/query-core'; -declare class QueryClient extends TanstackQueryClient { - constructor(config?: QueryClientConfig); -} -export { TanstackQueryClient, QueryClient, }; -export type { CancelOptions, ContextOptions, DefaultedInfiniteQueryObserverOptions, DefaultedQueryObserverOptions, DefaultOptions, DefinedQueryObserverResult, DefinedUseBaseQueryResult, DefinedUseQueryResult, DehydratedState, DehydrateOptions, FetchInfiniteQueryOptions, FetchNextPageOptions, FetchPreviousPageOptions, FetchQueryOptions, FetchStatus, GetNextPageParamFunction, GetPreviousPageParamFunction, HydrateOptions, HydrateProps, InfiniteData, InfiniteQueryObserverBaseResult, InfiniteQueryObserverLoadingErrorResult, InfiniteQueryObserverLoadingResult, InfiniteQueryObserverOptions, InfiniteQueryObserverRefetchErrorResult, InfiniteQueryObserverResult, InfiniteQueryObserverSuccessResult, InitialDataFunction, InvalidateOptions, InvalidateQueryFilters, Logger, MutateFunction, MutateOptions, Mutation, // class, but exported as type-only -MutationFilters, MutationFunction, MutationKey, MutationMeta, MutationObserverBaseResult, MutationObserverErrorResult, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverOptions, MutationObserverResult, MutationObserverSuccessResult, MutationOptions, MutationStatus, NetworkMode, NotifyEvent, NotifyEventType, PlaceholderDataFunction, QueriesOptions, QueriesResults, Query, // class, but exported as type-only -QueryClientConfig, QueryClientProviderProps, QueryErrorResetBoundaryProps, QueryFilters, QueryFunction, QueryFunctionContext, QueryKey, QueryKeyHashFunction, QueryMeta, QueryObserverBaseResult, QueryObserverLoadingErrorResult, QueryObserverLoadingResult, QueryObserverOptions, QueryObserverRefetchErrorResult, QueryObserverResult, QueryObserverSuccessResult, QueryOptions, QueryState, QueryStatus, RefetchOptions, RefetchPageFilters, RefetchQueryFilters, ResetOptions, ResetQueryFilters, ResultOptions, SetDataOptions, ShouldDehydrateMutationFunction, ShouldDehydrateQueryFunction, Updater, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseErrorBoundary, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, WithRequired, } from '@tanstack/react-query'; -export { CancelledError, defaultContext, defaultShouldDehydrateMutation, defaultShouldDehydrateQuery, dehydrate, focusManager, hashQueryKey, hydrate, Hydrate, isCancelledError, isError, isServer, InfiniteQueryObserver, IsRestoringProvider, matchQuery, MutationCache, MutationObserver, notifyManager, onlineManager, parseFilterArgs, parseMutationArgs, parseMutationFilterArgs, parseQueryArgs, QueriesObserver, QueryCache, QueryClientProvider, QueryErrorResetBoundary, QueryObserver, replaceEqualDeep, useHydrate, useInfiniteQuery, useIsFetching, useIsMutating, useIsRestoring, useMutation, useQueries, useQuery, useQueryClient, useQueryErrorResetBoundary, } from '@tanstack/react-query'; diff --git a/src/platform/packages/shared/kbn-resizable-layout/index.d.ts b/src/platform/packages/shared/kbn-resizable-layout/index.d.ts deleted file mode 100644 index 49d4a325f3e52..0000000000000 --- a/src/platform/packages/shared/kbn-resizable-layout/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { ResizableLayoutMode, ResizableLayoutDirection, ResizableLayoutOrder } from './types'; -export type { ResizableLayoutProps } from './src/resizable_layout'; -export { ResizableLayout } from './src/resizable_layout'; diff --git a/src/platform/packages/shared/kbn-resizable-layout/src/panels_resizable.d.ts b/src/platform/packages/shared/kbn-resizable-layout/src/panels_resizable.d.ts deleted file mode 100644 index 57de436ff347b..0000000000000 --- a/src/platform/packages/shared/kbn-resizable-layout/src/panels_resizable.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ReactNode } from 'react'; -import React from 'react'; -import { ResizableLayoutOrder, type ResizableLayoutDirection } from '../types'; -export declare const PanelsResizable: ({ className, direction, fixedPanelSize, minFixedPanelSize, minFlexPanelSize, fixedPanel, flexPanel, fixedPanelOrder, resizeButtonClassName, ["data-test-subj"]: dataTestSubj, onFixedPanelSizeChange, }: { - className?: string; - direction: ResizableLayoutDirection; - fixedPanelSize: number | "max-content"; - minFixedPanelSize: number; - minFlexPanelSize: number; - fixedPanel: ReactNode; - flexPanel: ReactNode; - fixedPanelOrder?: ResizableLayoutOrder; - resizeButtonClassName?: string; - ["data-test-subj"]?: string; - onFixedPanelSizeChange?: (fixedPanelSize: number) => void; -}) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-resizable-layout/src/panels_static.d.ts b/src/platform/packages/shared/kbn-resizable-layout/src/panels_static.d.ts deleted file mode 100644 index bb9229a31f6fb..0000000000000 --- a/src/platform/packages/shared/kbn-resizable-layout/src/panels_static.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ReactNode } from 'react'; -import React from 'react'; -import { ResizableLayoutDirection } from '../types'; -export declare const PanelsStatic: ({ className, direction, hideFixedPanel, fixedPanel, flexPanel, }: { - className?: string; - direction: ResizableLayoutDirection; - hideFixedPanel?: boolean; - fixedPanel: ReactNode; - flexPanel: ReactNode; -}) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-resizable-layout/src/resizable_layout.d.ts b/src/platform/packages/shared/kbn-resizable-layout/src/resizable_layout.d.ts deleted file mode 100644 index f1acf0b4f627e..0000000000000 --- a/src/platform/packages/shared/kbn-resizable-layout/src/resizable_layout.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { ReactNode } from 'react'; -import React from 'react'; -import type { ResizableLayoutDirection, ResizableLayoutOrder } from '../types'; -import { ResizableLayoutMode } from '../types'; -export interface ResizableLayoutProps { - /** - * Class name for the layout container - */ - className?: string; - /** - * The current layout mode - */ - mode: ResizableLayoutMode; - /** - * The current layout direction - */ - direction: ResizableLayoutDirection; - /** - * Current size of the fixed panel in pixels - */ - fixedPanelSize: number | 'max-content'; - /** - * Minimum size of the fixed panel in pixels - */ - minFixedPanelSize: number; - /** - * Minimum size of the flex panel in pixels - */ - minFlexPanelSize: number; - /** - * The fixed panel - */ - fixedPanel: ReactNode; - /** - * The flex panel - */ - flexPanel: ReactNode; - /** - * The side to render the fixed panel. - */ - fixedPanelOrder?: ResizableLayoutOrder; - /** - * Class name for the resize button - */ - resizeButtonClassName?: string; - /** - * Test subject for the layout container - */ - ['data-test-subj']?: string; - /** - * Callback when the fixed panel size changes, receives the new size in pixels - */ - onFixedPanelSizeChange?: (fixedPanelSize: number) => void; -} -export declare const ResizableLayout: ({ className, mode, direction, fixedPanelSize, minFixedPanelSize, minFlexPanelSize, fixedPanel, flexPanel, fixedPanelOrder, resizeButtonClassName, ["data-test-subj"]: dataTestSubj, onFixedPanelSizeChange, }: ResizableLayoutProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/kbn-resizable-layout/src/utils.d.ts b/src/platform/packages/shared/kbn-resizable-layout/src/utils.d.ts deleted file mode 100644 index 081814580292c..0000000000000 --- a/src/platform/packages/shared/kbn-resizable-layout/src/utils.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ResizableLayoutDirection } from '../types'; -export declare const percentToPixels: (containerSize: number, percentage: number) => number; -export declare const pixelsToPercent: (containerSize: number, pixels: number) => number; -export declare const getContainerSize: (direction: ResizableLayoutDirection, width: number, height: number) => number; diff --git a/src/platform/packages/shared/kbn-resizable-layout/types.d.ts b/src/platform/packages/shared/kbn-resizable-layout/types.d.ts deleted file mode 100644 index 0b47f5703c9d2..0000000000000 --- a/src/platform/packages/shared/kbn-resizable-layout/types.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -export declare enum ResizableLayoutMode { - /** - * Single panel mode -- hides the fixed panel - */ - Single = "single", - /** - * Static mode -- prevents resizing - */ - Static = "static", - /** - * Resizable mode -- allows resizing - */ - Resizable = "resizable" -} -export declare enum ResizableLayoutDirection { - /** - * Horizontal layout -- panels are side by side - */ - Horizontal = "horizontal", - /** - * Vertical layout -- panels are stacked - */ - Vertical = "vertical" -} -export declare enum ResizableLayoutOrder { - /** - * Start order (left or top) - */ - Start = "start", - /** - * End order (right or bottom) - */ - End = "end" -} diff --git a/src/platform/packages/shared/kbn-rison/index.d.ts b/src/platform/packages/shared/kbn-rison/index.d.ts deleted file mode 100644 index 54e55aa764f3f..0000000000000 --- a/src/platform/packages/shared/kbn-rison/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './kbn_rison'; -import { encode, encodeUnknown, decode, encodeArray, decodeArray } from './kbn_rison'; -declare const _default: { - encode: typeof encode; - encodeUnknown: typeof encodeUnknown; - decode: typeof decode; - encodeArray: typeof encodeArray; - decodeArray: typeof decodeArray; -}; -export default _default; diff --git a/src/platform/packages/shared/kbn-rison/kbn_rison.d.ts b/src/platform/packages/shared/kbn-rison/kbn_rison.d.ts deleted file mode 100644 index 8636c275c1141..0000000000000 --- a/src/platform/packages/shared/kbn-rison/kbn_rison.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Any value that can be represented in RISON — a superset of JSON primitives - * that also supports nested objects and arrays. - */ -export type RisonValue = boolean | string | number | RisonValue[] | { - [key: string]: RisonValue; -} | null; -/** - * RISON-encode a JavaScript value, returning `undefined` when the value cannot - * be represented in RISON (e.g. functions, symbols, or circular references). - * Use {@link encode} when the input is expected to always be encodable. - * - * @param obj - The value to encode. Typed as `any` because this function is - * intentionally used to probe whether an arbitrary runtime value is - * RISON-encodable before committing to encoding it. - * @returns The RISON-encoded string, or `undefined` if the value is not encodable. - */ -export declare function encodeUnknown(obj: any): string | undefined; -/** - * RISON-encode a JavaScript value, throwing if the value cannot be encoded. - * For values of unknown encodability, prefer {@link encodeUnknown}. - * - * @param obj - The JavaScript value to encode. Typed as `any` because RISON - * encoding is used to serialize arbitrary application state (e.g. URL - * parameters) whose shape is not known at compile time. - * @returns The RISON-encoded string. - */ -export declare function encode(obj: any): string; -/** - * Parse a RISON string into a JavaScript structure. - * - * @param rison - The RISON-encoded string to decode. - * @returns The decoded JavaScript value as a {@link RisonValue}. - */ -export declare function decode(rison: string): RisonValue; -/** - * Parse a RISON string into a JavaScript structure, returning `null` instead - * of throwing when the input is invalid. - * - * @param rison - The RISON-encoded string to decode. - * @returns The decoded {@link RisonValue}, or `null` if the string is not valid RISON. - */ -export declare function safeDecode(rison: string): RisonValue; -/** - * RISON-encode a JavaScript array using A-RISON format (without surrounding - * parentheses), suitable for use in URL array parameters. - * - * @param array - The array to encode. Typed as `any[]` because the array - * elements may be arbitrary application state values. - * @returns The A-RISON-encoded string. - */ -export declare function encodeArray(array: any[]): any; -/** - * Parse an A-RISON string (a RISON array without surrounding parentheses) - * into a JavaScript array. This prepends array markup before passing to the - * standard RISON decoder. - * - * @param rison - The A-RISON-encoded string to decode. - * @returns The decoded array of {@link RisonValue} elements. - */ -export declare function decodeArray(rison: string): RisonValue[]; diff --git a/src/platform/packages/shared/kbn-rrule/index.d.ts b/src/platform/packages/shared/kbn-rrule/index.d.ts deleted file mode 100644 index 5890af22264de..0000000000000 --- a/src/platform/packages/shared/kbn-rrule/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { RRule } from './rrule'; -export type { Options, WeekdayStr } from './types'; -export { Frequency, Weekday } from './types'; diff --git a/src/platform/packages/shared/kbn-rrule/rrule.d.ts b/src/platform/packages/shared/kbn-rrule/rrule.d.ts deleted file mode 100644 index a683c25f47684..0000000000000 --- a/src/platform/packages/shared/kbn-rrule/rrule.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import moment from 'moment-timezone'; -import type { ConstructorOptions } from './types'; -import { Frequency, type IterOptions } from './types'; -type AllResult = Date[] & { - hasMore?: boolean; -}; -export declare class RRule { - private options; - constructor(options: ConstructorOptions); - private dateset; - between(start: Date, end: Date): Date[]; - before(dt: Date): Date; - after(dt: Date): Date | null; - all(limit?: number): AllResult; - static isValid(options: ConstructorOptions): boolean; -} -export declare const getNextRecurrences: ({ refDT, wkst, byyearday, bymonth, bymonthday, byweekday, byhour, byminute, bysecond, bysetpos, freq, interval, }: IterOptions & { - freq?: Frequency; - interval?: number; -}) => moment.Moment[]; -export {}; diff --git a/src/platform/packages/shared/kbn-rrule/sanitize.d.ts b/src/platform/packages/shared/kbn-rrule/sanitize.d.ts deleted file mode 100644 index c561444ff0f40..0000000000000 --- a/src/platform/packages/shared/kbn-rrule/sanitize.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Options } from './types'; -export declare function sanitizeOptions(opts: Options): { - wkst?: (import("./types").Weekday | number | null) | undefined; - byyearday?: number[] | null | undefined; - bymonth?: number[] | null | undefined; - bysetpos?: number[] | null | undefined; - bymonthday?: number[] | null | undefined; - byweekday?: import("./types").Weekday[] | null | undefined; - byhour?: number[] | null | undefined; - byminute?: number[] | null | undefined; - bysecond?: number[] | null | undefined; - dtstart: Date; - freq?: import("./types").Frequency; - interval?: number; - until?: Date | null; - count?: number; - tzid: string; -}; diff --git a/src/platform/packages/shared/kbn-rrule/types.d.ts b/src/platform/packages/shared/kbn-rrule/types.d.ts deleted file mode 100644 index 311115f367ade..0000000000000 --- a/src/platform/packages/shared/kbn-rrule/types.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { Moment } from 'moment'; -export declare enum Frequency { - YEARLY = 0, - MONTHLY = 1, - WEEKLY = 2, - DAILY = 3, - HOURLY = 4, - MINUTELY = 5, - SECONDLY = 6 -} -export declare enum Weekday { - MO = 1, - TU = 2, - WE = 3, - TH = 4, - FR = 5, - SA = 6, - SU = 7 -} -export type WeekdayStr = 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU'; -export interface IterOptions { - refDT: Moment; - wkst?: Weekday | number | null; - byyearday?: number[] | null; - bymonth?: number[] | null; - bysetpos?: number[] | null; - bymonthday?: number[] | null; - byweekday?: Weekday[] | null; - byhour?: number[] | null; - byminute?: number[] | null; - bysecond?: number[] | null; -} -export type Options = Omit & { - dtstart: Date; - freq?: Frequency; - interval?: number; - until?: Date | null; - count?: number; - tzid: string; -}; -export type ConstructorOptions = Omit & { - byweekday?: Array | null; - wkst?: Weekday | WeekdayStr | number | null; -}; diff --git a/src/platform/packages/shared/kbn-rrule/validate.d.ts b/src/platform/packages/shared/kbn-rrule/validate.d.ts deleted file mode 100644 index 740db0f1bdc90..0000000000000 --- a/src/platform/packages/shared/kbn-rrule/validate.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ConstructorOptions } from './types'; -export declare function validateOptions(opts: ConstructorOptions): void; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/index.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/index.d.ts deleted file mode 100644 index 123b4bf113172..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './src/default_alerts_as_data'; -export * from './src/legacy_alerts_as_data'; -export * from './src/technical_field_names'; -export * from './src/alerts_as_data_rbac'; -export * from './src/alerts_as_data_severity'; -export * from './src/alerts_as_data_status'; -export * from './src/alerts_as_data_cases'; -export * from './src/rule_locator_params'; -export * from './src/routes/stack_rule_paths'; -export * from './src/rule_types'; -export * from './src/rule_constants'; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.d.ts deleted file mode 100644 index c88467cb64c2e..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const MAX_CASES_PER_ALERT = 10; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.d.ts deleted file mode 100644 index 78fb9d59cb1f3..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { EsQueryConfig } from '@kbn/es-query'; -export declare const ATTACK_DISCOVERY_SCHEDULES_ALERT_TYPE_ID: "attack-discovery"; -/** - * registering a new instance of the rule data client - * in a new plugin will require updating the below data structure - * to include the index name where the alerts as data will be written to. - */ -export declare const AlertConsumers: { - readonly APM: "apm"; - readonly LOGS: "logs"; - readonly INFRASTRUCTURE: "infrastructure"; - readonly OBSERVABILITY: "observability"; - readonly STREAMS: "streams"; - readonly SLO: "slo"; - readonly SIEM: "siem"; - readonly UPTIME: "uptime"; - readonly ML: "ml"; - readonly STACK_ALERTS: "stackAlerts"; - readonly EXAMPLE: "AlertingExample"; - readonly MONITORING: "monitoring"; - readonly ALERTS: "alerts"; - readonly DISCOVER: "discover"; -}; -export type AlertConsumers = (typeof AlertConsumers)[keyof typeof AlertConsumers]; -export declare const DEPRECATED_ALERTING_CONSUMERS: "observability"[]; -export type STATUS_VALUES = 'open' | 'acknowledged' | 'closed' | 'in-progress'; -export type ValidFeatureId = AlertConsumers; -export declare const validFeatureIds: string[]; -export declare const isValidFeatureId: (a: unknown) => a is ValidFeatureId; -/** - * Prevent javascript from returning Number.MAX_SAFE_INTEGER when Elasticsearch expects - * Java's Long.MAX_VALUE. This happens when sorting fields by date which are - * unmapped in the provided index - * - * Ref: https://github.com/elastic/elasticsearch/issues/28806#issuecomment-369303620 - * - * return stringified Long.MAX_VALUE if we receive Number.MAX_SAFE_INTEGER - * @param sortIds estypes.SortResults | undefined - * @returns SortResults - */ -export declare const getSafeSortIds: (sortIds: estypes.SortResults | null | undefined) => Array | undefined; -interface GetEsQueryConfigParamType { - allowLeadingWildcards?: EsQueryConfig['allowLeadingWildcards']; - queryStringOptions?: EsQueryConfig['queryStringOptions']; - ignoreFilterIfFieldNotInIndex?: EsQueryConfig['ignoreFilterIfFieldNotInIndex']; - dateFormatTZ?: EsQueryConfig['dateFormatTZ']; -} -export declare const getEsQueryConfig: (params?: GetEsQueryConfigParamType) => EsQueryConfig; -/** - * TODO: Remove when checks for specific rule type ids is not needed - *in the codebase. - */ -export declare const isSiemRuleType: (ruleTypeId: string) => boolean; -export {}; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.d.ts deleted file mode 100644 index 34fd1edd04460..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export declare const ALERT_SEVERITY_INFO = "info"; -export declare const ALERT_SEVERITY_LOW = "low"; -export declare const ALERT_SEVERITY_MEDIUM = "medium"; -export declare const ALERT_SEVERITY_HIGH = "high"; -export declare const ALERT_SEVERITY_CRITICAL = "critical"; -export declare const ALERT_SEVERITY_WARNING = "warning"; -export declare const ALERT_SEVERITY_MINOR = "minor"; -export declare const ALERT_SEVERITY_MAJOR = "major"; -export type AlertSeverity = typeof ALERT_SEVERITY_INFO | typeof ALERT_SEVERITY_LOW | typeof ALERT_SEVERITY_MEDIUM | typeof ALERT_SEVERITY_HIGH | typeof ALERT_SEVERITY_CRITICAL | typeof ALERT_SEVERITY_WARNING | typeof ALERT_SEVERITY_MINOR | typeof ALERT_SEVERITY_MAJOR; -/** - * Ordered list of severity values from highest to lowest, intended for UX - * surfaces and for runtime validation in API schemas. - */ -export declare const ALERT_SEVERITY_VALUES: readonly ["critical", "major", "high", "medium", "minor", "low", "warning", "info"]; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.d.ts deleted file mode 100644 index 11f38edb9c5bb..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const ALERT_STATUS_ACTIVE = "active"; -export declare const ALERT_STATUS_RECOVERED = "recovered"; -export declare const ALERT_STATUS_UNTRACKED = "untracked"; -export declare const ALERT_STATUS_DELAYED = "delayed"; -export type AlertStatus = typeof ALERT_STATUS_ACTIVE | typeof ALERT_STATUS_RECOVERED | typeof ALERT_STATUS_UNTRACKED | typeof ALERT_STATUS_DELAYED; -export type PublicAlertStatus = typeof ALERT_STATUS_ACTIVE | typeof ALERT_STATUS_RECOVERED | typeof ALERT_STATUS_UNTRACKED; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.d.ts deleted file mode 100644 index d3b7eb0c9b249..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -import type { ValuesType } from 'utility-types'; -declare const TIMESTAMP: "@timestamp"; -declare const KIBANA_NAMESPACE: "kibana"; -declare const ALERT_NAMESPACE: "kibana.alert"; -declare const ALERT_RULE_NAMESPACE: "kibana.alert.rule"; -declare const ALERT_STATE_NAMESPACE: "kibana.alert.state"; -declare const SPACE_IDS: "kibana.space_ids"; -declare const CPS_SCOPE_EXPRESSION: "kibana.cps_scope.expression"; -declare const CPS_SCOPE_LINKED_PROJECTS: "kibana.cps_scope.linked_projects"; -declare const VERSION: "kibana.version"; -declare const ALERT_ACTION_GROUP: "kibana.alert.action_group"; -declare const ALERT_PREVIOUS_ACTION_GROUP: "kibana.alert.previous_action_group"; -declare const ALERT_SEVERITY_IMPROVING: "kibana.alert.severity_improving"; -declare const ALERT_CASE_IDS: "kibana.alert.case_ids"; -declare const ALERT_DURATION: "kibana.alert.duration.us"; -declare const ALERT_END: "kibana.alert.end"; -declare const ALERT_FLAPPING: "kibana.alert.flapping"; -declare const ALERT_FLAPPING_HISTORY: "kibana.alert.flapping_history"; -declare const ALERT_MAINTENANCE_WINDOW_IDS: "kibana.alert.maintenance_window_ids"; -declare const ALERT_MAINTENANCE_WINDOW_NAMES: "kibana.alert.maintenance_window_names"; -declare const ALERT_CONSECUTIVE_MATCHES: "kibana.alert.consecutive_matches"; -declare const ALERT_PENDING_RECOVERED_COUNT: "kibana.alert.pending_recovered_count"; -declare const ALERT_INSTANCE_ID: "kibana.alert.instance.id"; -declare const ALERT_LAST_DETECTED: "kibana.alert.last_detected"; -declare const ALERT_INTENDED_TIMESTAMP: "kibana.alert.intended_timestamp"; -declare const ALERT_REASON: "kibana.alert.reason"; -declare const ALERT_START: "kibana.alert.start"; -declare const ALERT_UPDATED_AT: "kibana.alert.updated_at"; -declare const ALERT_UPDATED_BY_USER_ID: "kibana.alert.updated_by.user.id"; -declare const ALERT_UPDATED_BY_USER_NAME: "kibana.alert.updated_by.user.name"; -declare const ALERT_SEVERITY: "kibana.alert.severity"; -declare const ALERT_STATUS: "kibana.alert.status"; -declare const ALERT_TIME_RANGE: "kibana.alert.time_range"; -declare const ALERT_UUID: "kibana.alert.uuid"; -declare const ALERT_WORKFLOW_STATUS: "kibana.alert.workflow_status"; -declare const ALERT_WORKFLOW_TAGS: "kibana.alert.workflow_tags"; -declare const ALERT_WORKFLOW_ASSIGNEE_IDS: "kibana.alert.workflow_assignee_ids"; -declare const ALERT_RULE_CATEGORY: "kibana.alert.rule.category"; -declare const ALERT_RULE_CONSUMER: "kibana.alert.rule.consumer"; -declare const ALERT_RULE_EXECUTION_TIMESTAMP: "kibana.alert.rule.execution.timestamp"; -declare const ALERT_RULE_EXECUTION_UUID: "kibana.alert.rule.execution.uuid"; -declare const ALERT_RULE_NAME: "kibana.alert.rule.name"; -declare const ALERT_RULE_PARAMETERS: "kibana.alert.rule.parameters"; -declare const ALERT_RULE_PRODUCER: "kibana.alert.rule.producer"; -declare const ALERT_RULE_REVISION: "kibana.alert.rule.revision"; -declare const ALERT_RULE_TAGS: "kibana.alert.rule.tags"; -declare const ALERT_RULE_TYPE_ID: "kibana.alert.rule.rule_type_id"; -declare const ALERT_URL: "kibana.alert.url"; -declare const ALERT_RULE_UUID: "kibana.alert.rule.uuid"; -declare const ALERT_RULE_EXECUTION_TYPE: "kibana.alert.rule.execution.type"; -declare const ALERT_SCHEDULED_ACTION_GROUP: "kibana.alert.scheduled_action.group"; -declare const ALERT_SCHEDULED_ACTION_DATE: "kibana.alert.scheduled_action.date"; -declare const ALERT_SCHEDULED_ACTION_THROTTLING: "kibana.alert.scheduled_action.throttling"; -declare const ALERT_INDEX_PATTERN: "kibana.alert.index_pattern"; -declare const ALERT_MUTED: "kibana.alert.muted"; -declare const namespaces: { - KIBANA_NAMESPACE: "kibana"; - ALERT_NAMESPACE: "kibana.alert"; - ALERT_RULE_NAMESPACE: "kibana.alert.rule"; - ALERT_STATE_NAMESPACE: "kibana.alert.state"; -}; -export declare const fields: { - ALERT_ACTION_GROUP: "kibana.alert.action_group"; - ALERT_CASE_IDS: "kibana.alert.case_ids"; - ALERT_DURATION: "kibana.alert.duration.us"; - ALERT_END: "kibana.alert.end"; - ALERT_FLAPPING: "kibana.alert.flapping"; - ALERT_FLAPPING_HISTORY: "kibana.alert.flapping_history"; - ALERT_MAINTENANCE_WINDOW_IDS: "kibana.alert.maintenance_window_ids"; - ALERT_MAINTENANCE_WINDOW_NAMES: "kibana.alert.maintenance_window_names"; - ALERT_PENDING_RECOVERED_COUNT: "kibana.alert.pending_recovered_count"; - ALERT_CONSECUTIVE_MATCHES: "kibana.alert.consecutive_matches"; - ALERT_INSTANCE_ID: "kibana.alert.instance.id"; - ALERT_INDEX_PATTERN: "kibana.alert.index_pattern"; - ALERT_LAST_DETECTED: "kibana.alert.last_detected"; - ALERT_PREVIOUS_ACTION_GROUP: "kibana.alert.previous_action_group"; - ALERT_REASON: "kibana.alert.reason"; - ALERT_RULE_CATEGORY: "kibana.alert.rule.category"; - ALERT_RULE_CONSUMER: "kibana.alert.rule.consumer"; - ALERT_RULE_EXECUTION_TIMESTAMP: "kibana.alert.rule.execution.timestamp"; - ALERT_RULE_EXECUTION_TYPE: "kibana.alert.rule.execution.type"; - ALERT_INTENDED_TIMESTAMP: "kibana.alert.intended_timestamp"; - ALERT_RULE_EXECUTION_UUID: "kibana.alert.rule.execution.uuid"; - ALERT_RULE_NAME: "kibana.alert.rule.name"; - ALERT_RULE_PARAMETERS: "kibana.alert.rule.parameters"; - ALERT_RULE_PRODUCER: "kibana.alert.rule.producer"; - ALERT_RULE_REVISION: "kibana.alert.rule.revision"; - ALERT_RULE_TAGS: "kibana.alert.rule.tags"; - ALERT_RULE_TYPE_ID: "kibana.alert.rule.rule_type_id"; - ALERT_RULE_UUID: "kibana.alert.rule.uuid"; - ALERT_SEVERITY: "kibana.alert.severity"; - ALERT_SEVERITY_IMPROVING: "kibana.alert.severity_improving"; - ALERT_START: "kibana.alert.start"; - ALERT_UPDATED_AT: "kibana.alert.updated_at"; - ALERT_UPDATED_BY_USER_ID: "kibana.alert.updated_by.user.id"; - ALERT_UPDATED_BY_USER_NAME: "kibana.alert.updated_by.user.name"; - ALERT_STATUS: "kibana.alert.status"; - ALERT_TIME_RANGE: "kibana.alert.time_range"; - ALERT_URL: "kibana.alert.url"; - ALERT_UUID: "kibana.alert.uuid"; - ALERT_WORKFLOW_ASSIGNEE_IDS: "kibana.alert.workflow_assignee_ids"; - ALERT_WORKFLOW_STATUS: "kibana.alert.workflow_status"; - ALERT_WORKFLOW_TAGS: "kibana.alert.workflow_tags"; - ALERT_SCHEDULED_ACTION_GROUP: "kibana.alert.scheduled_action.group"; - ALERT_SCHEDULED_ACTION_DATE: "kibana.alert.scheduled_action.date"; - ALERT_SCHEDULED_ACTION_THROTTLING: "kibana.alert.scheduled_action.throttling"; - SPACE_IDS: "kibana.space_ids"; - CPS_SCOPE_EXPRESSION: "kibana.cps_scope.expression"; - CPS_SCOPE_LINKED_PROJECTS: "kibana.cps_scope.linked_projects"; - TIMESTAMP: "@timestamp"; - VERSION: "kibana.version"; - ALERT_MUTED: "kibana.alert.muted"; -}; -export { ALERT_NAMESPACE, ALERT_RULE_NAMESPACE, KIBANA_NAMESPACE, ALERT_STATE_NAMESPACE, ALERT_ACTION_GROUP, ALERT_CASE_IDS, ALERT_DURATION, ALERT_END, ALERT_FLAPPING, ALERT_FLAPPING_HISTORY, ALERT_MAINTENANCE_WINDOW_IDS, ALERT_MAINTENANCE_WINDOW_NAMES, ALERT_CONSECUTIVE_MATCHES, ALERT_PENDING_RECOVERED_COUNT, ALERT_INSTANCE_ID, ALERT_INDEX_PATTERN, ALERT_LAST_DETECTED, ALERT_PREVIOUS_ACTION_GROUP, ALERT_REASON, ALERT_RULE_CATEGORY, ALERT_RULE_CONSUMER, ALERT_RULE_EXECUTION_TIMESTAMP, ALERT_RULE_EXECUTION_TYPE, ALERT_INTENDED_TIMESTAMP, ALERT_RULE_EXECUTION_UUID, ALERT_RULE_NAME, ALERT_RULE_PARAMETERS, ALERT_RULE_PRODUCER, ALERT_RULE_REVISION, ALERT_RULE_TAGS, ALERT_RULE_TYPE_ID, ALERT_RULE_UUID, ALERT_SEVERITY, ALERT_SEVERITY_IMPROVING, ALERT_START, ALERT_UPDATED_AT, ALERT_UPDATED_BY_USER_ID, ALERT_UPDATED_BY_USER_NAME, ALERT_STATUS, ALERT_TIME_RANGE, ALERT_URL, ALERT_UUID, ALERT_WORKFLOW_ASSIGNEE_IDS, ALERT_WORKFLOW_STATUS, ALERT_WORKFLOW_TAGS, ALERT_SCHEDULED_ACTION_GROUP, ALERT_SCHEDULED_ACTION_DATE, ALERT_SCHEDULED_ACTION_THROTTLING, SPACE_IDS, CPS_SCOPE_EXPRESSION, CPS_SCOPE_LINKED_PROJECTS, TIMESTAMP, VERSION, ALERT_MUTED, }; -export type DefaultAlertFieldName = ValuesType; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.d.ts deleted file mode 100644 index b7cbd7e4fe8ad..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -declare const ECS_VERSION: "ecs.version"; -declare const EVENT_ACTION: "event.action"; -declare const EVENT_KIND: "event.kind"; -declare const EVENT_ORIGINAL: "event.original"; -declare const TAGS: "tags"; -declare const ALERT_RISK_SCORE: "kibana.alert.risk_score"; -declare const ALERT_RULE_AUTHOR: "kibana.alert.rule.author"; -declare const ALERT_RULE_CREATED_AT: "kibana.alert.rule.created_at"; -declare const ALERT_RULE_CREATED_BY: "kibana.alert.rule.created_by"; -declare const ALERT_RULE_DESCRIPTION: "kibana.alert.rule.description"; -declare const ALERT_RULE_ENABLED: "kibana.alert.rule.enabled"; -declare const ALERT_RULE_FROM: "kibana.alert.rule.from"; -declare const ALERT_RULE_INTERVAL: "kibana.alert.rule.interval"; -declare const ALERT_RULE_LICENSE: "kibana.alert.rule.license"; -declare const ALERT_RULE_NOTE: "kibana.alert.rule.note"; -declare const ALERT_RULE_REFERENCES: "kibana.alert.rule.references"; -declare const ALERT_RULE_RULE_ID: "kibana.alert.rule.rule_id"; -declare const ALERT_RULE_RULE_NAME_OVERRIDE: "kibana.alert.rule.rule_name_override"; -declare const ALERT_RULE_TO: "kibana.alert.rule.to"; -declare const ALERT_RULE_TYPE: "kibana.alert.rule.type"; -declare const ALERT_RULE_UPDATED_AT: "kibana.alert.rule.updated_at"; -declare const ALERT_RULE_UPDATED_BY: "kibana.alert.rule.updated_by"; -declare const ALERT_RULE_VERSION: "kibana.alert.rule.version"; -declare const ALERT_SUPPRESSION_TERMS: "kibana.alert.suppression.terms"; -declare const ALERT_SUPPRESSION_FIELD: "kibana.alert.suppression.terms.field"; -declare const ALERT_SUPPRESSION_VALUE: "kibana.alert.suppression.terms.value"; -declare const ALERT_SUPPRESSION_START: "kibana.alert.suppression.start"; -declare const ALERT_SUPPRESSION_END: "kibana.alert.suppression.end"; -declare const ALERT_SUPPRESSION_DOCS_COUNT: "kibana.alert.suppression.docs_count"; -declare const ALERT_SYSTEM_STATUS: "kibana.alert.system_status"; -declare const ALERT_WORKFLOW_REASON: "kibana.alert.workflow_reason"; -declare const ALERT_WORKFLOW_USER: "kibana.alert.workflow_user"; -declare const ALERT_WORKFLOW_STATUS_UPDATED_AT: "kibana.alert.workflow_status_updated_at"; -export { ALERT_RISK_SCORE, ALERT_RULE_AUTHOR, ALERT_RULE_CREATED_AT, ALERT_RULE_CREATED_BY, ALERT_RULE_DESCRIPTION, ALERT_RULE_ENABLED, ALERT_RULE_FROM, ALERT_RULE_INTERVAL, ALERT_RULE_LICENSE, ALERT_RULE_NOTE, ALERT_RULE_REFERENCES, ALERT_RULE_RULE_ID, ALERT_RULE_RULE_NAME_OVERRIDE, ALERT_RULE_TO, ALERT_RULE_TYPE, ALERT_RULE_UPDATED_AT, ALERT_RULE_UPDATED_BY, ALERT_RULE_VERSION, ALERT_SUPPRESSION_DOCS_COUNT, ALERT_SUPPRESSION_END, ALERT_SUPPRESSION_FIELD, ALERT_SUPPRESSION_START, ALERT_SUPPRESSION_TERMS, ALERT_SUPPRESSION_VALUE, ALERT_SYSTEM_STATUS, ALERT_WORKFLOW_REASON, ALERT_WORKFLOW_USER, ALERT_WORKFLOW_STATUS_UPDATED_AT, ECS_VERSION, EVENT_ACTION, EVENT_KIND, EVENT_ORIGINAL, TAGS, }; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.d.ts deleted file mode 100644 index a800cb21d4e84..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare const ruleDetailsRoute: "/rule/:ruleId"; -export declare const createRuleRoute: "/create/:ruleTypeId"; -export declare const createRuleFromTemplateRoute: "/create/template/:templateId"; -export declare const editRuleRoute: "/edit/:id"; -export declare const rulesAppDetailsRoute: "/rule/:ruleId"; -export declare const ruleLogsRoute: "/logs"; -export declare const triggersActionsRoute: "/app/management/insightsAndAlerting/triggersActions"; -export declare const rulesAppRoute: "/app/rules"; -export declare const getRuleDetailsRoute: (ruleId: string) => string; -export declare const getRulesAppDetailsRoute: (ruleId: string) => string; -export declare const getCreateRuleRoute: (ruleTypeId: string) => string; -export declare const getCreateRuleFromTemplateRoute: (templateId: string) => string; -export declare const getEditRuleRoute: (ruleId: string) => string; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_constants.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_constants.d.ts deleted file mode 100644 index 6a8d81ba8891a..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const ALERT_KEY_JOINER = ","; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_locator_params.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_locator_params.d.ts deleted file mode 100644 index 1c210dfcffde9..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_locator_params.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -export declare const ruleDetailsLocatorID = "RULE_DETAILS_LOCATOR"; -export declare const rulesLocatorID = "RULES_LOCATOR"; -export type RuleDetailsTabId = 'alerts' | 'history'; -export type RuleStatus = 'enabled' | 'disabled' | 'snoozed'; -export declare const RULE_DETAILS_ALERTS_TAB: RuleDetailsTabId; -export declare const RULE_DETAILS_HISTORY_TAB: RuleDetailsTabId; -export interface RuleDetailsLocatorParams extends SerializableRecord { - ruleId: string; - tabId?: RuleDetailsTabId; - rangeFrom?: string; - rangeTo?: string; - kuery?: string; - controlConfigs?: SerializableRecord[]; -} -export interface RulesLocatorParams extends SerializableRecord { - lastResponse?: string[]; - params?: Record; - search?: string; - status?: RuleStatus[]; - type?: string[]; -} diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.d.ts deleted file mode 100644 index 96ebef70ece89..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AlertConsumers } from '../alerts_as_data_rbac'; -import type { STACK_ALERTS_FEATURE_ID } from './stack_rules'; -export * from './stack_rules'; -export * from './o11y_rules'; -export type RuleCreationValidConsumer = typeof AlertConsumers.LOGS | typeof AlertConsumers.INFRASTRUCTURE | typeof AlertConsumers.OBSERVABILITY | typeof STACK_ALERTS_FEATURE_ID | 'alerts'; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.d.ts deleted file mode 100644 index 89bc1e8a6276a..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -export declare const OBSERVABILITY_THRESHOLD_RULE_TYPE_ID = "observability.rules.custom_threshold"; -/** - * APM rule types - */ -export declare enum ApmRuleType { - ErrorCount = "apm.error_rate",// ErrorRate was renamed to ErrorCount but the key is kept as `error_rate` for backwards-compat. - TransactionErrorRate = "apm.transaction_error_rate", - TransactionDuration = "apm.transaction_duration", - Anomaly = "apm.anomaly" -} -export declare const APM_RULE_TYPE_IDS: ApmRuleType[]; -/** - * Synthetics ryle types - */ -export declare const SYNTHETICS_STATUS_RULE = "xpack.synthetics.alerts.monitorStatus"; -export declare const SYNTHETICS_TLS_RULE = "xpack.synthetics.alerts.tls"; -export declare const SYNTHETICS_ALERT_RULE_TYPES: { - MONITOR_STATUS: string; - TLS: string; -}; -export declare const SYNTHETICS_RULE_TYPE_IDS: string[]; -/** - * SLO rule types - */ -export declare const SLO_BURN_RATE_RULE_TYPE_ID = "slo.rules.burnRate"; -export declare const SLO_RULE_TYPE_IDS: string[]; -/** - * ESQL rule types - */ -export declare const STREAMS_ESQL_RULE_TYPE_ID = "streams.rules.esql"; -export declare const STREAMS_RULE_TYPE_IDS: string[]; -/** - * Metrics rule types - */ -export declare const METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID = "metrics.alert.inventory.threshold"; -export declare const METRIC_THRESHOLD_ALERT_TYPE_ID = "metrics.alert.threshold"; -/** - * Logs rule types - */ -export declare const LOG_THRESHOLD_ALERT_TYPE_ID = "logs.alert.document.count"; -export declare const LOG_RULE_TYPE_IDS: string[]; -/** - * Uptime rule types - */ -export declare const UPTIME_RULE_TYPE_IDS: string[]; -/** - * Infra rule types - */ -export declare enum InfraRuleType { - MetricThreshold = "metrics.alert.threshold", - InventoryThreshold = "metrics.alert.inventory.threshold" -} -export declare const INFRA_RULE_TYPE_IDS: InfraRuleType[]; -export declare const OBSERVABILITY_RULE_TYPE_IDS: string[]; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.d.ts deleted file mode 100644 index 7f0a50c16da94..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare const STACK_ALERTS_FEATURE_ID = "stackAlerts"; -export declare const ES_QUERY_ID = ".es-query"; -export declare const ML_ANOMALY_DETECTION_RULE_TYPE_ID = "xpack.ml.anomaly_detection_alert"; -export declare const DEGRADED_DOCS_RULE_TYPE_ID = "datasetQuality.degradedDocs"; -/** - * These rule types are not the only stack rules. There are more. - * The variable holds all stack rule types that support multiple - * consumers aka the "Role visibility" UX dropdown. - */ -export declare const STACK_RULE_TYPE_IDS_SUPPORTED_BY_OBSERVABILITY: string[]; diff --git a/src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.d.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.d.ts deleted file mode 100644 index 97fe820dd379c..0000000000000 --- a/src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -import type { ValuesType } from 'utility-types'; -declare const EVENT_MODULE: "event.module"; -declare const ALERT_BUILDING_BLOCK_TYPE: "kibana.alert.building_block_type"; -declare const ALERT_EVALUATION_THRESHOLD: "kibana.alert.evaluation.threshold"; -declare const ALERT_EVALUATION_TIME_RANGE: "kibana.alert.evaluation.time_range"; -declare const ALERT_EVALUATION_VALUE: "kibana.alert.evaluation.value"; -declare const ALERT_CONTEXT: "kibana.alert.context"; -declare const ALERT_EVALUATION_VALUES: "kibana.alert.evaluation.values"; -declare const ALERT_GROUPING: "kibana.alert.grouping"; -declare const ALERT_GROUP: "kibana.alert.group"; -declare const ALERT_GROUP_FIELD: "kibana.alert.group.field"; -declare const ALERT_GROUP_VALUE: "kibana.alert.group.value"; -declare const ALERT_RULE_EXCEPTIONS_LIST: "kibana.alert.rule.exceptions_list"; -declare const ALERT_RULE_NAMESPACE_FIELD: "kibana.alert.rule.namespace"; -declare const ALERT_THREAT_FRAMEWORK: "kibana.alert.rule.threat.framework"; -declare const ALERT_THREAT_TACTIC_ID: "kibana.alert.rule.threat.tactic.id"; -declare const ALERT_THREAT_TACTIC_NAME: "kibana.alert.rule.threat.tactic.name"; -declare const ALERT_THREAT_TACTIC_REFERENCE: "kibana.alert.rule.threat.tactic.reference"; -declare const ALERT_THREAT_TECHNIQUE_ID: "kibana.alert.rule.threat.technique.id"; -declare const ALERT_THREAT_TECHNIQUE_NAME: "kibana.alert.rule.threat.technique.name"; -declare const ALERT_THREAT_TECHNIQUE_REFERENCE: "kibana.alert.rule.threat.technique.reference"; -declare const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID: "kibana.alert.rule.threat.technique.subtechnique.id"; -declare const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME: "kibana.alert.rule.threat.technique.subtechnique.name"; -declare const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE: "kibana.alert.rule.threat.technique.subtechnique.reference"; -declare const namespaces: { - KIBANA_NAMESPACE: "kibana"; - ALERT_NAMESPACE: "kibana.alert"; - ALERT_RULE_NAMESPACE: "kibana.alert.rule"; -}; -declare const fields: { - ECS_VERSION: "ecs.version"; - EVENT_KIND: "event.kind"; - EVENT_ACTION: "event.action"; - EVENT_MODULE: "event.module"; - TAGS: "tags"; - TIMESTAMP: "@timestamp"; - ALERT_ACTION_GROUP: "kibana.alert.action_group"; - ALERT_BUILDING_BLOCK_TYPE: "kibana.alert.building_block_type"; - ALERT_DURATION: "kibana.alert.duration.us"; - ALERT_END: "kibana.alert.end"; - ALERT_EVALUATION_THRESHOLD: "kibana.alert.evaluation.threshold"; - ALERT_EVALUATION_TIME_RANGE: "kibana.alert.evaluation.time_range"; - ALERT_EVALUATION_VALUE: "kibana.alert.evaluation.value"; - ALERT_EVALUATION_VALUES: "kibana.alert.evaluation.values"; - ALERT_GROUPING: "kibana.alert.grouping"; - ALERT_GROUP: "kibana.alert.group"; - ALERT_GROUP_FIELD: "kibana.alert.group.field"; - ALERT_GROUP_VALUE: "kibana.alert.group.value"; - ALERT_FLAPPING: "kibana.alert.flapping"; - ALERT_MAINTENANCE_WINDOW_IDS: "kibana.alert.maintenance_window_ids"; - ALERT_MAINTENANCE_WINDOW_NAMES: "kibana.alert.maintenance_window_names"; - ALERT_INSTANCE_ID: "kibana.alert.instance.id"; - ALERT_RULE_CONSUMER: "kibana.alert.rule.consumer"; - ALERT_RULE_PRODUCER: "kibana.alert.rule.producer"; - ALERT_REASON: "kibana.alert.reason"; - ALERT_CONTEXT: "kibana.alert.context"; - ALERT_RISK_SCORE: "kibana.alert.risk_score"; - ALERT_CASE_IDS: "kibana.alert.case_ids"; - ALERT_RULE_AUTHOR: "kibana.alert.rule.author"; - ALERT_RULE_CREATED_AT: "kibana.alert.rule.created_at"; - ALERT_RULE_CREATED_BY: "kibana.alert.rule.created_by"; - ALERT_RULE_DESCRIPTION: "kibana.alert.rule.description"; - ALERT_RULE_ENABLED: "kibana.alert.rule.enabled"; - ALERT_RULE_EXCEPTIONS_LIST: "kibana.alert.rule.exceptions_list"; - ALERT_RULE_EXECUTION_UUID: "kibana.alert.rule.execution.uuid"; - ALERT_RULE_FROM: "kibana.alert.rule.from"; - ALERT_RULE_INTERVAL: "kibana.alert.rule.interval"; - ALERT_RULE_LICENSE: "kibana.alert.rule.license"; - ALERT_RULE_NAME: "kibana.alert.rule.name"; - ALERT_RULE_NAMESPACE_FIELD: "kibana.alert.rule.namespace"; - ALERT_RULE_NOTE: "kibana.alert.rule.note"; - ALERT_RULE_PARAMETERS: "kibana.alert.rule.parameters"; - ALERT_RULE_REFERENCES: "kibana.alert.rule.references"; - ALERT_RULE_RULE_ID: "kibana.alert.rule.rule_id"; - ALERT_RULE_RULE_NAME_OVERRIDE: "kibana.alert.rule.rule_name_override"; - ALERT_RULE_TAGS: "kibana.alert.rule.tags"; - ALERT_RULE_TO: "kibana.alert.rule.to"; - ALERT_RULE_TYPE: "kibana.alert.rule.type"; - ALERT_RULE_TYPE_ID: "kibana.alert.rule.rule_type_id"; - ALERT_RULE_UPDATED_AT: "kibana.alert.rule.updated_at"; - ALERT_RULE_UPDATED_BY: "kibana.alert.rule.updated_by"; - ALERT_RULE_VERSION: "kibana.alert.rule.version"; - ALERT_START: "kibana.alert.start"; - ALERT_TIME_RANGE: "kibana.alert.time_range"; - ALERT_SEVERITY: "kibana.alert.severity"; - ALERT_STATUS: "kibana.alert.status"; - ALERT_SYSTEM_STATUS: "kibana.alert.system_status"; - ALERT_UUID: "kibana.alert.uuid"; - ALERT_WORKFLOW_ASSIGNEE_IDS: "kibana.alert.workflow_assignee_ids"; - ALERT_WORKFLOW_REASON: "kibana.alert.workflow_reason"; - ALERT_WORKFLOW_STATUS: "kibana.alert.workflow_status"; - ALERT_WORKFLOW_TAGS: "kibana.alert.workflow_tags"; - ALERT_WORKFLOW_USER: "kibana.alert.workflow_user"; - ALERT_RULE_UUID: "kibana.alert.rule.uuid"; - ALERT_RULE_CATEGORY: "kibana.alert.rule.category"; - ALERT_THREAT_FRAMEWORK: "kibana.alert.rule.threat.framework"; - ALERT_THREAT_TACTIC_ID: "kibana.alert.rule.threat.tactic.id"; - ALERT_THREAT_TACTIC_NAME: "kibana.alert.rule.threat.tactic.name"; - ALERT_THREAT_TACTIC_REFERENCE: "kibana.alert.rule.threat.tactic.reference"; - ALERT_THREAT_TECHNIQUE_ID: "kibana.alert.rule.threat.technique.id"; - ALERT_THREAT_TECHNIQUE_NAME: "kibana.alert.rule.threat.technique.name"; - ALERT_THREAT_TECHNIQUE_REFERENCE: "kibana.alert.rule.threat.technique.reference"; - ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID: "kibana.alert.rule.threat.technique.subtechnique.id"; - ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME: "kibana.alert.rule.threat.technique.subtechnique.name"; - ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE: "kibana.alert.rule.threat.technique.subtechnique.reference"; - ALERT_SUPPRESSION_TERMS: "kibana.alert.suppression.terms"; - ALERT_SUPPRESSION_FIELD: "kibana.alert.suppression.terms.field"; - ALERT_SUPPRESSION_VALUE: "kibana.alert.suppression.terms.value"; - ALERT_SUPPRESSION_START: "kibana.alert.suppression.start"; - ALERT_SUPPRESSION_END: "kibana.alert.suppression.end"; - ALERT_SUPPRESSION_DOCS_COUNT: "kibana.alert.suppression.docs_count"; - SPACE_IDS: "kibana.space_ids"; - VERSION: "kibana.version"; -}; -export { ALERT_BUILDING_BLOCK_TYPE, ALERT_EVALUATION_THRESHOLD, ALERT_EVALUATION_TIME_RANGE, ALERT_EVALUATION_VALUE, ALERT_CONTEXT, ALERT_EVALUATION_VALUES, ALERT_GROUPING, ALERT_GROUP, ALERT_GROUP_FIELD, ALERT_GROUP_VALUE, ALERT_RULE_EXCEPTIONS_LIST, ALERT_RULE_NAMESPACE_FIELD, ALERT_THREAT_FRAMEWORK, ALERT_THREAT_TACTIC_ID, ALERT_THREAT_TACTIC_NAME, ALERT_THREAT_TACTIC_REFERENCE, ALERT_THREAT_TECHNIQUE_ID, ALERT_THREAT_TECHNIQUE_NAME, ALERT_THREAT_TECHNIQUE_REFERENCE, ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, EVENT_MODULE, }; -export type TechnicalRuleDataFieldName = ValuesType; diff --git a/src/platform/packages/shared/kbn-search-errors/index.d.ts b/src/platform/packages/shared/kbn-search-errors/index.d.ts deleted file mode 100644 index 49c926d051c9b..0000000000000 --- a/src/platform/packages/shared/kbn-search-errors/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { createEsError } from './src/create_es_error'; -export { isEsError, EsError } from './src/es_error'; -export { renderSearchError } from './src/render_search_error'; -export type { IEsError } from './src/types'; diff --git a/src/platform/packages/shared/kbn-search-errors/src/create_es_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/create_es_error.d.ts deleted file mode 100644 index 639665b24b1a9..0000000000000 --- a/src/platform/packages/shared/kbn-search-errors/src/create_es_error.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ApplicationStart, CoreStart } from '@kbn/core/public'; -import type { AbstractDataView } from '@kbn/data-views-plugin/common'; -import type { IEsError } from './types'; -import { EsError } from './es_error'; -export interface Services { - application: ApplicationStart; - docLinks: CoreStart['docLinks']; -} -export declare function createEsError(err: IEsError, openInInspector: () => void, services: Services, dataView?: AbstractDataView): EsError; diff --git a/src/platform/packages/shared/kbn-search-errors/src/es_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/es_error.d.ts deleted file mode 100644 index 8c2de303b3f86..0000000000000 --- a/src/platform/packages/shared/kbn-search-errors/src/es_error.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import type { IEsError } from './types'; -/** - * Checks if a given errors originated from Elasticsearch. - * Those params are assigned to the attributes property of an error. - * - * @param e - */ -export declare function isEsError(e: any): e is IEsError; -export declare class EsError extends Error { - readonly attributes: IEsError['attributes']; - private readonly openInInspector; - constructor(err: IEsError, message: string, openInInspector: () => void); - getErrorMessage(): React.JSX.Element; - getActions(): React.JSX.Element[]; -} diff --git a/src/platform/packages/shared/kbn-search-errors/src/painless_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/painless_error.d.ts deleted file mode 100644 index 2a73d708e97a2..0000000000000 --- a/src/platform/packages/shared/kbn-search-errors/src/painless_error.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -import type { ApplicationStart } from '@kbn/core/public'; -import type { AbstractDataView } from '@kbn/data-views-plugin/common'; -import type { IEsError } from './types'; -import { EsError } from './es_error'; -export declare class PainlessError extends EsError { - private readonly applicationStart; - private readonly painlessCause; - private readonly dataView?; - constructor(err: IEsError, openInInspector: () => void, painlessCause: estypes.ErrorCause, applicationStart: ApplicationStart, dataView?: AbstractDataView); - getErrorMessage(): React.JSX.Element; - getActions(): React.JSX.Element[]; -} diff --git a/src/platform/packages/shared/kbn-search-errors/src/render_search_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/render_search_error.d.ts deleted file mode 100644 index 90949b630412a..0000000000000 --- a/src/platform/packages/shared/kbn-search-errors/src/render_search_error.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ReactNode } from 'react'; -export declare function renderSearchError(error: Error): { - title: string; - body: ReactNode; - actions?: ReactNode[]; -} | undefined; diff --git a/src/platform/packages/shared/kbn-search-errors/src/tsdb_error.d.ts b/src/platform/packages/shared/kbn-search-errors/src/tsdb_error.d.ts deleted file mode 100644 index 13d7a4c7a0c57..0000000000000 --- a/src/platform/packages/shared/kbn-search-errors/src/tsdb_error.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -import type { CoreStart } from '@kbn/core/public'; -import type { IEsError } from './types'; -import { EsError } from './es_error'; -export declare class TsdbError extends EsError { - private readonly docLinks; - constructor(err: IEsError, openInInspector: () => void, tsdbCause: estypes.ErrorCause, docLinks: CoreStart['docLinks']); - getErrorMessage(): React.JSX.Element; -} diff --git a/src/platform/packages/shared/kbn-search-errors/src/types.d.ts b/src/platform/packages/shared/kbn-search-errors/src/types.d.ts deleted file mode 100644 index aa1ace89bdd9f..0000000000000 --- a/src/platform/packages/shared/kbn-search-errors/src/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IEsErrorAttributes } from '@kbn/search-types'; -import type { KibanaServerError } from '@kbn/kibana-utils-plugin/common'; -export type IEsError = KibanaServerError; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/index.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/index.d.ts deleted file mode 100644 index cb7f9a4eb82fe..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type { SearchResponseWarning, WarningHandlerCallback } from './src/types'; -export { getWarningsDescription, getWarningsTitle, SearchResponseWarningsBadge, SearchResponseWarningsBadgePopoverContent, SearchResponseWarningsCallout, SearchResponseWarningsEmptyPrompt, ViewDetailsPopover, } from './src/components/search_response_warnings'; -export { extractWarnings } from './src/extract_warnings'; -export { handleWarnings } from './src/handle_warnings'; -export { hasUnsupportedDownsampledAggregationFailure } from './src/has_unsupported_downsampled_aggregation_failure'; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge.d.ts deleted file mode 100644 index c452bfd4c384e..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { SearchResponseWarning } from '../../types'; -interface Props { - warnings: SearchResponseWarning[]; -} -export declare const SearchResponseWarningsBadge: (props: Props) => React.JSX.Element | null; -export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge_popover_content.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge_popover_content.d.ts deleted file mode 100644 index 54184863ea321..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/badge_popover_content.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import type { SearchResponseWarning } from '../../types'; -interface Props { - onViewDetailsClick?: () => void; - warnings: SearchResponseWarning[]; -} -export declare const SearchResponseWarningsBadgePopoverContent: (props: Props) => React.JSX.Element; -export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/callout.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/callout.d.ts deleted file mode 100644 index 2c74fee869b13..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/callout.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { SearchResponseWarning } from '../../types'; -interface Props { - warnings: SearchResponseWarning[]; -} -export declare const SearchResponseWarningsCallout: (props: Props) => React.JSX.Element | null; -export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/empty_prompt.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/empty_prompt.d.ts deleted file mode 100644 index 25cb0dabdc40e..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/empty_prompt.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { SearchResponseWarning } from '../../types'; -interface Props { - warnings: SearchResponseWarning[]; -} -export declare const SearchResponseWarningsEmptyPrompt: (props: Props) => React.JSX.Element; -export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/i18n_utils.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/i18n_utils.d.ts deleted file mode 100644 index e14c77fe354b2..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/i18n_utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { SearchResponseWarning } from '../../types'; -export declare const viewDetailsLabel: string; -export declare function getNonSuccessfulClusters(warnings: SearchResponseWarning[]): Set; -export declare function getWarningsTitle(warnings: SearchResponseWarning[]): string; -export declare function getWarningsDescription(warnings: SearchResponseWarning[]): string; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/index.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/index.d.ts deleted file mode 100644 index b2941bd6490b9..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { getWarningsDescription, getWarningsTitle } from './i18n_utils'; -export { SearchResponseWarningsBadge } from './badge'; -export { SearchResponseWarningsBadgePopoverContent } from './badge_popover_content'; -export { SearchResponseWarningsCallout } from './callout'; -export { SearchResponseWarningsEmptyPrompt } from './empty_prompt'; -export { ViewDetailsPopover } from './view_details_popover'; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/view_details_popover.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/view_details_popover.d.ts deleted file mode 100644 index 91814026765bd..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/components/search_response_warnings/view_details_popover.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import type { SearchResponseWarning } from '../../types'; -interface Props { - displayAsLink?: boolean; - warnings: SearchResponseWarning[]; -} -export declare const ViewDetailsPopover: (props: Props) => React.JSX.Element | null; -export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/extract_warnings.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/extract_warnings.d.ts deleted file mode 100644 index d1f3ac61f9bfa..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/extract_warnings.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { ESQLSearchResponse } from '@kbn/es-types'; -import type { Start as InspectorStartContract, RequestAdapter } from '@kbn/inspector-plugin/public'; -import type { SearchResponseWarning } from './types'; -/** - * @internal - */ -export declare function extractWarnings(rawResponse: estypes.SearchResponse | ESQLSearchResponse, inspectorService: InspectorStartContract, requestAdapter: RequestAdapter, requestName: string, requestId?: string): SearchResponseWarning[]; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/handle_warnings.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/handle_warnings.d.ts deleted file mode 100644 index 7642896d75d40..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/handle_warnings.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { AnalyticsServiceStart, NotificationsStart, ThemeServiceStart, UserProfileService } from '@kbn/core/public'; -import type { I18nStart } from '@kbn/core-i18n-browser'; -import type { Start as InspectorStart, RequestAdapter } from '@kbn/inspector-plugin/public'; -import type { WarningHandlerCallback } from './types'; -interface Services { - analytics: AnalyticsServiceStart; - i18n: I18nStart; - inspector: InspectorStart; - notifications: NotificationsStart; - theme: ThemeServiceStart; - userProfile: UserProfileService; -} -/** - * @internal - * All warnings are expected to come from the same response. - */ -export declare function handleWarnings({ callback, request, requestId, requestName, requestAdapter, response, services, }: { - callback?: WarningHandlerCallback; - request: estypes.SearchRequest; - requestAdapter: RequestAdapter; - requestId?: string; - requestName: string; - response: estypes.SearchResponse; - services: Services; -}): void; -export {}; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/has_unsupported_downsampled_aggregation_failure.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/has_unsupported_downsampled_aggregation_failure.d.ts deleted file mode 100644 index 529abc9f3806a..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/has_unsupported_downsampled_aggregation_failure.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SearchResponseWarning } from './types'; -export declare function hasUnsupportedDownsampledAggregationFailure(warning: SearchResponseWarning): boolean; diff --git a/src/platform/packages/shared/kbn-search-response-warnings/src/types.d.ts b/src/platform/packages/shared/kbn-search-response-warnings/src/types.d.ts deleted file mode 100644 index 0b798f163c2b4..0000000000000 --- a/src/platform/packages/shared/kbn-search-response-warnings/src/types.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -/** - * A warning object for a search response with incomplete ES results - * ES returns incomplete results when: - * 1) Set timeout flag on search and the timeout expires on cluster - * 2) Some shard failures on a cluster - * 3) skipped remote(s) (skip_unavailable=true) - * a. all shards failed - * b. disconnected/not-connected - * @public - */ -export interface SearchResponseIncompleteWarning { - /** - * type: for sorting out incomplete warnings - */ - type: 'incomplete'; - /** - * requestName: human-friendly request name - */ - requestName: string; - /** - * clusters: cluster details. - */ - clusters: Record; - /** - * openInInspector: callback to open warning in inspector - */ - openInInspector: () => void; -} -/** - * A warning object for a search response with warnings - * @public - */ -export type SearchResponseWarning = SearchResponseIncompleteWarning; -/** - * A callback function which can intercept warnings when passed to {@link showWarnings}. Pass `true` from the - * function to prevent the search service from showing warning notifications by default. - * @public - */ -export type WarningHandlerCallback = (warning: SearchResponseWarning, meta: { - request: estypes.SearchRequest; - response: estypes.SearchResponse; - requestId: string | undefined; -}) => boolean | undefined; diff --git a/src/platform/packages/shared/kbn-search-types/index.d.ts b/src/platform/packages/shared/kbn-search-types/index.d.ts deleted file mode 100644 index fd934ed1ada65..0000000000000 --- a/src/platform/packages/shared/kbn-search-types/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { ISearchGeneric, ISearchClient, SanitizedConnectionRequestParams, IEsErrorAttributes, ISearchOptions, ISearchOptionsSerializable, } from './src/types'; -export type { IKibanaSearchRequest, IKibanaSearchResponse } from './src/kibana_search_types'; -export type { ISearchRequestParams, IEsSearchResponse, IEsSearchRequest, } from './src/es_search_types'; diff --git a/src/platform/packages/shared/kbn-search-types/src/es_search_types.d.ts b/src/platform/packages/shared/kbn-search-types/src/es_search_types.d.ts deleted file mode 100644 index bf052c94d9f2f..0000000000000 --- a/src/platform/packages/shared/kbn-search-types/src/es_search_types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { IKibanaSearchRequest, IKibanaSearchResponse } from './kibana_search_types'; -export type ISearchRequestParams = { - trackTotalHits?: boolean; -} & estypes.SearchRequest; -export interface IEsSearchRequest extends IKibanaSearchRequest { - indexType?: string; -} -export type IEsSearchResponse = IKibanaSearchResponse>; diff --git a/src/platform/packages/shared/kbn-search-types/src/kibana_search_types.d.ts b/src/platform/packages/shared/kbn-search-types/src/kibana_search_types.d.ts deleted file mode 100644 index 1c1364ce564b3..0000000000000 --- a/src/platform/packages/shared/kbn-search-types/src/kibana_search_types.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { SanitizedConnectionRequestParams } from './types'; -export interface IKibanaSearchRequest { - /** - * An id can be used to uniquely identify this request. - */ - id?: string; - params?: Params; -} -export interface IKibanaSearchResponse { - /** - * Some responses may contain a unique id to identify the request this response came from. - */ - id?: string; - /** - * If relevant to the search strategy, return a total number - * that represents how progress is indicated. - */ - total?: number; - /** - * If relevant to the search strategy, return a loaded number - * that represents how progress is indicated. - */ - loaded?: number; - /** - * Indicates whether search is still in flight - */ - isRunning?: boolean; - /** - * Indicates whether the results returned are complete or partial - */ - isPartial?: boolean; - /** - * Indicates whether the results returned are from the async-search index - */ - isRestored?: boolean; - /** - * Indicates whether the search has been saved to a search-session object and long keepAlive was set - */ - isStored?: boolean; - /** - * Optional warnings returned from Elasticsearch (for example, deprecation warnings) - */ - warning?: string; - /** - * The raw response returned by the internal search method (usually the raw ES response) - */ - rawResponse: RawResponse; - /** - * HTTP request parameters from elasticsearch transport client t - */ - requestParams?: SanitizedConnectionRequestParams; -} diff --git a/src/platform/packages/shared/kbn-search-types/src/types.d.ts b/src/platform/packages/shared/kbn-search-types/src/types.d.ts deleted file mode 100644 index daf2d81049933..0000000000000 --- a/src/platform/packages/shared/kbn-search-types/src/types.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { ConnectionRequestParams } from '@elastic/transport'; -import type { TransportRequestOptions } from '@elastic/elasticsearch'; -import type { KibanaExecutionContext } from '@kbn/core/public'; -import type { AbstractDataView } from '@kbn/data-views-plugin/common'; -import type { Observable } from 'rxjs'; -import type { ProjectRouting } from '@kbn/es-query'; -import type { IEsSearchRequest, IEsSearchResponse } from './es_search_types'; -import type { IKibanaSearchRequest, IKibanaSearchResponse } from './kibana_search_types'; -export type ISearchGeneric = (request: SearchStrategyRequest, options?: ISearchOptions) => Observable; -export type ISearchCancelGeneric = (id: string, options?: ISearchOptions) => Promise; -export type ISearchExtendGeneric = (id: string, keepAlive: string, options?: ISearchOptions) => Promise; -export interface ISearchClient { - search: ISearchGeneric; - /** - * Used to cancel an in-progress search request. - */ - cancel: ISearchCancelGeneric; - /** - * Used to extend the TTL of an in-progress search request. - */ - extend: ISearchExtendGeneric; -} -export type SanitizedConnectionRequestParams = Pick; -export interface IEsErrorAttributes { - error?: estypes.ErrorCause; - rawResponse?: estypes.SearchResponseBody; - requestParams?: SanitizedConnectionRequestParams; -} -export interface ISearchOptions { - /** - * An `AbortSignal` that allows the caller of `search` to abort a search request. - */ - abortSignal?: AbortSignal; - /** - * Use this option to force using a specific server side search strategy. Leave empty to use the default strategy. - */ - strategy?: string | symbol; - /** - * Request the legacy format for the total number of hits. If sending `rest_total_hits_as_int` to - * something other than `true`, this should be set to `false`. - */ - legacyHitsTotal?: boolean; - /** - * A session ID, grouping multiple search requests into a single session. - */ - sessionId?: string; - /** - * Whether the session is already saved (i.e. sent to background) - */ - isStored?: boolean; - /** - * Whether the search was successfully polled after session was saved. Search was added to a session saved object and keepAlive extended. - */ - isSearchStored?: boolean; - /** - * Whether the session is restored (i.e. search requests should re-use the stored search IDs, - * rather than starting from scratch) - */ - isRestore?: boolean; - /** - * By default, when polling, we don't retrieve the results of the search request (until it is complete). - * setting this to `true` will request the search results, regardless of whether or not the search is complete. - */ - returnIntermediateResults?: boolean; - /** - * Represents a meta-information about a Kibana entity intitating a saerch request. - */ - executionContext?: KibanaExecutionContext; - /** - * Index pattern reference is used for better error messages - */ - indexPattern?: AbstractDataView; - /** - * TransportRequestOptions, other than `signal`, to pass through to the ES client. - * To pass an abort signal, use {@link ISearchOptions.abortSignal} - */ - transport?: Omit; - /** - * When set es results are streamed back to the caller without any parsing of the content. - */ - stream?: boolean; - /** - * A hash of the request params. This is attached automatically by the search interceptor. It is used to link this request with a search session. - */ - requestHash?: string; - /** - * Project routing configuration for cross-project search (CPS). - */ - projectRouting?: ProjectRouting; -} -/** - * Same as `ISearchOptions`, but contains only serializable fields, which can - * be sent over the network. - */ -export type ISearchOptionsSerializable = Pick; diff --git a/src/platform/packages/shared/kbn-server-route-repository-utils/index.d.ts b/src/platform/packages/shared/kbn-server-route-repository-utils/index.d.ts deleted file mode 100644 index aaa39a220b61e..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository-utils/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { formatRequest } from './src/format_request'; -export { parseEndpoint } from './src/parse_endpoint'; -export type { ServerRouteCreateOptions, ServerRouteHandlerResources, RouteParamsRT, ServerRoute, EndpointOf, ReturnOf, RouteRepositoryClient, ClientRequestParamsOf, DecodedRequestParamsOf, ServerRouteRepository, DefaultClientOptions, DefaultRouteCreateOptions, DefaultRouteHandlerResources, IoTsParamsObject, ZodParamsObject, } from './src/typings'; diff --git a/src/platform/packages/shared/kbn-server-route-repository-utils/src/format_request.d.ts b/src/platform/packages/shared/kbn-server-route-repository-utils/src/format_request.d.ts deleted file mode 100644 index 682b6f811e8de..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository-utils/src/format_request.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare function formatRequest(endpoint: string, pathParams?: Record): { - method: "get" | import("@kbn/core/server").DestructiveRouteMethod; - pathname: string; - version: string; -}; diff --git a/src/platform/packages/shared/kbn-server-route-repository-utils/src/parse_endpoint.d.ts b/src/platform/packages/shared/kbn-server-route-repository-utils/src/parse_endpoint.d.ts deleted file mode 100644 index 02475d5bed081..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository-utils/src/parse_endpoint.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare function parseEndpoint(endpoint: string): { - method: "get" | import("@kbn/core-http-server").DestructiveRouteMethod; - pathname: string; - version: string; -}; diff --git a/src/platform/packages/shared/kbn-server-route-repository-utils/src/typings.d.ts b/src/platform/packages/shared/kbn-server-route-repository-utils/src/typings.d.ts deleted file mode 100644 index 7620fad7d374e..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository-utils/src/typings.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -import type { HttpFetchOptions } from '@kbn/core-http-browser'; -import type { IKibanaResponse, RouteAccess, RouteSecurity } from '@kbn/core-http-server'; -import type { KibanaRequest, KibanaResponseFactory, Logger, RequestHandlerContext, RouteConfigOptions, RouteMethod } from '@kbn/core/server'; -import type { ServerSentEvent } from '@kbn/sse-utils'; -import type { z } from '@kbn/zod/v4'; -import type * as t from 'io-ts'; -import type { Observable } from 'rxjs'; -import type { Readable } from 'stream'; -import type { Required, RequiredKeys, ValuesType } from 'utility-types'; -type MaybeOptional; -}> = RequiredKeys extends never ? { - params?: T['params']; -} : { - params: T['params']; -}; -type WithoutIncompatibleMethods = Omit & { - encode: t.Encode; - asEncoder: () => t.Encoder; -}; -export interface RouteParams { - path?: any; - query?: any; - body?: any; -} -export type ZodParamsObject = z.ZodObject<{ - path?: z.ZodType; - query?: z.ZodType; - body?: z.ZodType; -}>; -export type IoTsParamsObject = WithoutIncompatibleMethods>; -export type RouteParamsRT = IoTsParamsObject | ZodParamsObject; -export type ServerRouteHandlerResources = Record; -export interface ServerRouteCreateOptions { - [x: string]: any; -} -type RouteMethodOf = TEndpoint extends `${infer TRouteMethod} ${string}` ? Lowercase extends RouteMethod ? Lowercase : never : never; -type IsPublicEndpoint = TRouteAccess extends 'public' ? true : TRouteAccess extends 'internal' ? false : TEndpoint extends `${string} /api${string}` ? true : false; -type IsVersionSpecified = TEndpoint extends `${string} ${string} ${string}` ? true : false; -type ValidateEndpoint = IsPublicEndpoint extends true ? IsVersionSpecified : true; -type IsAny = 1 | 0 extends (T extends never ? 1 : 0) ? true : false; -type ValidateSerializableValue = IsAny extends true ? 1 : T extends Function ? 0 : T extends Record ? TWalkRecursively extends true ? ValuesType<{ - [key in keyof T]: ValidateSerializableValue; -}> : 1 : T extends string | number | boolean | null | undefined ? 1 : T extends any[] ? 1 : 0; -type GuardAgainstInvalidRecord = 0 extends ValidateSerializableValue ? never : T; -type ServerRouteHandlerReturnTypeWithoutRecord = Observable | Readable | IKibanaResponse | string | number | boolean | null | void; -type ServerRouteHandlerReturnType = ServerRouteHandlerReturnTypeWithoutRecord | Record; -type ServerRouteHandler = (options: TRouteHandlerResources & (TRouteParamsRT extends RouteParamsRT ? DecodedRequestParamsOfType : {})) => Promise>; -export type CreateServerRouteFactory = (options: { - endpoint: ValidateEndpoint extends true ? TEndpoint : never; - handler: ServerRouteHandler; - params?: TRouteParamsRT; - security: RouteSecurity; -} & Required<{ - options?: (TRouteCreateOptions extends DefaultRouteCreateOptions ? TRouteCreateOptions : {}) & RouteConfigOptions> & { - access?: TRouteAccess; - }; -}, RequiredKeys extends never ? never : 'options'>) => Record, TRouteCreateOptions>>; -export type ServerRoute = { - endpoint: TEndpoint; - handler: ServerRouteHandler; - security: RouteSecurity; -} & (TRouteParamsRT extends RouteParamsRT ? { - params: TRouteParamsRT; -} : {}) & (TRouteCreateOptions extends DefaultRouteCreateOptions ? { - options: TRouteCreateOptions; -} : {}); -export type ServerRouteRepository = Record>; -type ClientRequestParamsOfType = TRouteParamsRT extends t.Mixed ? MaybeOptional<{ - params: t.OutputOf; -}> : TRouteParamsRT extends z.ZodType ? z.input extends Record ? MaybeOptional<{ - params: z.input; -}> : never : never; -type DecodedRequestParamsOfType = TRouteParamsRT extends t.Mixed ? MaybeOptional<{ - params: t.TypeOf; -}> : TRouteParamsRT extends z.ZodType> ? MaybeOptional<{ - params: O; -}> : never; -export type EndpointOf = keyof TServerRouteRepository & string; -export type ReturnOf = TServerRouteRepository[TEndpoint] extends ServerRoute ? TReturnType extends IKibanaResponse ? TWrappedResponseType : TReturnType : never; -export type DecodedRequestParamsOf = TServerRouteRepository[TEndpoint] extends ServerRoute ? TRouteParamsRT extends RouteParamsRT ? DecodedRequestParamsOfType : {} : never; -export type ClientRequestParamsOf = TServerRouteRepository[TEndpoint] extends ServerRoute ? TRouteParamsRT extends RouteParamsRT ? ClientRequestParamsOfType : TRouteParamsRT extends undefined ? {} : never : never; -type MaybeOptionalArgs> = RequiredKeys extends never ? [T] | [] : [T]; -export interface RouteRepositoryClient> { - fetch>(endpoint: TEndpoint, ...args: MaybeOptionalArgs & TAdditionalClientOptions & HttpFetchOptions>): Promise>; - stream>(endpoint: TEndpoint, ...args: MaybeOptionalArgs & TAdditionalClientOptions & HttpFetchOptions>): ReturnOf extends Observable ? TReturnType extends ServerSentEvent ? Observable : never : never; -} -interface CoreRouteHandlerResources { - request: KibanaRequest; - response: KibanaResponseFactory; - context: RequestHandlerContext; -} -export type DefaultClientOptions = HttpFetchOptions; -export interface DefaultRouteHandlerResources extends CoreRouteHandlerResources { - logger: Logger; -} -export type DefaultRouteCreateOptions = RouteConfigOptions>; -export {}; diff --git a/src/platform/packages/shared/kbn-server-route-repository/index.d.ts b/src/platform/packages/shared/kbn-server-route-repository/index.d.ts deleted file mode 100644 index d54579d2b465e..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { formatRequest, parseEndpoint } from '@kbn/server-route-repository-utils'; -export { createServerRouteFactory } from './src/create_server_route_factory'; -export { decodeRequestParams } from './src/decode_request_params'; -export { stripNullishRequestParameters } from './src/strip_nullish_request_parameters'; -export { passThroughValidationObject } from './src/validation_objects'; -export { registerRoutes } from './src/register_routes'; -export type { RouteRepositoryClient, ReturnOf, EndpointOf, ClientRequestParamsOf, DecodedRequestParamsOf, ServerRouteRepository, ServerRoute, RouteParamsRT, DefaultRouteCreateOptions, DefaultRouteHandlerResources, IoTsParamsObject, } from '@kbn/server-route-repository-utils'; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/create_server_route_factory.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/create_server_route_factory.d.ts deleted file mode 100644 index 0cbf1dbac7e65..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository/src/create_server_route_factory.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DefaultRouteHandlerResources, ServerRouteHandlerResources } from '@kbn/server-route-repository-utils'; -import type { CreateServerRouteFactory, DefaultRouteCreateOptions } from '@kbn/server-route-repository-utils/src/typings'; -export declare function createServerRouteFactory(): CreateServerRouteFactory; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/decode_request_params.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/decode_request_params.d.ts deleted file mode 100644 index db492a8bd2f94..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository/src/decode_request_params.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IoTsParamsObject } from '@kbn/server-route-repository-utils'; -import type * as t from 'io-ts'; -export declare function decodeRequestParams(params: Partial<{ - path: any; - query: any; - body: any; -}>, paramsRt: T): t.OutputOf; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/make_zod_validation_object.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/make_zod_validation_object.d.ts deleted file mode 100644 index 916e85d4b5bcb..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository/src/make_zod_validation_object.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { z } from '@kbn/zod/v4'; -import type { ZodParamsObject } from '@kbn/server-route-repository-utils'; -export declare function makeZodValidationObject(params: ZodParamsObject): { - params: z.ZodObject<{}, z.core.$strict> | z.ZodPipe>>; - query: z.ZodObject<{}, z.core.$strict> | z.ZodPipe>>; - body: z.ZodUnion, z.ZodNull, z.ZodUndefined]> | z.ZodPipe>>; -}; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/register_routes.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/register_routes.d.ts deleted file mode 100644 index 91e781fceefe4..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository/src/register_routes.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { CoreSetup } from '@kbn/core-lifecycle-server'; -import type { Logger } from '@kbn/logging'; -import type { RouteParamsRT, ServerRoute } from '@kbn/server-route-repository-utils'; -export declare function registerRoutes>({ core, repository, logger, dependencies, runDevModeChecks, }: { - core: CoreSetup; - repository: Record>; - logger: Logger; - dependencies: TDependencies; - runDevModeChecks: boolean; -}): void; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/strip_nullish_request_parameters.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/strip_nullish_request_parameters.d.ts deleted file mode 100644 index 7d16ef6ff0759..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository/src/strip_nullish_request_parameters.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -interface KibanaRequestParams { - body?: unknown; - query?: unknown; - params?: unknown; -} -export declare function stripNullishRequestParameters(params: KibanaRequestParams): Partial<{ - path: any; - body: any; - query: any; -}>; -export {}; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/validate_and_decode_params.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/validate_and_decode_params.d.ts deleted file mode 100644 index d5932bf852d8e..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository/src/validate_and_decode_params.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { KibanaRequest } from '@kbn/core-http-server'; -import type { ZodParamsObject, IoTsParamsObject } from '@kbn/server-route-repository-utils'; -export declare function validateAndDecodeParams(request: KibanaRequest, paramsSchema: ZodParamsObject | IoTsParamsObject | undefined): import("@kbn/server-route-repository-utils/src/typings").RouteParams | undefined; diff --git a/src/platform/packages/shared/kbn-server-route-repository/src/validation_objects.d.ts b/src/platform/packages/shared/kbn-server-route-repository/src/validation_objects.d.ts deleted file mode 100644 index 6d687b9ed04b2..0000000000000 --- a/src/platform/packages/shared/kbn-server-route-repository/src/validation_objects.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { z } from '@kbn/zod/v4'; -export declare const passThroughValidationObject: { - body: z.ZodAny & import("@kbn/zod-helpers/v4/kbn_zod_types/kbn_zod_type").KbnZodType; - params: z.ZodAny & import("@kbn/zod-helpers/v4/kbn_zod_types/kbn_zod_type").KbnZodType; - query: z.ZodAny & import("@kbn/zod-helpers/v4/kbn_zod_types/kbn_zod_type").KbnZodType; -}; -export declare const noParamsValidationObject: { - params: z.ZodObject<{}, z.core.$strict>; - query: z.ZodObject<{}, z.core.$strict>; - body: z.ZodUnion, z.ZodNull, z.ZodUndefined]>; -}; diff --git a/src/platform/packages/shared/kbn-sse-utils-server/index.d.ts b/src/platform/packages/shared/kbn-sse-utils-server/index.d.ts deleted file mode 100644 index fb3845c39a314..0000000000000 --- a/src/platform/packages/shared/kbn-sse-utils-server/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { observableIntoEventSourceStream, cloudProxyBufferSize, } from './src/observable_into_event_source_stream'; -export { supertestToObservable } from './src/supertest_to_observable'; diff --git a/src/platform/packages/shared/kbn-sse-utils-server/src/observable_into_event_source_stream.d.ts b/src/platform/packages/shared/kbn-sse-utils-server/src/observable_into_event_source_stream.d.ts deleted file mode 100644 index c16244fa4bdc0..0000000000000 --- a/src/platform/packages/shared/kbn-sse-utils-server/src/observable_into_event_source_stream.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Logger } from '@kbn/logging'; -import type { ServerSentEvent } from '@kbn/sse-utils/src/events'; -import type { Observable } from 'rxjs'; -import { PassThrough } from 'stream'; -import type { Zlib } from 'zlib'; -declare class ResponseStream extends PassThrough { - private _compressor?; - setCompressor(compressor: Zlib): void; - flush(): void; -} -export declare const cloudProxyBufferSize = 4096; -export declare function observableIntoEventSourceStream(source$: Observable, { logger, signal, flushThrottleMs, flushMinBytes, }: { - logger: Pick; - signal: AbortSignal; - /** - * The minimum time in milliseconds between flushes of the stream. - * This is to avoid flushing too often if the source emits events in quick succession. - * - * @default 100 - */ - flushThrottleMs?: number; - /** - * The Cloud proxy currently buffers 4kb or 8kb of data until flushing. - * This decreases the responsiveness of the streamed response, - * so we manually insert some data during stream flushes to force the proxy to flush too. - */ - flushMinBytes?: number; -}): ResponseStream; -export {}; diff --git a/src/platform/packages/shared/kbn-sse-utils-server/src/supertest_to_observable.d.ts b/src/platform/packages/shared/kbn-sse-utils-server/src/supertest_to_observable.d.ts deleted file mode 100644 index 3f7aeed5cfcd0..0000000000000 --- a/src/platform/packages/shared/kbn-sse-utils-server/src/supertest_to_observable.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type supertest from 'supertest'; -import { Observable } from 'rxjs'; -/** - * Convert a supertest response to an SSE observable. - * - * Note: the supertest response should *NOT* be awaited when using that utility, - * or at least not before calling it. - * - * @example - * ```ts - * const response = supertest - * .post(`/some/sse/endpoint`) - * .set('kbn-xsrf', 'kibana') - * .send({ - * some: 'thing' - * }); - * const events = supertestIntoObservable(response); - * ``` - */ -export declare function supertestToObservable(response: supertest.Test): Observable; diff --git a/src/platform/packages/shared/kbn-ui-actions-browser/src/types/index.d.ts b/src/platform/packages/shared/kbn-ui-actions-browser/src/types/index.d.ts deleted file mode 100644 index 89711022a2bd2..0000000000000 --- a/src/platform/packages/shared/kbn-ui-actions-browser/src/types/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './presentable'; diff --git a/src/platform/packages/shared/kbn-ui-actions-browser/src/types/presentable.d.ts b/src/platform/packages/shared/kbn-ui-actions-browser/src/types/presentable.d.ts deleted file mode 100644 index 6e8d181d64bd0..0000000000000 --- a/src/platform/packages/shared/kbn-ui-actions-browser/src/types/presentable.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { FC } from 'react'; -import type { IconType } from '@elastic/eui'; -/** - * Represents something that can be displayed to user in UI. - */ -export interface Presentable { - /** - * ID that uniquely identifies this object. - */ - readonly id: string; - /** - * Determines the display order in relation to other items. Higher numbers are - * displayed first. - */ - readonly order: number; - /** - * Component to render when displaying this entity as a context menu item. - * If not provided, `getDisplayName` will be used instead. - */ - readonly MenuItem?: FC<{ - context: Context; - }>; - /** - * Optional EUI icon type that can be displayed along with the title. - */ - getIconType(context: Context): IconType | undefined; - /** - * Returns a title to be displayed to the user. - */ - getDisplayName(context: Context): string; - /** - * Returns tooltip text which should be displayed when user hovers this object. - * Should return empty string if tooltip should not be displayed. - */ - getDisplayNameTooltip?(context: Context): string; - /** - * This method should return a link if this item can be clicked on. The link - * is used to navigate user if user middle-clicks it or Ctrl + clicks or - * right-clicks and selects "Open in new tab". - */ - getHref?(context: Context): Promise; - /** - * Returns a promise that resolves to true if this item is compatible given - * the context and should be displayed to user, otherwise resolves to false. - */ - isCompatible(context: Context): Promise; - /** - * Grouping where this item should appear as a submenu. Each entry is a new - * sub-menu level. For example, used to show drilldowns and sharing options - * in panel context menu in a sub-menu. - */ - readonly grouping?: PresentableGrouping; -} -export interface PresentableGroup extends Partial, 'getDisplayName' | 'getDisplayNameTooltip' | 'getIconType' | 'order'>> { - id: string; -} -export type PresentableGrouping = Array>; diff --git a/src/platform/packages/shared/kbn-use-tracked-promise/index.d.ts b/src/platform/packages/shared/kbn-use-tracked-promise/index.d.ts deleted file mode 100644 index 8402bf03faec2..0000000000000 --- a/src/platform/packages/shared/kbn-use-tracked-promise/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { useTrackedPromise } from './use_tracked_promise'; diff --git a/src/platform/packages/shared/kbn-use-tracked-promise/use_tracked_promise.d.ts b/src/platform/packages/shared/kbn-use-tracked-promise/use_tracked_promise.d.ts deleted file mode 100644 index 20e8ea34acaeb..0000000000000 --- a/src/platform/packages/shared/kbn-use-tracked-promise/use_tracked_promise.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import type { DependencyList } from 'react'; -interface UseTrackedPromiseArgs { - createPromise: (...args: Arguments) => Promise; - onResolve?: (result: Result) => void; - onReject?: (value: unknown) => void; - cancelPreviousOn?: 'creation' | 'settlement' | 'resolution' | 'rejection' | 'never'; - triggerOrThrow?: 'always' | 'whenMounted'; -} -/** - * This hook manages a Promise factory and can create new Promises from it. The - * state of these Promises is tracked and they can be canceled when superseded - * to avoid race conditions. - * - * ``` - * const [requestState, performRequest] = useTrackedPromise( - * { - * cancelPreviousOn: 'resolution', - * createPromise: async (url: string) => { - * return await fetchSomething(url) - * }, - * onResolve: response => { - * setSomeState(response.data); - * }, - * onReject: response => { - * setSomeError(response); - * }, - * }, - * [fetchSomething] - * ); - * ``` - * - * The `onResolve` and `onReject` handlers are registered separately, because - * the hook will inject a rejection when in case of a canellation. The - * `cancelPreviousOn` attribute can be used to indicate when the preceding - * pending promises should be canceled: - * - * 'never': No preceding promises will be canceled. - * - * 'creation': Any preceding promises will be canceled as soon as a new one is - * created. - * - * 'settlement': Any preceding promise will be canceled when a newer promise is - * resolved or rejected. - * - * 'resolution': Any preceding promise will be canceled when a newer promise is - * resolved. - * - * 'rejection': Any preceding promise will be canceled when a newer promise is - * rejected. - * - * Any pending promises will be canceled when the component using the hook is - * unmounted, but their status will not be tracked to avoid React warnings - * about memory leaks. - * - * The last argument is a normal React hook dependency list that indicates - * under which conditions a new reference to the configuration object should be - * used. - * - * The `onResolve`, `onReject` and possible uncatched errors are only triggered - * if the underlying component is mounted. To ensure they always trigger (i.e. - * if the promise is called in a `useLayoutEffect`) use the `triggerOrThrow` - * attribute: - * - * 'whenMounted': (default) they are called only if the component is mounted. - * - * 'always': they always call. The consumer is then responsible of ensuring no - * side effects happen if the underlying component is not mounted. - */ -export declare const useTrackedPromise: ({ createPromise, onResolve, onReject, cancelPreviousOn, triggerOrThrow, }: UseTrackedPromiseArgs, dependencies: DependencyList) => [PromiseState, (...args: Arguments) => Promise, () => void]; -export interface UninitializedPromiseState { - state: 'uninitialized'; -} -export interface PendingPromiseState { - state: 'pending'; - promise: Promise; -} -export interface ResolvedPromiseState { - state: 'resolved'; - promise: Promise; - value: ResolvedValue; -} -export interface RejectedPromiseState { - state: 'rejected'; - promise: Promise; - value: RejectedValue; -} -export type SettledPromiseState = ResolvedPromiseState | RejectedPromiseState; -export type PromiseState = UninitializedPromiseState | PendingPromiseState | SettledPromiseState; -export declare const isRejectedPromiseState: (promiseState: PromiseState) => promiseState is RejectedPromiseState; -export declare class CanceledPromiseError extends Error { - isCanceled: boolean; - constructor(message?: string); -} -export declare class SilentCanceledPromiseError extends CanceledPromiseError { -} -export {}; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/constants.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/constants.d.ts deleted file mode 100644 index 1077e6bbe7c15..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const SAVED_OBJECT_REF_NAME = "savedObjectRef"; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.d.ts deleted file mode 100644 index c14aeb90d75c5..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/embeddable_api_context.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface EmbeddableApiContext { - /** - * TODO: once all actions are entirely decoupled from the embeddable system, this key should be renamed to "api" - * to reflect the fact that this context could contain any api. - */ - embeddable: unknown; -} -export declare const isEmbeddableApiContext: (context: unknown) => context is EmbeddableApiContext; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/index.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/index.d.ts deleted file mode 100644 index 62c2b30a5da4b..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -export { isEmbeddableApiContext, type EmbeddableApiContext } from './embeddable_api_context'; -export { type ComparatorFunction, type StateComparators, type WithAllKeys, runComparator, areComparatorsEqual, diffComparators, initializeStateManager, shouldLogStateDiff, logStateDiff, } from './state_manager'; -export { apiCanAccessViewMode, getInheritedViewMode, getViewModeSubject, type CanAccessViewMode, } from './interfaces/can_access_view_mode'; -export { apiCanLockHoverActions, type CanLockHoverActions, } from './interfaces/can_lock_hover_actions'; -export { fetch$, useFetchContext } from './interfaces/fetch/fetch'; -export type { FetchContext } from './interfaces/fetch/fetch_context'; -export { type PublishesPauseFetch, apiPublishesPauseFetch, type PublishesEditablePauseFetch, apiPublishesEditablePauseFetch, } from './interfaces/fetch/publishes_pause_fetch'; -export { initializeTimeRangeManager, timeRangeComparators, type SerializedTimeRange, } from './interfaces/fetch/time_range_manager'; -export { transformTimeRangeOut } from './interfaces/fetch/bwc/time_range_transforms'; -export { apiPublishesReload, type PublishesReload } from './interfaces/fetch/publishes_reload'; -export { apiAppliesFilters, type AppliesFilters, apiAppliesTimeslice, type AppliesTimeslice, apiHasUseGlobalFiltersSetting, type HasUseGlobalFiltersSetting, } from './interfaces/fetch/applies_filters'; -export { apiPublishesFilters, apiPublishesPartialUnifiedSearch, apiPublishesTimeRange, apiPublishesTimeslice, apiPublishesUnifiedSearch, apiPublishesWritableUnifiedSearch, useSearchApi, type PublishesFilters, type PublishesTimeRange, type PublishesTimeslice, type PublishesUnifiedSearch, type PublishesWritableUnifiedSearch, } from './interfaces/fetch/publishes_unified_search'; -export { apiPublishesProjectRouting, type PublishesProjectRouting, apiPublishesProjectRoutingOverrides, type ProjectRoutingOverrides, type PublishesProjectRoutingOverrides, } from './interfaces/fetch/publishes_project_routing'; -export { apiHasAppContext, type EmbeddableAppContext, type HasAppContext, } from './interfaces/has_app_context'; -export { apiHasDisableTriggers, areTriggersDisabled, type HasDisableTriggers, } from './interfaces/has_disable_triggers'; -export { hasEditCapabilities, type HasEditCapabilities } from './interfaces/has_edit_capabilities'; -export { canOverrideHoverActions, type CanOverrideHoverActions, } from './interfaces/can_override_hover_actions'; -export { hasReadOnlyCapabilities, type HasReadOnlyCapabilities, } from './interfaces/has_read_only_capabilities'; -export { apiHasExecutionContext, type HasExecutionContext, } from './interfaces/has_execution_context'; -export { apiHasLibraryTransforms, type HasLibraryTransforms, } from './interfaces/has_library_transforms'; -export { apiHasParentApi, type HasParentApi } from './interfaces/has_parent_api'; -export { apiHasSerializableState, type HasSerializableState, } from './interfaces/has_serializable_state'; -export { apiHasSupportedTriggers, type HasSupportedTriggers, } from './interfaces/has_supported_triggers'; -export { apiHasType, apiIsOfType, type HasType, type HasTypeDisplayName, } from './interfaces/has_type'; -export { apiHasUniqueId, type HasUniqueId } from './interfaces/has_uuid'; -export { apiPublishesBlockingError, hasBlockingError, type PublishesBlockingError, } from './interfaces/publishes_blocking_error'; -export { apiPublishesDataLoading, type PublishesDataLoading, } from './interfaces/publishes_data_loading'; -export { apiPublishesDataViews, type PublishesDataViews, type PublishesWritableDataViews, } from './interfaces/publishes_data_views'; -export { apiPublishesDisabledActionIds, type PublishesDisabledActionIds, } from './interfaces/publishes_disabled_action_ids'; -export { apiPublishesPhaseEvents, type PhaseEvent, type PhaseEventType, type PublishesPhaseEvents, } from './interfaces/publishes_phase_events'; -export { apiPublishesRendered, type PublishesRendered } from './interfaces/publishes_rendered'; -export { apiPublishesSavedObjectId, type PublishesSavedObjectId, } from './interfaces/publishes_saved_object_id'; -export { apiPublishesUnsavedChanges, type PublishesUnsavedChanges, } from './interfaces/publishes_unsaved_changes'; -export { apiPublishesViewMode, apiPublishesWritableViewMode, type PublishesViewMode, type PublishesWritableViewMode, type ViewMode, } from './interfaces/publishes_view_mode'; -export { apiPublishesDescription, apiPublishesWritableDescription, getDescription, type PublishesDescription, type PublishesWritableDescription, } from './interfaces/titles/publishes_description'; -export { apiPublishesTitle, apiPublishesWritableTitle, getTitle, type PublishesTitle, type PublishesWritableTitle, } from './interfaces/titles/publishes_title'; -export { apiPublishesHideBorder, apiPublishesWritableHideBorder, type PublishesHideBorder, type PublishesWritableHideBorder, } from './interfaces/titles/publishes_hide_border'; -export { initializeTitleManager, stateHasTitles, titleComparators, type TitlesApi, type SerializedTitles, } from './interfaces/titles/title_manager'; -export { transformTitlesOut } from './interfaces/titles/bwc/titles_transforms'; -export { useBatchedPublishingSubjects, usePublishingSubject, useStateFromPublishingSubject, type PublishingSubject, } from './publishing_subject'; -export { SAVED_OBJECT_REF_NAME } from './constants'; -export { convertCamelCasedKeysToSnakeCase } from './utils/snake_case'; -export type { PublishesSearchSession } from './interfaces/fetch/publishes_search_session'; -export { apiCanAddNewPanel, type CanAddNewPanel } from './interfaces/containers/can_add_new_panel'; -export { apiHasSerializedChildState, type HasSerializedChildState, } from './interfaces/containers/child_state'; -export { childrenUnsavedChanges$ } from './interfaces/containers/container_state/children_unsaved_changes'; -export { initializeStateApi } from './interfaces/containers/container_state/initialize_state_api'; -export { apiCanDuplicatePanels, apiCanExpandPanels, apiCanPinPanels, apiHasPinnedPanels, type CanDuplicatePanels, type CanExpandPanels, type CanPinPanels, } from './interfaces/containers/panel_management'; -export { apiCanBeDuplicated, apiCanBeCustomized, apiCanBeExpanded, apiCanBePinned, type IsDuplicable, type IsExpandable, type IsCustomizable, type IsPinnable, type HasPanelCapabilities, } from './interfaces/containers/panel_capabilities'; -export { type CanAddNewSection, apiCanAddNewSection, } from './interfaces/containers/can_add_new_section'; -export { canTrackContentfulRender, type TrackContentfulRender, } from './interfaces/containers/performance_trackers'; -export { type HasLastSavedChildState, apiHasLastSavedChildState, } from './interfaces/containers/last_saved_child_state'; -export { apiIsPresentationContainer, apiPublishesChildren, combineCompatibleChildrenApis, getContainerParentFromAPI, listenForCompatibleApi, apiHasSections, type PanelPackage, type PresentationContainer, type HasSections, } from './interfaces/containers/presentation_container'; -export { apiPublishesSettings, type PublishesSettings, } from './interfaces/containers/publishes_settings'; -export { apiCanFocusPanel, type CanFocusPanel } from './interfaces/containers/can_focus_panel'; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.d.ts deleted file mode 100644 index cf85eba0dd68a..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_access_view_mode.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { HasParentApi } from './has_parent_api'; -import type { PublishesViewMode } from './publishes_view_mode'; -/** - * This API can access a view mode, either its own or from its parent API. - */ -export type CanAccessViewMode = Partial | Partial>>; -/** - * A type guard which can be used to determine if a given API has access to a view mode, its own or from its parent. - */ -export declare const apiCanAccessViewMode: (api: unknown) => api is CanAccessViewMode; -/** - * A function which will get the view mode from the API or the parent API. if this api has a view mode AND its - * parent has a view mode, we consider the APIs version the source of truth. - */ -export declare const getInheritedViewMode: (api?: unknown) => import("./publishes_view_mode").ViewMode | undefined; -export declare const getViewModeSubject: (api?: unknown) => import("..").PublishingSubject | undefined; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.d.ts deleted file mode 100644 index 6614e3bf80bd7..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_lock_hover_actions.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { PublishingSubject } from '../publishing_subject'; -/** - * This API can lock hover actions - */ -export interface CanLockHoverActions { - hasLockedHoverActions$: PublishingSubject; - lockHoverActions: (lock: boolean) => void; -} -export declare const apiCanLockHoverActions: (api: unknown) => api is CanLockHoverActions; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_override_hover_actions.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_override_hover_actions.d.ts deleted file mode 100644 index c2c6b9515f322..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/can_override_hover_actions.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { PublishingSubject } from '../publishing_subject'; -/** - * An interface which determines whether the hover actions are overridden by the embeddable - */ -export interface CanOverrideHoverActions { - overrideHoverActions$: PublishingSubject; - OverriddenHoverActionsComponent: React.ComponentType; -} -/** - * A type guard which determines whether or not a given API overrides the hover actions. - */ -export declare const canOverrideHoverActions: (unknownApi: unknown) => unknownApi is CanOverrideHoverActions; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_panel.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_panel.d.ts deleted file mode 100644 index 3cd53b6c814e9..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_panel.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { PanelPackage } from './presentation_container'; -/** - * This API can add a new panel as a child. - */ -export interface CanAddNewPanel { - addNewPanel: (panel: PanelPackage, options?: { - displaySuccessMessage?: boolean; - scrollToPanel?: boolean; - beside?: string; - }) => Promise; -} -/** - * A type guard which can be used to determine if a given API can add a new panel. - */ -export declare const apiCanAddNewPanel: (api: unknown) => api is CanAddNewPanel; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_section.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_section.d.ts deleted file mode 100644 index 224e317b4de2f..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_add_new_section.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface CanAddNewSection { - addNewSection: () => void; -} -export declare const apiCanAddNewSection: (api: unknown) => api is CanAddNewSection; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_focus_panel.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_focus_panel.d.ts deleted file mode 100644 index 18e4c56218db7..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/can_focus_panel.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This API can focus a child panel - */ -export interface CanFocusPanel { - setFocusedPanelId: (panelId?: string) => void; -} -/** - * A type guard which can be used to determine if a given API can focus a child panel - */ -export declare const apiCanFocusPanel: (api: unknown) => api is CanFocusPanel; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/child_state.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/child_state.d.ts deleted file mode 100644 index 2f76b0029a55d..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/child_state.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface HasSerializedChildState { - getSerializedStateForChild: (childId: string) => SerializedState | undefined; -} -export declare const apiHasSerializedChildState: (api: unknown) => api is HasSerializedChildState; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/children_unsaved_changes.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/children_unsaved_changes.d.ts deleted file mode 100644 index 3459824289878..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/children_unsaved_changes.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PublishingSubject } from '../../../publishing_subject'; -export declare const DEBOUNCE_TIME = 100; -/** - * Create an observable stream of unsaved changes from all react embeddable children - */ -export declare function childrenUnsavedChanges$(children$: PublishingSubject<{ - [key: string]: Api; -}>): import("rxjs").Observable<{ - uuid: string; - hasUnsavedChanges: boolean; -}[]>; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/initialize_state_api.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/initialize_state_api.d.ts deleted file mode 100644 index 4673a0aa89b20..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/container_state/initialize_state_api.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { HasSerializableState } from '../../has_serializable_state'; -import type { PublishesUnsavedChanges } from '../../publishes_unsaved_changes'; -import { type StateComparators } from '../../../state_manager'; -import type { HasUniqueId } from '../../has_uuid'; -import type { HasParentApi } from '../../has_parent_api'; -export declare const initializeStateApi: ({ uuid, applySerializedState, parentApi, getComparators, defaultState, serializeState, anyStateChange$, }: HasSerializableState & HasUniqueId & HasParentApi & { - getComparators: () => StateComparators; - defaultState?: Partial; -}) => PublishesUnsavedChanges & HasSerializableState; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/last_saved_child_state.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/last_saved_child_state.d.ts deleted file mode 100644 index fe0e69019ca42..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/last_saved_child_state.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Observable } from 'rxjs'; -export interface HasLastSavedChildState { - lastSavedStateForChild$: (childId: string) => Observable; - getLastSavedStateForChild: (childId: string) => SerializedState | undefined; -} -export declare const apiHasLastSavedChildState: (api: unknown) => api is HasLastSavedChildState; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_capabilities.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_capabilities.d.ts deleted file mode 100644 index 274985952cc72..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_capabilities.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface IsDuplicable { - isDuplicable: boolean; -} -export declare const apiCanBeDuplicated: (unknownApi: unknown | null) => unknownApi is IsDuplicable; -export interface IsExpandable { - isExpandable: boolean; -} -export declare const apiCanBeExpanded: (unknownApi: unknown | null) => unknownApi is IsExpandable; -export interface IsCustomizable { - isCustomizable: boolean; -} -export declare const apiCanBeCustomized: (unknownApi: unknown | null) => unknownApi is IsCustomizable; -export interface IsPinnable { - isPinnable: boolean; -} -export declare const apiCanBePinned: (unknownApi: unknown | null) => unknownApi is IsPinnable; -export type HasPanelCapabilities = IsExpandable & IsCustomizable & IsDuplicable & IsPinnable; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_management.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_management.d.ts deleted file mode 100644 index 7383b0d5ae703..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/panel_management.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { PublishingSubject } from '../../publishing_subject'; -import type { PanelPackage } from './presentation_container'; -export interface CanDuplicatePanels { - duplicatePanel: (panelId: string) => void; -} -export declare const apiCanDuplicatePanels: (unknownApi: unknown | null) => unknownApi is CanDuplicatePanels; -export interface CanExpandPanels { - expandPanel: (panelId: string) => void; - expandedPanelId$: PublishingSubject; -} -export declare const apiCanExpandPanels: (unknownApi: unknown | null) => unknownApi is CanExpandPanels; -export interface HasPinnedPanels { - panelIsPinned: (panelId: string) => boolean; -} -export interface CanPinPanels extends HasPinnedPanels { - pinPanel: (panelId: string) => void; - unpinPanel: (panelId: string) => void; - addPinnedPanel: (panel: PanelPackage) => Promise; -} -export declare const apiHasPinnedPanels: (api: unknown) => api is HasPinnedPanels; -export declare const apiCanPinPanels: (api: unknown) => api is CanPinPanels; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/performance_trackers.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/performance_trackers.d.ts deleted file mode 100644 index 27194459d61dc..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/performance_trackers.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface TrackContentfulRender { - /** - * A way to report that the contentful render has been completed - */ - trackContentfulRender: () => void; -} -export declare const canTrackContentfulRender: (root: unknown) => root is TrackContentfulRender; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/presentation_container.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/presentation_container.d.ts deleted file mode 100644 index 8349281b9c587..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/presentation_container.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { PublishingSubject } from '../../publishing_subject'; -import type { CanAddNewPanel } from './can_add_new_panel'; -import type { CanAddNewSection } from './can_add_new_section'; -export interface PanelPackage { - panelType: string; - maybePanelId?: string; - /** - * The serialized state of this panel. - */ - serializedState?: SerializedState; -} -export interface PresentationContainer extends CanAddNewPanel { - /** - * Removes a panel from the container. - */ - removePanel: (panelId: string) => void; - /** - * Determines whether or not a container is capable of removing panels. - */ - canRemovePanels?: () => boolean; - /** - * Replaces a panel in the container with a new panel. - */ - replacePanel: (idToRemove: string, newPanel: PanelPackage) => Promise; - /** - * Returns the number of panels in the container. - */ - getPanelCount: () => number; - /** - * Gets a child API for the given ID. This is asynchronous and should await for the - * child API to be available. It is best practice to retrieve a child API using this method - */ - getChildApi: (uuid: string) => Promise; - /** - * A publishing subject containing the child APIs of the container. Note that - * children are created asynchronously. This means that the children$ observable might - * contain fewer children than the actual number of panels in the container. Use getChildApi - * to retrieve the child API for a specific panel. - */ - children$: PublishingSubject<{ - [key: string]: ApiType; - }>; -} -export declare const apiIsPresentationContainer: (api: unknown | null) => api is PresentationContainer; -export interface HasSections extends CanAddNewSection { - getPanelSection: (uuid: string) => string | undefined; - panelSection$: (uuid: string) => Observable; -} -export declare const apiHasSections: (api: unknown) => api is HasSections; -export declare const apiPublishesChildren: (api: unknown | null) => api is Pick; -export declare const getContainerParentFromAPI: (api: null | unknown) => PresentationContainer | undefined; -export declare const listenForCompatibleApi: (parent: unknown, isCompatible: (api: unknown) => api is ApiType, apiFound: (api: ApiType | undefined) => (() => void) | void) => () => void; -export declare const combineCompatibleChildrenApis: (api: unknown, observableKey: keyof ApiType, isCompatible: (api: unknown) => api is ApiType, emptyState: PublishingSubjectType, flattenMethod?: (array: PublishingSubjectType[]) => PublishingSubjectType) => Observable; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/publishes_settings.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/publishes_settings.d.ts deleted file mode 100644 index 61000e6c4efbd..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/containers/publishes_settings.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { PublishingSubject } from '../../publishing_subject'; -export interface PublishesSettings { - settings: Record>; -} -export declare const apiPublishesSettings: (unknownApi: null | unknown) => unknownApi is PublishesSettings; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/applies_filters.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/applies_filters.d.ts deleted file mode 100644 index 8d33615ccfd2e..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/applies_filters.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import type { PublishingSubject } from '../../publishing_subject'; -export interface AppliesFilters { - filtersLoading$: PublishingSubject; - appliedFilters$: PublishingSubject; -} -export declare const apiAppliesFilters: (unknownApi: unknown) => unknownApi is AppliesFilters; -export interface AppliesTimeslice { - appliedTimeslice$: PublishingSubject<[number, number] | undefined>; -} -export declare const apiAppliesTimeslice: (unknownApi: unknown) => unknownApi is AppliesTimeslice; -export interface HasUseGlobalFiltersSetting { - useGlobalFilters$: PublishingSubject; -} -export declare const apiHasUseGlobalFiltersSetting: (unknownApi: unknown) => unknownApi is HasUseGlobalFiltersSetting; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/bwc/time_range_transforms.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/bwc/time_range_transforms.d.ts deleted file mode 100644 index a82d5801bca4f..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/bwc/time_range_transforms.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SerializedTimeRange } from '@kbn/presentation-publishing-schemas'; -/** - * Pre 9.4 the time_range state was stored in a camelCased key called timeRange. - * This transform out function ensures that this state is not dropped when loading from - * a legacy stored state. This should only be used for embeddables that existed before 9.4. - */ -export declare const transformTimeRangeOut: >(storedState: StoredStateType) => StoredStateType; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.d.ts deleted file mode 100644 index f7030869a7f3e..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { type Observable } from 'rxjs'; -import { type FetchContext } from './fetch_context'; -export declare function fetch$(api: unknown): Observable; -export declare const useFetchContext: (api: unknown) => FetchContext; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch_context.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch_context.d.ts deleted file mode 100644 index 161137b52fe9f..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/fetch_context.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { AggregateQuery, Filter, Query, TimeRange, ProjectRouting } from '@kbn/es-query'; -import type { ESQLControlVariable } from '@kbn/esql-types'; -export interface FetchContext { - isReload: boolean; - filters: Filter[] | undefined; - query: Query | AggregateQuery | undefined; - searchSessionId: string | undefined; - timeRange: TimeRange | undefined; - timeslice: [number, number] | undefined; - esqlVariables: ESQLControlVariable[] | undefined; - projectRouting: ProjectRouting | undefined; -} -export interface ReloadTimeFetchContext extends Omit { - reloadTimestamp?: number; -} -export declare function isReloadTimeFetchContextEqual(previousContext: ReloadTimeFetchContext, currentContext: ReloadTimeFetchContext): boolean; -export declare const areFiltersEqualForFetch: (currentFilters?: Filter[], lastFilters?: Filter[]) => boolean; -export declare const isReloadTimestampEqualForFetch: (previousReloadTimestamp?: number, currentReloadTimestamp?: number) => boolean; -export declare const isQueryEqualForFetch: (currentQuery: Query | AggregateQuery | undefined, lastQuery: Query | AggregateQuery | undefined) => boolean; -export declare const isTimeRangeEqualForFetch: (currentTimeRange: TimeRange | undefined, lastTimeRange: TimeRange | undefined) => boolean; -export declare const isTimeSliceEqualForFetch: (currentTimeslice: [number, number] | undefined, lastTimeslice: [number, number] | undefined) => boolean; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_pause_fetch.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_pause_fetch.d.ts deleted file mode 100644 index f3a7b5b486bbe..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_pause_fetch.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Observable } from 'rxjs'; -export interface PublishesPauseFetch { - isFetchPaused$: Observable; -} -export interface PublishesEditablePauseFetch extends PublishesPauseFetch { - setFetchPaused: (paused: boolean) => void; -} -export declare const apiPublishesPauseFetch: (unknownApi: null | unknown) => unknownApi is PublishesPauseFetch; -export declare const apiPublishesEditablePauseFetch: (unknownApi: null | unknown) => unknownApi is PublishesEditablePauseFetch; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_project_routing.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_project_routing.d.ts deleted file mode 100644 index 333fc541f88cf..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_project_routing.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { ProjectRouting } from '@kbn/es-query'; -import type { PublishingSubject } from '../../publishing_subject'; -export interface PublishesProjectRouting { - projectRouting$: PublishingSubject; -} -export declare const apiPublishesProjectRouting: (unknownApi: unknown) => unknownApi is PublishesProjectRouting; -export type ProjectRoutingOverrides = { - name?: string; - value: string; -}[] | undefined; -export interface PublishesProjectRoutingOverrides { - projectRoutingOverrides$: PublishingSubject; -} -export declare const apiPublishesProjectRoutingOverrides: (unknownApi: unknown) => unknownApi is PublishesProjectRoutingOverrides; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.d.ts deleted file mode 100644 index 131dca02644da..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Observable } from 'rxjs'; -export interface PublishesReload { - reload$: Observable; -} -export declare const apiPublishesReload: (unknownApi: null | unknown) => unknownApi is PublishesReload; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.d.ts deleted file mode 100644 index fe6bb44523474..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_search_session.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { PublishingSubject } from '../../publishing_subject'; -export interface PublishesSearchSession { - searchSessionId$: PublishingSubject; - requestSearchSessionId?: () => Promise; -} -export declare const apiPublishesSearchSession: (unknownApi: null | unknown) => unknownApi is PublishesSearchSession; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.d.ts deleted file mode 100644 index 849ed7311656c..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query'; -import { BehaviorSubject } from 'rxjs'; -import type { PublishingSubject } from '../../publishing_subject'; -export interface PublishesTimeslice { - timeslice$: PublishingSubject<[number, number] | undefined>; -} -export interface PublishesTimeRange extends Partial { - timeRange$: PublishingSubject; - timeRestore$?: PublishingSubject; -} -export type PublishesWritableTimeRange = PublishesTimeRange & { - setTimeRange: (timeRange: TimeRange | undefined) => void; -}; -export interface PublishesFilters { - filters$: PublishingSubject; -} -export type PublishesUnifiedSearch = PublishesTimeRange & PublishesFilters & { - isCompatibleWithUnifiedSearch?: () => boolean; - canEditUnifiedSearch?: () => boolean; - query$: PublishingSubject; -}; -export type PublishesWritableUnifiedSearch = PublishesUnifiedSearch & PublishesWritableTimeRange & { - setFilters: (filters: Filter[] | undefined) => void; - setQuery: (query: Query | undefined) => void; -}; -export declare const apiPublishesTimeslice: (unknownApi: null | unknown) => unknownApi is PublishesTimeslice; -export declare const apiPublishesTimeRange: (unknownApi: null | unknown) => unknownApi is PublishesTimeRange; -export declare const apiPublishesFilters: (unknownApi: unknown) => unknownApi is PublishesFilters; -export declare const apiPublishesUnifiedSearch: (unknownApi: null | unknown) => unknownApi is PublishesUnifiedSearch; -export declare const apiPublishesPartialUnifiedSearch: (unknownApi: null | unknown) => unknownApi is Partial; -export declare const apiPublishesWritableUnifiedSearch: (unknownApi: null | unknown) => unknownApi is PublishesWritableUnifiedSearch; -/** - * React hook that converts search props into search observable API - */ -export declare function useSearchApi({ filters, query, timeRange, }: { - filters?: Filter[]; - query?: Query | AggregateQuery; - timeRange?: TimeRange; -}): { - filters$: BehaviorSubject; - query$: BehaviorSubject; - timeRange$: BehaviorSubject; -}; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/time_range_manager.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/time_range_manager.d.ts deleted file mode 100644 index f995acb6415cf..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/fetch/time_range_manager.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SerializedTimeRange } from '@kbn/presentation-publishing-schemas'; -import type { StateManager } from '../../state_manager/types'; -import type { StateComparators } from '../../state_manager'; -export type { SerializedTimeRange } from '@kbn/presentation-publishing-schemas'; -export declare const timeRangeComparators: StateComparators; -export declare const initializeTimeRangeManager: (initialTimeRangeState: SerializedTimeRange) => StateManager; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.d.ts deleted file mode 100644 index 98a7f820fc35f..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_app_context.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface EmbeddableAppContext { - /** - * Current app's path including query and hash starting from {appId} - */ - getCurrentPath?: () => string; - currentAppId: string; -} -export interface HasAppContext { - getAppContext: () => EmbeddableAppContext; -} -export declare const apiHasAppContext: (unknownApi: unknown) => unknownApi is HasAppContext; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.d.ts deleted file mode 100644 index 1239de08c5af0..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_disable_triggers.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface HasDisableTriggers { - disableTriggers: boolean; -} -export declare const apiHasDisableTriggers: (api: unknown | null) => api is HasDisableTriggers; -export declare function areTriggersDisabled(api?: unknown): boolean; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.d.ts deleted file mode 100644 index 49044d57cf384..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_edit_capabilities.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { HasTypeDisplayName } from './has_type'; -/** - * An interface which determines whether or not a given API is editable. - * In order to be editable, the api requires an edit function to execute the action - * a getTypeDisplayName function to display to the user which type of chart is being - * edited, and an isEditingEnabled function. - */ -export interface HasEditCapabilities extends HasTypeDisplayName { - onEdit: ({ isNewPanel }?: { - isNewPanel?: boolean; - }) => Promise; - isEditingEnabled: () => boolean; - getEditHref?: () => Promise; -} -/** - * A type guard which determines whether or not a given API is editable. - */ -export declare const hasEditCapabilities: (root: unknown) => root is HasEditCapabilities; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.d.ts deleted file mode 100644 index cab98dc2d6fbc..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_execution_context.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; -export interface HasExecutionContext { - executionContext: KibanaExecutionContext; -} -export declare const apiHasExecutionContext: (unknownApi: null | unknown) => unknownApi is HasExecutionContext; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.d.ts deleted file mode 100644 index 39a55eefdb35e..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_library_transforms.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * APIs that inherit this interface can be linked to and unlinked from the library. - */ -export interface HasLibraryTransforms { - /** - * @returns {Promise} - */ - hasLibraryItemWithTitle: (title: string) => Promise; - /** - * - * @returns {Promise} - * Returns true when this API is by-value and can be converted to by-reference - */ - canLinkToLibrary: () => Promise; - /** - * - * @returns {Promise} - * Returns true when this API is by-reference and can be converted to by-value - */ - canUnlinkFromLibrary: () => Promise; - /** - * Save the state of this API to the library. This will return the ID of the persisted library item. - * - * @returns {Promise} id of persisted library item - */ - saveToLibrary: (title: string) => Promise; - /** - * - * @returns {ByReferenceSerializedState} - * get by-reference serialized state from this API. - */ - getSerializedStateByReference: (newId: string) => ByReferenceSerializedState; - /** - * - * @returns {ByValueSerializedState} - * get by-value serialized state from this API - */ - getSerializedStateByValue: () => ByValueSerializedState; -} -export declare const apiHasLibraryTransforms: (unknownApi: null | unknown) => unknownApi is HasLibraryTransforms; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.d.ts deleted file mode 100644 index d7ee41588f6d5..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_parent_api.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface HasParentApi { - parentApi: ParentApiType; -} -/** - * A type guard which checks whether or not a given API has a parent API. - */ -export declare const apiHasParentApi: (unknownApi: null | unknown) => unknownApi is HasParentApi; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_read_only_capabilities.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_read_only_capabilities.d.ts deleted file mode 100644 index 1a980b9d579d2..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_read_only_capabilities.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { HasTypeDisplayName } from './has_type'; -/** - * An interface which determines whether or not a given API offers to show the config for read only permissions. - * In order to be read only, the api requires a show config function to execute the action - * a getTypeDisplayName function to display to the user which type of chart is being - * shown, and an isReadOnlyEnabled function. - */ -export interface HasReadOnlyCapabilities extends HasTypeDisplayName { - onShowConfig: () => Promise; - isReadOnlyEnabled: () => { - read: boolean; - write: boolean; - }; -} -/** - * A type guard which determines whether or not a given API is editable. - */ -export declare const hasReadOnlyCapabilities: (root: unknown) => root is HasReadOnlyCapabilities; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_serializable_state.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_serializable_state.d.ts deleted file mode 100644 index bee86ff3fa792..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_serializable_state.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { MaybePromise } from '@kbn/utility-types'; -import type { Observable } from 'rxjs'; -export interface HasSerializableState { - /** - * Emit on any state change. - * - * Must not emit on subscribe. - * Must not debounce. - */ - anyStateChange$: Observable; - /** - * Serializes all state into a format that can be saved into - * some external store. The opposite of `deserialize` in the {@link ReactEmbeddableFactory} - */ - serializeState: () => SerializedState; - /** - * Applies a serialized state snapshot owned by the parent container. - */ - applySerializedState: (state: SerializedState) => MaybePromise; -} -export declare const apiHasSerializableState: (api: unknown | null) => api is HasSerializableState; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.d.ts deleted file mode 100644 index b246b5dbaec44..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_supported_triggers.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface HasSupportedTriggers { - supportedTriggers: () => string[]; -} -export declare const apiHasSupportedTriggers: (api: unknown | null) => api is HasSupportedTriggers; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.d.ts deleted file mode 100644 index 99e57318335f9..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_type.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface HasType { - type: T; -} -export interface HasTypeDisplayName { - getTypeDisplayName: () => string; - getTypeDisplayNameLowerCase?: () => string; -} -export declare const apiHasType: (api: unknown | null) => api is HasType; -export declare const apiIsOfType: (api: unknown | null, typeToCheck: T) => api is HasType; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.d.ts deleted file mode 100644 index 346a153af4f69..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/has_uuid.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface HasUniqueId { - uuid: string; -} -export declare const apiHasUniqueId: (unknownApi: null | unknown) => unknownApi is HasUniqueId; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.d.ts deleted file mode 100644 index 81c2c8a67565e..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_blocking_error.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { PublishingSubject } from '../publishing_subject'; -export interface PublishesBlockingError { - blockingError$: PublishingSubject; -} -export declare const apiPublishesBlockingError: (unknownApi: null | unknown) => unknownApi is PublishesBlockingError; -export declare function hasBlockingError(api: unknown): boolean; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.d.ts deleted file mode 100644 index 0fa8f897ade3f..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_loading.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { PublishingSubject } from '../publishing_subject'; -export interface PublishesDataLoading { - dataLoading$: PublishingSubject; -} -export declare const apiPublishesDataLoading: (unknownApi: null | unknown) => unknownApi is PublishesDataLoading; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.d.ts deleted file mode 100644 index fb8f7c84e6bb7..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_data_views.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { PublishingSubject } from '../publishing_subject'; -/** - * This API publishes a list of data views that it uses. - */ -export interface PublishesDataViews { - dataViews$: PublishingSubject; -} -export type PublishesWritableDataViews = PublishesDataViews & { - setDataViews: (dataViews: DataView[]) => void; -}; -export declare const apiPublishesDataViews: (unknownApi: null | unknown) => unknownApi is PublishesDataViews; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.d.ts deleted file mode 100644 index dee59e471b4a8..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_disabled_action_ids.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PublishingSubject } from '../publishing_subject'; -export interface PublishesDisabledActionIds { - disabledActionIds$: PublishingSubject; - setDisabledActionIds: (ids: string[] | undefined) => void; - getAllTriggersDisabled?: () => boolean; -} -/** - * A type guard which checks whether or not a given API publishes Disabled Action IDs. This can be used - * to programatically limit which actions are available on a per-API basis. - */ -export declare const apiPublishesDisabledActionIds: (unknownApi: null | unknown) => unknownApi is PublishesDisabledActionIds; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.d.ts deleted file mode 100644 index 851f35acf8bc0..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_phase_events.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ErrorLike } from '@kbn/expressions-plugin/common'; -import type { PublishingSubject } from '../publishing_subject'; -/** ------------------------------------------------------------------------------------------ - * Performance Tracking Types - * ------------------------------------------------------------------------------------------ */ -export type PhaseEventType = 'loading' | 'loaded' | 'rendered' | 'error'; -export interface PhaseEvent { - id: string; - status: PhaseEventType; - error?: ErrorLike; - timeToEvent: number; -} -export interface PublishesPhaseEvents { - phase$: PublishingSubject; -} -export declare const apiPublishesPhaseEvents: (unknownApi: null | unknown) => unknownApi is PublishesPhaseEvents; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.d.ts deleted file mode 100644 index d67b23aee8eca..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_rendered.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { PublishingSubject } from '../publishing_subject'; -export interface PublishesRendered { - rendered$: PublishingSubject; -} -export declare const apiPublishesRendered: (unknownApi: null | unknown) => unknownApi is PublishesRendered; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.d.ts deleted file mode 100644 index c48b9872b691f..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_saved_object_id.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PublishingSubject } from '../publishing_subject'; -/** - * This API publishes a saved object id which can be used to determine which saved object this API is linked to. - */ -export interface PublishesSavedObjectId { - savedObjectId$: PublishingSubject; -} -/** - * A type guard which can be used to determine if a given API publishes a saved object id. - */ -export declare const apiPublishesSavedObjectId: (unknownApi: null | unknown) => unknownApi is PublishesSavedObjectId; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.d.ts deleted file mode 100644 index 3ae88b4d30ae0..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_unsaved_changes.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Observable } from 'rxjs'; -export interface PublishesUnsavedChanges { - hasUnsavedChanges$: Observable; -} -export declare const apiPublishesUnsavedChanges: (api: unknown) => api is PublishesUnsavedChanges; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.d.ts deleted file mode 100644 index 1dc258428d8cf..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/publishes_view_mode.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { PublishingSubject } from '../publishing_subject'; -export type ViewMode = 'view' | 'edit' | 'print' | 'preview'; -/** - * This API publishes a universal view mode which can change compatibility of actions and the - * visibility of components. - */ -export interface PublishesViewMode { - viewMode$: PublishingSubject; -} -/** - * This API publishes a writable universal view mode which can change compatibility of actions and the - * visibility of components. - */ -export type PublishesWritableViewMode = PublishesViewMode & { - setViewMode: (viewMode: ViewMode) => void; -}; -/** - * A type guard which can be used to determine if a given API publishes a view mode. - */ -export declare const apiPublishesViewMode: (unknownApi: null | unknown) => unknownApi is PublishesViewMode; -export declare const apiPublishesWritableViewMode: (unknownApi: null | unknown) => unknownApi is PublishesWritableViewMode; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/bwc/titles_transforms.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/bwc/titles_transforms.d.ts deleted file mode 100644 index cb382484f5c36..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/bwc/titles_transforms.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SerializedTitles } from '@kbn/presentation-publishing-schemas'; -/** - * Pre 9.4 the hide_titles state was stored in a camelCased key called hidePanelTitles. - * This transform out function ensures that this state is not dropped when loading from - * a legacy stored state. This should only be used for embeddables that existed before 9.4. - */ -export declare const transformTitlesOut: (storedState: StoredStateType) => StoredStateType; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_description.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_description.d.ts deleted file mode 100644 index e4a5bb5a0a2d4..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_description.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PublishingSubject } from '../../publishing_subject'; -export interface PublishesDescription { - description$: PublishingSubject; - defaultDescription$?: PublishingSubject; -} -export declare function getDescription(api: Partial): string | undefined; -export type PublishesWritableDescription = PublishesDescription & { - setDescription: (newTitle: string | undefined) => void; -}; -export declare const apiPublishesDescription: (unknownApi: null | unknown) => unknownApi is PublishesDescription; -export declare const apiPublishesWritableDescription: (unknownApi: null | unknown) => unknownApi is PublishesWritableDescription; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_hide_border.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_hide_border.d.ts deleted file mode 100644 index d4c7e815c6ff2..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_hide_border.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { PublishingSubject } from '../../publishing_subject'; -export interface PublishesHideBorder { - hideBorder$: PublishingSubject; -} -export type PublishesWritableHideBorder = PublishesHideBorder & { - setHideBorder: (hideBorder: boolean | undefined) => void; -}; -export declare const apiPublishesHideBorder: (unknownApi: unknown | null) => unknownApi is PublishesHideBorder; -export declare const apiPublishesWritableHideBorder: (unknownApi: unknown | null) => unknownApi is PublishesWritableHideBorder; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_title.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_title.d.ts deleted file mode 100644 index 0594ac24bc828..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/publishes_title.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { PublishingSubject } from '../../publishing_subject'; -export interface PublishesTitle { - title$: PublishingSubject; - hideTitle$: PublishingSubject; - defaultTitle$?: PublishingSubject; -} -export declare function getTitle(api: Partial): string | undefined; -export type PublishesWritableTitle = PublishesTitle & { - setTitle: (newTitle: string | undefined) => void; - setHideTitle: (hide: boolean | undefined) => void; -}; -export declare const apiPublishesTitle: (unknownApi: null | unknown) => unknownApi is PublishesTitle; -export declare const apiPublishesWritableTitle: (unknownApi: null | unknown) => unknownApi is PublishesWritableTitle; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/title_manager.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/title_manager.d.ts deleted file mode 100644 index 93518d0a0b78e..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/interfaces/titles/title_manager.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { SerializedTitles } from '@kbn/presentation-publishing-schemas'; -import type { StateComparators, StateManager } from '../../state_manager/types'; -import type { PublishesWritableDescription } from './publishes_description'; -import type { PublishesWritableTitle } from './publishes_title'; -import type { PublishesWritableHideBorder } from './publishes_hide_border'; -export type { SerializedTitles } from '@kbn/presentation-publishing-schemas'; -export type TitleManager = { - api: PublishesWritableTitle & PublishesWritableDescription & PublishesWritableHideBorder; -} & Pick, 'anyStateChange$' | 'getLatestState' | 'reinitializeState'>; -export declare const titleComparators: StateComparators; -export declare const stateHasTitles: (state: unknown) => state is SerializedTitles; -export interface TitlesApi extends PublishesWritableTitle, PublishesWritableDescription, PublishesWritableHideBorder { -} -export declare const initializeTitleManager: (initialTitlesState: SerializedTitles) => TitleManager; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.d.ts deleted file mode 100644 index 163e46fd8697f..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { useBatchedPublishingSubjects } from './publishing_batcher'; -export { useStateFromPublishingSubject, usePublishingSubject } from './publishing_subject'; -export type { PublishingSubject, ValueFromPublishingSubject, UnwrapPublishingSubjectTuple, } from './types'; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.d.ts deleted file mode 100644 index f3c6bb7573933..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_batcher.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { PublishingSubject, UnwrapPublishingSubjectTuple } from './types'; -/** - * Batches the latest values of multiple publishing subjects into a single object. Use this to avoid unnecessary re-renders. - * Use when `subjects` are static and do not change over the lifetime of the component. - * - * Do not use when value is used as an input value to avoid debouncing user interactions - * - * @param subjects Publishing subjects array. - */ -export declare const useBatchedPublishingSubjects: >]>(...subjects: [...SubjectsType]) => UnwrapPublishingSubjectTuple; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.d.ts deleted file mode 100644 index 3befb54511154..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/publishing_subject.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { PublishingSubject, ValueFromPublishingSubject } from './types'; -/** - * Declares a publishing subject, allowing external code to subscribe to react state changes. - * Changes to state fire subject.next - * @param state React state from useState hook. - */ -export declare const usePublishingSubject: (state: T) => PublishingSubject; -/** - * Declares a state variable that is synced with a publishing subject value. - * @param subject Publishing subject. - */ -export declare const useStateFromPublishingSubject: >(subject: SubjectType) => ValueFromPublishingSubject; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.d.ts deleted file mode 100644 index 69d45997e5156..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/publishing_subject/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { BehaviorSubject } from 'rxjs'; -/** - * A publishing subject is a RxJS subject that can be used to listen to value changes, but does not allow pushing values via the Next method. - */ -export type PublishingSubject = Omit, 'next'>; -type AnyValue = any; -export type AnyPublishingSubject = PublishingSubject | undefined; -export type ValueFromPublishingSubject | undefined = PublishingSubject | undefined> = T extends PublishingSubject ? ValueType : T extends undefined ? undefined : never; -export type UnwrapPublishingSubjectTuple = T extends [ - infer Head extends AnyPublishingSubject, - ...infer Tail extends AnyPublishingSubject[] -] ? [ValueFromPublishingSubject, ...UnwrapPublishingSubjectTuple] : []; -export {}; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/index.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/index.d.ts deleted file mode 100644 index 9b54858878898..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { shouldLogStateDiff, logStateDiff } from './state_diff_logger'; -export { areComparatorsEqual, diffComparators, runComparator } from './state_comparators'; -export { initializeStateManager } from './state_manager'; -export type { ComparatorFunction, StateComparators, WithAllKeys } from './types'; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_comparators.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_comparators.d.ts deleted file mode 100644 index d4fe79e4a30a4..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_comparators.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { StateComparators } from './types'; -export declare const runComparator: (comparator: StateComparators[keyof StateType], lastSavedState?: Partial, latestState?: Partial, lastSavedValue?: StateType[keyof StateType], latestValue?: StateType[keyof StateType]) => boolean; -/** - * Run all comparators, and return an object containing only the keys that are not equal, set to the value of the latest state - */ -export declare const diffComparators: (comparators: StateComparators, lastSavedState?: Partial, latestState?: Partial, defaultState?: Partial) => Partial; -/** - * Run comparators until at least one returns false - */ -export declare const areComparatorsEqual: (comparators: StateComparators, lastSavedState?: StateType, currentState?: StateType, defaultState?: Partial, getCustomLogLabel?: (key: string) => string) => boolean; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_diff_logger.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_diff_logger.d.ts deleted file mode 100644 index e0500789d713e..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_diff_logger.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare function shouldLogStateDiff(): boolean; -/** - * Conditional (window.ELASTIC_PRESENTATION_LOGGER needs to be set to true) logger function - */ -export declare function logStateDiff(label: string, lastValue: unknown, currentValue: unknown): Promise; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_manager.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_manager.d.ts deleted file mode 100644 index fa7accbfad88d..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/state_manager.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { StateComparators, StateManager, WithAllKeys } from './types'; -/** - * Initializes a composable state manager instance for a given state type. - * @param initialState - The initial state of the state manager. - * @param defaultState - The default state of the state manager. Every key in this state must be present, for optional keys specify undefined explicly. - * @param comparators - Optional StateComparators. When provided, subject will only emit when value changes. - */ -export declare const initializeStateManager: (initialState: Partial, defaultState: WithAllKeys, comparators?: StateComparators) => StateManager; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/types.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/state_manager/types.d.ts deleted file mode 100644 index 7137b3d26f259..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/state_manager/types.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { PublishingSubject } from '../publishing_subject'; -import type { SnakeToCamelCase } from '../utils/types'; -export type WithAllKeys = { - [Key in keyof Required]: T[Key]; -}; -export type ComparatorFunction = (last: StateType[KeyType] | undefined, current: StateType[KeyType] | undefined, lastState?: Partial, currentState?: Partial) => boolean; -/** - * A type that maps each key in a state type to a definition of how it should be compared. If a custom - * comparator is provided, return true if the values are equal, false otherwise. - */ -export type StateComparators = { - [KeyType in keyof Required]: 'referenceEquality' | 'deepEquality' | 'skip' | ComparatorFunction; -}; -export type CustomComparators = { - [KeyType in keyof StateType]?: ComparatorFunction; -}; -export type SubjectsOf = { - [KeyType in keyof Required as `${SnakeToCamelCase}$`]: PublishingSubject; -}; -export type SettersOf = { - [KeyType in keyof Required as `set${Capitalize>}`]: (value: T[KeyType]) => void; -}; -export interface StateManager { - getLatestState: () => WithAllKeys; - reinitializeState: (newState?: Partial, comparators?: StateComparators) => void; - api: SettersOf & SubjectsOf; - anyStateChange$: Observable; -} diff --git a/src/platform/packages/shared/presentation/presentation_publishing/utils/snake_case.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/utils/snake_case.d.ts deleted file mode 100644 index 27adbbc51fe80..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/utils/snake_case.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SnakeCasedKeys } from './types'; -/** - * This function takes an object and recursively converts all of the keys to `snaked_cased` - * @param input The object with `camelCased` keys - * @returns The object with `snake_cased` keys - */ -export declare const convertCamelCasedKeysToSnakeCase: (input: StateType) => SnakeCasedKeys; diff --git a/src/platform/packages/shared/presentation/presentation_publishing/utils/types.d.ts b/src/platform/packages/shared/presentation/presentation_publishing/utils/types.d.ts deleted file mode 100644 index a4786ec80ae72..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_publishing/utils/types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * A type that converts a single key from snake case to camel case. - */ -export type SnakeToCamelCase = S extends `${infer P1}_${infer P2}${infer P3}` ? `${P1}${Uppercase}${SnakeToCamelCase}` : S; -/** - * A type that converts a single key from camel case to snake case. - */ -export type CamelToSnakeCase = S extends `${infer C}${infer R}` ? `${C extends Lowercase ? '' : '_'}${Lowercase}${CamelToSnakeCase}` : S; -/** - * A type that recursively converts all keys in an object from camel case to snake case. - */ -export type SnakeCasedKeys = { - [KeyType in keyof StateType as `${CamelToSnakeCase}`]: StateType[KeyType] extends object ? StateType[KeyType] extends Array ? StateType[KeyType] : SnakeCasedKeys : StateType[KeyType]; -}; diff --git a/src/platform/packages/shared/presentation/presentation_util/index.d.ts b/src/platform/packages/shared/presentation/presentation_util/index.d.ts deleted file mode 100644 index 5dec67a4b55d5..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_util/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { openLazyFlyout } from './src/open_lazy_flyout'; -export { tracksOverlays, type TracksOverlays } from './src/tracks_overlays'; diff --git a/src/platform/packages/shared/presentation/presentation_util/src/focus_helpers.d.ts b/src/platform/packages/shared/presentation/presentation_util/src/focus_helpers.d.ts deleted file mode 100644 index 28db792feac34..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_util/src/focus_helpers.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const focusFirstFocusable: (elId: Element | null) => void; diff --git a/src/platform/packages/shared/presentation/presentation_util/src/loading_flyout.d.ts b/src/platform/packages/shared/presentation/presentation_util/src/loading_flyout.d.ts deleted file mode 100644 index c81121215af22..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_util/src/loading_flyout.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import React from 'react'; -export declare const LoadingFlyout: React.JSX.Element; diff --git a/src/platform/packages/shared/presentation/presentation_util/src/open_lazy_flyout.d.ts b/src/platform/packages/shared/presentation/presentation_util/src/open_lazy_flyout.d.ts deleted file mode 100644 index 50450a4fe3a1f..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_util/src/open_lazy_flyout.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { CoreStart, OverlayFlyoutOpenOptions } from '@kbn/core/public'; -interface LoadContentArgs { - closeFlyout: () => void; - ariaLabelledBy: string; -} -interface OpenLazyFlyoutParams { - core: CoreStart; - parentApi?: unknown; - loadContent: (args: LoadContentArgs) => Promise; - flyoutProps?: Partial & { - triggerId?: string; - focusedPanelId?: string; - }; -} -/** - * Opens a flyout panel with lazily loaded content. - * - * This helper handles: - * - Mounting a flyout panel with async content. - * - Automatically focusing the flyout when content is ready. - * - Tracking the flyout if `parentApi` supports overlay tracking. - * - Returning focus to a trigger element when the flyout closes. - * - * @param params - Configuration object. - * @param params.core - The `CoreStart` contract, used for overlays and notifications. - * @param params.loadContent - Async function that loads the flyout content. Must return a valid React element. - * If it resolves to `null` or `undefined`, the flyout will close automatically. - * @param params.flyoutProps - Optional props passed to `openFlyout` (e.g. size, className, etc). - * Supports `OverlayFlyoutOpenOptions`. - * @param params.parentApi - Optional parent API to track opened overlays (e.g. dashboardsApi). - * - * @returns A handle to the opened flyout (`OverlayRef`). - */ -export declare const openLazyFlyout: (params: OpenLazyFlyoutParams) => import("@kbn/core/public").OverlayRef; -export {}; diff --git a/src/platform/packages/shared/presentation/presentation_util/src/tracks_overlays.d.ts b/src/platform/packages/shared/presentation/presentation_util/src/tracks_overlays.d.ts deleted file mode 100644 index ecb025ecae074..0000000000000 --- a/src/platform/packages/shared/presentation/presentation_util/src/tracks_overlays.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { EuiFlyoutProps } from '@elastic/eui'; -import type { OverlayRef } from '@kbn/core-mount-utils-browser'; -/** - * Options for tracking overlays. - * - * @public - */ -export interface TracksOverlaysOptions { - /** - * If present, the panel with this ID will be focused when the overlay is opened. This can be used in tandem with a push - * flyout to edit a panel's settings in context - */ - focusedPanelId?: string; -} -/** - * API for tracking overlays. - * - * Used by parent containers (like dashboards) to track opened overlays (e.g. flyouts) and clear them when needed. - * - * @public - */ -export interface TracksOverlays { - /** - * Preferred flyout type for panel flyouts opened from this host (`push` pushes app content, `overlay` opens above layout). - */ - panelFlyoutType?: EuiFlyoutProps['type']; - /** - * Registers an overlay. - * - * @param ref - The overlay reference to track. - * @param options - Optional options such as `focusedPanelId` for context. - */ - openOverlay: (ref: OverlayRef, options?: TracksOverlaysOptions) => void; - /** - * Clears all tracked overlays. - * - * Typically called when the container is destroyed or when overlays should be force-closed. - */ - clearOverlays: () => void; -} -/** - * Type guard to check if an object implements {@link TracksOverlays}. - * - * @param root - The object to check. - * @returns `true` if the object has `openOverlay` and `clearOverlays` methods. - */ -export declare const tracksOverlays: (root: unknown) => root is TracksOverlays; diff --git a/src/platform/packages/shared/react/kibana_mount/index.d.ts b/src/platform/packages/shared/react/kibana_mount/index.d.ts deleted file mode 100644 index ecfc58348fdb4..0000000000000 --- a/src/platform/packages/shared/react/kibana_mount/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { toMountPoint } from './to_mount_point'; -export type { ToMountPointParams } from './to_mount_point'; -export { MountPointPortal } from './mount_point_portal'; -export type { MountPointPortalProps } from './mount_point_portal'; -export { useIfMounted } from './utils'; diff --git a/src/platform/packages/shared/react/kibana_mount/mount_point_portal.d.ts b/src/platform/packages/shared/react/kibana_mount/mount_point_portal.d.ts deleted file mode 100644 index a223a5e0af8e3..0000000000000 --- a/src/platform/packages/shared/react/kibana_mount/mount_point_portal.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import React from 'react'; -import type { MountPoint } from '@kbn/core-mount-utils-browser'; -export interface MountPointPortalProps { - setMountPoint: SetMountPointFn; - children: React.ReactNode; -} -type SetMountPointFn = (mountPoint: MountPoint | undefined) => UnsetMountPointFn | void; -type UnsetMountPointFn = () => void; -/** - * Utility component to portal a part of a react application into the provided `MountPoint`. - */ -export declare const MountPointPortal: FC>; -export {}; diff --git a/src/platform/packages/shared/react/kibana_mount/to_mount_point.d.ts b/src/platform/packages/shared/react/kibana_mount/to_mount_point.d.ts deleted file mode 100644 index 3b1d6e259fc5d..0000000000000 --- a/src/platform/packages/shared/react/kibana_mount/to_mount_point.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { MountPoint } from '@kbn/core-mount-utils-browser'; -import type { RenderingService } from '@kbn/core-rendering-browser'; -import type { KibanaRenderContextProviderProps } from '@kbn/react-kibana-context-render'; -import React from 'react'; -/** - * @deprecated Pass RenderingService as the second parameter to toMountPoint instead - */ -type ToMountPointParamsDeprecated = Pick; -export type ToMountPointParams = ToMountPointParamsDeprecated | RenderingService; -/** - * MountPoint converter for react nodes. - * - * @param node React node to get a mount point for - * @param params services needed for rendering fully-featured React nodes in Kibana - */ -export declare const toMountPoint: (node: React.ReactNode, params: ToMountPointParams) => MountPoint; -export {}; diff --git a/src/platform/packages/shared/react/kibana_mount/utils.d.ts b/src/platform/packages/shared/react/kibana_mount/utils.d.ts deleted file mode 100644 index c099c392c5c1e..0000000000000 --- a/src/platform/packages/shared/react/kibana_mount/utils.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const useIfMounted: () => (func?: () => void) => void; diff --git a/src/platform/packages/shared/shared-ux/avatar/solution/index.d.ts b/src/platform/packages/shared/shared-ux/avatar/solution/index.d.ts deleted file mode 100644 index d9e5cbff58a40..0000000000000 --- a/src/platform/packages/shared/shared-ux/avatar/solution/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { KibanaSolutionAvatar } from './src/solution_avatar'; -export type { KibanaSolutionAvatarProps } from './src/solution_avatar'; diff --git a/src/platform/packages/shared/shared-ux/avatar/solution/src/solution_avatar.d.ts b/src/platform/packages/shared/shared-ux/avatar/solution/src/solution_avatar.d.ts deleted file mode 100644 index 811274df5b837..0000000000000 --- a/src/platform/packages/shared/shared-ux/avatar/solution/src/solution_avatar.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import type { DistributiveOmit, EuiAvatarProps, IconType } from '@elastic/eui'; -import type { SolutionNameType } from './types'; -export type KnownSolutionProps = DistributiveOmit & { - /** - * Any EuiAvatar size available, or `xxl` for custom large, brand-focused version - */ - size?: EuiAvatarProps['size'] | 'xxl'; - name: SolutionNameType; -}; -export type IconTypeProps = DistributiveOmit & { - /** - * Any EuiAvatar size available, or `xxl` for custom large, brand-focused version - */ - size?: EuiAvatarProps['size'] | 'xxl'; - name?: string; - iconType: IconType; -}; -export type KibanaSolutionAvatarProps = KnownSolutionProps | IconTypeProps; -/** - * Applies extra styling to a typical EuiAvatar. - * The `name` value will be appended to 'logo' to configure the `iconType` unless `iconType` is provided. - */ -export declare const KibanaSolutionAvatar: (props: KibanaSolutionAvatarProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/avatar/solution/src/types.d.ts b/src/platform/packages/shared/shared-ux/avatar/solution/src/types.d.ts deleted file mode 100644 index ab6a9cd2be692..0000000000000 --- a/src/platform/packages/shared/shared-ux/avatar/solution/src/types.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type SolutionNameType = 'App Search' | 'Beats' | 'Business Analytics' | 'Cloud' | 'Cloud Enterprise' | 'Code' | 'Elastic' | 'Elastic Stack' | 'Elasticsearch' | 'Enterprise Search' | 'Logstash' | 'Maps' | 'Metrics' | 'Observability' | 'Security' | 'Site Search' | 'Uptime' | 'Webhook' | 'Workplace Search'; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/index.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/index.d.ts deleted file mode 100644 index 51fab1f8254d4..0000000000000 --- a/src/platform/packages/shared/shared-ux/card/no_data/impl/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { NoDataCardKibanaDependencies, NoDataCardProps, NoDataCardComponentProps, NoDataCardServices, } from '@kbn/shared-ux-card-no-data-types'; -export { NoDataCard } from './src/no_data_card'; -export { NoDataCardKibanaProvider, NoDataCardProvider } from './src/services'; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/elastic_agent_card_illustration.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/elastic_agent_card_illustration.d.ts deleted file mode 100644 index 258be452f6a37..0000000000000 --- a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/elastic_agent_card_illustration.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import React from 'react'; -export declare const ElasticAgentCardIllustration: () => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.component.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.component.d.ts deleted file mode 100644 index 66cea61c289e0..0000000000000 --- a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.component.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import React from 'react'; -import type { NoDataCardComponentProps as Props } from '@kbn/shared-ux-card-no-data-types'; -export declare const NO_DATA_CARD_MAX_WIDTH = 400; -export declare const NoDataCard: ({ title, description, canAccessFleet, href, buttonText, buttonIsDisabled, disabledButtonTooltipText, docsLink: link, onClick, icon, "data-test-subj": dataTestSubj, }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.d.ts deleted file mode 100644 index d1db78c920019..0000000000000 --- a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/no_data_card.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from 'react'; -import type { NoDataCardProps as Props } from '@kbn/shared-ux-card-no-data-types'; -export declare const NoDataCard: ({ href: srcHref, ...props }: Props) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/services.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/impl/src/services.d.ts deleted file mode 100644 index f3ff6789709ad..0000000000000 --- a/src/platform/packages/shared/shared-ux/card/no_data/impl/src/services.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import type { Services, NoDataCardServices, NoDataCardKibanaDependencies } from '@kbn/shared-ux-card-no-data-types'; -/** - * A Context Provider that provides services to the component and its dependencies. - */ -export declare const NoDataCardProvider: FC>; -/** - * Kibana-specific Provider that maps dependencies to services. - */ -export declare const NoDataCardKibanaProvider: FC>; -/** - * React hook for accessing pre-wired services. - */ -export declare function useServices(): Services; diff --git a/src/platform/packages/shared/shared-ux/card/no_data/types/index.d.ts b/src/platform/packages/shared/shared-ux/card/no_data/types/index.d.ts deleted file mode 100644 index 0a93cec4c037d..0000000000000 --- a/src/platform/packages/shared/shared-ux/card/no_data/types/index.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { EuiEmptyPromptProps } from '@elastic/eui'; -/** - * A list of services that are consumed by this component. - */ -export interface Services { - addBasePath: (path: string) => string; - canAccessFleet: boolean; -} -/** - * Services that are consumed by this component and any dependencies. - */ -export type NoDataCardServices = Services; -/** - * An interface containing a collection of Kibana plugins and services required to - * render this component. - */ -interface KibanaDependencies { - coreStart: { - http: { - basePath: { - prepend: (path: string) => string; - }; - }; - application: { - capabilities: { - navLinks: Record; - }; - }; - }; -} -/** - * An interface containing a collection of Kibana plugins and services required to - * render this component as well as any dependencies. - */ -export type NoDataCardKibanaDependencies = KibanaDependencies; -/** - * Props for the `NoDataCard` pure component. - */ -export type NoDataCardComponentProps = Pick & { - /** - * Title for the card; - * If not provided, the default will be used - */ - title?: string; - /** - * Description for the card; - * If not provided, the default will be used - */ - description?: React.ReactNode; - /** True if the person has access to Fleet, false otherwise */ - canAccessFleet?: boolean; - /** - * Provide a string for the button's label; - * The button will be hidden completely if `canAccessFleet=false` or `hideActionButton=true` - */ - buttonText?: string; - /** - * Provide a boolean to disable the button; - * The button will be disabled if `buttonIsDisabled` or `disabledButtonTooltipText`is provided otherwise the button will be hidden completely - */ - buttonIsDisabled?: boolean; - /** - * Provide a tooltip text for the disabled button; - * The button will be disabled if `buttonIsDisabled` or `disabledButtonTooltipText` is provided otherwise the button will be hidden completely - */ - disabledButtonTooltipText?: string; - /** - * Provide a href for the button; - */ - href?: string; - /** - * Link to the documentation for this card; - * If not provided, the default will be used - */ - docsLink?: string; - /** Callback function for when the button is clicked */ - onClick?: (e: React.MouseEvent) => void; - /** Data test subject for the card */ - 'data-test-subj'?: string; -}; -/** - * Props for the `NoDataCard` sevice-connected component. - */ -export type NoDataCardProps = NoDataCardComponentProps; -export {}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/code_editor.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/code_editor.d.ts deleted file mode 100644 index 26b15a03eb85c..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/code_editor.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -import React from 'react'; -import { monaco } from '@kbn/monaco'; -import type { Interpolation, Theme } from '@emotion/react'; -import { type MonacoEditorProps as ReactMonacoEditorProps } from './react_monaco_editor'; -import { type ContextMenuAction } from './mods'; -export interface CodeEditorProps extends Pick { - /** Width of editor. Defaults to 100%. */ - width?: string | number; - /** Height of editor. Defaults to 100px. */ - height?: string | number; - /** ID of the editor language */ - languageId: string; - /** Value of the editor */ - value: string; - /** Function invoked when text in editor is changed */ - onChange?: (value: string, event: monaco.editor.IModelContentChangedEvent) => void; - /** - * Options for the Monaco Code Editor - * Documentation of options can be found here: - * https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneEditorConstructionOptions.html - */ - options?: monaco.editor.IStandaloneEditorConstructionOptions; - /** - * Suggestion provider for autocompletion - * Documentation for the provider can be found here: - * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.CompletionItemProvider.html - */ - suggestionProvider?: monaco.languages.CompletionItemProvider; - /** - * Signature provider for function parameter info - * Documentation for the provider can be found here: - * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.SignatureHelpProvider.html - */ - signatureProvider?: monaco.languages.SignatureHelpProvider; - /** - * Hover provider for hover documentation - * Documentation for the provider can be found here: - * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.HoverProvider.html - */ - hoverProvider?: monaco.languages.HoverProvider; - /** - * Inline completions provider for inline suggestions - * Documentation for the provider can be found here: - * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.InlineCompletionsProvider.html - */ - inlineCompletionsProvider?: monaco.languages.InlineCompletionsProvider; - /** - * Language config provider for bracket - * Documentation for the provider can be found here: - * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.LanguageConfiguration.html - */ - languageConfiguration?: monaco.languages.LanguageConfiguration; - /** - * CodeAction provider for code actions on markers feedback - * Documentation for the provider can be found here: - * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.CodeActionProvider.html - */ - codeActions?: monaco.languages.CodeActionProvider; - /** - * Document highlight provider for highlighting all occurrences of a symbol - * Documentation for the provider can be found here: - * https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.DocumentHighlightProvider.html - */ - documentHighlightProvider?: monaco.languages.DocumentHighlightProvider; - /** - * Function called before the editor is mounted in the view - */ - editorWillMount?: () => void; - /** - * Function called before the editor is mounted in the view - * and completely replaces the setup behavior called by the component - */ - overrideEditorWillMount?: () => void; - /** - * Function called after the editor is mounted in the view - */ - editorDidMount?: (editor: monaco.editor.IStandaloneCodeEditor) => void; - editorWillUnmount?: () => void; - /** - * Should the editor use a transparent background - */ - transparentBackground?: boolean; - /** - * Should the editor be rendered using the fullWidth EUI attribute - */ - fullWidth?: boolean; - placeholder?: string; - /** - * Accessible name for the editor. (Defaults to "Code editor") - */ - 'aria-label'?: string; - /** - * ID of the element that describes the editor. - */ - 'aria-describedby'?: string; - isCopyable?: boolean; - allowFullScreen?: boolean; - /** - * Alternate text to display, when an attempt is made to edit read only content. (Defaults to "Cannot edit in read-only editor") - */ - readOnlyMessage?: string; - /** - * Enables the editor to grow vertically to fit its content. - * This option overrides the `height` option. - */ - fitToContent?: { - minLines?: number; - maxLines?: number; - }; - /** - * Enables the editor to get disabled when pressing ESC to resolve focus trapping for accessibility. - */ - accessibilityOverlayEnabled?: boolean; - /** - * Enables the Search bar functionality in the editor. Disabled by default. - */ - enableFindAction?: boolean; - dataTestSubj?: string; - /** - * Custom CSS class to apply to the container - */ - classNameCss?: Interpolation; - /** - * Enables a custom context menu with Cut, Copy, Paste actions. Disabled by default. - */ - enableCustomContextMenu?: boolean; - /** - * If the custom context menu is enable through {@link enableCustomContextMenu}, - * this prop allows adding more custom menu actions, on top of the default Cut, Copy, and Paste actions. - */ - customContextMenuActions?: ContextMenuAction[]; - /** - * Optional html id for accessibility labeling - */ - htmlId?: string; - /** - * Enables clickable links in the editor. URLs will be underlined and can be opened - * in a new tab using Cmd/Ctrl+Click. Disabled by default. - */ - links?: boolean; - /** - * Callbacks for when editor is focused/blurred - */ - onFocus?: () => void; - onBlur?: () => void; -} -export declare const CodeEditor: React.FC; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/editor.styles.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/editor.styles.d.ts deleted file mode 100644 index f2dc47208d330..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/editor.styles.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { EuiThemeComputed } from '@elastic/eui'; -export declare const styles: { - container: import("@emotion/react").SerializedStyles; - keyboardHint: (euiTheme: EuiThemeComputed) => import("@emotion/react").SerializedStyles; - controls: { - base: (euiTheme: EuiThemeComputed) => import("@emotion/react").SerializedStyles; - fullscreen: (euiTheme: EuiThemeComputed) => import("@emotion/react").SerializedStyles; - }; -}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/index.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/index.d.ts deleted file mode 100644 index 85dfa8f5e67c2..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import type { CodeEditorProps } from './code_editor'; -export type { CodeEditorProps } from './code_editor'; -export { monaco, BarePluginApi } from '@kbn/monaco'; -export * from './react_monaco_editor/languages/supported'; -export { CODE_EDITOR_DEFAULT_THEME_ID, CODE_EDITOR_TRANSPARENT_THEME_ID, defaultThemesResolvers, XJsonLang, PainlessLang, SQLLang, ESQLLang, YamlLang, ConsoleLang, ConsoleOutputLang, MarkdownLang, GrokLang, HandlebarsLang, CssLang, HJsonLang, PromQLLang, ESQL_DARK_THEME_ID, ESQL_LIGHT_THEME_ID, ESQL_AUTOCOMPLETE_TRIGGER_CHARS, CONSOLE_THEME_ID, CONSOLE_OUTPUT_THEME_ID, getParsedRequestsProvider, ConsoleParsedRequestsProvider, ConsoleWorkerProxyService, createOutputParser, configureMonacoYamlSchema, EditorStateService, PainlessCompletionAdapter, initializeSupportedLanguages, getUndoRedoService, } from '@kbn/monaco'; -export type { LangModuleType, CompleteLangModuleType, CustomLangModuleType, MonacoEditorError, LangValidation, SyntaxErrors, BaseWorkerDefinition, UndoRedoService, UndoRedoElement, ESQLDependencies, MonacoMessage, ConsoleOutputParser, ConsoleParserResult, ErrorAnnotation, ParsedRequest, PainlessContext, PainlessCompletionKind, PainlessCompletionItem, PainlessCompletionResult, PainlessAutocompleteField, EditorState, Language, } from '@kbn/monaco'; -/** - * Renders a Monaco code editor with EUI color theme. - * - * @see CodeEditorField to render a code editor in the same style as other EUI form fields. - */ -export declare const CodeEditor: React.FunctionComponent; -/** - * Renders a Monaco code editor in the same style as other EUI form fields. - */ -export declare const CodeEditorField: React.FunctionComponent; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/components/rebroadcast_mouse_down_events.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/components/rebroadcast_mouse_down_events.d.ts deleted file mode 100644 index 64f8b0873d527..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/components/rebroadcast_mouse_down_events.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React, { type FC } from 'react'; -/** - * @description See {@link https://github.com/elastic/kibana/issues/177756 | GitHub issue #177756} for the rationale behind this bug fix implementation - */ -export declare const ReBroadcastMouseDownEvents: FC<{ - children: React.ReactNode; -}>; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_context_menu_utils.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_context_menu_utils.d.ts deleted file mode 100644 index 09823a3ae5c8c..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_context_menu_utils.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { monaco } from '@kbn/monaco'; -interface RegisterContextMenuActionsParams { - editor: monaco.editor.IStandaloneCodeEditor; - enableWriteActions: boolean; - customActions?: ContextMenuAction[]; -} -export interface ContextMenuAction { - actionDescriptor: monaco.editor.IActionDescriptor; - writeAction: boolean; -} -/** - * Hook that returns a function for registering context menu actions in the Monaco editor. - */ -export declare const useContextMenuUtils: () => { - registerContextMenuActions: ({ editor, enableWriteActions, customActions, }: RegisterContextMenuActionsParams) => void; - unregisterContextMenuActions: () => void; -}; -export {}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_copy.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_copy.d.ts deleted file mode 100644 index ac1327220adb0..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_copy.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -export declare const useCopy: ({ isCopyable, value }: { - isCopyable: boolean; - value: string; -}) => { - showCopyButton: string | false; - CopyButton: () => React.JSX.Element | null; -}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fit_content.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fit_content.d.ts deleted file mode 100644 index 3a225d173ad9c..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fit_content.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { monaco } from '@kbn/monaco'; -export declare const useFitToContent: ({ editor, fitToContent, isFullScreen, }: { - editor: monaco.editor.IStandaloneCodeEditor | null; - isFullScreen: boolean; - fitToContent?: { - minLines?: number; - maxLines?: number; - }; -}) => void; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fullscreen.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fullscreen.d.ts deleted file mode 100644 index 457fdaa32bc72..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_fullscreen.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Fullscreen logic - */ -import React, { type KeyboardEvent } from 'react'; -export declare const useFullScreen: ({ allowFullScreen }: { - allowFullScreen?: boolean; -}) => { - FullScreenButton: React.FC<{}>; - FullScreenDisplay: ({ children }: { - children: Array | JSX.Element; - }) => React.JSX.Element; - onKeyDown: (event: KeyboardEvent) => void; - isFullScreen: boolean; - setIsFullScreen: React.Dispatch>; -}; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_placeholder.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_placeholder.d.ts deleted file mode 100644 index 76e164e49ae82..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/hooks/use_placeholder.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { monaco } from '@kbn/monaco'; -import type { UseEuiTheme } from '@elastic/eui'; -export declare const usePlaceholder: ({ placeholder, euiTheme, editor, value, }: { - placeholder: string | undefined; - euiTheme: UseEuiTheme["euiTheme"]; - editor: monaco.editor.IStandaloneCodeEditor | null; - value: string; -}) => void; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/index.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/mods/index.d.ts deleted file mode 100644 index 24463303c47b2..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/mods/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { ReBroadcastMouseDownEvents } from './components/rebroadcast_mouse_down_events'; -export { type ContextMenuAction, useContextMenuUtils } from './hooks/use_context_menu_utils'; -export { useFullScreen } from './hooks/use_fullscreen'; -export { useCopy } from './hooks/use_copy'; -export { usePlaceholder } from './hooks/use_placeholder'; -export { useFitToContent } from './hooks/use_fit_content'; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/editor.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/editor.d.ts deleted file mode 100644 index 6f0082b2abc1e..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/editor.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @notice - * This code is forked from the `react-monaco-editor` - * https://github.com/react-monaco-editor/react-monaco-editor/blob/975cc47b5cb411ee2ffcbdb973daa9342e81a805/src/editor.tsx - * - * The MIT License (MIT) - * - * Copyright (c) 2016-present Leon Shi - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -import type { monaco as monacoEditor } from '@kbn/monaco'; -import * as React from 'react'; -export type EditorConstructionOptions = monacoEditor.editor.IStandaloneEditorConstructionOptions; -export type EditorWillMount = (monaco: typeof monacoEditor) => void | EditorConstructionOptions; -export type EditorDidMount = (editor: monacoEditor.editor.IStandaloneCodeEditor, monaco: typeof monacoEditor) => void; -export type EditorWillUnmount = (editor: monacoEditor.editor.IStandaloneCodeEditor, monaco: typeof monacoEditor) => void | EditorConstructionOptions; -export type ChangeHandler = (value: string, event: monacoEditor.editor.IModelContentChangedEvent) => void; -export interface MonacoEditorProps { - /** - * Width of editor. Defaults to 100%. - */ - width?: string | number; - /** - * Height of editor. Defaults to 100%. - */ - height?: string | number; - /** - * The initial value of the auto created model in the editor. - */ - defaultValue?: string; - /** - * Value of the auto created model in the editor. - * If you specify `null` or `undefined` for this property, the component behaves in uncontrolled mode. - * Otherwise, it behaves in controlled mode. - */ - value?: string | null; - /** - * The initial language of the auto created model in the editor. Defaults to 'javascript'. - */ - language?: string; - /** - * Theme to be used for rendering. - * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. - * You can create custom themes via `monaco.editor.defineTheme`. - */ - theme?: string | null; - /** - * Optional string classname to append to the editor. - */ - className?: string | null; - /** - * Refer to Monaco interface {monaco.editor.IStandaloneEditorConstructionOptions}. - */ - options?: monacoEditor.editor.IStandaloneEditorConstructionOptions; - /** - * An event emitted before the editor mounted (similar to componentWillMount of React). - */ - editorWillMount?: EditorWillMount; - /** - * An event emitted when the editor has been mounted (similar to componentDidMount of React). - */ - editorDidMount?: EditorDidMount; - /** - * An event emitted before the editor unmount (similar to componentWillUnmount of React). - */ - editorWillUnmount?: EditorWillUnmount; - /** - * An event emitted when the content of the current model has changed. - */ - onChange?: ChangeHandler; - /** - * Optional z-index to override the default z-index of the overflow widgets container. - */ - overflowWidgetsContainerZIndexOverride?: number; -} -export declare const OVERFLOW_WIDGETS_TEST_ID = "kbnCodeEditorEditorOverflowWidgetsContainer"; -export declare function MonacoEditor({ width, height, value, defaultValue, language, theme, options, editorWillMount, editorDidMount, editorWillUnmount, onChange, className, overflowWidgetsContainerZIndexOverride, }: MonacoEditorProps): React.JSX.Element; -export declare namespace MonacoEditor { - var displayName: string; -} diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/index.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/index.d.ts deleted file mode 100644 index 0755485603d69..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './editor'; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/languages/supported.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/languages/supported.d.ts deleted file mode 100644 index c7996041207ed..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/react_monaco_editor/languages/supported.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { CSS_LANG_ID, HANDLEBARS_LANG_ID, MARKDOWN_LANG_ID, YAML_LANG_ID, HJSON_LANG_ID, GROK_LANG_ID, XJSON_LANG_ID, PAINLESS_LANG_ID, SQL_LANG_ID, ESQL_LANG_ID, CONSOLE_LANG_ID, CONSOLE_OUTPUT_LANG_ID, PROMQL_LANG_ID, } from '@kbn/monaco/src/languages'; diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/utils/placeholder_widget.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/utils/placeholder_widget.d.ts deleted file mode 100644 index 4f9fd6d9ae65e..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/utils/placeholder_widget.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { monaco } from '@kbn/monaco'; -import type { EuiThemeComputed } from '@elastic/eui'; -export declare class PlaceholderWidget implements monaco.editor.IContentWidget { - private readonly placeholderText; - private readonly euiTheme; - private readonly editor; - constructor(placeholderText: string, euiTheme: EuiThemeComputed, editor: monaco.editor.ICodeEditor); - private domNode; - getId(): string; - getDomNode(): HTMLElement; - getPosition(): monaco.editor.IContentWidgetPosition | null; - dispose(): void; -} diff --git a/src/platform/packages/shared/shared-ux/code_editor/impl/utils/remeasure_fonts.d.ts b/src/platform/packages/shared/shared-ux/code_editor/impl/utils/remeasure_fonts.d.ts deleted file mode 100644 index 386e409caeea8..0000000000000 --- a/src/platform/packages/shared/shared-ux/code_editor/impl/utils/remeasure_fonts.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * When using custom fonts with monaco need to call `monaco.editor.remeasureFonts()` when custom fonts finished loading - * Otherwise initial measurements on fallback font are used which causes visual glitches in the editor - */ -export declare const remeasureFonts: () => void; diff --git a/src/platform/packages/shared/shared-ux/link/redirect_app/impl/index.d.ts b/src/platform/packages/shared/shared-ux/link/redirect_app/impl/index.d.ts deleted file mode 100644 index 7af98954600c9..0000000000000 --- a/src/platform/packages/shared/shared-ux/link/redirect_app/impl/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { RedirectAppLinks, type RedirectAppLinksServices, type RedirectAppLinksKibanaDependencies, type RedirectAppLinksProps, } from './src/deprecated_redirect_app_links.component'; -export { RedirectAppLinks as RedirectAppLinksContainer } from './src/deprecated_redirect_app_links.component'; -export { RedirectAppLinks as RedirectAppLinksComponent } from './src/deprecated_redirect_app_links.component'; diff --git a/src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/deprecated_redirect_app_links.component.d.ts b/src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/deprecated_redirect_app_links.component.d.ts deleted file mode 100644 index 39dc2733ea528..0000000000000 --- a/src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/deprecated_redirect_app_links.component.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { FC } from 'react'; -import React from 'react'; -import type { Observable } from 'rxjs'; -import type { DetailedHTMLProps, HTMLAttributes } from 'react'; -export type NavigateToUrl = (url: string) => Promise | void; -/** - * Contextual services for this component. - * @deprecated - */ -export interface RedirectAppLinksServices { - navigateToUrl: NavigateToUrl; - currentAppId?: string; -} -/** - * Kibana-specific contextual services to be adapted for this component. - * @deprecated - */ -export interface RedirectAppLinksKibanaDependencies { - coreStart: { - application: { - currentAppId$: Observable; - navigateToUrl: NavigateToUrl; - }; - }; -} -/** - * Props for the `RedirectAppLinks` component. - * @deprecated - */ -export type RedirectAppLinksProps = Partial & DetailedHTMLProps, HTMLDivElement>; -export declare const redirectAppLinksStyles: import("@emotion/react").SerializedStyles; -/** - * @deprecated - This component is deprecated and usages of it can be safely removed from your codebase. - * The link navigation is handled by GlobalRedirectAppLinks component at the root of Kibana. - * When removing the usages of this component, make sure to check that your app layout hasn't been affected since this adds additional div with styles - */ -export declare const RedirectAppLinks: FC>; diff --git a/src/platform/packages/shared/shared-ux/modal/tabbed/index.d.ts b/src/platform/packages/shared/shared-ux/modal/tabbed/index.d.ts deleted file mode 100644 index 2b00e3308796a..0000000000000 --- a/src/platform/packages/shared/shared-ux/modal/tabbed/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { TabbedModal, type IModalTabDeclaration } from './src/tabbed_modal'; diff --git a/src/platform/packages/shared/shared-ux/modal/tabbed/src/context/index.d.ts b/src/platform/packages/shared/shared-ux/modal/tabbed/src/context/index.d.ts deleted file mode 100644 index 2c79da2906eaa..0000000000000 --- a/src/platform/packages/shared/shared-ux/modal/tabbed/src/context/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import React, { type PropsWithChildren, type Dispatch } from 'react'; -interface IDispatchAction { - type: string; - payload: any; -} -export type IDispatchFunction = Dispatch; -export interface IMetaState { - defaultSelectedTabId: string; - selectedTabId: string; -} -type IReducer = (state: S, action: IDispatchAction) => S; -export interface ITabDeclaration { - id: string; - name: string; - initialState?: Partial; - reducer?: IReducer; -} -interface IModalContext>>> { - tabs: Array>; - state: { - meta: IMetaState; - [index: string]: any; - }; - dispatch: Dispatch; -} -export declare const useModalContext: >>>() => IModalContext; -export type IModalContextProviderProps>>> = PropsWithChildren<{ - /** - * Array of tab declaration to be rendered into the modal that will be rendered - */ - tabs: Tabs; - /** - * ID of the tab we'd like the modal to have selected on render - */ - defaultSelectedTabId: Tabs[number]['id']; -}>; -export declare function ModalContextProvider>>>({ tabs, defaultSelectedTabId, children, }: IModalContextProviderProps): React.JSX.Element; -export {}; diff --git a/src/platform/packages/shared/shared-ux/modal/tabbed/src/tabbed_modal.d.ts b/src/platform/packages/shared/shared-ux/modal/tabbed/src/tabbed_modal.d.ts deleted file mode 100644 index 5cf3d9a58ece6..0000000000000 --- a/src/platform/packages/shared/shared-ux/modal/tabbed/src/tabbed_modal.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import React, { type ComponentProps, type ReactElement, type ReactNode } from 'react'; -import { EuiModal, type EuiTabProps, type CommonProps } from '@elastic/eui'; -import { type ITabDeclaration, type IDispatchFunction, type IModalContextProviderProps } from './context'; -export type IModalTabContent = (props: { - state: S; - dispatch: IDispatchFunction; -}) => ReactElement; -interface IModalTabActionBtn extends CommonProps { - id: string; - dataTestSubj: string; - label: string; - handler: (args: { - state: S; - }) => void; - isCopy?: boolean; - style?: (args: { - state: S; - }) => boolean; -} -export interface IModalTabDeclaration extends EuiTabProps, ITabDeclaration { - description?: string; - 'data-test-subj'?: string; - content: IModalTabContent; - modalActionBtn?: IModalTabActionBtn; -} -export interface ITabbedModalInner extends Pick, 'onClose' | 'outsideClickCloses'> { - modalWidth?: number; - modalTitle?: string; - anchorElement?: HTMLElement; - aboveTabsContent?: ReactNode; - 'data-test-subj'?: string; -} -export declare function TabbedModal>>({ tabs, defaultSelectedTabId, ...rest }: Omit, 'children'> & ITabbedModalInner): React.JSX.Element; -export {}; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/index.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/index.d.ts deleted file mode 100644 index ced682ee7d165..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { KibanaPageTemplate } from './src/page_template'; -export { KibanaPageTemplateProvider, KibanaPageTemplateKibanaProvider } from './src/services'; -export type { NoDataConfig, KibanaPageTemplateProps, KibanaPageTemplateServices, KibanaPageTemplateKibanaDependencies, } from '@kbn/shared-ux-page-kibana-template-types'; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template.d.ts deleted file mode 100644 index 4b818e56659fa..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { FC } from 'react'; -import React from 'react'; -import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template-types'; -export declare const _KibanaPageTemplate: FC; -/** - * Kibana-specific wrapper of EuiPageTemplate and it's namespaced components - */ -export declare const KibanaPageTemplate: FC & { - Sidebar: React.FunctionComponent; - Header: React.FunctionComponent; - Section: React.FunctionComponent; - BottomBar: React.FunctionComponent; - EmptyPrompt: React.FunctionComponent; -}; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.d.ts deleted file mode 100644 index 94ca2d6d18911..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/page_template_inner.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { FC } from 'react'; -import React from 'react'; -import type { KibanaPageTemplateProps as Props } from '@kbn/shared-ux-page-kibana-template-types'; -/** - * A thin wrapper around EuiPageTemplate with a few Kibana specific additions - */ -export declare const KibanaPageTemplateInner: FC; -export declare const KibanaPageTemplateWithSolutionNav: { - (props: import("@elastic/eui/src/components/page_template/outer/page_outer")._EuiPageOuterProps & Omit & import("@elastic/eui/src/components/page/_restrict_width")._EuiPageRestrictWidth & import("@elastic/eui/src/components/page/_bottom_border")._EuiPageBottomBorder & { - contentBorder?: import("@elastic/eui/src/components/page_template/inner/page_inner")._EuiPageInnerProps["border"]; - minHeight?: React.CSSProperties["minHeight"]; - offset?: number; - mainProps?: import("@elastic/eui").CommonProps & React.HTMLAttributes; - component?: import("@elastic/eui/src/components/page_template/inner/page_inner").ComponentTypes; - } & { - isEmptyState?: boolean; - emptyPageBody?: React.ReactNode; - solutionNav?: import("@kbn/shared-ux-page-solution-nav").SolutionNavProps; - noDataConfig?: import("@kbn/shared-ux-page-no-data-config-types").NoDataConfig; - pageHeader?: import("@elastic/eui").EuiPageHeaderProps; - pageSideBar?: React.ReactNode; - pageSideBarProps?: import("@elastic/eui").EuiPageSidebarProps; - } & import("@kbn/shared-ux-page-solution-nav/src/with_solution_nav").TemplateProps & { - solutionNav: import("@kbn/shared-ux-page-solution-nav").SolutionNavProps; - }): React.JSX.Element; - displayName: string; -}; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/services.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/services.d.ts deleted file mode 100644 index 69ae77ed2d4bd..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/kibana_template/impl/src/services.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import type { KibanaPageTemplateServices, KibanaPageTemplateKibanaDependencies } from '@kbn/shared-ux-page-kibana-template-types'; -/** - * A Context Provider that provides services to the component and its dependencies. - */ -export declare const KibanaPageTemplateProvider: FC>; -/** - * Kibana-specific Provider that maps dependencies to services. - */ -export declare const KibanaPageTemplateKibanaProvider: FC>; diff --git a/src/platform/packages/shared/shared-ux/page/kibana_template/types/index.d.ts b/src/platform/packages/shared/shared-ux/page/kibana_template/types/index.d.ts deleted file mode 100644 index 87b06dd99086f..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/kibana_template/types/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { EuiPageTemplateProps, EuiPageSidebarProps, EuiPageHeaderProps } from '@elastic/eui'; -import type { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; -import type { ReactNode } from 'react'; -import type { NoDataConfig, NoDataConfigPageServices, NoDataConfigPageKibanaDependencies } from '@kbn/shared-ux-page-no-data-config-types'; -export type KibanaPageTemplateKibanaDependencies = NoDataConfigPageKibanaDependencies; -export type KibanaPageTemplateServices = NoDataConfigPageServices; -export type { NoDataConfig } from '@kbn/shared-ux-page-no-data-config-types'; -export type KibanaPageTemplateProps = EuiPageTemplateProps & { - /** - * Converts the `pageHeader` contents into an EuiEmptyPrompt when no `children` are present - */ - isEmptyState?: boolean; - /** - * Combined with isEmptyState, this prop allows complete override of the empty page - */ - emptyPageBody?: ReactNode; - /** - * Quick creation of EuiSideNav. Hooks up mobile instance too - */ - solutionNav?: SolutionNavProps; - /** - * Accepts a configuration object, that when provided, ignores `pageHeader` and `children` and instead - * displays Agent, Beats, and custom cards to direct users to the right ingest location - */ - noDataConfig?: NoDataConfig; - /** - * BWC Props from old EUI template - */ - pageHeader?: EuiPageHeaderProps; - pageSideBar?: ReactNode; - pageSideBarProps?: EuiPageSidebarProps; -}; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/impl/index.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/impl/index.d.ts deleted file mode 100644 index 2f005263bd458..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data/impl/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { NoDataPage } from './src/no_data_page'; -export type { NoDataPageProps, NoDataPageServices, NoDataPageKibanaDependencies, } from '@kbn/shared-ux-page-no-data-types'; -export { NoDataPageKibanaProvider, NoDataPageProvider } from './src/services'; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/action_card.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/action_card.d.ts deleted file mode 100644 index 169aa041cf24f..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/action_card.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from 'react'; -import type { NoDataCardProps } from '@kbn/shared-ux-card-no-data'; -import type { ActionCardProps } from '@kbn/shared-ux-page-no-data-types'; -export type NoDataPageActions = NoDataCardProps; -export declare const KEY_ELASTIC_AGENT = "elasticAgent"; -export declare const ActionCard: ({ action }: ActionCardProps) => React.JSX.Element | null; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/no_data_page.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/no_data_page.d.ts deleted file mode 100644 index 918505dbf09d2..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/no_data_page.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from 'react'; -import type { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; -export declare const NoDataPage: ({ action, className }: NoDataPageProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/services.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/impl/src/services.d.ts deleted file mode 100644 index 2e2517c1fa9ca..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data/impl/src/services.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import type { NoDataPageServices, NoDataPageKibanaDependencies } from '@kbn/shared-ux-page-no-data-types'; -/** - * A Context Provider that provides services to the component and its dependencies. - */ -export declare const NoDataPageProvider: FC>; -/** - * Kibana-specific Provider that maps dependencies to services. - */ -export declare const NoDataPageKibanaProvider: FC>; diff --git a/src/platform/packages/shared/shared-ux/page/no_data/types/index.d.ts b/src/platform/packages/shared/shared-ux/page/no_data/types/index.d.ts deleted file mode 100644 index 6611c65304607..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data/types/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { CommonProps } from '@elastic/eui'; -import type { NoDataCardProps, NoDataCardServices, NoDataCardKibanaDependencies } from '@kbn/shared-ux-card-no-data-types'; -export type NoDataPageActions = NoDataCardProps; -export interface ActionCardProps { - /** - * An object of `NoDataPageActions`. - * - * Use `elasticAgent` as the primary key for pre-configured cards of this type. - * Otherwise use a custom key that contains `EuiCard` props. - */ - action: Record; -} -export interface NoDataPageProps extends CommonProps, ActionCardProps { -} -/** - * A list of services that are consumed by this component. - */ -export type NoDataPageServices = NoDataCardServices; -/** - * An interface containing a collection of Kibana plugins and services required to - * render this component. - */ -export type NoDataPageKibanaDependencies = NoDataCardKibanaDependencies; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/index.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/index.d.ts deleted file mode 100644 index 2c160b5503480..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './src/no_data_config_page'; -export { NoDataConfigPageKibanaProvider, NoDataConfigPageProvider } from './src/services'; -export type { NoDataConfigPageProps, NoDataConfigPageServices, NoDataConfigPageKibanaDependencies, } from '@kbn/shared-ux-page-no-data-config-types'; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/constants.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/constants.d.ts deleted file mode 100644 index 49bae3a2cf035..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const NO_DATA_PAGE_MAX_WIDTH = 950; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/no_data_config_page.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/no_data_config_page.d.ts deleted file mode 100644 index 771d8ea91e406..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/no_data_config_page.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import type { NoDataConfigPageProps } from '@kbn/shared-ux-page-no-data-config-types'; -export declare const NoDataConfigPage: (props: NoDataConfigPageProps) => React.JSX.Element | null; -export declare const NoDataConfigPageWithSolutionNavBar: { - (props: import("@elastic/eui/src/components/page_template/outer/page_outer")._EuiPageOuterProps & Omit & import("@elastic/eui/src/components/page/_restrict_width")._EuiPageRestrictWidth & import("@elastic/eui/src/components/page/_bottom_border")._EuiPageBottomBorder & { - contentBorder?: import("@elastic/eui/src/components/page_template/inner/page_inner")._EuiPageInnerProps["border"]; - minHeight?: React.CSSProperties["minHeight"]; - offset?: number; - mainProps?: import("@elastic/eui").CommonProps & React.HTMLAttributes; - component?: import("@elastic/eui/src/components/page_template/inner/page_inner").ComponentTypes; - } & { - noDataConfig?: import("@kbn/shared-ux-page-no-data-config-types").NoDataConfig; - pageSideBar?: React.ReactNode; - pageSideBarProps?: import("@elastic/eui").EuiPageSidebarProps; - } & import("@kbn/shared-ux-page-solution-nav/src/with_solution_nav").TemplateProps & { - solutionNav: import("@kbn/shared-ux-page-solution-nav").SolutionNavProps; - }): React.JSX.Element; - displayName: string; -}; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/services.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/services.d.ts deleted file mode 100644 index 9370aabd6b92e..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data_config/impl/src/services.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import type { NoDataConfigPageServices, NoDataConfigPageKibanaDependencies } from '@kbn/shared-ux-page-no-data-config-types'; -/** - * A Context Provider that provides services to the component and its dependencies. - */ -export declare const NoDataConfigPageProvider: FC>; -/** - * Kibana-specific Provider that maps dependencies to services. - */ -export declare const NoDataConfigPageKibanaProvider: FC>; diff --git a/src/platform/packages/shared/shared-ux/page/no_data_config/types/index.d.ts b/src/platform/packages/shared/shared-ux/page/no_data_config/types/index.d.ts deleted file mode 100644 index 58435f53251fd..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/no_data_config/types/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { ReactNode } from 'react'; -import type { EuiPageTemplateProps, EuiPageSidebarProps } from '@elastic/eui'; -import type { NoDataPageProps, NoDataPageServices, NoDataPageKibanaDependencies } from '@kbn/shared-ux-page-no-data-types'; -export type NoDataConfigPageKibanaDependencies = NoDataPageKibanaDependencies; -export type NoDataConfigPageServices = NoDataPageServices; -export type NoDataConfig = NoDataPageProps; -export type NoDataConfigPageProps = EuiPageTemplateProps & { - /** - * Accepts a configuration object, that when provided, ignores `pageHeader` and `children` and instead - * displays Agent, Beats, and custom cards to direct users to the right ingest location - */ - noDataConfig?: NoDataConfig; - /** - * BWC Props from old EUI template - */ - pageSideBar?: ReactNode; - pageSideBarProps?: EuiPageSidebarProps; -}; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/index.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/index.d.ts deleted file mode 100644 index c98f73213bdce..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/solution_nav/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { SolutionNav } from './src/solution_nav'; -export type { SolutionNavProps } from './src/solution_nav'; -export { withSolutionNav } from './src/with_solution_nav'; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/src/collapse_button.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/src/collapse_button.d.ts deleted file mode 100644 index efc9f3299a396..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/solution_nav/src/collapse_button.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import type { EuiButtonIconPropsForButton } from '@elastic/eui'; -export type SolutionNavCollapseButtonProps = Partial & { - /** - * Boolean state of current collapsed status - */ - isCollapsed: boolean; -}; -/** - * Creates the styled icon button for showing/hiding solution nav - */ -export declare const SolutionNavCollapseButton: ({ className, isCollapsed, ...rest }: SolutionNavCollapseButtonProps) => React.JSX.Element; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/src/solution_nav.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/src/solution_nav.d.ts deleted file mode 100644 index 3e398f43b401f..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/solution_nav/src/solution_nav.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { FC } from 'react'; -import React from 'react'; -import type { EuiAvatarProps, EuiFlyoutProps, EuiSideNavProps } from '@elastic/eui'; -/** - * Props for the `SolutionNav` component. - */ -export type SolutionNavProps = Omit, 'children' | 'items' | 'heading'> & { - /** - * Name of the solution, i.e. "Observability" - */ - name: EuiAvatarProps['name']; - /** - * Solution logo, i.e. "logoObservability" - */ - icon?: EuiAvatarProps['iconType']; - /** - * An array of #EuiSideNavItem objects. Lists navigation menu items. - */ - items?: EuiSideNavProps<{}>['items']; - /** - * Renders the children instead of default EuiSideNav - */ - children?: React.ReactNode; - /** - * The position of the close button when the navigation flyout is open. - * Note that side navigation turns into a flyout only when the screen has medium size. - */ - closeFlyoutButtonPosition?: EuiFlyoutProps['closeButtonPosition']; - /** - * Control the collapsed state - */ - isOpenOnDesktop?: boolean; - /** - * Handler for when the navigation flyout is collapsed. - */ - onCollapse?: () => void; - /** - * Allows hiding of the navigation by the user. - * If false, forces all breakpoint versions into the open state without the ability to hide. - */ - canBeCollapsed?: boolean; - /** - * Optional content to render at the bottom of the nav, pinned below the scrollable nav items. - * Hidden when the nav is collapsed. - */ - footer?: React.ReactNode; -}; -/** - * A wrapper around `EuiSideNav` that includes the appropriate title with optional solution logo. - */ -export declare const SolutionNav: FC; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.d.ts deleted file mode 100644 index 197b70b9bbdbe..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { ComponentType, CSSProperties, ReactNode } from 'react'; -import React from 'react'; -import type { EuiPageSidebarProps } from '@elastic/eui'; -import type { SolutionNavProps } from './solution_nav'; -export interface TemplateProps { - children?: ReactNode; - pageSideBar?: ReactNode; - pageSideBarProps?: EuiPageSidebarProps; - style?: CSSProperties; -} -type Props

= P & TemplateProps & { - solutionNav: SolutionNavProps; -}; -export declare const withSolutionNav:

(WrappedComponent: ComponentType

) => { - (props: Props

): React.JSX.Element; - displayName: string; -}; -export {}; diff --git a/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.styles.d.ts b/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.styles.d.ts deleted file mode 100644 index 70fc96cd8cd36..0000000000000 --- a/src/platform/packages/shared/shared-ux/page/solution_nav/src/with_solution_nav.styles.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { EuiThemeComputed } from '@elastic/eui'; -export declare const WithSolutionNavStyles: (euiTheme: EuiThemeComputed<{}>) => string; diff --git a/src/platform/packages/shared/shared-ux/prompt/not_found/index.d.ts b/src/platform/packages/shared/shared-ux/prompt/not_found/index.d.ts deleted file mode 100644 index abd50c6d11411..0000000000000 --- a/src/platform/packages/shared/shared-ux/prompt/not_found/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { NotFoundPrompt } from './src/not_found_prompt'; diff --git a/src/platform/packages/shared/shared-ux/prompt/not_found/src/not_found_prompt.d.ts b/src/platform/packages/shared/shared-ux/prompt/not_found/src/not_found_prompt.d.ts deleted file mode 100644 index 40899498b93e9..0000000000000 --- a/src/platform/packages/shared/shared-ux/prompt/not_found/src/not_found_prompt.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import type { EuiEmptyPromptProps } from '@elastic/eui'; -interface NotFoundProps { - /** Array of buttons, links and other actions to show at the bottom of the `EuiEmptyPrompt`. Defaults to a "Back" button. */ - actions?: EuiEmptyPromptProps['actions']; - title?: EuiEmptyPromptProps['title'] | string; - body?: EuiEmptyPromptProps['body']; -} -/** - * Predefined `EuiEmptyPrompt` for 404 pages. - */ -export declare const NotFoundPrompt: ({ actions, title, body }: NotFoundProps) => React.JSX.Element; -export {}; diff --git a/src/platform/packages/shared/shared-ux/table_persist/index.d.ts b/src/platform/packages/shared/shared-ux/table_persist/index.d.ts deleted file mode 100644 index 7702c42a7f282..0000000000000 --- a/src/platform/packages/shared/shared-ux/table_persist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { useEuiTablePersist, DEFAULT_PAGE_SIZE_OPTIONS, withEuiTablePersist } from './src'; -export type { EuiTablePersistInjectedProps, EuiTablePersistPropsGetter, HOCProps } from './src'; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/constants.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/constants.d.ts deleted file mode 100644 index eccf2dff167f9..0000000000000 --- a/src/platform/packages/shared/shared-ux/table_persist/src/constants.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const DEFAULT_PAGE_SIZE_OPTIONS: number[]; -export declare const DEFAULT_INITIAL_PAGE_SIZE = 50; -export declare const LOCAL_STORAGE_PREFIX = "tablePersist"; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/index.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/index.d.ts deleted file mode 100644 index fcdb285bfd040..0000000000000 --- a/src/platform/packages/shared/shared-ux/table_persist/src/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { useEuiTablePersist } from './use_table_persist'; -export { DEFAULT_PAGE_SIZE_OPTIONS } from './constants'; -export { withEuiTablePersist } from './table_persist_hoc'; -export type { EuiTablePersistInjectedProps, EuiTablePersistPropsGetter, HOCProps, } from './table_persist_hoc'; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/storage.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/storage.d.ts deleted file mode 100644 index d29206b0ea535..0000000000000 --- a/src/platform/packages/shared/shared-ux/table_persist/src/storage.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -type IStorageEngine = typeof window.localStorage; -declare class Storage { - engine: IStorageEngine; - prefix: string; - encode(val: unknown): string; - decode(val: string | null): any; - encodeKey(key: string): string; - set(key: string, val: unknown): unknown; - has(key: string): boolean; - get(key: string, _default?: T): any; -} -export declare function createStorage(): Storage; -export {}; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/table_persist_hoc.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/table_persist_hoc.d.ts deleted file mode 100644 index 347094497d4ff..0000000000000 --- a/src/platform/packages/shared/shared-ux/table_persist/src/table_persist_hoc.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { type CriteriaWithPagination } from '@elastic/eui'; -import type { EuiTablePersistProps } from './use_table_persist'; -import type { PropertySort } from './types'; -export interface EuiTablePersistInjectedProps { - euiTablePersist: { - /** The EuiInMemoryTable onTableChange prop */ - onTableChange: (change: CriteriaWithPagination) => void; - /** The EuiInMemoryTable sorting prop */ - sorting: { - sort: PropertySort; - } | true; - /** The EuiInMemoryTable pagination.pageSize value */ - pageSize: number; - }; -} -export type EuiTablePersistPropsGetter = (props: Omit>) => EuiTablePersistProps; -export type HOCProps = P & { - /** Custom value for the EuiTablePersist HOC */ - euiTablePersistProps?: Partial>; -}; -export declare function withEuiTablePersist(WrappedComponent: React.ComponentClass>, euiTablePersistDefault: (EuiTablePersistProps & { - get?: undefined; -}) | { - get: EuiTablePersistPropsGetter; -}): React.FC>>; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/types.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/types.d.ts deleted file mode 100644 index 99d0b72d9a195..0000000000000 --- a/src/platform/packages/shared/shared-ux/table_persist/src/types.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface PropertySort { - field: keyof T; - direction: 'asc' | 'desc'; -} -export interface PersistData { - pageSize?: number; - sort?: PropertySort; -} diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/use_table_persist.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/use_table_persist.d.ts deleted file mode 100644 index 3d855624cef00..0000000000000 --- a/src/platform/packages/shared/shared-ux/table_persist/src/use_table_persist.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { CriteriaWithPagination } from '@elastic/eui'; -import type { PropertySort } from './types'; -export interface EuiTablePersistProps { - /** A unique id that will be included in the local storage variable for this table. */ - tableId: string; - /** (Optional) Specifies a custom onTableChange handler. */ - customOnTableChange?: (change: CriteriaWithPagination) => void; - /** (Optional) Specifies a custom initial table sorting. */ - initialSort?: PropertySort; - /** (Optional) Specifies a custom initial page size for the table. Defaults to 50. */ - initialPageSize?: number; - /** (Optional) Specifies custom page size options for the table. - * Defaults to {@link DEFAULT_PAGE_SIZE_OPTIONS} */ - pageSizeOptions?: number[]; -} -/** - * A hook that stores and retrieves from local storage the table page size and sort criteria. - * Returns the persisting page size and sort and the onTableChange handler that should be passed - * as props to an Eui table component. - */ -export declare function useEuiTablePersist(props: EuiTablePersistProps & { - initialSort: PropertySort; -}): { - sorting: { - sort: PropertySort; - }; - pageSize: number; - onTableChange: (nextValues: CriteriaWithPagination) => void; -}; -export declare function useEuiTablePersist(props: EuiTablePersistProps & { - initialSort?: undefined; -}): { - sorting: true; - pageSize: number; - onTableChange: (nextValues: CriteriaWithPagination) => void; -}; -export declare function useEuiTablePersist(props: EuiTablePersistProps): { - sorting: true | { - sort: PropertySort; - }; - pageSize: number; - onTableChange: (nextValues: CriteriaWithPagination) => void; -}; diff --git a/src/platform/packages/shared/shared-ux/table_persist/src/validate_persist_data.d.ts b/src/platform/packages/shared/shared-ux/table_persist/src/validate_persist_data.d.ts deleted file mode 100644 index fff70eaf53a69..0000000000000 --- a/src/platform/packages/shared/shared-ux/table_persist/src/validate_persist_data.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * A utility function used to validate a table persist data. - * If any of the properties is not valid, it is returned with undefined value. - * - * @param data The data to be validated - * @param pageSizeOptions The table page size options that are available - */ -export declare const validatePersistData: (data: any, pageSizeOptions: number[]) => { - pageSize: any; - sort: any; -}; diff --git a/src/platform/plugins/private/url_forwarding/public/forward_app/forward_app.d.ts b/src/platform/plugins/private/url_forwarding/public/forward_app/forward_app.d.ts deleted file mode 100644 index 33b32d1a612dd..0000000000000 --- a/src/platform/plugins/private/url_forwarding/public/forward_app/forward_app.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { App, CoreSetup } from '@kbn/core/public'; -import type { ForwardDefinition, UrlForwardingStart } from '../plugin'; -export declare const createLegacyUrlForwardApp: (core: CoreSetup<{}, UrlForwardingStart>, forwards: ForwardDefinition[]) => App; diff --git a/src/platform/plugins/private/url_forwarding/public/forward_app/index.d.ts b/src/platform/plugins/private/url_forwarding/public/forward_app/index.d.ts deleted file mode 100644 index 4ca7226194532..0000000000000 --- a/src/platform/plugins/private/url_forwarding/public/forward_app/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './forward_app'; diff --git a/src/platform/plugins/private/url_forwarding/public/forward_app/navigate_to_legacy_kibana_url.d.ts b/src/platform/plugins/private/url_forwarding/public/forward_app/navigate_to_legacy_kibana_url.d.ts deleted file mode 100644 index 013425f092c80..0000000000000 --- a/src/platform/plugins/private/url_forwarding/public/forward_app/navigate_to_legacy_kibana_url.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ApplicationStart, IBasePath } from '@kbn/core/public'; -import type { ForwardDefinition } from '..'; -export declare const navigateToLegacyKibanaUrl: (path: string, forwards: ForwardDefinition[], basePath: IBasePath, application: ApplicationStart) => { - navigated: boolean; -}; diff --git a/src/platform/plugins/private/url_forwarding/public/forward_app/normalize_path.d.ts b/src/platform/plugins/private/url_forwarding/public/forward_app/normalize_path.d.ts deleted file mode 100644 index 5d21403f3d487..0000000000000 --- a/src/platform/plugins/private/url_forwarding/public/forward_app/normalize_path.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function normalizePath(path: string): string; diff --git a/src/platform/plugins/private/url_forwarding/public/index.d.ts b/src/platform/plugins/private/url_forwarding/public/index.d.ts deleted file mode 100644 index a0948bd9d4596..0000000000000 --- a/src/platform/plugins/private/url_forwarding/public/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { UrlForwardingPlugin } from './plugin'; -export declare const plugin: () => UrlForwardingPlugin; -export type { ForwardDefinition, UrlForwardingSetup, UrlForwardingStart } from './plugin'; -export { UrlForwardingPlugin } from './plugin'; diff --git a/src/platform/plugins/private/url_forwarding/public/plugin.d.ts b/src/platform/plugins/private/url_forwarding/public/plugin.d.ts deleted file mode 100644 index 4cbac5e2b1d1d..0000000000000 --- a/src/platform/plugins/private/url_forwarding/public/plugin.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import type { CoreStart, CoreSetup } from '@kbn/core/public'; -export interface ForwardDefinition { - legacyAppId: string; - newAppId: string; - rewritePath: (legacyPath: string) => string; -} -export declare class UrlForwardingPlugin { - private forwardDefinitions; - setup(core: CoreSetup<{}, UrlForwardingStart>): { - /** - * Forwards URLs within the legacy `kibana` app to a new platform application. - * - * @param legacyAppId The name of the old app to forward URLs from - * @param newAppId The name of the new app that handles the URLs now - * @param rewritePath Function to rewrite the legacy sub path of the app to the new path in the core app. - * If none is provided, it will just strip the prefix of the legacyAppId away - * - * path into the new path - * - * Example usage: - * ``` - * urlForwarding.forwardApp( - * 'old', - * 'new', - * path => { - * const [, id] = /old/item\/(.*)$/.exec(path) || []; - * if (!id) { - * return '#/home'; - * } - * return '#/items/${id}'; - * } - * ); - * ``` - * This will cause the following redirects: - * - * * app/kibana#/old/ -> app/new#/home - * * app/kibana#/old/item/123 -> app/new#/items/123 - * - */ - forwardApp: (legacyAppId: string, newAppId: string, rewritePath?: (legacyPath: string) => string) => void; - }; - start({ application, http: { basePath } }: CoreStart): { - /** - * Resolves the provided hash using the registered forwards and navigates to the target app. - * If a navigation happened, `{ navigated: true }` will be returned. - * If no matching forward is found, `{ navigated: false }` will be returned. - * @param hash - */ - navigateToLegacyKibanaUrl: (hash: string) => { - navigated: boolean; - }; - /** - * @deprecated - * Just exported for wiring up with legacy platform, should not be used. - */ - getForwards: () => ForwardDefinition[]; - }; -} -export type UrlForwardingSetup = ReturnType; -export type UrlForwardingStart = ReturnType; diff --git a/src/platform/plugins/shared/content_management/common/constants.d.ts b/src/platform/plugins/shared/content_management/common/constants.d.ts deleted file mode 100644 index fa735c80efb19..0000000000000 --- a/src/platform/plugins/shared/content_management/common/constants.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const PLUGIN_ID = "contentManagement"; -export declare const API_ENDPOINT = "/api/content_management/rpc"; diff --git a/src/platform/plugins/shared/content_management/common/index.d.ts b/src/platform/plugins/shared/content_management/common/index.d.ts deleted file mode 100644 index 00dd2165896ff..0000000000000 --- a/src/platform/plugins/shared/content_management/common/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { PLUGIN_ID, API_ENDPOINT } from './constants'; -export type { ProcedureSchemas, ProcedureName, GetIn, GetResult, BulkGetIn, BulkGetResult, CreateIn, CreateResult, UpdateIn, UpdateResult, DeleteIn, DeleteResult, SearchIn, SearchQuery, SearchResult, MSearchIn, MSearchQuery, MSearchResult, MSearchOut, } from './rpc'; diff --git a/src/platform/plugins/shared/content_management/common/rpc/bulk_get.d.ts b/src/platform/plugins/shared/content_management/common/rpc/bulk_get.d.ts deleted file mode 100644 index 299fedc4836e5..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/bulk_get.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -import type { GetResult } from './get'; -export declare const bulkGetSchemas: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - ids: import("@kbn/config-schema").Type; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - hits: import("@kbn/config-schema").Type | undefined; - } & { - item: Readonly<{} & {}>; - }>; - contentTypeId: string; - }>[]>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; -}; -export interface BulkGetIn { - contentTypeId: T; - ids: string[]; - version?: Version; - options?: Options; -} -export type BulkGetResult = ResultMeta extends void ? { - hits: Array>; -} : { - hits: Array>; - meta: ResultMeta; -}; diff --git a/src/platform/plugins/shared/content_management/common/rpc/common.d.ts b/src/platform/plugins/shared/content_management/common/rpc/common.d.ts deleted file mode 100644 index 6d4098f1800ac..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/common.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const itemResultSchema: import("@kbn/config-schema").ObjectType<{ - item: import("@kbn/config-schema").ObjectType<{}>; - meta: import("@kbn/config-schema").Type | undefined>; -}>; diff --git a/src/platform/plugins/shared/content_management/common/rpc/constants.d.ts b/src/platform/plugins/shared/content_management/common/rpc/constants.d.ts deleted file mode 100644 index 5f878f9a71cc1..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/constants.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const procedureNames: readonly ["get", "bulkGet", "create", "update", "delete", "search", "mSearch"]; -export type ProcedureName = (typeof procedureNames)[number]; -export declare const versionSchema: import("@kbn/config-schema").Type; diff --git a/src/platform/plugins/shared/content_management/common/rpc/create.d.ts b/src/platform/plugins/shared/content_management/common/rpc/create.d.ts deleted file mode 100644 index 35b351f1996d2..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/create.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -import type { ItemResult } from './types'; -export declare const createSchemas: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - data: import("@kbn/config-schema").Type>; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - item: import("@kbn/config-schema").ObjectType<{}>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; - }>; -}; -export interface CreateIn { - contentTypeId: T; - data: Data; - version?: Version; - options?: Options; -} -export type CreateResult = ItemResult; diff --git a/src/platform/plugins/shared/content_management/common/rpc/delete.d.ts b/src/platform/plugins/shared/content_management/common/rpc/delete.d.ts deleted file mode 100644 index 275e1fe94d5ba..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/delete.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -export declare const deleteSchemas: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - id: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - success: import("@kbn/config-schema").Type; - }>; - }>; -}; -export interface DeleteIn { - contentTypeId: T; - id: string; - version?: Version; - options?: Options; -} -export interface DeleteResult { - success: boolean; -} diff --git a/src/platform/plugins/shared/content_management/common/rpc/get.d.ts b/src/platform/plugins/shared/content_management/common/rpc/get.d.ts deleted file mode 100644 index f421ed6e5c659..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/get.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -import type { ItemResult } from './types'; -export declare const getResultSchema: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - item: import("@kbn/config-schema").ObjectType<{}>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; -}>; -export declare const getSchemas: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - id: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - item: import("@kbn/config-schema").ObjectType<{}>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; - }>; -}; -export interface GetIn { - id: string; - contentTypeId: T; - version?: Version; - options?: Options; -} -export type GetResult = ItemResult; diff --git a/src/platform/plugins/shared/content_management/common/rpc/index.d.ts b/src/platform/plugins/shared/content_management/common/rpc/index.d.ts deleted file mode 100644 index 48e340674dacd..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export { schemas } from './rpc'; -export { procedureNames } from './constants'; -export type { GetIn, GetResult } from './get'; -export type { BulkGetIn, BulkGetResult } from './bulk_get'; -export type { CreateIn, CreateResult } from './create'; -export type { UpdateIn, UpdateResult } from './update'; -export type { DeleteIn, DeleteResult } from './delete'; -export type { SearchIn, SearchQuery, SearchResult } from './search'; -export type { MSearchIn, MSearchQuery, MSearchOut, MSearchResult } from './msearch'; -export type { ProcedureSchemas } from './types'; -export type { ProcedureName } from './constants'; diff --git a/src/platform/plugins/shared/content_management/common/rpc/msearch.d.ts b/src/platform/plugins/shared/content_management/common/rpc/msearch.d.ts deleted file mode 100644 index 4a2f2fc6b229b..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/msearch.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -import type { SearchQuery, SearchResult } from './search'; -export declare const mSearchSchemas: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypes: import("@kbn/config-schema").Type[]>; - query: import("@kbn/config-schema").Type | undefined; - limit?: number | undefined; - cursor?: string | undefined; - } & {}>>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypes: import("@kbn/config-schema").Type[]>; - result: import("@kbn/config-schema").ObjectType<{ - hits: import("@kbn/config-schema").Type; - pagination: import("@kbn/config-schema").ObjectType<{ - total: import("@kbn/config-schema").Type; - cursor: import("@kbn/config-schema").Type; - }>; - }>; - }>; -}; -export type MSearchQuery = SearchQuery; -export interface MSearchIn { - contentTypes: Array<{ - contentTypeId: string; - version?: Version; - }>; - query: MSearchQuery; -} -export type MSearchResult = SearchResult; -export interface MSearchOut { - contentTypes: Array<{ - contentTypeId: string; - version?: Version; - }>; - result: MSearchResult; -} diff --git a/src/platform/plugins/shared/content_management/common/rpc/rpc.d.ts b/src/platform/plugins/shared/content_management/common/rpc/rpc.d.ts deleted file mode 100644 index 8a94779375f56..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/rpc.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -export declare const schemas: { - get: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - id: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - item: import("@kbn/config-schema").ObjectType<{}>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; - }>; - }; - bulkGet: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - ids: import("@kbn/config-schema").Type; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - hits: import("@kbn/config-schema").Type | undefined; - } & { - item: Readonly<{} & {}>; - }>; - contentTypeId: string; - }>[]>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; - }; - create: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - data: import("@kbn/config-schema").Type>; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - item: import("@kbn/config-schema").ObjectType<{}>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; - }>; - }; - update: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - id: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - data: import("@kbn/config-schema").Type>; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - item: import("@kbn/config-schema").ObjectType<{}>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; - }>; - }; - delete: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - id: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - success: import("@kbn/config-schema").Type; - }>; - }>; - }; - search: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - query: import("@kbn/config-schema").Type | undefined; - limit?: number | undefined; - cursor?: string | undefined; - } & {}>>; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - hits: import("@kbn/config-schema").Type; - pagination: import("@kbn/config-schema").ObjectType<{ - total: import("@kbn/config-schema").Type; - cursor: import("@kbn/config-schema").Type; - }>; - }>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; - }; - mSearch: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypes: import("@kbn/config-schema").Type[]>; - query: import("@kbn/config-schema").Type | undefined; - limit?: number | undefined; - cursor?: string | undefined; - } & {}>>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypes: import("@kbn/config-schema").Type[]>; - result: import("@kbn/config-schema").ObjectType<{ - hits: import("@kbn/config-schema").Type; - pagination: import("@kbn/config-schema").ObjectType<{ - total: import("@kbn/config-schema").Type; - cursor: import("@kbn/config-schema").Type; - }>; - }>; - }>; - }; -}; diff --git a/src/platform/plugins/shared/content_management/common/rpc/search.d.ts b/src/platform/plugins/shared/content_management/common/rpc/search.d.ts deleted file mode 100644 index eea454195c827..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/search.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -export declare const searchQuerySchema: import("@kbn/config-schema").Type | undefined; - limit?: number | undefined; - cursor?: string | undefined; -} & {}>>; -export declare const searchResultSchema: import("@kbn/config-schema").ObjectType<{ - hits: import("@kbn/config-schema").Type; - pagination: import("@kbn/config-schema").ObjectType<{ - total: import("@kbn/config-schema").Type; - cursor: import("@kbn/config-schema").Type; - }>; -}>; -export declare const searchSchemas: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - query: import("@kbn/config-schema").Type | undefined; - limit?: number | undefined; - cursor?: string | undefined; - } & {}>>; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - hits: import("@kbn/config-schema").Type; - pagination: import("@kbn/config-schema").ObjectType<{ - total: import("@kbn/config-schema").Type; - cursor: import("@kbn/config-schema").Type; - }>; - }>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; -}; -export interface SearchQuery { - /** The text to search for */ - text?: string; - /** List of tags id to include and exclude */ - tags?: { - included?: string[]; - excluded?: string[]; - }; - /** The number of result to return */ - limit?: number; - /** The cursor for this query. Can be a page number or a cursor */ - cursor?: string; -} -export interface SearchIn { - contentTypeId: T; - query: SearchQuery; - version?: Version; - options?: Options; -} -export type SearchResult = M extends void ? { - hits: T[]; - pagination: { - total: number; - /** Page number or cursor */ - cursor?: string; - }; -} : { - hits: T[]; - pagination: { - total: number; - /** Page number or cursor */ - cursor?: string; - }; - meta: M; -}; diff --git a/src/platform/plugins/shared/content_management/common/rpc/types.d.ts b/src/platform/plugins/shared/content_management/common/rpc/types.d.ts deleted file mode 100644 index 5ab2caa447ad8..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/types.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Type } from '@kbn/config-schema'; -export interface ProcedureSchemas { - in: Type | false; - out?: Type | false; -} -export type ItemResult = M extends void ? { - item: T; - meta?: never; -} : { - item: T; - meta: M; -}; diff --git a/src/platform/plugins/shared/content_management/common/rpc/update.d.ts b/src/platform/plugins/shared/content_management/common/rpc/update.d.ts deleted file mode 100644 index 326b0e5000a30..0000000000000 --- a/src/platform/plugins/shared/content_management/common/rpc/update.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -import type { ItemResult } from './types'; -export declare const updateSchemas: { - in: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - id: import("@kbn/config-schema").Type; - version: import("@kbn/config-schema").Type; - data: import("@kbn/config-schema").Type>; - options: import("@kbn/config-schema").Type | undefined>; - }>; - out: import("@kbn/config-schema").ObjectType<{ - contentTypeId: import("@kbn/config-schema").Type; - result: import("@kbn/config-schema").ObjectType<{ - item: import("@kbn/config-schema").ObjectType<{}>; - meta: import("@kbn/config-schema").Type | undefined>; - }>; - }>; -}; -export interface UpdateIn { - contentTypeId: T; - id: string; - data: Data; - version?: Version; - options?: Options; -} -export type UpdateResult = ItemResult; diff --git a/src/platform/plugins/shared/content_management/common/schemas.d.ts b/src/platform/plugins/shared/content_management/common/schemas.d.ts deleted file mode 100644 index c1f05c9926a62..0000000000000 --- a/src/platform/plugins/shared/content_management/common/schemas.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { schemas as rpcSchemas } from './rpc'; diff --git a/src/platform/plugins/shared/content_management/public/content_client/content_client.d.ts b/src/platform/plugins/shared/content_management/public/content_client/content_client.d.ts deleted file mode 100644 index 737f9891af046..0000000000000 --- a/src/platform/plugins/shared/content_management/public/content_client/content_client.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { QueryClient } from '@kbn/react-query'; -import type { CrudClient } from '../crud_client'; -import type { CreateIn, GetIn, UpdateIn, DeleteIn, SearchIn, MSearchIn, MSearchResult } from '../../common'; -import type { ContentTypeRegistry } from '../registry'; -export declare const queryKeyBuilder: { - all: (type: string) => readonly [string]; - item: (type: string, id: string) => readonly [string, string]; - search: (type: string, query: unknown, options?: object) => readonly [string, "search", unknown, object | undefined]; -}; -declare const createQueryOptionBuilder: ({ crudClientProvider, contentTypeRegistry, }: { - crudClientProvider: (contentType: string) => CrudClient; - contentTypeRegistry: ContentTypeRegistry; -}) => { - get: , O = unknown>(_input: I) => { - queryKey: readonly [string, string]; - queryFn: () => Promise; - }; - search: , O = unknown>(_input: I) => { - queryKey: readonly [string, "search", unknown, object | undefined]; - queryFn: () => Promise; - }; -}; -export declare class ContentClient { - private readonly crudClientProvider; - private readonly contentTypeRegistry; - readonly queryClient: QueryClient; - readonly queryOptionBuilder: ReturnType; - constructor(crudClientProvider: (contentType?: string) => CrudClient, contentTypeRegistry: ContentTypeRegistry); - get(input: I): Promise; - get$(input: I): import("rxjs").Observable>; - create(input: I): Promise; - update(input: I): Promise; - delete(input: I): Promise; - search(input: I): Promise; - search$(input: I): import("rxjs").Observable>; - mSearch(input: MSearchIn): Promise>; -} -export {}; diff --git a/src/platform/plugins/shared/content_management/public/content_client/content_client_context.d.ts b/src/platform/plugins/shared/content_management/public/content_client/content_client_context.d.ts deleted file mode 100644 index 444ad8864d7b6..0000000000000 --- a/src/platform/plugins/shared/content_management/public/content_client/content_client_context.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import type { ContentClient } from './content_client'; -export declare const useContentClient: () => ContentClient; -export declare const ContentClientProvider: FC>; diff --git a/src/platform/plugins/shared/content_management/public/content_client/content_client_mutation_hooks.d.ts b/src/platform/plugins/shared/content_management/public/content_client/content_client_mutation_hooks.d.ts deleted file mode 100644 index 3c7c45784420a..0000000000000 --- a/src/platform/plugins/shared/content_management/public/content_client/content_client_mutation_hooks.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CreateIn, UpdateIn, DeleteIn } from '../../common'; -export declare const useCreateContentMutation: () => import("@kbn/react-query").UseMutationResult; -export declare const useUpdateContentMutation: () => import("@kbn/react-query").UseMutationResult; -export declare const useDeleteContentMutation: () => import("@kbn/react-query").UseMutationResult; diff --git a/src/platform/plugins/shared/content_management/public/content_client/content_client_query_hooks.d.ts b/src/platform/plugins/shared/content_management/public/content_client/content_client_query_hooks.d.ts deleted file mode 100644 index 499b7085df894..0000000000000 --- a/src/platform/plugins/shared/content_management/public/content_client/content_client_query_hooks.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { QueryObserverOptions } from '@kbn/react-query'; -import type { GetIn, SearchIn } from '../../common'; -/** - * Exposed `useQuery` options - */ -export type QueryOptions = Pick; -/** - * - * @param input - get content identifier like "id" and "contentType" - * @param queryOptions - query options - */ -export declare const useGetContentQuery: (input: I, queryOptions?: QueryOptions) => import("@kbn/react-query").UseQueryResult; -/** - * - * @param input - get content identifier like "id" and "contentType" - * @param queryOptions - query options - */ -export declare const useSearchContentQuery: (input: I, queryOptions?: QueryOptions) => import("@kbn/react-query").UseQueryResult; diff --git a/src/platform/plugins/shared/content_management/public/content_client/index.d.ts b/src/platform/plugins/shared/content_management/public/content_client/index.d.ts deleted file mode 100644 index 2bbb939afecf3..0000000000000 --- a/src/platform/plugins/shared/content_management/public/content_client/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { ContentClient } from './content_client'; -export { ContentClientProvider, useContentClient } from './content_client_context'; -export { useGetContentQuery, useSearchContentQuery, type QueryOptions, } from './content_client_query_hooks'; -export { useCreateContentMutation, useUpdateContentMutation, useDeleteContentMutation, } from './content_client_mutation_hooks'; diff --git a/src/platform/plugins/shared/content_management/public/content_client/query_observable.d.ts b/src/platform/plugins/shared/content_management/public/content_client/query_observable.d.ts deleted file mode 100644 index 02ed35945ae8f..0000000000000 --- a/src/platform/plugins/shared/content_management/public/content_client/query_observable.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { QueryObserverOptions, QueryObserverResult, QueryClient, QueryKey } from '@kbn/react-query'; -import { Observable } from 'rxjs'; -export declare const createQueryObservable: (queryClient: QueryClient, queryOptions: QueryObserverOptions) => Observable>; diff --git a/src/platform/plugins/shared/content_management/public/crud_client/crud_client.d.ts b/src/platform/plugins/shared/content_management/public/crud_client/crud_client.d.ts deleted file mode 100644 index 9b49103cfdec9..0000000000000 --- a/src/platform/plugins/shared/content_management/public/crud_client/crud_client.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { GetIn, CreateIn, UpdateIn, DeleteIn, SearchIn, MSearchIn } from '../../common'; -export interface CrudClient { - get(input: GetIn): Promise; - create(input: CreateIn): Promise; - update(input: UpdateIn): Promise; - delete(input: DeleteIn): Promise; - search(input: SearchIn): Promise; - mSearch?(input: MSearchIn): Promise; -} diff --git a/src/platform/plugins/shared/content_management/public/crud_client/index.d.ts b/src/platform/plugins/shared/content_management/public/crud_client/index.d.ts deleted file mode 100644 index 28e4cd850f719..0000000000000 --- a/src/platform/plugins/shared/content_management/public/crud_client/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { CrudClient } from './crud_client'; diff --git a/src/platform/plugins/shared/content_management/public/index.d.ts b/src/platform/plugins/shared/content_management/public/index.d.ts deleted file mode 100644 index 409eb0f41a91c..0000000000000 --- a/src/platform/plugins/shared/content_management/public/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ContentManagementPlugin } from './plugin'; -export type { CrudClient } from './crud_client'; -export { ContentClientProvider, ContentClient, useCreateContentMutation, useUpdateContentMutation, useDeleteContentMutation, useSearchContentQuery, useGetContentQuery, useContentClient, type QueryOptions, } from './content_client'; -export declare function plugin(): ContentManagementPlugin; -export type { ContentManagementPublicStart, ContentManagementPublicSetup } from './types'; diff --git a/src/platform/plugins/shared/content_management/public/plugin.d.ts b/src/platform/plugins/shared/content_management/public/plugin.d.ts deleted file mode 100644 index 7866819d32343..0000000000000 --- a/src/platform/plugins/shared/content_management/public/plugin.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CoreStart, Plugin } from '@kbn/core/public'; -import type { ContentManagementPublicStart, ContentManagementPublicSetup, SetupDependencies, StartDependencies } from './types'; -import { ContentClient } from './content_client'; -export declare class ContentManagementPlugin implements Plugin { - private contentTypeRegistry; - constructor(); - setup(): { - registry: { - register: (definition: import("./registry").ContentTypeDefinition) => import("./registry").ContentType; - }; - }; - start(core: CoreStart, deps: StartDependencies): { - client: ContentClient; - registry: { - get: (id: string) => import("./registry").ContentType | undefined; - getAll: () => import("./registry").ContentType[]; - }; - }; -} diff --git a/src/platform/plugins/shared/content_management/public/registry/content_type.d.ts b/src/platform/plugins/shared/content_management/public/registry/content_type.d.ts deleted file mode 100644 index 56aa447f29b7c..0000000000000 --- a/src/platform/plugins/shared/content_management/public/registry/content_type.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ContentTypeDefinition } from './content_type_definition'; -import type { CrudClient } from '../crud_client'; -export declare class ContentType { - readonly definition: ContentTypeDefinition; - constructor(definition: ContentTypeDefinition); - get id(): string; - get name(): string; - get description(): string; - get icon(): string; - get crud(): CrudClient | undefined; - get version(): ContentTypeDefinition['version']; -} diff --git a/src/platform/plugins/shared/content_management/public/registry/content_type_definition.d.ts b/src/platform/plugins/shared/content_management/public/registry/content_type_definition.d.ts deleted file mode 100644 index b6c9f45c5090b..0000000000000 --- a/src/platform/plugins/shared/content_management/public/registry/content_type_definition.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -import type { CrudClient } from '../crud_client'; -/** - * Content type definition as it is registered in the content registry. - */ -export interface ContentTypeDefinition { - /** - * ID of the type. Must be unique. Like "dashboard", "visualization", etc. - */ - id: string; - /** - * Human-readable name of the type. Like "Dashboard", "Visualization", etc. - */ - name?: string; - /** - * Human-readable description of the type. - */ - description?: string; - /** - * Icon to use for this type. Usually an EUI icon type. - * - * @see https://elastic.github.io/eui/#/display/icons - */ - icon?: string; - /** - * CRUD client to use for this type. - * If not provided the default CRUD client is used assuming that this type has a server-side content registry - */ - crud?: CrudClient; - version: { - /** The latest version for this content */ - latest: Version; - }; -} diff --git a/src/platform/plugins/shared/content_management/public/registry/index.d.ts b/src/platform/plugins/shared/content_management/public/registry/index.d.ts deleted file mode 100644 index be225ef2dd8f4..0000000000000 --- a/src/platform/plugins/shared/content_management/public/registry/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { ContentTypeDefinition } from './content_type_definition'; -export { ContentType } from './content_type'; -export { ContentTypeRegistry } from './registry'; diff --git a/src/platform/plugins/shared/content_management/public/registry/registry.d.ts b/src/platform/plugins/shared/content_management/public/registry/registry.d.ts deleted file mode 100644 index 4838ddb4346a8..0000000000000 --- a/src/platform/plugins/shared/content_management/public/registry/registry.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ContentTypeDefinition } from './content_type_definition'; -import { ContentType } from './content_type'; -export declare class ContentTypeRegistry { - private readonly types; - register(definition: ContentTypeDefinition): ContentType; - get(id: string): ContentType | undefined; - getAll(): ContentType[]; -} diff --git a/src/platform/plugins/shared/content_management/public/rpc_client/index.d.ts b/src/platform/plugins/shared/content_management/public/rpc_client/index.d.ts deleted file mode 100644 index b1f603b1c3b8c..0000000000000 --- a/src/platform/plugins/shared/content_management/public/rpc_client/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { RpcClient } from './rpc_client'; diff --git a/src/platform/plugins/shared/content_management/public/rpc_client/rpc_client.d.ts b/src/platform/plugins/shared/content_management/public/rpc_client/rpc_client.d.ts deleted file mode 100644 index 733ac31925e7b..0000000000000 --- a/src/platform/plugins/shared/content_management/public/rpc_client/rpc_client.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { HttpSetup } from '@kbn/core/public'; -import type { GetIn, BulkGetIn, CreateIn, UpdateIn, DeleteIn, SearchIn, MSearchIn, MSearchResult } from '../../common'; -import type { CrudClient } from '../crud_client/crud_client'; -export declare class RpcClient implements CrudClient { - private http; - constructor(http: { - post: HttpSetup['post']; - }); - get(input: I): Promise>; - bulkGet(input: I): Promise<{ - hits: import("../../common/rpc/types").ItemResult[]; - }>; - create(input: I): Promise>; - update(input: I): Promise>; - delete(input: I): Promise; - search(input: I): Promise<{ - hits: O[]; - pagination: { - total: number; - cursor?: string; - }; - }>; - mSearch(input: MSearchIn): Promise>; - private sendMessage; -} diff --git a/src/platform/plugins/shared/content_management/public/types.d.ts b/src/platform/plugins/shared/content_management/public/types.d.ts deleted file mode 100644 index 312d3f7357efd..0000000000000 --- a/src/platform/plugins/shared/content_management/public/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ContentClient } from './content_client'; -import type { ContentTypeRegistry } from './registry'; -export interface SetupDependencies { -} -export interface StartDependencies { -} -export interface ContentManagementPublicSetup { - registry: Pick; -} -export interface ContentManagementPublicStart { - client: ContentClient; - registry: Pick; -} diff --git a/src/platform/plugins/shared/content_management/server/content_client/content_client.d.ts b/src/platform/plugins/shared/content_management/server/content_client/content_client.d.ts deleted file mode 100644 index c5fd8678ffa4c..0000000000000 --- a/src/platform/plugins/shared/content_management/server/content_client/content_client.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { StorageContext } from '../core'; -import { ContentCrud } from '../core/crud'; -import type { IContentClient } from './types'; -interface Context { - crudInstance: ContentCrud; - storageContext: StorageContext; -} -export declare class ContentClient implements IContentClient { - contentTypeId: string; - private readonly ctx; - static create(contentTypeId: string, ctx: Context): IContentClient; - constructor(token: symbol, contentTypeId: string, ctx: Context); - get(id: string, options: object): Promise>; - bulkGet(ids: string[], options: object): Promise>; - create(data: object, options?: object): Promise>; - update(id: string, data: object, options?: object): Promise>; - delete(id: string, options?: object): Promise; - search(query: object, options?: object): Promise>; -} -export {}; diff --git a/src/platform/plugins/shared/content_management/server/content_client/content_client_factory.d.ts b/src/platform/plugins/shared/content_management/server/content_client/content_client_factory.d.ts deleted file mode 100644 index 8bbe03ee1fd45..0000000000000 --- a/src/platform/plugins/shared/content_management/server/content_client/content_client_factory.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Logger, KibanaRequest } from '@kbn/core/server'; -import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; -import type { Version } from '@kbn/object-versioning'; -import type { MSearchIn, MSearchOut } from '../../common'; -import type { ContentRegistry } from '../core'; -import type { MSearchService } from '../core/msearch'; -export declare const getContentClientFactory: ({ contentRegistry }: { - contentRegistry: ContentRegistry; -}) => (contentTypeId: string) => { - /** - * Client getter to interact with the registered content type. - */ - getForRequest: ({ request, requestHandlerContext, version, }: { - request: KibanaRequest; - requestHandlerContext: RequestHandlerContext; - version?: Version; - }) => import("./types").IContentClient; -}; -export declare const getMSearchClientFactory: ({ contentRegistry, mSearchService, logger, }: { - contentRegistry: ContentRegistry; - mSearchService: MSearchService; - logger: Logger; -}) => ({ requestHandlerContext, request, }: { - requestHandlerContext: RequestHandlerContext; - request: KibanaRequest; -}) => { - msearch: ({ contentTypes, query }: MSearchIn) => Promise; -}; diff --git a/src/platform/plugins/shared/content_management/server/content_client/index.d.ts b/src/platform/plugins/shared/content_management/server/content_client/index.d.ts deleted file mode 100644 index a820b1497c1fb..0000000000000 --- a/src/platform/plugins/shared/content_management/server/content_client/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { getContentClientFactory, getMSearchClientFactory } from './content_client_factory'; -export type { IContentClient } from './types'; diff --git a/src/platform/plugins/shared/content_management/server/content_client/types.d.ts b/src/platform/plugins/shared/content_management/server/content_client/types.d.ts deleted file mode 100644 index f05640c0fb636..0000000000000 --- a/src/platform/plugins/shared/content_management/server/content_client/types.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { ContentCrud } from '../core/crud'; -type CrudGetParameters = Parameters['get']>; -export type GetParameters = [CrudGetParameters[1], CrudGetParameters[2]?]; -type CrudBulkGetParameters = Parameters['bulkGet']>; -export type BulkGetParameters = [ - CrudBulkGetParameters[1], - CrudBulkGetParameters[2]? -]; -type CrudCreateParameters = Parameters['create']>; -export type CreateParameters = [ - CrudCreateParameters[1], - CrudCreateParameters[2]? -]; -type CrudUpdateParameters = Parameters['update']>; -export type UpdateParameters = [ - CrudUpdateParameters[1], - CrudUpdateParameters[2], - CrudUpdateParameters[3]? -]; -type CrudDeleteParameters = Parameters['delete']>; -export type DeleteParameters = [ - CrudDeleteParameters[1], - CrudDeleteParameters[2]? -]; -type CrudSearchParameters = Parameters['search']>; -export type SearchParameters = [ - CrudSearchParameters[1], - CrudSearchParameters[2]? -]; -export interface IContentClient { - contentTypeId: string; - get(...params: GetParameters): ReturnType['get']>; - bulkGet(...params: BulkGetParameters): ReturnType['bulkGet']>; - create(...params: CreateParameters): ReturnType['create']>; - update(...params: UpdateParameters): ReturnType['update']>; - delete(...params: DeleteParameters): ReturnType['delete']>; - search(...params: SearchParameters): ReturnType['search']>; -} -export {}; diff --git a/src/platform/plugins/shared/content_management/server/core/content_type.d.ts b/src/platform/plugins/shared/content_management/server/core/content_type.d.ts deleted file mode 100644 index 2eb1531d5fb71..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/content_type.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ContentCrud } from './crud'; -import type { EventBus } from './event_bus'; -import type { ContentStorage, ContentTypeDefinition } from './types'; -export declare class ContentType { - /** Content definition. */ - private readonly _definition; - /** Content crud instance. */ - private readonly contentCrud; - constructor(definition: ContentTypeDefinition, eventBus: EventBus); - get id(): string; - get definition(): ContentTypeDefinition>>; - get storage(): ContentStorage>; - get crud(): ContentCrud; - get version(): { - latest: import("@kbn/object-versioning").Version; - }; -} diff --git a/src/platform/plugins/shared/content_management/server/core/core.d.ts b/src/platform/plugins/shared/content_management/server/core/core.d.ts deleted file mode 100644 index 131200f8475c9..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/core.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { Logger, KibanaRequest } from '@kbn/core/server'; -import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; -import type { Version } from '@kbn/object-versioning'; -import type { MSearchIn, MSearchOut } from '../../common'; -import type { IContentClient } from '../content_client'; -import type { ContentCrud } from './crud'; -import { EventBus } from './event_bus'; -import { ContentRegistry } from './registry'; -export interface GetContentClientForRequestDependencies { - requestHandlerContext: RequestHandlerContext; - request: KibanaRequest; -} -export interface CoreApi { - /** - * Register a new content in the registry. - * - * @param contentType The content type to register - * @param config The content configuration - */ - register: ContentRegistry['register']; - /** Handler to retrieve a content crud instance */ - crud: (contentType: string) => ContentCrud; - /** Content management event bus */ - eventBus: EventBus; - /** Client getters to interact with registered content types. */ - contentClient: { - /** Client getter to interact with registered content types for the current HTTP request. */ - getForRequest(deps: GetContentClientForRequestDependencies): { - for: (contentTypeId: string, version?: Version) => IContentClient; - msearch(args: MSearchIn): Promise; - }; - }; -} -export interface CoreInitializerContext { - logger: Logger; -} -export interface CoreSetup { - /** Content registry instance */ - contentRegistry: ContentRegistry; - /** Api exposed to other plugins */ - api: CoreApi; -} -export declare class Core { - private readonly ctx; - private contentRegistry; - private eventBus; - constructor(ctx: CoreInitializerContext); - setup(): CoreSetup; - private getContentClientForRequest; -} diff --git a/src/platform/plugins/shared/content_management/server/core/crud.d.ts b/src/platform/plugins/shared/content_management/server/core/crud.d.ts deleted file mode 100644 index 466d4cdefc360..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/crud.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { GetResult, BulkGetResult, CreateResult, UpdateResult, DeleteResult, SearchResult, SearchQuery } from '../../common'; -import type { EventBus } from './event_bus'; -import type { ContentStorage, StorageContext } from './types'; -export interface GetResponse { - contentTypeId: string; - result: GetResult; -} -export interface BulkGetResponse { - contentTypeId: string; - result: BulkGetResult; -} -export interface CreateItemResponse { - contentTypeId: string; - result: CreateResult; -} -export interface UpdateItemResponse { - contentTypeId: string; - result: UpdateResult; -} -export interface DeleteItemResponse { - contentTypeId: string; - result: DeleteResult; -} -export interface SearchResponse { - contentTypeId: string; - result: SearchResult; -} -export declare class ContentCrud { - private storage; - private eventBus; - contentTypeId: string; - constructor(contentTypeId: string, contentStorage: ContentStorage, { eventBus, }: { - eventBus: EventBus; - }); - get(ctx: StorageContext, contentId: string, options?: object): Promise>; - bulkGet(ctx: StorageContext, ids: string[], options?: object): Promise>; - create(ctx: StorageContext, data: object, options?: object): Promise>; - update(ctx: StorageContext, id: string, data: object, options?: object): Promise>; - delete(ctx: StorageContext, id: string, options?: object): Promise; - search(ctx: StorageContext, query: SearchQuery, options?: object): Promise>; -} diff --git a/src/platform/plugins/shared/content_management/server/core/event_bus.d.ts b/src/platform/plugins/shared/content_management/server/core/event_bus.d.ts deleted file mode 100644 index 24a899b0d5f8a..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/event_bus.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { ContentEvent, ContentEventType } from './event_types'; -/** - * Content event listener - */ -export type EventListener = (arg: ContentEvent) => void; -/** - * Event bus for all content generated events - */ -export declare class EventBus { - private contentTypeValidator?; - /** The events Rxjs Subject */ - private _events$; - /** Map of listener for each content type */ - private eventListeners; - /** Subscription to the _events$ Observable */ - private eventsSubscription; - /** - * @param contentTypeValidator Handler to validate if a content type is valid or not - */ - constructor(contentTypeValidator?: ((contentType: string) => boolean) | undefined); - /** - * - * - * @param type The event type e.g. "getItemSuccess") - * @param cb Callback to execute - * - * @example - * - * ```ts - * // Register an event for all content types - * eventBus.on('getItemSuccess', (event) => {}) - * - * // Register an event for the "dashboard" content type - * * eventBus.on('getItemSuccess', 'dashboard', (event) => {}) - * ``` - */ - /** - * Register an event listener for specific events on specific content types - * - * @param eventType The event type to listen to - * @param contentType The content type to listen to (if not specified all content types will send the event type) - * @param cb Handler to call when the event occurs - * - * @returns Handler to unsubscribe - */ - on(eventType: ContentEventType, cb: EventListener): () => void; - on(eventType: ContentEventType, contentType: ContentType, cb: EventListener): () => void; - /** - * Send an event to the CM event bus - * @param event The event to send - */ - emit(event: ContentEvent): void; - /** Content management events Observable */ - get events$(): import("rxjs").Observable; - stop(): void; -} diff --git a/src/platform/plugins/shared/content_management/server/core/event_types.d.ts b/src/platform/plugins/shared/content_management/server/core/event_types.d.ts deleted file mode 100644 index 7bdf91fce2699..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/event_types.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -interface BaseEvent { - type: T; - contentTypeId: string; - options?: Options; -} -export interface GetItemStart extends BaseEvent<'getItemStart'> { - contentId: string; -} -export interface GetItemSuccess extends BaseEvent<'getItemSuccess'> { - contentId: string; - data: unknown; -} -export interface GetItemError extends BaseEvent<'getItemError'> { - contentId: string; - error: unknown; -} -export interface BulkGetItemStart extends BaseEvent<'bulkGetItemStart'> { - ids: string[]; -} -export interface BulkGetItemSuccess extends BaseEvent<'bulkGetItemSuccess'> { - ids: string[]; - data: unknown; -} -export interface BulkGetItemError extends BaseEvent<'bulkGetItemError'> { - ids: string[]; - error: unknown; -} -export interface CreateItemStart extends BaseEvent<'createItemStart'> { - data: object; -} -export interface CreateItemSuccess extends BaseEvent<'createItemSuccess'> { - data: object; -} -export interface CreateItemError extends BaseEvent<'createItemError'> { - data: object; - error: unknown; -} -export interface UpdateItemStart extends BaseEvent<'updateItemStart'> { - contentId: string; - data: object; -} -export interface UpdateItemSuccess extends BaseEvent<'updateItemSuccess'> { - contentId: string; - data: object; -} -export interface UpdateItemError extends BaseEvent<'updateItemError'> { - contentId: string; - data: object; - error: unknown; -} -export interface DeleteItemStart extends BaseEvent<'deleteItemStart'> { - contentId: string; -} -export interface DeleteItemSuccess extends BaseEvent<'deleteItemSuccess'> { - contentId: string; -} -export interface DeleteItemError extends BaseEvent<'deleteItemError'> { - contentId: string; - error: unknown; -} -export interface SearchItemStart extends BaseEvent<'searchItemStart'> { - query: object; -} -export interface SearchItemSuccess extends BaseEvent<'searchItemSuccess'> { - query: object; - data: unknown; -} -export interface SearchItemError extends BaseEvent<'searchItemError'> { - query: object; - error: unknown; -} -export type ContentEvent = GetItemStart | GetItemSuccess | GetItemError | BulkGetItemStart | BulkGetItemSuccess | BulkGetItemError | CreateItemStart | CreateItemSuccess | CreateItemError | UpdateItemStart | UpdateItemSuccess | UpdateItemError | DeleteItemStart | DeleteItemSuccess | DeleteItemError | SearchItemStart | SearchItemSuccess | SearchItemError; -export type ContentEventType = ContentEvent['type']; -export {}; diff --git a/src/platform/plugins/shared/content_management/server/core/index.d.ts b/src/platform/plugins/shared/content_management/server/core/index.d.ts deleted file mode 100644 index 37659f58dd2f1..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { Core } from './core'; -export type { CoreApi } from './core'; -export type { ContentType } from './content_type'; -export type { ContentStorage, ContentTypeDefinition, StorageContext, StorageContextGetTransformFn, MSearchConfig, } from './types'; -export type { ContentRegistry } from './registry'; -export type { ContentCrud } from './crud'; diff --git a/src/platform/plugins/shared/content_management/server/core/msearch.d.ts b/src/platform/plugins/shared/content_management/server/core/msearch.d.ts deleted file mode 100644 index 88e88af8630c4..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/msearch.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import type { MSearchResult, SearchQuery } from '../../common'; -import type { ContentRegistry } from './registry'; -import type { StorageContext } from './types'; -export declare class MSearchService { - private readonly deps; - constructor(deps: { - getSavedObjectsClient: () => Promise; - contentRegistry: ContentRegistry; - getConfig: { - listingLimit: () => Promise; - perPage: () => Promise; - }; - }); - search(contentTypes: Array<{ - contentTypeId: string; - ctx: StorageContext; - }>, query: SearchQuery): Promise; -} diff --git a/src/platform/plugins/shared/content_management/server/core/registry.d.ts b/src/platform/plugins/shared/content_management/server/core/registry.d.ts deleted file mode 100644 index 7697bac57595d..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/registry.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { ContentType } from './content_type'; -import type { EventBus } from './event_bus'; -import type { ContentStorage, ContentTypeDefinition, MSearchConfig } from './types'; -import type { ContentCrud } from './crud'; -export declare class ContentRegistry { - private eventBus; - private types; - constructor(eventBus: EventBus); - /** - * Register a new content in the registry. - * - * @param contentType The content type to register - * @param config The content configuration - */ - register> = ContentStorage>(definition: ContentTypeDefinition): { - /** - * Client getters to interact with the registered content type. - */ - contentClient: { - getForRequest: ({ request, requestHandlerContext, version, }: { - request: import("@kbn/core/packages/http/server").KibanaRequest; - requestHandlerContext: import("@kbn/core/packages/http/request-handler-context-server").RequestHandlerContext; - version?: import("@kbn/object-versioning").Version; - }) => import("../content_client").IContentClient; - }; - }; - getContentType(id: string): ContentType; - /** Get the definition for a specific content type */ - getDefinition(id: string): ContentTypeDefinition>>; - /** Get the crud instance of a content type */ - getCrud(id: string): ContentCrud; - /** Helper to validate if a content type has been registered */ - isContentRegistered(id: string): boolean; -} diff --git a/src/platform/plugins/shared/content_management/server/core/types.d.ts b/src/platform/plugins/shared/content_management/server/core/types.d.ts deleted file mode 100644 index 8e5ef52b88d92..0000000000000 --- a/src/platform/plugins/shared/content_management/server/core/types.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; -import type { Version, ContentManagementServiceTransforms, ContentManagementServiceDefinitionVersioned } from '@kbn/object-versioning'; -import type { SavedObjectsFindResult } from '@kbn/core-saved-objects-api-server'; -import type { KibanaRequest } from '@kbn/core/server'; -import type { GetResult, BulkGetResult, CreateResult, UpdateResult, DeleteResult, SearchQuery, SearchResult } from '../../common'; -export type StorageContextGetTransformFn = (definitions: ContentManagementServiceDefinitionVersioned, requestVersion?: Version) => ContentManagementServiceTransforms; -/** Context that is sent to all storage instance methods */ -export interface StorageContext { - request: KibanaRequest; - /** The Core HTTP request handler context */ - requestHandlerContext: RequestHandlerContext; - version: { - /** - * The content type version for the request. It usually is the latest version although in some - * cases the client (browser) might still be on an older version and make requests with that version. - */ - request: Version; - /** - * The latest version of the content type. This is the version that the content type is currently on - * after updating the Kibana server. - */ - latest: Version; - }; - utils: { - /** - * Get the transforms handlers for the content type. - * The transforms are used to transform the content object to the latest schema (up) and back - * to a previous schema (down). - */ - getTransforms: StorageContextGetTransformFn; - }; -} -export interface ContentStorage = MSearchConfig> { - /** Get a single item */ - get(ctx: StorageContext, id: string, options?: object): Promise>; - /** Get multiple items */ - bulkGet(ctx: StorageContext, ids: string[], options?: object): Promise>; - /** Create an item */ - create(ctx: StorageContext, data: object, options?: object): Promise>; - /** Update an item */ - update(ctx: StorageContext, id: string, data: object, options?: object): Promise>; - /** Delete an item */ - delete(ctx: StorageContext, id: string, options?: object): Promise; - /** Search items */ - search(ctx: StorageContext, query: SearchQuery, options?: object): Promise>; - /** - * Opt-in to multi-type search. - * Can only be supported if the content type is backed by a saved object since `mSearch` is using the `savedObjects.find` API. - **/ - mSearch?: TMSearchConfig; -} -export interface ContentTypeDefinition { - /** Unique id for the content type */ - id: string; - /** The storage layer for the content. It must implement the ContentStorage interface. */ - storage: S; - version: { - latest: Version; - }; -} -/** - * A configuration for multi-type search. - * By configuring a content type with a `MSearchConfig`, it can be searched in the multi-type search. - * Underneath content management is using the `savedObjects.find` API to search the saved objects. - */ -export interface MSearchConfig { - /** - * The saved object type that corresponds to this content type. - */ - savedObjectType: string; - /** - * Mapper function that transforms the saved object into the content item result. - */ - toItemResult: (ctx: StorageContext, savedObject: SavedObjectsFindResult) => T; - /** - * Additional fields to search on. These fields will be added to the search query. - * By default, only `title` and `description` are searched. - */ - additionalSearchFields?: string[]; -} diff --git a/src/platform/plugins/shared/content_management/server/index.d.ts b/src/platform/plugins/shared/content_management/server/index.d.ts deleted file mode 100644 index 2c464992f7296..0000000000000 --- a/src/platform/plugins/shared/content_management/server/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/server'; -export declare function plugin(initializerContext: PluginInitializerContext): Promise; -export type { ContentManagementServerSetup, ContentManagementServerStart } from './types'; -export type { ContentStorage, StorageContext, MSearchConfig } from './core'; diff --git a/src/platform/plugins/shared/content_management/server/plugin.d.ts b/src/platform/plugins/shared/content_management/server/plugin.d.ts deleted file mode 100644 index 3471fa25fc21e..0000000000000 --- a/src/platform/plugins/shared/content_management/server/plugin.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; -import type { ContentManagementServerSetup, ContentManagementServerStart, ContentManagementServerSetupDependencies, ContentManagementServerStartDependencies } from './types'; -export declare class ContentManagementPlugin implements Plugin { - private readonly logger; - private readonly core; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup, plugins: ContentManagementServerSetupDependencies): { - favorites: import("@kbn/content-management-favorites-server/src/favorites_registry").FavoritesRegistrySetup; - register: import("./core").ContentRegistry["register"]; - crud: (contentType: string) => import("./core").ContentCrud; - eventBus: import("./core/event_bus").EventBus; - contentClient: { - getForRequest(deps: import("./core/core").GetContentClientForRequestDependencies): { - for: (contentTypeId: string, version?: import("@kbn/object-versioning").Version) => import("./types").IContentClient; - msearch(args: import("../common/rpc").MSearchIn): Promise; - }; - }; - }; - start(core: CoreStart): {}; -} diff --git a/src/platform/plugins/shared/content_management/server/rpc/index.d.ts b/src/platform/plugins/shared/content_management/server/rpc/index.d.ts deleted file mode 100644 index 2c99225930c22..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { RpcService } from './rpc_service'; -export { initRpcRoutes } from './routes'; -export { registerProcedures } from './procedures'; -export type { Context } from './types'; -export type { ProcedureDefinition } from './rpc_service'; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/all_procedures.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/all_procedures.d.ts deleted file mode 100644 index c254f7c72776f..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/all_procedures.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { ProcedureName } from '../../../common'; -import type { ProcedureDefinition } from '../rpc_service'; -import type { Context } from '../types'; -export declare const getProcedures: (logger: Logger) => { [key in ProcedureName]: ProcedureDefinition; }; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/bulk_get.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/bulk_get.d.ts deleted file mode 100644 index bc3ce54d5ec20..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/bulk_get.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { BulkGetIn } from '../../../common'; -import type { ProcedureDefinition } from '../rpc_service'; -import type { Context } from '../types'; -import type { BulkGetResponse } from '../../core/crud'; -export declare const bulkGet: ProcedureDefinition, BulkGetResponse>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/create.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/create.d.ts deleted file mode 100644 index b4ccc213288be..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/create.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CreateIn } from '../../../common'; -import type { ProcedureDefinition } from '../rpc_service'; -import type { Context } from '../types'; -export declare const create: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/delete.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/delete.d.ts deleted file mode 100644 index b99febeaff878..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/delete.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { DeleteIn } from '../../../common'; -import type { ProcedureDefinition } from '../rpc_service'; -import type { Context } from '../types'; -export declare const deleteProc: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/get.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/get.d.ts deleted file mode 100644 index 737976ac70f70..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/get.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { GetIn } from '../../../common'; -import type { ProcedureDefinition } from '../rpc_service'; -import type { Context } from '../types'; -export declare const get: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/index.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/index.d.ts deleted file mode 100644 index a6e69a72fc02f..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { ProcedureName } from '../../../common'; -import type { RpcService } from '../rpc_service'; -import type { Context } from '../types'; -export declare function registerProcedures(rpc: RpcService, logger: Logger): void; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/msearch.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/msearch.d.ts deleted file mode 100644 index 4dd9a9e8bfd98..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/msearch.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { MSearchIn, MSearchOut } from '../../../common'; -import type { ProcedureDefinition } from '../rpc_service'; -import type { Context } from '../types'; -export declare const getMSearch: (logger: Logger) => ProcedureDefinition; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/search.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/search.d.ts deleted file mode 100644 index 712b1676b35b3..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/search.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { SearchIn } from '../../../common'; -import type { ProcedureDefinition } from '../rpc_service'; -import type { Context } from '../types'; -export declare const search: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/procedures/update.d.ts b/src/platform/plugins/shared/content_management/server/rpc/procedures/update.d.ts deleted file mode 100644 index 5fbb12fb36d45..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/procedures/update.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { UpdateIn } from '../../../common'; -import type { ProcedureDefinition } from '../rpc_service'; -import type { Context } from '../types'; -export declare const update: ProcedureDefinition>; diff --git a/src/platform/plugins/shared/content_management/server/rpc/routes/error_wrapper.d.ts b/src/platform/plugins/shared/content_management/server/rpc/routes/error_wrapper.d.ts deleted file mode 100644 index 5fd05fbc65beb..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/routes/error_wrapper.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ResponseError, CustomHttpResponseOptions } from '@kbn/core/server'; -export declare function wrapError(error: any): CustomHttpResponseOptions; diff --git a/src/platform/plugins/shared/content_management/server/rpc/routes/index.d.ts b/src/platform/plugins/shared/content_management/server/rpc/routes/index.d.ts deleted file mode 100644 index 96808fbde15aa..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/routes/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { initRpcRoutes } from './routes'; diff --git a/src/platform/plugins/shared/content_management/server/rpc/routes/routes.d.ts b/src/platform/plugins/shared/content_management/server/rpc/routes/routes.d.ts deleted file mode 100644 index a99b9269e1d6a..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/routes/routes.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IRouter } from '@kbn/core/server'; -import type { ProcedureName } from '../../../common'; -import type { ContentRegistry } from '../../core'; -import type { RpcService } from '../rpc_service'; -import type { Context as RpcContext } from '../types'; -interface RouteContext { - rpc: RpcService; - contentRegistry: ContentRegistry; -} -export declare function initRpcRoutes(procedureNames: readonly ProcedureName[], router: IRouter, { rpc, contentRegistry }: RouteContext): void; -export {}; diff --git a/src/platform/plugins/shared/content_management/server/rpc/rpc_service.d.ts b/src/platform/plugins/shared/content_management/server/rpc/rpc_service.d.ts deleted file mode 100644 index 53cf6329bec55..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/rpc_service.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ProcedureSchemas } from '../../common'; -export interface ProcedureDefinition { - fn: (context: Context, input: I extends void ? undefined : I) => Promise; - schemas?: ProcedureSchemas; -} -export declare class RpcService { - private registry; - register(name: Names, definition: ProcedureDefinition): void; - call(context: Context, name: Names, input?: unknown): Promise<{ - result: unknown; - }>; -} diff --git a/src/platform/plugins/shared/content_management/server/rpc/types.d.ts b/src/platform/plugins/shared/content_management/server/rpc/types.d.ts deleted file mode 100644 index ac5563ec4e8e3..0000000000000 --- a/src/platform/plugins/shared/content_management/server/rpc/types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; -import type { KibanaRequest } from '@kbn/core-http-server'; -import type { ContentRegistry } from '../core'; -import type { MSearchService } from '../core/msearch'; -export interface Context { - contentRegistry: ContentRegistry; - requestHandlerContext: RequestHandlerContext; - request: KibanaRequest; - mSearchService: MSearchService; -} diff --git a/src/platform/plugins/shared/content_management/server/types.d.ts b/src/platform/plugins/shared/content_management/server/types.d.ts deleted file mode 100644 index f85f5e1f201b5..0000000000000 --- a/src/platform/plugins/shared/content_management/server/types.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import type { FavoritesSetup } from '@kbn/content-management-favorites-server'; -import type { CoreApi, StorageContextGetTransformFn } from './core'; -export type { IContentClient } from './content_client/types'; -export interface ContentManagementServerSetupDependencies { - usageCollection?: UsageCollectionSetup; -} -export interface ContentManagementServerStartDependencies { -} -export interface ContentManagementServerSetup extends CoreApi { - favorites: FavoritesSetup; -} -export interface ContentManagementServerStart { -} -export type GetTransformsFactoryFn = (contentTypeId: string, requestVersion: Version, options?: { - cacheEnabled?: boolean; -}) => StorageContextGetTransformFn; diff --git a/src/platform/plugins/shared/content_management/server/utils/index.d.ts b/src/platform/plugins/shared/content_management/server/utils/index.d.ts deleted file mode 100644 index 481f39c1d17de..0000000000000 --- a/src/platform/plugins/shared/content_management/server/utils/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { getStorageContext, validate } from './utils'; -export { getServiceObjectTransformFactory, disableCache as disableTransformsCache, } from './services_transforms_factory'; diff --git a/src/platform/plugins/shared/content_management/server/utils/services_transforms_factory.d.ts b/src/platform/plugins/shared/content_management/server/utils/services_transforms_factory.d.ts deleted file mode 100644 index bb9c8be15a996..0000000000000 --- a/src/platform/plugins/shared/content_management/server/utils/services_transforms_factory.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Version } from '@kbn/object-versioning'; -import type { StorageContextGetTransformFn } from '../core'; -export declare const disableCache: () => void; -/** - * Wrap the "getContentManagementServicesTransforms()" handler from the @kbn/object-versioning package - * to be able to cache the service definitions compilations so we can reuse them accross request as the - * services definitions won't change until a new Elastic version is released. In which case the cache - * will be cleared. - * - * @param contentTypeId The content type id for the service definition - * @returns A "getContentManagementServicesTransforms()" - */ -export declare const getServiceObjectTransformFactory: (contentTypeId: string, _requestVersion: Version) => StorageContextGetTransformFn; diff --git a/src/platform/plugins/shared/content_management/server/utils/utils.d.ts b/src/platform/plugins/shared/content_management/server/utils/utils.d.ts deleted file mode 100644 index a9c9b7a1f4302..0000000000000 --- a/src/platform/plugins/shared/content_management/server/utils/utils.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Type, ValidationError } from '@kbn/config-schema'; -import type { KibanaRequest } from '@kbn/core/server'; -import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; -import type { ContentRegistry, StorageContext } from '../core'; -import type { GetTransformsFactoryFn } from '../types'; -export declare const validate: (input: unknown, schema: Type) => ValidationError | null; -export declare const getStorageContext: ({ request, contentTypeId, version: _version, ctx: { contentRegistry, requestHandlerContext, getTransformsFactory }, }: { - request: KibanaRequest; - contentTypeId: string; - version?: number; - ctx: { - contentRegistry: ContentRegistry; - requestHandlerContext: RequestHandlerContext; - getTransformsFactory: GetTransformsFactoryFn; - }; -}) => StorageContext; diff --git a/src/platform/plugins/shared/cps/public/index.d.ts b/src/platform/plugins/shared/cps/public/index.d.ts deleted file mode 100644 index 8b239ee02c8f8..0000000000000 --- a/src/platform/plugins/shared/cps/public/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import { CpsPlugin } from './plugin'; -export declare function plugin(initContext: PluginInitializerContext): CpsPlugin; -export type { CPSPluginSetup, CPSPluginStart, CPSConfigType } from './types'; diff --git a/src/platform/plugins/shared/cps/public/plugin.d.ts b/src/platform/plugins/shared/cps/public/plugin.d.ts deleted file mode 100644 index 9eed73912e72c..0000000000000 --- a/src/platform/plugins/shared/cps/public/plugin.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { CPSPluginSetup, CPSPluginStart, CPSConfigType } from './types'; -export declare class CpsPlugin implements Plugin { - private readonly initializerContext; - private readonly appAccessResolvers; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup): CPSPluginSetup; - start(core: CoreStart): CPSPluginStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/cps/public/services/async_services.d.ts b/src/platform/plugins/shared/cps/public/services/async_services.d.ts deleted file mode 100644 index 437d03130a500..0000000000000 --- a/src/platform/plugins/shared/cps/public/services/async_services.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { HttpSetup } from '@kbn/core/public'; -export { createProjectFetcher } from './project_fetcher'; -/** - * Resolves the default project routing for the current space. - * Returns {@link PROJECT_ROUTING.ALL} when the expression doesn't exist (404). - */ -export declare const fetchDefaultProjectRouting: (http: HttpSetup) => Promise; diff --git a/src/platform/plugins/shared/cps/public/services/cps_manager.d.ts b/src/platform/plugins/shared/cps/public/services/cps_manager.d.ts deleted file mode 100644 index d865d82773092..0000000000000 --- a/src/platform/plugins/shared/cps/public/services/cps_manager.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type { ApplicationStart, HttpSetup } from '@kbn/core/public'; -import type { Logger } from '@kbn/logging'; -import type { ProjectRouting } from '@kbn/es-query'; -import { BehaviorSubject } from 'rxjs'; -import { type CPSAppAccessResolver, type ICPSManager, type ProjectsData, ProjectRoutingAccess } from '@kbn/cps-utils'; -/** - * Central service for managing project routing and project data. - * - * - Fetches project data from ES via `/internal/cps/projects_tags` endpoint (with caching and retry logic) - * - Manages current project routing state using observables - * - projectRouting$ represents temporary UI state; apps should reset to their saved value or spaces project routing on navigation - */ -export declare class CPSManager implements ICPSManager { - private readonly http; - private readonly logger; - private readonly application; - private projectFetcherPromise; - private defaultProjectRouting; - private allProjects; - private readonly readyPromise; - private readonly appAccessResolvers; - private currentAppId; - private currentLocation; - private readonly projectRouting$; - private readonly projectPickerAccess$; - private lastEditableProjectRouting; - constructor(deps: { - http: HttpSetup; - logger: Logger; - application: ApplicationStart; - appAccessResolvers?: Map; - }); - /** - * Resolves once the default project routing and total count of projects has been fetched - */ - whenReady(): Promise; - /** - * Initialize the default project routing from the active space. - * Fetches the default project routing for the current space from the CPS plugin. - */ - private initializeDefaultProjectRouting; - /** - * Get the default project routing value from a global space setting. - * This is the fallback value used when no app-specific or saved value exists. - */ - getDefaultProjectRouting(): ProjectRouting; - updateDefaultProjectRouting(projectRouting: string): void; - /** - * Fetches all projects - */ - private fetchAllProjects; - /** - * Returns the total number of projects (origin + linked) across all project routings. - */ - getTotalProjectCount(): number; - /** - * Get the current project routing as an observable - */ - getProjectRouting$(): import("rxjs").Observable; - registerAppAccess(appId: string, resolver: CPSAppAccessResolver): void; - private applyAccess; - private resolveAccess; - /** - * Set the current project routing - */ - setProjectRouting(projectRouting: ProjectRouting): void; - /** - * Get the current project routing value - */ - getProjectRouting(overrideValue?: ProjectRouting): ProjectRouting; - /** - * Get the project picker access level as an observable. - * This combines the current app ID and location to determine whether - * the project picker should be editable, readonly, or disabled. - */ - getProjectPickerAccess$(): BehaviorSubject; - /** - * Fetches projects from the server with caching and retry logic. - * Returns cached data if already loaded. If a fetch is already in progress, returns the existing promise. - * @returns Promise resolving to ProjectsData - */ - fetchProjects(projectRouting?: ProjectRouting): Promise; - private getProjectFetcher; -} diff --git a/src/platform/plugins/shared/cps/public/services/project_fetcher.d.ts b/src/platform/plugins/shared/cps/public/services/project_fetcher.d.ts deleted file mode 100644 index 20bc639c11a4f..0000000000000 --- a/src/platform/plugins/shared/cps/public/services/project_fetcher.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { HttpSetup } from '@kbn/core/public'; -import type { Logger } from '@kbn/logging'; -import type { ProjectsData } from '@kbn/cps-utils'; -import type { ProjectRouting } from '@kbn/es-query'; -export declare const CACHE_TTL_MS = 15000; -export interface ProjectFetcher { - fetchProjects: (projectRouting?: ProjectRouting) => Promise; -} -/** - * Creates project fetcher with retry logic, in-flight deduplication, and short-lived caching. - * - * - Concurrent calls with the same `projectRouting` share a single HTTP round-trip. - * - Successful responses are cached for {@link CACHE_TTL_MS}; subsequent calls within that - * window return the cached result without a network request. - * - Errors are never cached — the next call always retries. - */ -export declare function createProjectFetcher(http: HttpSetup, logger: Logger): ProjectFetcher; diff --git a/src/platform/plugins/shared/cps/public/types.d.ts b/src/platform/plugins/shared/cps/public/types.d.ts deleted file mode 100644 index 205358f9b5318..0000000000000 --- a/src/platform/plugins/shared/cps/public/types.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ICPSManager, CPSAppAccessResolver } from '@kbn/cps-utils'; -export interface CPSPluginSetup { - cpsEnabled?: boolean; - /** - * Register a dynamic access resolver for a specific app during plugin setup. - * See {@link ICPSManager.registerAppAccess} for details. - */ - registerAppAccess(appId: string, resolver: CPSAppAccessResolver): void; -} -export interface CPSConfigType { - cpsEnabled: boolean; -} -export interface CPSPluginStart { - cpsManager?: ICPSManager; -} -export interface CPSPluginStop { -} diff --git a/src/platform/plugins/shared/custom_integrations/common/index.d.ts b/src/platform/plugins/shared/custom_integrations/common/index.d.ts deleted file mode 100644 index d9fb29c12598e..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/common/index.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -export declare const PLUGIN_ID = "customIntegrations"; -export declare const PLUGIN_NAME = "customIntegrations"; -/** - * A map of category names and their corresponding titles. - */ -export declare const INTEGRATION_CATEGORY_DISPLAY: { - [key: string]: { - title: string; - parent_id?: string; - }; -}; -export declare const FEATURED_INTEGRATIONS_BY_CATEGORY: { - security: string[]; - '': string[]; -}; -/** - * A category applicable to an Integration. - */ -export type IntegrationCategory = string; -/** - * The list of all available categories. - */ -export declare const category: IntegrationCategory[]; -/** - * An object containing the id of an `IntegrationCategory` and the count of all Integrations in that category. - */ -export interface IntegrationCategoryCount { - count: number; - id: IntegrationCategory; -} -/** - * A map of shipper names and their corresponding titles. - */ -export declare const SHIPPER_DISPLAY: { - beats: string; - search: string; - language_clients: string; - other: string; - sample_data: string; - tests: string; - tutorial: string; - placeholders: string; -}; -/** - * A shipper-- an internal or external system capable of storing data in ES/Kibana-- applicable to an Integration. - */ -export type Shipper = keyof typeof SHIPPER_DISPLAY; -/** - * The list of all known shippers. - */ -export declare const shipper: Shipper[]; -/** - * An icon representing an Integration. - */ -export interface CustomIntegrationIcon { - src: string; - type: 'eui' | 'svg'; -} -/** - * A definition of a dataintegration, which can be registered with Kibana. - */ -export interface CustomIntegration { - id: string; - title: string; - description: string; - type: 'ui_link'; - uiInternalPath: string; - uiExternalLink?: string; - isBeta: boolean; - icons: CustomIntegrationIcon[]; - categories: IntegrationCategory[]; - shipper: Shipper; - eprOverlap?: string; -} -export declare const ROUTES_APPEND_CUSTOM_INTEGRATIONS = "/internal/customIntegrations/appendCustomIntegrations"; -export declare const ROUTES_REPLACEMENT_CUSTOM_INTEGRATIONS = "/internal/customIntegrations/replacementCustomIntegrations"; diff --git a/src/platform/plugins/shared/custom_integrations/common/language_integrations.d.ts b/src/platform/plugins/shared/custom_integrations/common/language_integrations.d.ts deleted file mode 100644 index c4a845b5e656a..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/common/language_integrations.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface LanguageIntegration { - id: string; - title: string; - icon?: string; - euiIconName?: string; - description: string; - docUrlTemplate: string; - integrationsAppUrl: string; - exportLanguageUiComponent: boolean; -} -export declare const languageIntegrations: LanguageIntegration[]; diff --git a/src/platform/plugins/shared/custom_integrations/server/custom_integration_registry.d.ts b/src/platform/plugins/shared/custom_integrations/server/custom_integration_registry.d.ts deleted file mode 100644 index aa2023bb70339..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/server/custom_integration_registry.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { CustomIntegration } from '../common'; -export declare class CustomIntegrationRegistry { - private readonly _integrations; - private readonly _logger; - private readonly _isDev; - /** - * Deferred initializers registered via {@link registerDeferredInitializer}. They are - * called (in order, exactly once) the first time the integration list is read, so that - * callers can avoid executing expensive work (e.g. evaluating i18n strings) at plugin - * start time. - */ - private readonly _deferredInitializers; - constructor(logger: Logger, isDev: boolean); - registerDeferredInitializer(init: () => void): void; - private _materializeDeferredInitializers; - registerCustomIntegration(customIntegration: CustomIntegration): void; - getAppendCustomIntegrations(): CustomIntegration[]; - getReplacementCustomIntegrations(): CustomIntegration[]; -} diff --git a/src/platform/plugins/shared/custom_integrations/server/external_integration/index.d.ts b/src/platform/plugins/shared/custom_integrations/server/external_integration/index.d.ts deleted file mode 100644 index fae9eae792f07..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/server/external_integration/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { CoreSetup } from '@kbn/core/server'; -import type { CustomIntegrationRegistry } from '../custom_integration_registry'; -import type { IntegrationCategory } from '../../common'; -interface ExternalIntegration { - id: string; - title: string; - icon?: string; - euiIconName?: string; - description: string; - docUrlTemplate: string; - categories: IntegrationCategory[]; -} -export declare const integrations: ExternalIntegration[]; -export declare function registerExternalIntegrations(core: CoreSetup, registry: CustomIntegrationRegistry, branch: string): void; -export {}; diff --git a/src/platform/plugins/shared/custom_integrations/server/index.d.ts b/src/platform/plugins/shared/custom_integrations/server/index.d.ts deleted file mode 100644 index a5fcd392eb0d7..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/server/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/server'; -export declare function plugin(initializerContext: PluginInitializerContext): Promise; -export type { CustomIntegrationsPluginSetup, CustomIntegrationsPluginStart } from './types'; -export type { IntegrationCategory, CustomIntegration } from '../common'; -export declare const config: { - schema: import("@kbn/config-schema").ObjectType<{}>; -}; diff --git a/src/platform/plugins/shared/custom_integrations/server/language_clients/index.d.ts b/src/platform/plugins/shared/custom_integrations/server/language_clients/index.d.ts deleted file mode 100644 index 47f8f6acf2a13..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/server/language_clients/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CoreSetup } from '@kbn/core/server'; -import type { CustomIntegrationRegistry } from '../custom_integration_registry'; -export declare function registerLanguageClients(core: CoreSetup, registry: CustomIntegrationRegistry, branch: string): void; diff --git a/src/platform/plugins/shared/custom_integrations/server/plugin.d.ts b/src/platform/plugins/shared/custom_integrations/server/plugin.d.ts deleted file mode 100644 index 40f47ef79204c..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/server/plugin.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; -import type { CustomIntegrationsPluginSetup, CustomIntegrationsPluginStart } from './types'; -export declare class CustomIntegrationsPlugin implements Plugin { - private readonly logger; - private readonly customIngegrationRegistry; - private readonly branch; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup): CustomIntegrationsPluginSetup; - start(core: CoreStart): {}; - stop(): void; -} diff --git a/src/platform/plugins/shared/custom_integrations/server/routes/define_routes.d.ts b/src/platform/plugins/shared/custom_integrations/server/routes/define_routes.d.ts deleted file mode 100644 index e4f5845bfa079..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/server/routes/define_routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IRouter } from '@kbn/core/server'; -import type { CustomIntegrationRegistry } from '../custom_integration_registry'; -export declare function defineRoutes(router: IRouter, customIntegrationsRegistry: CustomIntegrationRegistry): void; diff --git a/src/platform/plugins/shared/custom_integrations/server/types.d.ts b/src/platform/plugins/shared/custom_integrations/server/types.d.ts deleted file mode 100644 index 3bec666438c52..0000000000000 --- a/src/platform/plugins/shared/custom_integrations/server/types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { CustomIntegration } from '../common'; -export interface CustomIntegrationsPluginSetup { - registerCustomIntegration(customIntegration: Omit): void; - getAppendCustomIntegrations(): CustomIntegration[]; - /** - * Registers a deferred initializer that will be called (once, in registration order) the - * first time the integration list is read. Use this to avoid evaluating i18n strings and - * building registration payloads at plugin start time — work is deferred to the first - * incoming HTTP request instead. - */ - registerDeferredIntegrations(init: () => void): void; -} -export interface CustomIntegrationsPluginStart { -} diff --git a/src/platform/plugins/shared/data/common/constants.d.ts b/src/platform/plugins/shared/data/common/constants.d.ts deleted file mode 100644 index e99bc98f29104..0000000000000 --- a/src/platform/plugins/shared/data/common/constants.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { UI_SETTINGS } from '@kbn/data-service/src/constants'; -export declare const DEFAULT_QUERY_LANGUAGE = "kuery"; -export declare const KIBANA_USER_QUERY_LANGUAGE_KEY = "kibana.userQueryLanguage"; -export type ValueSuggestionsMethod = 'terms_enum' | 'terms_agg'; -export declare const SAVED_QUERY_BASE_URL = "/internal/saved_query"; -export declare const KQL_TELEMETRY_ROUTE_LATEST_VERSION = "1"; -export declare const SCRIPT_LANGUAGES_ROUTE_LATEST_VERSION = "1"; diff --git a/src/platform/plugins/shared/data/common/datatable_utilities/datatable_utilities_service.d.ts b/src/platform/plugins/shared/data/common/datatable_utilities/datatable_utilities_service.d.ts deleted file mode 100644 index 1580c6e459060..0000000000000 --- a/src/platform/plugins/shared/data/common/datatable_utilities/datatable_utilities_service.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { DataView, DataViewsContract, DataViewField } from '@kbn/data-views-plugin/common'; -import type { Datatable, DatatableColumn } from '@kbn/expressions-plugin/common'; -import type { FieldFormatsStartCommon, FieldFormat } from '@kbn/field-formats-plugin/common'; -import type { AggsCommonStart, AggConfig } from '../search'; -import type { TimeRange } from '../types'; -interface DateHistogramMeta { - interval?: string; - timeZone?: string; - timeRange?: TimeRange; -} -export declare class DatatableUtilitiesService { - private aggs; - private dataViews; - private fieldFormats; - constructor(aggs: AggsCommonStart, dataViews: DataViewsContract, fieldFormats: FieldFormatsStartCommon); - clearField(column: DatatableColumn): void; - clearFieldFormat(column: DatatableColumn): void; - getAggConfig(column: DatatableColumn): Promise; - /** - * Helper function returning the used interval, used time zone and applied time filters for data table column created by the date_histogramm agg type. - * "auto" will get expanded to the actually used interval. - * If the column is not a column created by a date_histogram aggregation of the esaggs data source, - * this function will return undefined. - */ - getDateHistogramMeta(column: DatatableColumn, defaults?: Partial<{ - timeZone: string; - }>): DateHistogramMeta | undefined; - getDataView(column: DatatableColumn): Promise; - getField(column: DatatableColumn): Promise; - getFieldFormat(column: DatatableColumn): FieldFormat | undefined; - getInterval(column: DatatableColumn): string | undefined; - /** - * Helper function returning the used interval for data table column created by the histogramm agg type. - * "auto" will get expanded to the actually used interval. - * If the column is not a column created by a histogram aggregation of the esaggs data source, - * this function will return undefined. - */ - getNumberHistogramInterval(column: DatatableColumn): number | undefined; - getTotalCount(table: Datatable): number | undefined; - hasPrecisionError(column: DatatableColumn): import("@kbn/utility-types").Serializable; - isFilterable(column: DatatableColumn): boolean; - setFieldFormat(column: DatatableColumn, fieldFormat: FieldFormat): void; -} -export {}; diff --git a/src/platform/plugins/shared/data/common/datatable_utilities/index.d.ts b/src/platform/plugins/shared/data/common/datatable_utilities/index.d.ts deleted file mode 100644 index e8662383edeb6..0000000000000 --- a/src/platform/plugins/shared/data/common/datatable_utilities/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './datatable_utilities_service'; diff --git a/src/platform/plugins/shared/data/common/es_query/index.d.ts b/src/platform/plugins/shared/data/common/es_query/index.d.ts deleted file mode 100644 index b473f5898f715..0000000000000 --- a/src/platform/plugins/shared/data/common/es_query/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { getEsQueryConfig } from '@kbn/data-service/src/es_query'; diff --git a/src/platform/plugins/shared/data/common/exports/constants.d.ts b/src/platform/plugins/shared/data/common/exports/constants.d.ts deleted file mode 100644 index 1effe9e302726..0000000000000 --- a/src/platform/plugins/shared/data/common/exports/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const CSV_FORMULA_CHARS: string[]; -export declare const nonAlphaNumRE: RegExp; -export declare const allDoubleQuoteRE: RegExp; -export declare const commonQuotedDelimiters: Set; diff --git a/src/platform/plugins/shared/data/common/exports/escape_value.d.ts b/src/platform/plugins/shared/data/common/exports/escape_value.d.ts deleted file mode 100644 index a2dc5af92751c..0000000000000 --- a/src/platform/plugins/shared/data/common/exports/escape_value.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -type RawValue = string | object | null | undefined; -/** - * Create a function that will escape CSV values like "=", "@" and "+" with a - * "'". This will also place CSV values in "" if contain non-alphanumeric chars. - * - * For example: - * - * Given: =1+1 - * Returns: "'=1+1" - * - * See OWASP: https://www.owasp.org/index.php/CSV_Injection. - */ -export declare function createEscapeValue({ separator, quoteValues, escapeFormulaValues, }: { - separator: string; - quoteValues: boolean; - escapeFormulaValues: boolean; -}): (val: RawValue) => string; -export {}; diff --git a/src/platform/plugins/shared/data/common/exports/export_csv.d.ts b/src/platform/plugins/shared/data/common/exports/export_csv.d.ts deleted file mode 100644 index e49933e098b8e..0000000000000 --- a/src/platform/plugins/shared/data/common/exports/export_csv.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Datatable } from '@kbn/expressions-plugin/common'; -import type { FormatFactory } from '@kbn/field-formats-plugin/common'; -export declare const LINE_FEED_CHARACTER = "\r\n"; -export declare const CSV_MIME_TYPE = "text/plain;charset=utf-8"; -interface CSVOptions { - csvSeparator: string; - quoteValues: boolean; - escapeFormulaValues: boolean; - formatFactory: FormatFactory; - raw?: boolean; -} -export declare function datatableToCSV({ columns, rows }: Datatable, { csvSeparator, quoteValues, formatFactory, raw, escapeFormulaValues }: CSVOptions): string; -export {}; diff --git a/src/platform/plugins/shared/data/common/exports/formula_checks.d.ts b/src/platform/plugins/shared/data/common/exports/formula_checks.d.ts deleted file mode 100644 index f932826f9ff85..0000000000000 --- a/src/platform/plugins/shared/data/common/exports/formula_checks.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Datatable } from '@kbn/expressions-plugin/common'; -export declare const cellHasFormulas: (val: string) => boolean; -export declare const tableHasFormulas: (columns: Datatable["columns"], rows: Datatable["rows"]) => boolean; diff --git a/src/platform/plugins/shared/data/common/exports/index.d.ts b/src/platform/plugins/shared/data/common/exports/index.d.ts deleted file mode 100644 index ffe232a0433c5..0000000000000 --- a/src/platform/plugins/shared/data/common/exports/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { datatableToCSV, CSV_MIME_TYPE } from './export_csv'; -export { createEscapeValue } from './escape_value'; -export { CSV_FORMULA_CHARS } from './constants'; -export { cellHasFormulas, tableHasFormulas } from './formula_checks'; diff --git a/src/platform/plugins/shared/data/common/index.d.ts b/src/platform/plugins/shared/data/common/index.d.ts deleted file mode 100644 index 5f2444d33da69..0000000000000 --- a/src/platform/plugins/shared/data/common/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export type { RefreshInterval } from '@kbn/data-service-server'; -export { DEFAULT_QUERY_LANGUAGE, KIBANA_USER_QUERY_LANGUAGE_KEY, KQL_TELEMETRY_ROUTE_LATEST_VERSION, SAVED_QUERY_BASE_URL, SCRIPT_LANGUAGES_ROUTE_LATEST_VERSION, UI_SETTINGS, } from './constants'; -export type { RawValue } from './serializable_field'; -export { SerializableField } from './serializable_field'; -export type { SerializedField, SerializedValue } from './serialize_utils'; -export { SerializableType, deserializeField, serializeField } from './serialize_utils'; -export type { ValueSuggestionsMethod } from './constants'; -export { DatatableUtilitiesService } from './datatable_utilities'; -export { getEsQueryConfig } from './es_query'; -export { KbnFieldType } from './kbn_field_types'; -export { calculateBounds, getAbsoluteTimeRange, getRelativeTime, getTime, isQuery, isTimeRange, textBasedQueryStateToAstWithValidation, textBasedQueryStateToExpressionAst, } from './query'; -export type { QueryState } from './query'; -export type { AggConfigSerialized, AggConfigOptions, IAggConfig, AggConfigsOptions, CreateAggConfigParams, GenericBucket, IAggConfigs, AggGroupName, AggTypeConfig, IAggType, AggTypesDependencies, AggTypesRegistrySetup, AggTypesRegistryStart, AggsCommonSetupDependencies, AggsCommonStartDependencies, IBucketAggConfig, BucketAggParam, CalculateBoundsFn, IBucketDateHistogramAggConfig, AggParamsDateHistogram, AggParamsDateRange, AggParamsFilter, FiltersBucketAggDependencies, AggParamsFilters, AggParamsGeoTile, AutoBounds, HistogramBucketAggDependencies, IBucketHistogramAggConfig, AggParamsHistogram, AggParamsIpPrefix, AggParamsIpRange, CidrMaskIpRangeAggKey, RangeIpRangeAggKey, IpRangeKey, RangeBucketAggDependencies, AggParamsRange, AggParamsSignificantTerms, AggParamsSignificantText, CommonAggParamsTerms, AggParamsTermsSerialized, AggParamsTerms, AggParamsMultiTermsSerialized, AggParamsMultiTerms, AggParamsRareTerms, AggParamsSampler, AggParamsDiversifiedSampler, AggParamsTimeSeries, AggParamsAvg, AggParamsBucketAvgSerialized, AggParamsBucketAvg, AggParamsBucketMaxSerialized, AggParamsBucketMax, AggParamsBucketMinSerialized, AggParamsBucketMin, AggParamsBucketSumSerialized, AggParamsBucketSum, AggParamsFilteredMetricSerialized, AggParamsFilteredMetric, FiltersMetricAggDependencies, AggParamsCardinality, AggParamsValueCount, AggParamsCount, CommonAggParamsCumulativeSum, AggParamsCumulativeSumSerialized, AggParamsCumulativeSum, CommonAggParamsDerivative, AggParamsDerivativeSerialized, AggParamsDerivative, AggParamsGeoBounds, AggParamsGeoCentroid, AggParamsMax, AggParamsMedian, AggParamsSinglePercentile, IMetricAggConfig, MetricAggParam, IMetricAggType, AggParamsMin, CommonAggParamsMovingAvg, AggParamsMovingAvgSerialized, AggParamsMovingAvg, AggParamsPercentileRanks, IPercentileRanksAggConfig, PercentileRanksMetricAggDependencies, AggParamsPercentiles, IPercentileAggConfig, AggParamsRate, AggParamsSinglePercentileRank, CommonAggParamsSerialDiff, AggParamsSerialDiffSerialized, AggParamsSerialDiff, AggParamsStdDeviation, IStdDevAggConfig, AggParamsSum, BaseAggParamsTopHit, AggParamsTopHitSerialized, AggParamsTopHit, BaseAggParamsTopMetrics, AggParamsTopMetricsSerialized, AggParamsTopMetrics, FieldTypes, FilterFieldFn, IFieldParamType, OptionedValueProp, AggParam, AggParamOption, IpPrefixKey, AggsCommonSetup, AggsCommonStart, AggsStart, BaseAggParams, AggExpressionType, AggExpressionFunctionArgs, AggParamsMapping, AggFunctionsMapping, ParsedInterval, REASON_ID_TYPES, Cidr, CidrOutput, ExpressionFunctionCidr, DateRange, DateRangeOutput, ExpressionFunctionDateRange, ExtendedBounds, ExtendedBoundsOutput, ExpressionFunctionExtendedBounds, GeoBoundingBox, GeoBoundingBoxOutput, ExpressionFunctionGeoBoundingBox, GeoPoint, GeoPointOutput, ExpressionFunctionGeoPoint, IpPrefix, IpPrefixOutput, ExpressionFunctionIpPrefix, IpRange, IpRangeOutput, ExpressionFunctionIpRange, ExpressionFunctionKibana, ExpressionFunctionKibanaContext, ExpressionFunctionKql, ExpressionFunctionLucene, NumericalRange, NumericalRangeOutput, ExpressionFunctionNumericalRange, QueryFilter, QueryFilterOutput, ExpressionFunctionQueryFilter, ExpressionValueSearchContext, KibanaQueryOutput, KibanaFilter, KibanaField, KIBANA_CONTEXT_NAME, KibanaContext, EsaggsExpressionFunctionDefinition, EsaggsStartDependencies, RequestHandlerParams, KibanaRange, ExpressionFunctionRange, ExpressionFunctionField, ExpressionFunctionPhraseFilter, ExpressionFunctionExistsFilter, ExpressionFunctionRangeFilter, ExpressionFunctionRemoveFilter, ExpressionFunctionSelectFilter, ExpressionFunctionKibanaFilter, KibanaTimerangeOutput, ExpressionFunctionKibanaTimerange, EsRawResponse, EsRawResponseExpressionTypeDefinition, EqlRawResponse, SearchTypes, TotalValue, BaseHit, EqlSequence, EqlSearchResponse, EqlRawResponseExpressionTypeDefinition, EsdslExpressionFunctionDefinition, EqlExpressionFunctionDefinition, EsqlExpressionFunctionDefinition, SearchRequest, FetchHandlers, SearchError, SearchSourceDependencies, ISearchSource, ISearchStartSearchSource, SortDirectionFormat, SortDirectionNumeric, EsQuerySortValue, SearchFieldValue, SearchSourceFields, SerializedSearchSourceFields, SearchSourceOptions, IInspectorInfo, SearchSourceSearchOptions, SearchSessionSavedObjectAttributes, SearchSessionRequestInfo, SearchSessionRequestStatus, SearchSessionStatusResponse, SearchSessionStatusesResponse, SearchSessionsFindResponse, EqlRequestParams, EqlSearchStrategyRequest, EqlSearchStrategyResponse, IAsyncSearchOptions, SqlRequestParams, SqlSearchStrategyRequest, SqlSearchStrategyResponse, } from './search'; -export { AggConfig, AggConfigs, AggGroupNames, AggGroupLabels, AggType, getAggTypes, getAggTypesFunctions, AggTypesRegistry, aggsRequiredUiSettings, AggsCommonService, autoInterval, isAutoInterval, intervalOptions, BucketAggType, isBucketAggType, BUCKET_TYPES, aggDateHistogramFnName, aggDateHistogram, isDateHistogramBucketAggConfig, getDateHistogramBucketAgg, aggDateRangeFnName, aggDateRange, getDateRangeBucketAgg, aggFilterFnName, aggFilter, getFilterBucketAgg, aggFiltersFnName, aggFilters, getFiltersBucketAgg, aggGeoTileFnName, aggGeoTile, getGeoTitleBucketAgg, aggHistogramFnName, aggHistogram, getHistogramBucketAgg, aggIpPrefixFnName, aggIpPrefix, getIpPrefixBucketAgg, aggIpRangeFnName, aggIpRange, IP_RANGE_TYPES, getIpRangeBucketAgg, CidrMask, convertDateRangeToString, convertIPRangeToString, boundsDescendingRaw, calcAutoIntervalNear, calcAutoIntervalLessThan, TimeBuckets, isType, isNumberType, isStringType, isStringOrNumberType, migrateIncludeExcludeFormat, aggRangeFnName, aggRange, getRangeBucketAgg, aggSignificantTermsFnName, aggSignificantTerms, getSignificantTermsBucketAgg, aggSignificantTextFnName, aggSignificantText, getSignificantTextBucketAgg, aggTermsFnName, aggTerms, termsAggFilter, getTermsBucketAgg, MultiFieldKey, RangeKey, MULTI_FIELD_KEY_SEPARATOR, aggMultiTermsFnName, aggMultiTerms, getMultiTermsBucketAgg, aggRareTermsFnName, aggRareTerms, getRareTermsBucketAgg, aggSamplerFnName, aggSampler, SAMPLER_AGG_NAME, getSamplerBucketAgg, aggDiversifiedSamplerFnName, aggDiversifiedSampler, DIVERSIFIED_SAMPLER_AGG_NAME, getDiversifiedSamplerBucketAgg, getTimeSeriesBucketAgg, aggTimeSeriesFnName, aggTimeSeries, SHARD_DELAY_AGG_NAME, aggAvgFnName, aggAvg, getAvgMetricAgg, aggBucketAvgFnName, aggBucketAvg, getBucketAvgMetricAgg, aggBucketMaxFnName, aggBucketMax, getBucketMaxMetricAgg, aggBucketMinFnName, aggBucketMin, getBucketMinMetricAgg, aggBucketSumFnName, aggBucketSum, getBucketSumMetricAgg, aggFilteredMetricFnName, aggFilteredMetric, getFilteredMetricAgg, aggCardinalityFnName, aggCardinality, getCardinalityMetricAgg, aggValueCountFnName, aggValueCount, getValueCountMetricAgg, getCountMetricAgg, aggCountFnName, aggCount, aggCumulativeSumFnName, aggCumulativeSum, getCumulativeSumMetricAgg, aggDerivativeFnName, aggDerivative, getDerivativeMetricAgg, aggGeoBoundsFnName, aggGeoBounds, getGeoBoundsMetricAgg, aggGeoCentroidFnName, aggGeoCentroid, getGeoCentroidMetricAgg, parentPipelineType, parentPipelineAggHelper, siblingPipelineType, siblingPipelineAggHelper, aggMaxFnName, aggMax, getMaxMetricAgg, aggMedianFnName, aggMedian, getMedianMetricAgg, aggSinglePercentileFnName, aggSinglePercentile, getSinglePercentileMetricAgg, MetricAggType, isMetricAggType, METRIC_TYPES, aggMinFnName, aggMin, getMinMetricAgg, aggMovingAvgFnName, aggMovingAvg, getMovingAvgMetricAgg, aggPercentileRanksFnName, aggPercentileRanks, getPercentileRanksMetricAgg, aggPercentilesFnName, aggPercentiles, getPercentilesMetricAgg, aggRateFnName, aggRate, getRateMetricAgg, aggSinglePercentileRankFnName, aggSinglePercentileRank, getSinglePercentileRankMetricAgg, aggSerialDiffFnName, aggSerialDiff, getSerialDiffMetricAgg, aggStdDeviationFnName, aggStdDeviation, getStdDeviationMetricAgg, aggSumFnName, aggSum, getSumMetricAgg, aggTopHitFnName, aggTopHit, getTopHitMetricAgg, getTopMetricsMetricAgg, aggTopMetricsFnName, aggTopMetrics, AggParamType, BaseParamType, FieldParamType, JsonParamType, OptionedParamType, StringParamType, getCalculateAutoTimeExpression, dateHistogramInterval, InvalidEsCalendarIntervalError, InvalidEsIntervalFormatError, isValidEsInterval, isValidInterval, splitStringInterval, parseInterval, parseEsInterval, toAbsoluteDates, getAggsFormats, IpAddress, propFilter, inferTimeZone, parseTimeShift, isAbsoluteTimeShift, REASON_IDS, parseAbsoluteTimeShift, validateAbsoluteTimeShift, cidrFunction, cidrToAst, dateRangeFunction, dateRangeToAst, extendedBoundsFunction, extendedBoundsToAst, geoBoundingBoxFunction, geoBoundingBoxToAst, geoPointFunction, geoPointToAst, ipPrefixFunction, ipPrefixToAst, ipRangeFunction, ipRangeToAst, kibana, kqlFunction, luceneFunction, numericalRangeFunction, numericalRangeToAst, queryFilterFunction, queryFilterToAst, queryToAst, aggregateQueryToAst, timerangeToAst, getEsaggsMeta, handleEsaggsRequest, functionWrapper, adaptToExpressionValueFilter, rangeFunction, fieldFunction, phraseFilterFunction, existsFilterFunction, rangeFilterFunction, removeFilterFunction, selectFilterFunction, kibanaFilterFunction, filtersToAst, kibanaTimerangeFunction, esRawResponse, eqlRawResponse, getEsdslFn, getEqlFn, getEsqlFn, createSearchSource, injectReferences, extractReferences, parseSearchSourceJSON, getResponseInspectorStats, getSearchParamsFromRequest, getEsPreference, RequestFailure, searchSourceRequiredUiSettings, SearchSource, SearchSourceService, SortDirection, isSerializedSearchSource, queryToFields, tabifyDocs, flattenHit, tabifyAggResponse, tabifyGetColumns, isAbortResponse, isRunningResponse, getUserTimeZone, strategyToString, SearchSessionStatus, SearchStatus, SEARCH_SESSION_TYPE, SEARCH_SESSIONS_TABLE_ID, pollSearch, ES_SEARCH_STRATEGY, getTotalLoaded, shimHitsTotal, EQL_SEARCH_STRATEGY, ENHANCED_ES_SEARCH_STRATEGY, SQL_SEARCH_STRATEGY, ESQL_SEARCH_STRATEGY, ESQL_ASYNC_SEARCH_STRATEGY, ESQL_TABLE_TYPE, getQueryLanguage, getQueryString, getQueryStringCharCount, getQueryStringLineCount, } from './search'; -export type { TimeRangeBounds, TimeRange, GetConfigFn, SavedQuery, SavedQueryAttributes, SavedQueryTimeFilter, KbnFieldTypeOptions, Query, } from './types'; -export { KBN_FIELD_TYPES, ES_FIELD_TYPES } from './types'; -export { createEscapeValue, tableHasFormulas, datatableToCSV, cellHasFormulas, CSV_FORMULA_CHARS, CSV_MIME_TYPE, } from './exports'; -export type { DataViewAttributes, FieldAttrs, FieldAttrSet, UiSettingsCommon, GetFieldsOptions, IDataViewsApiClient, SavedObject, AggregationRestrictions, TypeMeta, FieldSpecConflictDescriptions, FieldSpec, DataViewFieldMap, DataViewSpec, SourceFilter, IndexPatternExpressionType, IndexPatternLoadStartDependencies, IndexPatternLoadExpressionFunctionDefinition, } from '@kbn/data-views-plugin/common'; -export type { DataViewsContract, DataViewListItem } from '@kbn/data-views-plugin/common'; -export { RUNTIME_FIELD_TYPES, DEFAULT_ASSETS_TO_IGNORE, META_FIELDS, DATA_VIEW_SAVED_OBJECT_TYPE, isFilterable, fieldList, DataViewField, DataViewType, DataViewsService, DataView, DuplicateDataViewError, DataViewSavedObjectConflictError, getIndexPatternLoadMeta, isNestedField, isMultiField, getFieldSubtypeMulti, getFieldSubtypeNested, } from '@kbn/data-views-plugin/common'; diff --git a/src/platform/plugins/shared/data/common/kbn_field_types/index.d.ts b/src/platform/plugins/shared/data/common/kbn_field_types/index.d.ts deleted file mode 100644 index 86056ad9624ec..0000000000000 --- a/src/platform/plugins/shared/data/common/kbn_field_types/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { KbnFieldType } from '@kbn/field-types'; -export { KbnFieldType }; diff --git a/src/platform/plugins/shared/data/common/kbn_field_types/types.d.ts b/src/platform/plugins/shared/data/common/kbn_field_types/types.d.ts deleted file mode 100644 index 22b272326efd9..0000000000000 --- a/src/platform/plugins/shared/data/common/kbn_field_types/types.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { KbnFieldTypeOptions } from '@kbn/field-types'; -import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; -export type { KbnFieldTypeOptions }; -export { ES_FIELD_TYPES, KBN_FIELD_TYPES }; diff --git a/src/platform/plugins/shared/data/common/query/filters/persistable_state.d.ts b/src/platform/plugins/shared/data/common/query/filters/persistable_state.d.ts deleted file mode 100644 index 4bb7dd894f305..0000000000000 --- a/src/platform/plugins/shared/data/common/query/filters/persistable_state.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import type { SavedObjectReference } from '@kbn/core/types'; -import type { MigrateFunctionsObject, VersionedState } from '@kbn/kibana-utils-plugin/common'; -export declare const extract: (filters: Filter[]) => { - state: Filter[]; - references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; -}; -export declare const inject: (filters: Filter[], references: SavedObjectReference[]) => Filter[]; -export declare const telemetry: (filters: Filter[], collector: unknown) => {}; -export declare const migrateToLatest: (filters: VersionedState) => Filter[]; -export declare const getAllMigrations: () => MigrateFunctionsObject; diff --git a/src/platform/plugins/shared/data/common/query/index.d.ts b/src/platform/plugins/shared/data/common/query/index.d.ts deleted file mode 100644 index 731c2f9be1c29..0000000000000 --- a/src/platform/plugins/shared/data/common/query/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './timefilter'; -export type * from './types'; -export * from './is_query'; -export type * from './query_state'; -export { textBasedQueryStateToAstWithValidation } from './text_based_query_state_to_ast_with_validation'; -export { textBasedQueryStateToExpressionAst } from './text_based_query_state_to_ast'; diff --git a/src/platform/plugins/shared/data/common/query/is_query.d.ts b/src/platform/plugins/shared/data/common/query/is_query.d.ts deleted file mode 100644 index 7d5bb97c34af7..0000000000000 --- a/src/platform/plugins/shared/data/common/query/is_query.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Query } from './types'; -export declare const isQuery: (x: unknown) => x is Query; diff --git a/src/platform/plugins/shared/data/common/query/persistable_state.d.ts b/src/platform/plugins/shared/data/common/query/persistable_state.d.ts deleted file mode 100644 index a096ce72aac81..0000000000000 --- a/src/platform/plugins/shared/data/common/query/persistable_state.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { SavedObjectReference } from '@kbn/core/types'; -import type { MigrateFunctionsObject, VersionedState } from '@kbn/kibana-utils-plugin/common'; -import type { QueryState } from './query_state'; -export declare const extract: (queryState: QueryState) => { - state: { - filters: import("@kbn/es-query").Filter[]; - time?: import("./types").TimeRange; - refreshInterval?: import("@kbn/data-service-server").RefreshInterval; - query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; - }; - references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; -}; -export declare const inject: (queryState: QueryState, references: SavedObjectReference[]) => { - filters: import("@kbn/es-query").Filter[]; - time?: import("./types").TimeRange; - refreshInterval?: import("@kbn/data-service-server").RefreshInterval; - query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; -}; -export declare const telemetry: (queryState: QueryState, collector: unknown) => {}; -export declare const migrateToLatest: ({ state, version }: VersionedState) => { - filters: import("@kbn/es-query").Filter[]; - time?: import("./types").TimeRange; - refreshInterval?: import("@kbn/data-service-server").RefreshInterval; - query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; -}; -export declare const getAllMigrations: () => MigrateFunctionsObject; diff --git a/src/platform/plugins/shared/data/common/query/query_state.d.ts b/src/platform/plugins/shared/data/common/query/query_state.d.ts deleted file mode 100644 index de9c1a20b70ea..0000000000000 --- a/src/platform/plugins/shared/data/common/query/query_state.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import type { RefreshInterval } from '@kbn/data-service-server'; -import type { TimeRange } from './timefilter/types'; -import type { Query, AggregateQuery } from './types'; -/** - * All query state service state - * - * @remark - * `type` instead of `interface` to make it compatible with PersistableState utils - * - */ -export type QueryState = { - time?: TimeRange; - refreshInterval?: RefreshInterval; - filters?: Filter[]; - query?: Query | AggregateQuery; -}; diff --git a/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast.d.ts b/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast.d.ts deleted file mode 100644 index 13c622745e3ac..0000000000000 --- a/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Query } from '@kbn/es-query'; -import type { QueryState } from '..'; -interface Args extends QueryState { - timeFieldName?: string; - inputQuery?: Query; - titleForInspector?: string; - descriptionForInspector?: string; - ignoreGlobalFilters?: boolean; -} -/** - * Converts QueryState to expression AST - * @param filters array of kibana filters - * @param query kibana query or aggregate query - * @param inputQuery - * @param time kibana time range - * @param dataView - * @param titleForInspector - * @param descriptionForInspector - */ -export declare function textBasedQueryStateToExpressionAst({ filters, query, inputQuery, time, timeFieldName, titleForInspector, descriptionForInspector, ignoreGlobalFilters, }: Args): import("@kbn/expressions-plugin/common").ExpressionAstExpression; -export {}; diff --git a/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast_with_validation.d.ts b/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast_with_validation.d.ts deleted file mode 100644 index 0801d49b60313..0000000000000 --- a/src/platform/plugins/shared/data/common/query/text_based_query_state_to_ast_with_validation.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Query } from '@kbn/es-query'; -import type { QueryState } from '..'; -interface Args extends QueryState { - inputQuery?: Query; - timeFieldName?: string; - titleForInspector?: string; - descriptionForInspector?: string; -} -/** - * Converts QueryState to expression AST - * @param filters array of kibana filters - * @param query kibana query or aggregate query - * @param inputQuery - * @param time kibana time range - * @param timeFieldName - * @param titleForInspector - * @param descriptionForInspector - */ -export declare function textBasedQueryStateToAstWithValidation({ filters, query, inputQuery, time, timeFieldName, titleForInspector, descriptionForInspector, }: Args): Promise; -export {}; diff --git a/src/platform/plugins/shared/data/common/query/timefilter/get_time.d.ts b/src/platform/plugins/shared/data/common/query/timefilter/get_time.d.ts deleted file mode 100644 index dffb8ea2753b5..0000000000000 --- a/src/platform/plugins/shared/data/common/query/timefilter/get_time.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { TimeRange } from '@kbn/es-query'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { TimeRangeBounds } from '../..'; -export interface CalculateBoundsOptions { - forceNow?: Date; -} -export declare function calculateBounds(timeRange: TimeRange, options?: CalculateBoundsOptions): TimeRangeBounds; -export declare function getAbsoluteTimeRange(timeRange: TimeRange, { forceNow }?: { - forceNow?: Date; -}): TimeRange; -export declare function getTime(indexPattern: DataView | undefined, timeRange: TimeRange, options?: { - forceNow?: Date; - fieldName?: string; -}): import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter | undefined; -export declare function getRelativeTime(indexPattern: DataView | undefined, timeRange: TimeRange, options?: { - forceNow?: Date; - fieldName?: string; -}): import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter | undefined; diff --git a/src/platform/plugins/shared/data/common/query/timefilter/index.d.ts b/src/platform/plugins/shared/data/common/query/timefilter/index.d.ts deleted file mode 100644 index 72d2c0aab770b..0000000000000 --- a/src/platform/plugins/shared/data/common/query/timefilter/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './get_time'; -export * from './is_time_range'; diff --git a/src/platform/plugins/shared/data/common/query/timefilter/is_time_range.d.ts b/src/platform/plugins/shared/data/common/query/timefilter/is_time_range.d.ts deleted file mode 100644 index 07a4ec1d2233b..0000000000000 --- a/src/platform/plugins/shared/data/common/query/timefilter/is_time_range.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TimeRange } from './types'; -export declare const isTimeRange: (x: unknown) => x is TimeRange; diff --git a/src/platform/plugins/shared/data/common/query/timefilter/types.d.ts b/src/platform/plugins/shared/data/common/query/timefilter/types.d.ts deleted file mode 100644 index 978b085ef628d..0000000000000 --- a/src/platform/plugins/shared/data/common/query/timefilter/types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Moment } from 'moment'; -export type TimeRange = { - from: string; - to: string; - mode?: 'absolute' | 'relative'; -}; -export interface TimeRangeBounds { - min: Moment | undefined; - max: Moment | undefined; -} diff --git a/src/platform/plugins/shared/data/common/query/types.d.ts b/src/platform/plugins/shared/data/common/query/types.d.ts deleted file mode 100644 index 301e53f6ea0cd..0000000000000 --- a/src/platform/plugins/shared/data/common/query/types.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Query, Filter } from '@kbn/es-query'; -import type { RefreshInterval } from '@kbn/data-service-server'; -import type { TimeRange } from './timefilter/types'; -export type { TimeRange, TimeRangeBounds } from './timefilter/types'; -export type { Query, AggregateQuery } from '@kbn/es-query'; -export type { RefreshInterval } from '@kbn/data-service-server'; -export type SavedQueryTimeFilter = TimeRange & { - refreshInterval: RefreshInterval; -}; -export interface SavedQuery { - id: string; - attributes: SavedQueryAttributes; - namespaces: string[]; -} -export interface SavedQueryAttributes { - title: string; - description: string; - query: Query; - filters?: Filter[]; - timefilter?: SavedQueryTimeFilter; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_config.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_config.d.ts deleted file mode 100644 index e119c241dffc2..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/agg_config.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -import moment from 'moment'; -import type { SerializableRecord } from '@kbn/utility-types'; -import type { Assign, Ensure } from '@kbn/utility-types'; -import type { ExpressionAstExpression } from '@kbn/expressions-plugin/common'; -import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; -import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; -import type { ISearchOptions } from '@kbn/search-types'; -import type { ISearchSource } from '../../../public'; -import type { IAggType } from './agg_type'; -import type { IAggConfigs } from './agg_configs'; -/** @public **/ -export type AggConfigSerialized = Ensure<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | SerializableRecord; - schema?: string; -}, SerializableRecord>; -export type AggConfigOptions = Assign; -/** - * @name AggConfig - * - * @description This class represents an aggregation, which is displayed in the left-hand nav of - * the Visualize app. - */ -export type IAggConfig = AggConfig; -export declare class AggConfig { - /** - * Ensure that all of the objects in the list have ids, the objects - * and list are modified by reference. - * - * @param {array[object]} list - a list of objects, objects can be anything really - * @return {array} - the list that was passed in - */ - static ensureIds(list: any[]): any[]; - /** - * Calculate the next id based on the ids in this list - * - * @return {array} list - a list of objects with id properties - */ - static nextId(list: IAggConfig[]): number; - aggConfigs: IAggConfigs; - id: string; - enabled: boolean; - params: any; - parent?: IAggConfigs; - brandNew?: boolean; - schema?: string; - private __type; - private __typeDecorations; - private subAggs; - constructor(aggConfigs: IAggConfigs, opts: AggConfigOptions); - /** - * Write the current values to this.params, filling in the defaults as we go - * - * @param {object} [from] - optional object to read values from, - * used when initializing - * @return {undefined} - */ - setParams(from: any): void; - getParam(key: string): any; - hasTimeShift(): boolean; - getTimeShift(): undefined | moment.Duration; - write(aggs?: IAggConfigs): Record; - isFilterable(): boolean; - createFilter(key: string, params?: {}): any; - /** - * Hook for pre-flight logic, see AggType#onSearchRequestStart - * @param {SearchSource} searchSource - * @param {ISearchOptions} options - * @return {Promise} - */ - onSearchRequestStart(searchSource: ISearchSource, options?: ISearchOptions): Promise | Promise; - /** - * Convert this aggConfig to its dsl syntax. - * - * Adds params and adhoc subaggs to a pojo, then returns it - * - * @param {AggConfigs} aggConfigs - the config object to convert - * @return {void|Object} - if the config has a dsl representation, it is - * returned, else undefined is returned - */ - toDsl(aggConfigs?: IAggConfigs): any; - /** - * @returns Returns a serialized representation of an AggConfig. - */ - serialize(): AggConfigSerialized; - /** - * @deprecated Use serialize() instead. - * @removeBy 8.1 - */ - toJSON(): AggConfigSerialized; - /** - * Returns a serialized field format for the field used in this agg. - * This can be passed to fieldFormats.deserialize to get the field - * format instance. - * - * @public - */ - toSerializedFieldFormat(): SerializedFieldFormat; - /** - * @returns Returns an ExpressionAst representing the this agg type. - */ - toExpressionAst(): ExpressionAstExpression | undefined; - getAggParams(): import("./param_types/agg").AggParamType[]; - getRequestAggs(): AggConfig[]; - getResponseAggs(): AggConfig[]; - getValue(bucket: any): any; - getResponseId(): string; - getKey(bucket: any, key?: string): any; - getFieldDisplayName(): any; - getField(): any; - /** - * Returns the bucket path containing the main value the agg will produce - * (e.g. for sum of bytes it will point to the sum, for median it will point - * to the 50 percentile in the percentile multi value bucket) - */ - getValueBucketPath(): string; - makeLabel(percentageMode?: boolean): any; - getIndexPattern(): import("../..").DataView; - getTimeRange(): import("@kbn/es-query").TimeRange | undefined; - fieldName(): any; - fieldIsTimeField(): boolean; - get type(): IAggType; - set type(type: IAggType); - setType(type: IAggType): void; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_configs.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_configs.d.ts deleted file mode 100644 index 91403b214bd44..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/agg_configs.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -import moment from 'moment-timezone'; -import type { Assign } from '@kbn/utility-types'; -import type { TimeRange, RangeFilter } from '@kbn/es-query'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { estypes } from '@elastic/elasticsearch'; -import type { ISearchOptions, IEsSearchResponse } from '@kbn/search-types'; -import type { ISearchSource } from '../../../public'; -import type { AggConfigSerialized, IAggConfig } from './agg_config'; -import { AggConfig } from './agg_config'; -import type { IAggType } from './agg_type'; -import type { AggTypesRegistryStart } from './agg_types_registry'; -import type { AggTypesDependencies, GetConfigFn } from '../..'; -export interface AggConfigsOptions { - typesRegistry: AggTypesRegistryStart; - hierarchical?: boolean; - aggExecutionContext?: AggTypesDependencies['aggExecutionContext']; - partialRows?: boolean; - probability?: number; - samplerSeed?: number; -} -export type CreateAggConfigParams = Assign; -export type GenericBucket = estypes.AggregationsBuckets & { - [property: string]: estypes.AggregationsAggregate; -}; -/** - * @name AggConfigs - * - * @description A "data structure"-like class with methods for indexing and - * accessing instances of AggConfig. This should never be instantiated directly - * outside of this plugin. Rather, downstream plugins should do this via - * `createAggConfigs()` - * - * @internal - */ -export type IAggConfigs = AggConfigs; -export declare class AggConfigs { - indexPattern: DataView; - private opts; - private getConfig; - timeRange?: TimeRange; - timeFields?: string[]; - forceNow?: Date; - aggs: IAggConfig[]; - readonly timeZone: string; - constructor(indexPattern: DataView, configStates: CreateAggConfigParams[] | undefined, opts: AggConfigsOptions, getConfig: GetConfigFn); - get hierarchical(): boolean; - get partialRows(): boolean; - get samplerConfig(): { - probability: number; - seed: number | undefined; - }; - isSamplingEnabled(): boolean; - setTimeFields(timeFields: string[] | undefined): void; - setForceNow(now: Date | undefined): void; - setTimeRange(timeRange: TimeRange): void; - /** - * Returns the current time range as moment instance (date math will get resolved using the current "now" value or system time if not set) - * @returns Current time range as resolved date. - */ - getResolvedTimeRange(): import("../..").TimeRangeBounds | undefined; - clone({ enabledOnly, opts, }?: { - enabledOnly?: boolean; - opts?: Partial; - }): AggConfigs; - createAggConfig: (params: CreateAggConfigParams, { addToAggConfigs }?: { - addToAggConfigs?: boolean | undefined; - }) => T; - /** - * Data-by-data comparison of this Aggregation - * Ignores the non-array indexes - * @param aggConfigs an AggConfigs instance - */ - jsonDataEquals(aggConfigs: AggConfig[]): boolean; - toDsl(): Record; - getAll(): AggConfig[]; - byIndex(index: number): AggConfig; - byId(id: string): AggConfig | undefined; - byName(name: string): AggConfig[]; - byType(type: string): AggConfig[]; - byTypeName(type: string): AggConfig[]; - bySchemaName(schema: string): AggConfig[]; - getRequestAggs(): AggConfig[]; - getTimeShifts(): Record; - getTimeShiftInterval(): moment.Duration | undefined; - hasTimeShifts(): boolean; - getSearchSourceTimeFilter(forceNow?: Date): RangeFilter[] | { - meta: { - index: string | undefined; - params: {}; - alias: string; - disabled: boolean; - negate: boolean; - }; - query: { - bool: { - should: { - bool: { - filter: { - range: { - [x: string]: { - format: string; - gte: string; - lte: string; - }; - }; - }[]; - }; - }[]; - minimum_should_match: number; - }; - }; - }[]; - postFlightTransform(response: IEsSearchResponse): IEsSearchResponse; - getRequestAggById(id: string): AggConfig | undefined; - /** - * Gets the AggConfigs (and possibly ResponseAggConfigs) that - * represent the values that will be produced when all aggs - * are run. - * - * With multi-value metric aggs it is possible for a single agg - * request to result in multiple agg values, which is why the length - * of a vis' responseValuesAggs may be different than the vis' aggs - * - * @return {array[AggConfig]} - */ - getResponseAggs(): AggConfig[]; - /** - * Find a response agg by it's id. This may be an agg in the aggConfigs, or one - * created specifically for a response value - * - * @param {string} id - the id of the agg to find - * @return {AggConfig} - */ - getResponseAggById(id: string): AggConfig | undefined; - onSearchRequestStart(searchSource: ISearchSource, options?: ISearchOptions): Promise<(void | any[])[]>; - /** - * Generates an expression abstract syntax tree using the `esaggs` expression function. - * @returns The expression AST. - */ - toExpressionAst(): import("@kbn/expressions-plugin/common").ExpressionAstExpression; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_groups.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_groups.d.ts deleted file mode 100644 index 16d4b5f55a111..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/agg_groups.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { $Values } from '@kbn/utility-types'; -export declare const AggGroupNames: Readonly<{ - Buckets: "buckets"; - Metrics: "metrics"; - None: "none"; -}>; -export type AggGroupName = $Values; -export declare const AggGroupLabels: { - buckets: string; - metrics: string; - none: string; -}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_params.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_params.d.ts deleted file mode 100644 index 5a541a6762fb2..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/agg_params.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { AggParamType } from './param_types/agg'; -import { BaseParamType } from './param_types/base'; -import type { AggConfig } from './agg_config'; -import type { IAggConfigs } from './agg_configs'; -export type AggParam = BaseParamType; -export interface AggParamOption { - val: string; - display: string; - enabled?(agg: AggConfig): boolean; -} -export declare const initParams: (params: TAggParam[]) => TAggParam[]; -/** - * Reads an aggConfigs - * - * @method write - * @param {AggConfig} aggConfig - * the AggConfig object who's type owns these aggParams and contains the param values for our param defs - * @param {object} [locals] - * an array of locals that will be available to the write function (can be used to enhance - * the quality of things like date_histogram's "auto" interval) - * @return {object} output - * output of the write calls, reduced into a single object. A `params: {}` property is exposed on the - * output object which is used to create the agg dsl for the search request. All other properties - * are dependent on the AggParam#write methods which should be studied for each AggType. - */ -export declare const writeParams: = AggParamType>(params: Array> | undefined, aggConfig: TAggConfig, aggs?: IAggConfigs, locals?: Record) => Record; diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_type.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_type.d.ts deleted file mode 100644 index bd7fc4065de64..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/agg_type.d.ts +++ /dev/null @@ -1,210 +0,0 @@ -import type { DatatableColumnType } from '@kbn/expressions-plugin/common'; -import type { RequestAdapter } from '@kbn/inspector-plugin/common'; -import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; -import type { estypes } from '@elastic/elasticsearch'; -import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; -import type { ISearchSource } from '../../../public'; -import type { AggConfig } from './agg_config'; -import type { IAggConfigs } from './agg_configs'; -import type { AggParamType } from './param_types/agg'; -type PostFlightRequestFn = (resp: estypes.SearchResponse, aggConfigs: IAggConfigs, aggConfig: TAggConfig, searchSource: ISearchSource, inspectorRequestAdapter?: RequestAdapter, abortSignal?: AbortSignal, searchSessionId?: string, disableWarningToasts?: boolean) => Promise>; -export interface AggTypeConfig = AggParamType> { - name: string; - title: string; - createFilter?: (aggConfig: TAggConfig, key: any, params?: any) => any; - type?: string; - dslName?: string; - expressionName: string; - makeLabel?: ((aggConfig: TAggConfig) => string) | (() => string); - ordered?: any; - hasNoDsl?: boolean; - hasNoDslParams?: boolean; - params?: Array>; - getValueType?: (aggConfig: TAggConfig) => DatatableColumnType; - getRequestAggs?: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); - getResponseAggs?: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); - customLabels?: boolean; - json?: boolean; - decorateAggConfig?: () => any; - postFlightRequest?: PostFlightRequestFn; - hasPrecisionError?: (aggBucket: Record) => boolean; - getSerializedFormat?: (agg: TAggConfig) => SerializedFieldFormat; - getValue?: (agg: TAggConfig, bucket: any) => any; - getKey?: (bucket: any, key: any, agg: TAggConfig) => any; - getValueBucketPath?: (agg: TAggConfig) => string; - getResponseId?: (agg: TAggConfig) => string; -} -export type IAggType = AggType; -export declare class AggType = AggParamType> { - /** - * the unique, unchanging, name that we have assigned this aggType - * - * @property name - * @type {string} - */ - name: string; - type: string; - subtype?: string; - /** - * the name of the elasticsearch aggregation that this aggType represents. Usually just this.name - * - * @property name - * @type {string} - */ - dslName: string; - /** - * the name of the expression function that this aggType represents. - * - * @property name - * @type {string} - */ - expressionName: string; - /** - * the user friendly name that will be shown in the ui for this aggType - * - * @property title - * @type {string} - */ - title: string; - /** - * The type the values produced by this agg will have in the final data table. - * If not specified, the type of the field is used. - */ - getValueType?: (aggConfig: TAggConfig) => DatatableColumnType; - /** - * a function that will be called when this aggType is assigned to - * an aggConfig, and that aggConfig is being rendered (in a form, chart, etc.). - * - * @method makeLabel - * @param {AggConfig} aggConfig - an agg config of this type - * @returns {string} - label that can be used in the ui to describe the aggConfig - */ - makeLabel: ((aggConfig: TAggConfig) => string) | (() => string); - /** - * Describes if this aggType creates data that is ordered, and if that ordered data - * is some sort of time series. - * - * If the aggType does not create ordered data, set this to something "falsy". - * - * If this does create orderedData, then the value should be an object. - * - * If the orderdata is some sort of time series, `this.ordered` should be an object - * with the property `date: true` - * - * @property ordered - * @type {object|undefined} - */ - ordered: any; - /** - * Flag that prevents this aggregation from being included in the dsl. This is only - * used by the count aggregation (currently) since it doesn't really exist and it's output - * is available on every bucket. - * - * @type {Boolean} - */ - hasNoDsl: boolean; - /** - * Flag that prevents params from this aggregation from being included in the dsl. Sibling and parent aggs are still written. - * - * @type {Boolean} - */ - hasNoDslParams: boolean; - /** - * The method to create a filter representation of the bucket - * @param {object} aggConfig The instance of the aggConfig - * @param {mixed} key The key for the bucket - * @returns {object} The filter - */ - createFilter: ((aggConfig: TAggConfig, key: any, params?: any) => any) | undefined; - /** - * An instance of {{#crossLink "AggParams"}}{{/crossLink}}. - * - * @property params - * @type {AggParams} - */ - params: TParam[]; - /** - * Designed for multi-value metric aggs, this method can return a - * set of AggConfigs that should replace this aggConfig in requests - * - * @method getRequestAggs - * @returns {array[AggConfig]} - an array of aggConfig objects - * that should replace this one, - * or undefined - */ - getRequestAggs: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); - /** - * Designed for multi-value metric aggs, this method can return a - * set of AggConfigs that should replace this aggConfig in result sets - * that walk the AggConfig set. - * - * @method getResponseAggs - * @returns {array[AggConfig]|undefined} - an array of aggConfig objects - * that should replace this one, - * or undefined - */ - getResponseAggs: ((aggConfig: TAggConfig) => TAggConfig[]) | (() => TAggConfig[] | void); - /** - * A function that will be called each time an aggConfig of this type - * is created, giving the agg type a chance to modify the agg config - */ - decorateAggConfig: () => any; - hasPrecisionError?: (aggBucket: Record) => boolean; - /** - * A function that needs to be called after the main request has been made - * and should return an updated response - * @param aggConfigs - agg config array used to produce main request - * @param aggConfig - AggConfig that requested the post flight request - * @param searchSourceAggs - SearchSource aggregation configuration - * @param resp - Response to the main request - * @param nestedSearchSource - the new SearchSource that will be used to make post flight request - * @param abortSignal - `AbortSignal` to abort the request - * @param searchSessionId - searchSessionId to be used for grouping requests into a single search session - * @return {Promise} - */ - postFlightRequest: PostFlightRequestFn; - /** - * Get the serialized format for the values produced by this agg type, - * overridden by several metrics that always output a simple number. - * You can pass this output to fieldFormatters.deserialize to get - * the formatter instance. - * - * @param {agg} agg - the agg to pick a format for - * @return {SerializedFieldFormat} - */ - getSerializedFormat: (agg: TAggConfig) => SerializedFieldFormat; - getValue: (agg: TAggConfig, bucket: any) => any; - getKey?: (bucket: any, key: any, agg: TAggConfig) => any; - paramByName: (name: string) => TParam | undefined; - getValueBucketPath: (agg: TAggConfig) => string; - splitForTimeShift(agg: TAggConfig, aggs: IAggConfigs): boolean; - /** - * Returns the key of the object containing the results of the agg in the Elasticsearch response object. - * In most cases this returns the `agg.id` property, but in some cases the response object is structured differently. - * In the following example of a terms agg, `getResponseId` returns "myAgg": - * ``` - * { - * "aggregations": { - * "myAgg": { - * "doc_count_error_upper_bound": 0, - * "sum_other_doc_count": 0, - * "buckets": [ - * ... - * ``` - * - * @param {agg} agg - the agg to return the id in the ES reponse object for - * @return {string} - */ - getResponseId: (agg: TAggConfig) => string; - /** - * Generic AggType Constructor - * - * Used to create the values exposed by the agg_types module. - * - * @class AggType - * @internal - * @param {object} config - used to set the properties of the AggType - */ - constructor(config: AggTypeConfig); -} -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_types.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_types.d.ts deleted file mode 100644 index 9104148b2098f..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/agg_types.d.ts +++ /dev/null @@ -1,408 +0,0 @@ -import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; -import * as buckets from './buckets'; -import type { CalculateBoundsFn } from './buckets'; -import * as metrics from './metrics'; -export interface AggTypesDependencies { - calculateBounds: CalculateBoundsFn; - getConfig: (key: string) => T; - getFieldFormatsStart: () => Pick; - aggExecutionContext?: { - shouldDetectTimeZone?: boolean; - }; -} -/** @internal */ -export declare const getAggTypes: () => { - metrics: ({ - name: metrics.METRIC_TYPES; - fn: () => metrics.MetricAggType; - } | { - name: metrics.METRIC_TYPES; - fn: ({ getFieldFormatsStart, }: metrics.PercentileRanksMetricAggDependencies) => metrics.MetricAggType; - } | { - name: metrics.METRIC_TYPES; - fn: () => metrics.MetricAggType; - } | { - name: metrics.METRIC_TYPES; - fn: ({ getConfig }: metrics.FiltersMetricAggDependencies) => metrics.MetricAggType; - })[]; - buckets: ({ - name: buckets.BUCKET_TYPES; - fn: ({ calculateBounds, aggExecutionContext, getConfig, }: AggTypesDependencies) => buckets.BucketAggType; - } | { - name: buckets.BUCKET_TYPES; - fn: ({ getConfig, getFieldFormatsStart, }: buckets.HistogramBucketAggDependencies) => buckets.BucketAggType; - } | { - name: buckets.BUCKET_TYPES; - fn: ({ aggExecutionContext, getConfig }: AggTypesDependencies) => buckets.BucketAggType; - } | { - name: buckets.BUCKET_TYPES; - fn: () => buckets.BucketAggType; - })[]; -}; -/** @internal */ -export declare const getAggTypesFunctions: () => ((() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggDateHistogram", any, { - id?: string | undefined; - timeRange?: import("..").KibanaTimerangeOutput | undefined; - time_zone?: string | undefined; - customLabel?: string | undefined; - field?: (import("@kbn/es-query").DataViewFieldBase | string) | undefined; - enabled?: boolean | undefined; - format?: string | undefined; - extended_bounds?: import("..").ExtendedBoundsOutput | undefined; - schema?: string | undefined; - interval?: string | undefined; - scaleMetricValues?: boolean | undefined; - json?: string | undefined; - timeShift?: string | undefined; - useNormalizedEsInterval?: boolean | undefined; - used_interval?: string | undefined; - used_time_zone?: string | undefined; - drop_partials?: boolean | undefined; - min_doc_count?: number | undefined; - extendToTimeRange?: boolean | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggTimeSeries", any, import("./types").BaseAggParams & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSampler", any, buckets.AggParamsSampler & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggDiversifiedSampler", any, buckets.AggParamsDiversifiedSampler & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSignificantText", any, buckets.AggParamsSignificantText & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggTopMetrics", any, metrics.AggParamsTopMetricsSerialized & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggFilter", any, { - filter?: import("..").KibanaQueryOutput | undefined; - geo_bounding_box?: import("..").GeoBoundingBoxOutput | undefined; - id?: string | undefined; - customLabel?: string | undefined; - timeWindow?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggFilters", any, { - id?: string | undefined; - filters?: import("..").QueryFilterOutput[] | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSignificantTerms", any, buckets.AggParamsSignificantTerms & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggIpPrefix", any, { - id?: string | undefined; - customLabel?: string | undefined; - field: string; - enabled?: boolean | undefined; - ipPrefix?: import("..").IpPrefixOutput | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggIpRange", any, { - id?: string | undefined; - customLabel?: string | undefined; - field: string; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - ranges?: Array | undefined; - ipRangeType?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggDateRange", any, { - id?: string | undefined; - time_zone?: string | undefined; - customLabel?: string | undefined; - field?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - ranges?: import("..").DateRangeOutput[] | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggRange", any, { - id?: string | undefined; - customLabel?: string | undefined; - field: string; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - ranges?: import("..").NumericalRangeOutput[] | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggGeoTile", any, buckets.AggParamsGeoTile & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggHistogram", any, { - id?: string | undefined; - customLabel?: string | undefined; - field: string; - enabled?: boolean | undefined; - extended_bounds?: import("..").ExtendedBoundsOutput | undefined; - schema?: string | undefined; - interval: number | string; - json?: string | undefined; - timeShift?: string | undefined; - used_interval?: number | string | undefined; - min_doc_count?: boolean | undefined; - maxBars?: number | undefined; - intervalBase?: number | undefined; - has_extended_bounds?: boolean | undefined; - autoExtendBounds?: boolean | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggTerms", any, { - order?: "asc" | "desc" | undefined; - size?: number | undefined; - id?: string | undefined; - customLabel?: string | undefined; - field: string; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - otherBucketLabel?: string | undefined; - missingBucketLabel?: string | undefined; - include?: string[] | string | number[] | undefined; - exclude?: string[] | string | number[] | undefined; - timeShift?: string | undefined; - shardSize?: number | undefined; - orderAgg?: import("./types").AggExpressionType | undefined; - orderBy: string; - missingBucket?: boolean | undefined; - otherBucket?: boolean | undefined; - includeIsRegex?: boolean | undefined; - excludeIsRegex?: boolean | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMultiTerms", any, { - fields: string[]; - order?: "asc" | "desc" | undefined; - size?: number | undefined; - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - otherBucketLabel?: string | undefined; - timeShift?: string | undefined; - shardSize?: number | undefined; - orderAgg?: import("./types").AggExpressionType | undefined; - orderBy: string; - otherBucket?: boolean | undefined; - separatorLabel?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggRareTerms", any, buckets.AggParamsRareTerms & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggAvg", any, metrics.AggParamsAvg & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggBucketAvg", any, { - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customBucket?: import("./types").AggExpressionType | undefined; - customMetric?: import("./types").AggExpressionType | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggBucketMax", any, { - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customBucket?: import("./types").AggExpressionType | undefined; - customMetric?: import("./types").AggExpressionType | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggBucketMin", any, { - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customBucket?: import("./types").AggExpressionType | undefined; - customMetric?: import("./types").AggExpressionType | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggBucketSum", any, { - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customBucket?: import("./types").AggExpressionType | undefined; - customMetric?: import("./types").AggExpressionType | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggFilteredMetric", any, { - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customBucket?: import("./types").AggExpressionType | undefined; - customMetric?: import("./types").AggExpressionType | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggCardinality", any, metrics.AggParamsCardinality & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggValueCount", any, metrics.AggParamsValueCount & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggCount", any, metrics.AggParamsCount & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggCumulativeSum", any, { - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customMetric?: import("./types").AggExpressionType | undefined; - metricAgg?: string | undefined; - buckets_path?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggDerivative", any, { - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customMetric?: import("./types").AggExpressionType | undefined; - metricAgg?: string | undefined; - buckets_path?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggGeoBounds", any, metrics.AggParamsGeoBounds & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggGeoCentroid", any, metrics.AggParamsGeoCentroid & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMax", any, metrics.AggParamsMax & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMedian", any, metrics.AggParamsMedian & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSinglePercentile", any, metrics.AggParamsSinglePercentile & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSinglePercentileRank", any, metrics.AggParamsSinglePercentileRank & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMin", any, metrics.AggParamsMin & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggMovingAvg", any, { - script?: string | undefined; - id?: string | undefined; - customLabel?: string | undefined; - window?: number | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customMetric?: import("./types").AggExpressionType | undefined; - metricAgg?: string | undefined; - buckets_path?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggPercentileRanks", any, metrics.AggParamsPercentileRanks & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggPercentiles", any, metrics.AggParamsPercentiles & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSerialDiff", any, { - id?: string | undefined; - customLabel?: string | undefined; - enabled?: boolean | undefined; - schema?: string | undefined; - json?: string | undefined; - timeShift?: string | undefined; - customMetric?: import("./types").AggExpressionType | undefined; - metricAgg?: string | undefined; - buckets_path?: string | undefined; -}, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggStdDeviation", any, metrics.AggParamsStdDeviation & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggSum", any, metrics.AggParamsSum & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggTopHit", any, metrics.AggParamsTopHitSerialized & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>) | (() => import("../../../../expressions/common").ExpressionFunctionDefinition<"aggRate", any, metrics.AggParamsRate & Pick<{ - type: string; - enabled?: boolean; - id?: string; - params?: {} | import("@kbn/utility-types").SerializableRecord; - schema?: string; -}, "id" | "enabled" | "schema">, import("./types").AggExpressionType, import("../../../../expressions/common").ExecutionContext>))[]; diff --git a/src/platform/plugins/shared/data/common/search/aggs/agg_types_registry.d.ts b/src/platform/plugins/shared/data/common/search/aggs/agg_types_registry.d.ts deleted file mode 100644 index 4118e7bd80c54..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/agg_types_registry.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { BucketAggType } from './buckets/bucket_agg_type'; -import type { MetricAggType } from './metrics/metric_agg_type'; -import type { AggTypesDependencies } from './agg_types'; -export type AggTypesRegistrySetup = ReturnType; -export type AggTypesRegistryStart = ReturnType; -export declare class AggTypesRegistry { - private readonly bucketAggs; - private readonly metricAggs; - private readonly legacyAggs; - setup: () => { - registerBucket: BucketAggType>(name: N, type: T) => void; - registerMetric: MetricAggType>(name: N, type: T) => void; - registerLegacy: BucketAggType | MetricAggType>(name: N, type: T) => void; - }; - start: (aggTypesDependencies: AggTypesDependencies) => { - get: (name: string) => BucketAggType | MetricAggType | undefined; - getAll: () => { - buckets: BucketAggType[]; - metrics: MetricAggType[]; - }; - }; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/aggs_service.d.ts b/src/platform/plugins/shared/data/common/search/aggs/aggs_service.d.ts deleted file mode 100644 index cb1a5e56edde5..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/aggs_service.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { ExpressionsServiceSetup } from '@kbn/expressions-plugin/common'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; -import type { AggTypesDependencies } from '../..'; -import type { GetConfigFn } from '../../types'; -import type { AggsCommonSetup, AggsCommonStart } from './types'; -/** @internal */ -export declare const aggsRequiredUiSettings: string[]; -export interface AggsCommonSetupDependencies { - registerFunction: ExpressionsServiceSetup['registerFunction']; -} -export interface AggsCommonStartDependencies { - getIndexPattern(id: string): Promise; - getConfig: GetConfigFn; - fieldFormats: FieldFormatsStartCommon; - calculateBounds: AggTypesDependencies['calculateBounds']; -} -/** - * The aggs service provides a means of modeling and manipulating the various - * Elasticsearch aggregations supported by Kibana, providing the ability to - * output the correct DSL when you are ready to send your request to ES. - */ -export declare class AggsCommonService { - private aggExecutionContext?; - private readonly aggTypesRegistry; - constructor(aggExecutionContext?: AggTypesDependencies['aggExecutionContext']); - setup({ registerFunction }: AggsCommonSetupDependencies): AggsCommonSetup; - start({ getConfig, fieldFormats, calculateBounds, }: AggsCommonStartDependencies): AggsCommonStart; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/_interval_options.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/_interval_options.d.ts deleted file mode 100644 index 2ff221f069ea0..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/_interval_options.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { IBucketAggConfig } from './bucket_agg_type'; -export declare const autoInterval = "auto"; -export declare const isAutoInterval: (value: unknown) => value is "auto"; -export declare const intervalOptions: ({ - display: string; - val: string; - enabled(agg: IBucketAggConfig): boolean; -} | { - display: string; - val: string; - enabled?: undefined; -})[]; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_order_helper.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_order_helper.d.ts deleted file mode 100644 index 1e6a5745c1da8..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_order_helper.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IBucketAggConfig, BucketAggParam } from './bucket_agg_type'; -export declare const termsAggFilter: string[]; -export declare const termsOrderAggParamDefinition: Partial>; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_other_bucket_helper.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_other_bucket_helper.d.ts deleted file mode 100644 index 710e0f2c0bcba..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/_terms_other_bucket_helper.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { Filter } from '@kbn/es-query'; -import type { IAggConfigs } from '../agg_configs'; -import type { IAggConfig } from '../agg_config'; -export declare const OTHER_NESTED_BUCKET_SEPARATOR = "\u2570\u2504\u25BA"; -export declare const buildOtherBucketAgg: (aggConfigs: IAggConfigs, aggWithOtherBucket: IAggConfig, response: any) => false | (() => { - sampling: { - aggs: { - 'other-filter': { - aggs: any; - filters: any; - }; - }; - }; - 'other-filter'?: undefined; -} | { - 'other-filter': { - aggs: any; - filters: any; - }; - sampling?: undefined; -}); -export declare const mergeOtherBucketAggResponse: (aggsConfig: IAggConfigs, response: estypes.SearchResponse, otherResponse: any, otherAgg: IAggConfig, requestAgg: Record, otherFilterBuilder: (requestAgg: Record, key: string, otherAgg: IAggConfig) => Filter) => estypes.SearchResponse; -export declare const updateMissingBucket: (response: estypes.SearchResponse, aggConfigs: IAggConfigs, agg: IAggConfig) => estypes.SearchResponse>; -export declare function constructSingleTermOtherFilter(requestAgg: Record, key: string, otherAgg: IAggConfig): import("@kbn/es-query").PhrasesFilter; -export declare function constructMultiTermOtherFilter(requestAgg: Record, key: string): Filter; -export declare const createOtherBucketPostFlightRequest: (otherFilterBuilder: (requestAgg: Record, key: string, otherAgg: IAggConfig) => Filter) => (resp: estypes.SearchResponse, aggConfigs: IAggConfigs, aggConfig: import("../agg_config").AggConfig, searchSource: import("../..").ISearchSource, inspectorRequestAdapter?: import("../../../../../inspector/common").RequestAdapter, abortSignal?: AbortSignal, searchSessionId?: string, disableWarningToasts?: boolean) => Promise>; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_type.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_type.d.ts deleted file mode 100644 index d8300d44926c1..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_type.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type moment from 'moment'; -import type { IAggConfig } from '../agg_config'; -import type { FilterFieldFn, GenericBucket, IAggConfigs } from '../../..'; -import type { AggTypeConfig } from '../agg_type'; -import { AggType } from '../agg_type'; -import type { AggParamType } from '../param_types/agg'; -import type { FieldTypes } from '../param_types/field'; -export interface IBucketAggConfig extends IAggConfig { - type: InstanceType; -} -export interface BucketAggParam extends AggParamType { - scriptable?: boolean; - filterFieldTypes?: FieldTypes; - onlyAggregatable?: boolean; - /** - * Filter available fields by passing filter fn on a {@link DataViewField} - * If used, takes precedence over filterFieldTypes and other filter params - */ - filterField?: FilterFieldFn; -} -interface BucketAggTypeConfig extends AggTypeConfig> { - getKey?: (bucket: any, key: any, agg: IAggConfig) => any; - getShiftedKey?: (agg: TBucketAggConfig, key: string | number, timeShift: moment.Duration) => string | number; - orderBuckets?(agg: TBucketAggConfig, a: GenericBucket, b: GenericBucket): number; - splitForTimeShift?(agg: TBucketAggConfig, aggs: IAggConfigs): boolean; - getTimeShiftInterval?(agg: TBucketAggConfig): undefined | moment.Duration; -} -export declare class BucketAggType extends AggType> { - getKey: (bucket: any, key: any, agg: TBucketAggConfig) => any; - type: string; - getShiftedKey(agg: TBucketAggConfig, key: string | number, timeShift: moment.Duration): string | number; - getTimeShiftInterval(agg: TBucketAggConfig): undefined | moment.Duration; - orderBuckets(agg: TBucketAggConfig, a: GenericBucket, b: GenericBucket): number; - constructor(config: BucketAggTypeConfig); -} -export declare function isBucketAggType(aggConfig: any): aggConfig is BucketAggType; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_types.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_types.d.ts deleted file mode 100644 index c0d77343537f2..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/bucket_agg_types.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export declare enum BUCKET_TYPES { - FILTER = "filter", - FILTERS = "filters", - HISTOGRAM = "histogram", - IP_PREFIX = "ip_prefix", - IP_RANGE = "ip_range", - DATE_RANGE = "date_range", - RANGE = "range", - TERMS = "terms", - MULTI_TERMS = "multi_terms", - RARE_TERMS = "rare_terms", - SIGNIFICANT_TERMS = "significant_terms", - SIGNIFICANT_TEXT = "significant_text", - GEOTILE_GRID = "geotile_grid", - DATE_HISTOGRAM = "date_histogram", - SAMPLER = "sampler", - DIVERSIFIED_SAMPLER = "diversified_sampler", - TIME_SERIES = "time_series" -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_histogram.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_histogram.d.ts deleted file mode 100644 index 667474a2f4b63..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_histogram.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { IBucketDateHistogramAggConfig } from '../date_histogram'; -export declare const createFilterDateHistogram: (agg: IBucketDateHistogramAggConfig, key: string | number) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_range.d.ts deleted file mode 100644 index 9f8bb96b7cbb9..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/date_range.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DateRange } from '../../../expressions'; -import type { IBucketAggConfig } from '../bucket_agg_type'; -export declare const createFilterDateRange: (agg: IBucketAggConfig, { from, to }: DateRange) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/filters.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/filters.d.ts deleted file mode 100644 index dba91f5c1c94c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/filters.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { IBucketAggConfig } from '../bucket_agg_type'; -export declare const createFilterFilters: (aggConfig: IBucketAggConfig, key: string) => { - query: (Record & { - query_string?: { - query: string; - fields?: string[]; - }; - }) | undefined; - meta: { - alias: string | null; - disabled?: boolean; - negate?: boolean; - controlledBy?: string; - group?: string; - index: string; - isMultiIndex?: boolean; - type?: string; - key?: string; - params?: import("@kbn/es-query/src/filters/build_filters").FilterMetaParams; - value?: string | import("@kbn/es-query").RangeFilterParams | import("@kbn/es-query/src/filters/build_filters").PhraseFilterValue[]; - }; -} | undefined; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/histogram.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/histogram.d.ts deleted file mode 100644 index 70b02313fefd1..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/histogram.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AggTypesDependencies } from '../../agg_types'; -import type { IBucketAggConfig } from '../bucket_agg_type'; -/** @internal */ -export declare const createFilterHistogram: (getFieldFormatsStart: AggTypesDependencies["getFieldFormatsStart"]) => (aggConfig: IBucketAggConfig, key: string) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_prefix.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_prefix.d.ts deleted file mode 100644 index c8ec5484606b1..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_prefix.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IBucketAggConfig } from '../bucket_agg_type'; -import type { IpPrefixKey } from '../lib/ip_prefix'; -export declare const createFilterIpPrefix: (aggConfig: IBucketAggConfig, key: IpPrefixKey) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_range.d.ts deleted file mode 100644 index fbe16d6ccbba0..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/ip_range.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IBucketAggConfig } from '../bucket_agg_type'; -import type { IpRangeKey } from '../lib/ip_range'; -export declare const createFilterIpRange: (aggConfig: IBucketAggConfig, key: IpRangeKey) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/multi_terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/multi_terms.d.ts deleted file mode 100644 index 5a1e34708eb86..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/multi_terms.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import type { IBucketAggConfig } from '../bucket_agg_type'; -import type { MultiFieldKey } from '../multi_field_key'; -export declare const createFilterMultiTerms: (aggConfig: IBucketAggConfig, key: MultiFieldKey, params: { - terms: MultiFieldKey[]; -}) => Filter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/range.d.ts deleted file mode 100644 index 6af723fb61b24..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/range.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AggTypesDependencies } from '../../agg_types'; -import type { IBucketAggConfig } from '../bucket_agg_type'; -/** @internal */ -export declare const createFilterRange: (getFieldFormatsStart: AggTypesDependencies["getFieldFormatsStart"]) => (aggConfig: IBucketAggConfig, { label, ...params }: any) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/terms.d.ts deleted file mode 100644 index ff451a56c839d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/create_filter/terms.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import type { IBucketAggConfig } from '../bucket_agg_type'; -export declare const createFilterTerms: (aggConfig: IBucketAggConfig, key: string, params: any) => Filter[] | import("@kbn/es-query").PhraseFilter | import("@kbn/es-query").ExistsFilter | import("@kbn/es-query").ScriptedPhraseFilter; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram.d.ts deleted file mode 100644 index 8e2ea2c981b22..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { DataViewFieldBase, TimeRange } from '@kbn/es-query'; -import type { AggTypesDependencies, TimeRangeBounds } from '../../..'; -import type { ExtendedBounds } from '../../expressions'; -import type { IBucketAggConfig } from './bucket_agg_type'; -import { BucketAggType } from './bucket_agg_type'; -import { TimeBuckets } from './lib/time_buckets'; -import type { BaseAggParams } from '../types'; -/** @internal */ -export type CalculateBoundsFn = (timeRange: TimeRange) => TimeRangeBounds; -export interface IBucketDateHistogramAggConfig extends IBucketAggConfig { - buckets: TimeBuckets; -} -export declare function isDateHistogramBucketAggConfig(agg: any): agg is IBucketDateHistogramAggConfig; -export interface AggParamsDateHistogram extends BaseAggParams { - field?: DataViewFieldBase | string; - timeRange?: TimeRange; - useNormalizedEsInterval?: boolean; - scaleMetricValues?: boolean; - interval?: string; - used_interval?: string; - time_zone?: string; - used_time_zone?: string; - drop_partials?: boolean; - format?: string; - min_doc_count?: number; - extended_bounds?: ExtendedBounds; - extendToTimeRange?: boolean; -} -export declare const getDateHistogramBucketAgg: ({ calculateBounds, aggExecutionContext, getConfig, }: AggTypesDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram_fn.d.ts deleted file mode 100644 index 7b2ada99c8ad8..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_histogram_fn.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { ExtendedBoundsOutput, KibanaTimerangeOutput } from '../../expressions'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggDateHistogramFnName = "aggDateHistogram"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggDateHistogram: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range.d.ts deleted file mode 100644 index 5983a413a3da2..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { DateRange } from '../../expressions'; -import type { IBucketAggConfig } from './bucket_agg_type'; -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -import type { AggTypesDependencies } from '../agg_types'; -export interface AggParamsDateRange extends BaseAggParams { - field?: string; - ranges?: DateRange[]; - time_zone?: string; -} -export declare const getDateRangeBucketAgg: ({ aggExecutionContext, getConfig }: AggTypesDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range_fn.d.ts deleted file mode 100644 index c98395444fec2..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/date_range_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { DateRangeOutput } from '../../expressions'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggDateRangeFnName = "aggDateRange"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggDateRange: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler.d.ts deleted file mode 100644 index e4641be3702eb..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export declare const DIVERSIFIED_SAMPLER_AGG_NAME = "diversified_sampler"; -export interface AggParamsDiversifiedSampler extends BaseAggParams { - /** - * Is used to provide values used for de-duplication - */ - field: string; - /** - * Limits how many top-scoring documents are collected in the sample processed on each shard. - */ - shard_size?: number; - /** - * Limits how many documents are permitted per choice of de-duplicating value - */ - max_docs_per_value?: number; -} -/** - * Like the sampler aggregation this is a filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents. - * The diversified_sampler aggregation adds the ability to limit the number of matches that share a common value. - */ -export declare const getDiversifiedSamplerBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler_fn.d.ts deleted file mode 100644 index 56b3a3d8a2822..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/diversified_sampler_fn.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionFunctionArgs, AggExpressionType, BUCKET_TYPES } from '..'; -export declare const aggDiversifiedSamplerFnName = "aggDiversifiedSampler"; -type Input = any; -type Arguments = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggDiversifiedSampler: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/filter.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/filter.d.ts deleted file mode 100644 index 4d443a43a4214..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/filter.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { GeoBoundingBox, QueryFilter } from '../../expressions'; -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -import type { CalculateBoundsFn } from '.'; -export interface AggParamsFilter extends BaseAggParams { - geo_bounding_box?: GeoBoundingBox; - filter?: QueryFilter; - timeWindow?: string; -} -export declare const getFilterBucketAgg: ({ getConfig, calculateBounds, }: { - getConfig: (key: string) => T; - calculateBounds: CalculateBoundsFn; -}) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/filter_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/filter_fn.d.ts deleted file mode 100644 index 7d6cac5c7923c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/filter_fn.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { GeoBoundingBoxOutput, KibanaQueryOutput } from '../../expressions'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggFilterFnName = "aggFilter"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggFilter: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/filters.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/filters.d.ts deleted file mode 100644 index d5e11fb386187..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/filters.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { QueryFilter } from '../../expressions'; -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export interface FiltersBucketAggDependencies { - getConfig: (key: string) => any; -} -export interface AggParamsFilters extends Omit { - filters?: QueryFilter[]; -} -export declare const getFiltersBucketAgg: ({ getConfig }: FiltersBucketAggDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/filters_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/filters_fn.d.ts deleted file mode 100644 index 6f1c041d4c60d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/filters_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { QueryFilterOutput } from '../../expressions'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggFiltersFnName = "aggFilters"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggFilters: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile.d.ts deleted file mode 100644 index 177e5124959f4..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsGeoTile extends BaseAggParams { - field: string; - useGeocentroid?: boolean; - precision?: number; -} -export declare const getGeoTitleBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile_fn.d.ts deleted file mode 100644 index 18e4c3db91807..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/geo_tile_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggGeoTileFnName = "aggGeoTile"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggGeoTile: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram.d.ts deleted file mode 100644 index aa9fdd7eedc2c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { ExtendedBounds } from '../../expressions'; -import type { AggTypesDependencies } from '../agg_types'; -import type { BaseAggParams } from '../types'; -import type { IBucketAggConfig } from './bucket_agg_type'; -import { BucketAggType } from './bucket_agg_type'; -export interface AutoBounds { - min: number; - max: number; -} -export interface HistogramBucketAggDependencies { - getConfig: (key: string) => T; - getFieldFormatsStart: AggTypesDependencies['getFieldFormatsStart']; -} -export interface IBucketHistogramAggConfig extends IBucketAggConfig { - setAutoBounds: (bounds: AutoBounds) => void; - getAutoBounds: () => AutoBounds; -} -export interface AggParamsHistogram extends BaseAggParams { - field: string; - interval: number | string; - used_interval?: number | string; - maxBars?: number; - intervalBase?: number; - min_doc_count?: boolean; - has_extended_bounds?: boolean; - extended_bounds?: ExtendedBounds; - autoExtendBounds?: boolean; -} -export declare const getHistogramBucketAgg: ({ getConfig, getFieldFormatsStart, }: HistogramBucketAggDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram_fn.d.ts deleted file mode 100644 index 05b632cfdf24a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/histogram_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { ExtendedBoundsOutput } from '../../expressions'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggHistogramFnName = "aggHistogram"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggHistogram: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/index.d.ts deleted file mode 100644 index d3af3af222346..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -export * from './_interval_options'; -export * from './bucket_agg_type'; -export * from './bucket_agg_types'; -export * from './date_histogram_fn'; -export * from './date_histogram'; -export * from './date_range_fn'; -export * from './date_range'; -export * from './filter_fn'; -export * from './filter'; -export * from './filters_fn'; -export * from './filters'; -export * from './geo_tile_fn'; -export * from './geo_tile'; -export * from './histogram_fn'; -export * from './histogram'; -export * from './ip_prefix_fn'; -export * from './ip_prefix'; -export * from './ip_range_fn'; -export * from './ip_range'; -export * from './lib/cidr_mask'; -export * from './lib/date_range'; -export * from './lib/ip_range'; -export * from './lib/time_buckets/calc_auto_interval'; -export { TimeBuckets, convertDurationToNormalizedEsInterval } from './lib/time_buckets'; -export * from './migrate_include_exclude_format'; -export * from './range_fn'; -export * from './range'; -export * from './range_key'; -export * from './significant_terms_fn'; -export * from './significant_terms'; -export * from './significant_text_fn'; -export * from './significant_text'; -export * from './terms_fn'; -export * from './terms'; -export { MultiFieldKey, MULTI_FIELD_KEY_SEPARATOR } from './multi_field_key'; -export * from './multi_terms_fn'; -export * from './multi_terms'; -export * from './rare_terms_fn'; -export * from './rare_terms'; -export * from './sampler_fn'; -export * from './sampler'; -export * from './diversified_sampler_fn'; -export * from './diversified_sampler'; -export * from './time_series'; -export * from './time_series_fn'; -export { SHARD_DELAY_AGG_NAME } from './shard_delay'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix.d.ts deleted file mode 100644 index 56dfe9541b99a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IpPrefix } from '../../expressions'; -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsIpPrefix extends BaseAggParams { - field: string; - ipPrefix?: IpPrefix; -} -export declare const getIpPrefixBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix_fn.d.ts deleted file mode 100644 index 20cb8dcf14bf7..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_prefix_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { IpPrefixOutput } from '../../expressions'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggIpPrefixFnName = "aggIpPrefix"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggIpPrefix: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range.d.ts deleted file mode 100644 index eb9202ae37748..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { RangeIpRangeAggKey, CidrMaskIpRangeAggKey } from './lib/ip_range'; -import type { BaseAggParams } from '../types'; -export declare enum IP_RANGE_TYPES { - FROM_TO = "fromTo", - MASK = "mask" -} -export interface AggParamsIpRange extends BaseAggParams { - field: string; - ipRangeType?: IP_RANGE_TYPES; - ranges?: Partial<{ - [IP_RANGE_TYPES.FROM_TO]: RangeIpRangeAggKey[]; - [IP_RANGE_TYPES.MASK]: CidrMaskIpRangeAggKey[]; - }>; -} -export declare const getIpRangeBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range_fn.d.ts deleted file mode 100644 index 1b9ba1f07cd1c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/ip_range_fn.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -import type { CidrOutput, IpRangeOutput } from '../../expressions'; -export declare const aggIpRangeFnName = "aggIpRange"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; - ipRangeType?: string; -}>; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggIpRange: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/cidr_mask.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/cidr_mask.d.ts deleted file mode 100644 index dac521b78ac93..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/cidr_mask.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export declare class CidrMask { - private static getNetmask; - private address; - private netmask; - private prefix; - constructor(cidr: string); - private getBroadcastAddress; - private getNetworkAddress; - getRange(): { - from: string; - to: string; - }; - toString(): string; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/date_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/date_range.d.ts deleted file mode 100644 index 4083831f06300..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/date_range.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { DateRange } from '../../../expressions'; -export declare function convertDateRangeToString({ from, to }: DateRange, format: (val: any) => string): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/histogram_calculate_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/histogram_calculate_interval.d.ts deleted file mode 100644 index 6ebb6c41a032f..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/histogram_calculate_interval.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ES_FIELD_TYPES } from '../../../../types'; -interface IntervalValuesRange { - min: number; - max: number; -} -export interface CalculateHistogramIntervalParams { - interval: number | string; - maxBucketsUiSettings: number; - maxBucketsUserInput?: number | ''; - esTypes: ES_FIELD_TYPES[]; - intervalBase?: number; - values?: IntervalValuesRange; -} -export declare const calculateHistogramInterval: ({ interval, maxBucketsUiSettings, maxBucketsUserInput, intervalBase, values, esTypes, }: CalculateHistogramIntervalParams) => number; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_prefix.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_prefix.d.ts deleted file mode 100644 index 4dfed8370e423..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_prefix.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface IpPrefixAggKey { - type: 'ip_prefix'; - address: string; - prefix_length: number; -} -export type IpPrefixKey = IpPrefixAggKey; -export declare const convertIPPrefixToString: (cidr: IpPrefixKey, format: (val: any) => string) => string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_range.d.ts deleted file mode 100644 index b69b6b7601df8..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/ip_range.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface CidrMaskIpRangeAggKey { - type: 'mask'; - mask: string; -} -export interface RangeIpRangeAggKey { - type: 'range'; - from: string; - to: string; -} -export type IpRangeKey = CidrMaskIpRangeAggKey | RangeIpRangeAggKey; -export declare const convertIPRangeToString: (range: IpRangeKey, format: (val: any) => string) => string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.d.ts deleted file mode 100644 index cf8c1fb8456ea..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_auto_interval.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import moment from 'moment'; -export declare const boundsDescendingRaw: ({ - bound: number; - interval: moment.Duration; - boundLabel: string; - intervalLabel: string; -} | { - bound: moment.Duration; - interval: moment.Duration; - boundLabel: string; - intervalLabel: string; -})[]; -/** - * Using some simple rules we pick a "pretty" interval that will - * produce around the number of buckets desired given a time range. - * - * @param targetBucketCount desired number of buckets - * @param duration time range the agg covers - */ -export declare function calcAutoIntervalNear(targetBucketCount: number, duration: number): moment.Duration; -/** - * Pick a "pretty" interval that produces no more than the maxBucketCount - * for the given time range. - * - * @param maxBucketCount maximum number of buckets to create - * @param duration amount of time covered by the agg - */ -export declare function calcAutoIntervalLessThan(maxBucketCount: number, duration: number): moment.Duration; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.d.ts deleted file mode 100644 index 77f0f3e8942af..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import moment from 'moment'; -import type { Unit } from '@kbn/datemath'; -export interface EsInterval { - expression: string; - unit: Unit; - value: number; -} -/** - * Convert a moment.duration into an es - * compatible expression, and provide - * associated metadata - * - * @param {moment.duration} duration - * @return {object} - */ -export declare function convertDurationToNormalizedEsInterval(duration: moment.Duration, targetUnit?: Unit): EsInterval; -export declare function convertIntervalToEsInterval(interval: string): EsInterval; -declare module 'moment' { - interface Locale { - _config: moment.LocaleSpecification; - } -} -export declare function getPreciseDurationDescription(intervalValue: number, unit: moment.unitOfTime.Base): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.d.ts deleted file mode 100644 index 06484c2bb1fdb..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare const dayLabel: (amount: number) => string; -export declare const hourLabel: (amount: number) => string; -export declare const yearLabel: () => string; -export declare const minuteLabel: (amount: number) => string; -export declare const secondLabel: (amount: number) => string; -export declare const millisecondLabel: (amount: number) => string; -export declare const infinityLabel: () => string; -export declare const monthLabel: () => string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/index.d.ts deleted file mode 100644 index d6e8f4bea63bf..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { TimeBuckets } from './time_buckets'; -export { convertDurationToNormalizedEsInterval } from './calc_es_interval'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.d.ts deleted file mode 100644 index 94d5c6f5826a0..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -import moment from 'moment'; -import type { TimeRangeBounds } from '../../../../../query'; -import type { EsInterval } from './calc_es_interval'; -export interface TimeBucketsInterval extends moment.Duration { - description: string; - esValue: EsInterval['value']; - esUnit: EsInterval['unit']; - expression: EsInterval['expression']; - preScaled?: TimeBucketsInterval; - scale?: number; - scaled?: boolean; -} -export interface TimeBucketsConfig extends Record { - 'histogram:maxBars': number; - 'histogram:barTarget': number; - dateFormat: string; - 'dateFormat:scaled': string[][]; -} -/** - * Helper class for wrapping the concept of an "Interval", - * which describes a timespan that will separate moments. - * - * @param {state} object - one of "" - * @param {[type]} display [description] - */ -export declare class TimeBuckets { - private _timeBucketConfig; - private _lb; - private _ub; - private _originalInterval; - private _i?; - [key: string]: any; - constructor(timeBucketConfig: TimeBucketsConfig); - /** - * Get a moment duration object representing - * the distance between the bounds, if the bounds - * are set. - * - * @return {moment.duration|undefined} - */ - private getDuration; - /** - * Set the bounds that these buckets are expected to cover. - * This is required to support interval "auto" as well - * as interval scaling. - * - * @param {object} input - an object with properties min and max, - * representing the edges for the time span - * we should cover - * - * @returns {undefined} - */ - setBounds(input?: TimeRangeBounds | TimeRangeBounds[]): void; - /** - * Clear the stored bounds - * - * @return {undefined} - */ - clearBounds(): void; - /** - * Check to see if we have received bounds yet - * - * @return {Boolean} - */ - hasBounds(): boolean; - /** - * Return the current bounds, if we have any. - * - * THIS DOES NOT CLONE THE BOUNDS, so editing them - * may have unexpected side-effects. Always - * call bounds.min.clone() before editing - * - * @return {object|undefined} - If bounds are not defined, this - * returns undefined, else it returns the bounds - * for these buckets. This object has two props, - * min and max. Each property will be a moment() - * object - * - */ - getBounds(): TimeRangeBounds | undefined; - /** - * Update the interval at which buckets should be - * generated. - * - * Input can be one of the following: - * - Any object from src/legacy/ui/agg_types.js - * - "auto" - * - Pass a valid moment unit - * - * @param {object|string|moment.duration} input - see desc - */ - setInterval(input: null | string | Record): void; - /** - * Get the interval for the buckets. If the - * number of buckets created by the interval set - * is larger than config:histogram:maxBars then the - * interval will be scaled up. If the number of buckets - * created is less than one, the interval is scaled back. - * - * The interval object returned is a moment.duration - * object that has been decorated with the following - * properties. - * - * interval.description: a text description of the interval. - * designed to be used list "field per {{ desc }}". - * - "minute" - * - "10 days" - * - "3 years" - * - * interval.expression: the elasticsearch expression that creates this - * interval. If the interval does not properly form an elasticsearch - * expression it will be forced into one. - * - * interval.scaled: the interval was adjusted to - * accommodate the maxBars setting. - * - * interval.scale: the number that y-values should be - * multiplied by - */ - getInterval(useNormalizedEsInterval?: boolean): TimeBucketsInterval; - /** - * Get a date format string that will represent dates that - * progress at our interval. - * - * Since our interval can be as small as 1ms, the default - * date format is usually way too much. with `dateFormat:scaled` - * users can modify how dates are formatted within series - * produced by TimeBuckets - * - * @return {string} - */ - getScaledDateFormat(): string; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/migrate_include_exclude_format.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/migrate_include_exclude_format.d.ts deleted file mode 100644 index e995223ac93b6..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/migrate_include_exclude_format.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IBucketAggConfig, BucketAggParam } from './bucket_agg_type'; -import type { IAggConfig } from '../agg_config'; -export declare const isType: (...types: string[]) => (agg: IAggConfig) => boolean; -export declare const isNumberType: (agg: IAggConfig) => boolean; -export declare const isStringType: (agg: IAggConfig) => boolean; -export declare const isStringOrNumberType: (agg: IAggConfig) => boolean; -export declare const migrateIncludeExcludeFormat: Partial>; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_field_key.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_field_key.d.ts deleted file mode 100644 index 090e38e7990b3..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_field_key.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { SerializableField } from '../../../serializable_field'; -import { SerializableType } from '../../../serialize_utils'; -/** - * Serialized form of {@link @kbn/data-plugin/common.MultiFieldKey} - */ -export interface SerializedMultiFieldKey { - type: typeof SerializableType.MultiFieldKey; - keys: string[]; -} -export declare class MultiFieldKey extends SerializableField { - static isInstance(field: unknown): field is MultiFieldKey; - static deserialize(value: SerializedMultiFieldKey): MultiFieldKey; - static idBucket(bucket: unknown): string; - keys: string[]; - constructor(bucket: unknown); - toString(): string; - serialize(): SerializedMultiFieldKey; -} -/** - * Multi-field key separator used in Visualizations (Lens, AggBased, TSVB). - * This differs from the separator used in the toString method of the MultiFieldKey - */ -export declare const MULTI_FIELD_KEY_SEPARATOR = " \u203A "; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms.d.ts deleted file mode 100644 index 5a12960c4a9de..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -interface CommonAggParamsMultiTerms extends BaseAggParams { - fields: string[]; - orderBy: string; - order?: 'asc' | 'desc'; - size?: number; - shardSize?: number; - otherBucket?: boolean; - otherBucketLabel?: string; - separatorLabel?: string; -} -export interface AggParamsMultiTermsSerialized extends CommonAggParamsMultiTerms { - orderAgg?: AggConfigSerialized; -} -export interface AggParamsMultiTerms extends CommonAggParamsMultiTerms { - orderAgg?: IAggConfig; -} -export declare const getMultiTermsBucketAgg: () => BucketAggType; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms_fn.d.ts deleted file mode 100644 index 6d4729140bab5..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/multi_terms_fn.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggMultiTermsFnName = "aggMultiTerms"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggMultiTerms: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/range.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/range.d.ts deleted file mode 100644 index 1008eb8a13440..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/range.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { NumericalRange } from '../../expressions'; -import type { AggTypesDependencies } from '../agg_types'; -import type { BaseAggParams } from '../types'; -import { BucketAggType } from './bucket_agg_type'; -export interface RangeBucketAggDependencies { - getFieldFormatsStart: AggTypesDependencies['getFieldFormatsStart']; -} -export interface AggParamsRange extends BaseAggParams { - field: string; - ranges?: NumericalRange[]; -} -export declare const getRangeBucketAgg: ({ getFieldFormatsStart }: RangeBucketAggDependencies) => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/range_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/range_fn.d.ts deleted file mode 100644 index 5182e53d76452..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/range_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { NumericalRangeOutput } from '../../expressions'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggRangeFnName = "aggRange"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggRange: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/range_key.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/range_key.d.ts deleted file mode 100644 index ae5c17fd91567..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/range_key.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { SerializableField } from '../../../serializable_field'; -import { SerializableType } from '../../../serialize_utils'; -type Ranges = Array>; -/** - * Serialized form of {@link @kbn/data-plugin/common.RangeKey} - */ -export interface SerializedRangeKey { - type: typeof SerializableType.RangeKey; - from: string | number | null; - to: string | number | null; - ranges: Ranges; -} -export declare class RangeKey extends SerializableField { - static isInstance(field: unknown): field is RangeKey; - static deserialize(value: SerializedRangeKey): RangeKey; - static idBucket(bucket: unknown): string; - static isRangeKeyString(rangeKey: string): boolean; - /** - * Returns `RangeKey` from stringified form. Cannot extract labels from stringified form. - * - * Only supports numerical (non-string) values. - */ - static fromString(rangeKey: string): RangeKey; - gte: string | number; - lt: string | number; - label?: string; - constructor(bucket: unknown, allRanges?: Ranges); - toString(): string; - serialize(): SerializedRangeKey; -} -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms.d.ts deleted file mode 100644 index 4b924a959f9c6..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsRareTerms extends BaseAggParams { - field: string; - max_doc_count?: number; -} -export declare const getRareTermsBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms_fn.d.ts deleted file mode 100644 index 7c885ee392365..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/rare_terms_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggRareTermsFnName = "aggRareTerms"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggRareTerms: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler.d.ts deleted file mode 100644 index 89cf0662cfe20..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export declare const SAMPLER_AGG_NAME = "sampler"; -export interface AggParamsSampler extends BaseAggParams { - /** - * Limits how many top-scoring documents are collected in the sample processed on each shard. - */ - shard_size?: number; -} -/** - * A filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents. - */ -export declare const getSamplerBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler_fn.d.ts deleted file mode 100644 index 83bf242072a2e..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/sampler_fn.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionFunctionArgs, AggExpressionType, BUCKET_TYPES } from '..'; -export declare const aggSamplerFnName = "aggSampler"; -type Input = any; -type Arguments = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggSampler: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay.d.ts deleted file mode 100644 index f881e71e1a9b1..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export declare const SHARD_DELAY_AGG_NAME = "shard_delay"; -export interface AggParamsShardDelay extends BaseAggParams { - delay?: string; -} -export declare const getShardDelayBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay_fn.d.ts deleted file mode 100644 index 7959d4a8271a1..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/shard_delay_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggConfigSerialized } from '..'; -import type { AggParamsShardDelay } from './shard_delay'; -export declare const aggShardDelayFnName = "aggShardDelay"; -type Input = any; -type Arguments = AggParamsShardDelay & Pick; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggShardDelay: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms.d.ts deleted file mode 100644 index 66e55f74e499c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsSignificantTerms extends BaseAggParams { - field: string; - size?: number; - shardSize?: number; - exclude?: string | string[]; - include?: string | string[]; -} -export declare const getSignificantTermsBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms_fn.d.ts deleted file mode 100644 index 0d8ea4f4668c3..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_terms_fn.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggSignificantTermsFnName = "aggSignificantTerms"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = AggArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggSignificantTerms: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text.d.ts deleted file mode 100644 index 0f8f1e45156ab..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsSignificantText extends BaseAggParams { - field: string; - size?: number; - min_doc_count?: number; - filter_duplicate_text?: boolean; - exclude?: string; - include?: string; -} -export declare const getSignificantTextBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text_fn.d.ts deleted file mode 100644 index 9dc496bc52b2e..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/significant_text_fn.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggSignificantTextFnName = "aggSignificantText"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = AggArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggSignificantText: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/terms.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/terms.d.ts deleted file mode 100644 index 442a98b201820..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/terms.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export { termsAggFilter } from './_terms_order_helper'; -export interface CommonAggParamsTerms extends BaseAggParams { - field: string; - orderBy: string; - size?: number; - shardSize?: number; - missingBucket?: boolean; - missingBucketLabel?: string; - otherBucket?: boolean; - otherBucketLabel?: string; - exclude?: string[] | string | number[]; - include?: string[] | string | number[]; - includeIsRegex?: boolean; - excludeIsRegex?: boolean; -} -export interface AggParamsTermsSerialized extends CommonAggParamsTerms { - orderAgg?: AggConfigSerialized; - order?: 'asc' | 'desc'; -} -export interface AggParamsTerms extends CommonAggParamsTerms { - orderAgg?: IAggConfig; - order?: { - value: 'asc' | 'desc'; - text: string; - }; -} -export declare const getTermsBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/terms_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/terms_fn.d.ts deleted file mode 100644 index 3bd2293c2c455..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/terms_fn.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggTermsFnName = "aggTerms"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggTerms: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series.d.ts deleted file mode 100644 index 0946df23d112b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { BucketAggType } from './bucket_agg_type'; -import type { BaseAggParams } from '../types'; -export { termsAggFilter } from './_terms_order_helper'; -export type AggParamsTimeSeries = BaseAggParams; -export declare const getTimeSeriesBucketAgg: () => BucketAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series_fn.d.ts deleted file mode 100644 index a7026f53e5783..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/buckets/time_series_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { BUCKET_TYPES } from '..'; -export declare const aggTimeSeriesFnName = "aggTimeSeries"; -type Input = any; -type Output = AggExpressionType; -type AggArgs = AggExpressionFunctionArgs; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggTimeSeries: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/index.d.ts deleted file mode 100644 index adb703cfff039..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * from './agg_config'; -export * from './agg_configs'; -export * from './agg_groups'; -export * from './agg_type'; -export * from './agg_types'; -export * from './agg_types_registry'; -export * from './aggs_service'; -export * from './buckets'; -export * from './metrics'; -export * from './param_types'; -export type * from './types'; -export * from './utils'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/avg.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/avg.d.ts deleted file mode 100644 index 4c3a77a46278b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/avg.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsAvg extends BaseAggParams { - field: string; -} -export declare const getAvgMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/avg_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/avg_fn.d.ts deleted file mode 100644 index a72f7318f508c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/avg_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggAvgFnName = "aggAvg"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggAvg: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg.d.ts deleted file mode 100644 index 299669e9072e7..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface AggParamsBucketAvgSerialized extends BaseAggParams { - customMetric?: AggConfigSerialized; - customBucket?: AggConfigSerialized; -} -export interface AggParamsBucketAvg extends BaseAggParams { - customMetric?: IAggConfig; - customBucket?: IAggConfig; -} -export declare const getBucketAvgMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg_fn.d.ts deleted file mode 100644 index b9f483703d569..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_avg_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggBucketAvgFnName = "aggBucketAvg"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggBucketAvg: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max.d.ts deleted file mode 100644 index 4c36e99dbb64a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface AggParamsBucketMaxSerialized extends BaseAggParams { - customMetric?: AggConfigSerialized; - customBucket?: AggConfigSerialized; -} -export interface AggParamsBucketMax extends BaseAggParams { - customMetric?: IAggConfig; - customBucket?: IAggConfig; -} -export declare const getBucketMaxMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max_fn.d.ts deleted file mode 100644 index 7f3fb09db4abf..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_max_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggBucketMaxFnName = "aggBucketMax"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggBucketMax: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min.d.ts deleted file mode 100644 index 2c45aa779a7e0..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface AggParamsBucketMinSerialized extends BaseAggParams { - customMetric?: AggConfigSerialized; - customBucket?: AggConfigSerialized; -} -export interface AggParamsBucketMin extends BaseAggParams { - customMetric?: IAggConfig; - customBucket?: IAggConfig; -} -export declare const getBucketMinMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min_fn.d.ts deleted file mode 100644 index 52703fa376989..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_min_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggBucketMinFnName = "aggBucketMin"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggBucketMin: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum.d.ts deleted file mode 100644 index a0be21ca025b5..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface AggParamsBucketSumSerialized extends BaseAggParams { - customMetric?: AggConfigSerialized; - customBucket?: AggConfigSerialized; -} -export interface AggParamsBucketSum extends BaseAggParams { - customMetric?: IAggConfig; - customBucket?: IAggConfig; -} -export declare const getBucketSumMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum_fn.d.ts deleted file mode 100644 index 366927a5c2f05..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/bucket_sum_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggBucketSumFnName = "aggBucketSum"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggBucketSum: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality.d.ts deleted file mode 100644 index 55a1283632b81..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IMetricAggConfig } from './metric_agg_type'; -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsCardinality extends BaseAggParams { - field: string; - emptyAsNull?: boolean; -} -export declare const getCardinalityMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality_fn.d.ts deleted file mode 100644 index 31f6cb8476dce..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/cardinality_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggCardinalityFnName = "aggCardinality"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggCardinality: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/count.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/count.d.ts deleted file mode 100644 index 29fab198e636c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/count.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BaseAggParams } from '../types'; -import { MetricAggType } from './metric_agg_type'; -export interface AggParamsCount extends BaseAggParams { - emptyAsNull?: boolean; -} -export declare const getCountMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/count_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/count_fn.d.ts deleted file mode 100644 index 8f4a497aba786..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/count_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggCountFnName = "aggCount"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggCount: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum.d.ts deleted file mode 100644 index 217a9c6e1167c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface CommonAggParamsCumulativeSum extends BaseAggParams { - buckets_path?: string; - metricAgg?: string; -} -export interface AggParamsCumulativeSumSerialized extends CommonAggParamsCumulativeSum { - customMetric?: AggConfigSerialized; -} -export interface AggParamsCumulativeSum extends CommonAggParamsCumulativeSum { - customMetric?: IAggConfig; -} -export declare const getCumulativeSumMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum_fn.d.ts deleted file mode 100644 index 1cccdf598705c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/cumulative_sum_fn.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggCumulativeSumFnName = "aggCumulativeSum"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggCumulativeSum: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative.d.ts deleted file mode 100644 index 137449b6131d6..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface CommonAggParamsDerivative extends BaseAggParams { - buckets_path?: string; - metricAgg?: string; -} -export interface AggParamsDerivativeSerialized extends CommonAggParamsDerivative { - customMetric?: AggConfigSerialized; -} -export interface AggParamsDerivative extends CommonAggParamsDerivative { - customMetric?: IAggConfig; -} -export declare const getDerivativeMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative_fn.d.ts deleted file mode 100644 index 3d4820c7b8364..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/derivative_fn.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggDerivativeFnName = "aggDerivative"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggDerivative: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric.d.ts deleted file mode 100644 index 90884362de45f..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface AggParamsFilteredMetricSerialized extends BaseAggParams { - customMetric?: AggConfigSerialized; - customBucket?: AggConfigSerialized; -} -export interface AggParamsFilteredMetric extends BaseAggParams { - customMetric?: IAggConfig; - customBucket?: IAggConfig; -} -export interface FiltersMetricAggDependencies { - getConfig: (key: string) => T; -} -export declare const getFilteredMetricAgg: ({ getConfig }: FiltersMetricAggDependencies) => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric_fn.d.ts deleted file mode 100644 index 5eedad3fac3ef..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/filtered_metric_fn.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggFilteredMetricFnName = "aggFilteredMetric"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggFilteredMetric: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds.d.ts deleted file mode 100644 index c03ef8a0e677e..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsGeoBounds extends BaseAggParams { - field: string; -} -export declare const getGeoBoundsMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds_fn.d.ts deleted file mode 100644 index 85f2341f2b935..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_bounds_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggGeoBoundsFnName = "aggGeoBounds"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggGeoBounds: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid.d.ts deleted file mode 100644 index 5454d39af2054..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsGeoCentroid extends BaseAggParams { - field: string; -} -export declare const getGeoCentroidMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid_fn.d.ts deleted file mode 100644 index f22c1b90a4ed6..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/geo_centroid_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggGeoCentroidFnName = "aggGeoCentroid"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggGeoCentroid: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/index.d.ts deleted file mode 100644 index 6931d32d34424..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -export * from './avg_fn'; -export * from './avg'; -export * from './bucket_avg_fn'; -export * from './bucket_avg'; -export * from './bucket_max_fn'; -export * from './bucket_max'; -export * from './bucket_min_fn'; -export * from './bucket_min'; -export * from './bucket_sum_fn'; -export * from './bucket_sum'; -export * from './filtered_metric_fn'; -export * from './filtered_metric'; -export * from './cardinality_fn'; -export * from './cardinality'; -export * from './value_count_fn'; -export * from './value_count'; -export * from './count'; -export * from './count_fn'; -export * from './cumulative_sum_fn'; -export * from './cumulative_sum'; -export * from './derivative_fn'; -export * from './derivative'; -export * from './geo_bounds_fn'; -export * from './geo_bounds'; -export * from './geo_centroid_fn'; -export * from './geo_centroid'; -export * from './lib/parent_pipeline_agg_helper'; -export * from './lib/sibling_pipeline_agg_helper'; -export * from './max_fn'; -export * from './max'; -export * from './median_fn'; -export * from './median'; -export * from './single_percentile_fn'; -export * from './single_percentile'; -export * from './metric_agg_type'; -export * from './metric_agg_types'; -export * from './min_fn'; -export * from './min'; -export * from './moving_avg_fn'; -export * from './moving_avg'; -export * from './percentile_ranks_fn'; -export * from './percentile_ranks'; -export * from './percentiles_fn'; -export * from './percentiles'; -export * from './rate_fn'; -export * from './rate'; -export * from './single_percentile_rank_fn'; -export * from './single_percentile_rank'; -export * from './serial_diff_fn'; -export * from './serial_diff'; -export * from './std_deviation_fn'; -export * from './std_deviation'; -export * from './sum_fn'; -export * from './sum'; -export * from './top_hit_fn'; -export * from './top_hit'; -export * from './top_metrics'; -export * from './top_metrics_fn'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/create_filter.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/create_filter.d.ts deleted file mode 100644 index 0883a70e53a01..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/create_filter.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AggConfig } from '../../agg_config'; -import type { IMetricAggConfig } from '../metric_agg_type'; -export declare const createMetricFilter: (aggConfig: TMetricAggConfig, key: string) => import("@kbn/es-query").ExistsFilter | undefined; -export declare const createTopHitFilter: (aggConfig: TMetricAggConfig, key: string) => import("@kbn/es-query").PhraseFilter | import("@kbn/es-query").CombinedFilter | import("@kbn/es-query").ScriptedPhraseFilter | undefined; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/get_response_agg_config_class.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/get_response_agg_config_class.d.ts deleted file mode 100644 index dc3ee8b114c71..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/get_response_agg_config_class.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IMetricAggConfig } from '../metric_agg_type'; -/** - * Get the ResponseAggConfig class for an aggConfig, - * which might be cached on the aggConfig or created. - * - * @param {AggConfig} agg - the AggConfig the VAC should inherit from - * @param {object} props - properties that the VAC should have - * @return {Constructor} - a constructor for VAC objects that will inherit the aggConfig - */ -export declare const getResponseAggConfigClass: (agg: any, props: Partial) => any; -export interface IResponseAggConfig extends IMetricAggConfig { - key: string | number; - parentId: IMetricAggConfig['id']; -} -export declare function getResponseAggId(parentId: string, key: string): string; -export declare const create: (parentAgg: IMetricAggConfig, props: Partial) => { - (this: IResponseAggConfig, key: string): void; - prototype: any; -}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/make_nested_label.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/make_nested_label.d.ts deleted file mode 100644 index 14f12e7fdd959..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/make_nested_label.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { IMetricAggConfig } from '../metric_agg_type'; -export declare const makeNestedLabel: (aggConfig: IMetricAggConfig, label: string) => any; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/nested_agg_helpers.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/nested_agg_helpers.d.ts deleted file mode 100644 index 240bd32e65413..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/nested_agg_helpers.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { IMetricAggConfig } from '../metric_agg_type'; -/** - * Forwards modifyAggConfigOnSearchRequestStart calls to a nested AggConfig. - * This must be used for each parameter, that accepts a nested aggregation, otherwise - * some parameters of the nested aggregation might not work properly (like auto interval - * on a nested date histogram). - * You should assign the return value of this function to the modifyAggConfigOnSearchRequestStart - * of the parameter that accepts a nested aggregation. Example: - * { - * name: 'customBucket', - * modifyAggConfigOnSearchRequestStart: forwardModifyAggConfigOnSearchRequestStart('customBucket') - * } - * - * @param {string} paramName - The name of the parameter, that this function should forward - * calls to. That should match the name of the parameter the function is called on. - * @returns {function} A function, that forwards the calls. - */ -export declare const forwardModifyAggConfigOnSearchRequestStart: (paramName: string) => (aggConfig: IMetricAggConfig, searchSource?: any, request?: any) => void; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/ordinal_suffix.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/ordinal_suffix.d.ts deleted file mode 100644 index a19c85561040e..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/ordinal_suffix.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function ordinalSuffix(num: any): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.d.ts deleted file mode 100644 index 64743bf0f9c93..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_helper.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IMetricAggConfig, MetricAggParam } from '../metric_agg_type'; -export declare const parentPipelineType: string; -export declare const parentPipelineAggHelper: { - subtype: string; - params(): Array>; - getSerializedFormat(agg: IMetricAggConfig): any; -}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_writer.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_writer.d.ts deleted file mode 100644 index a35d660c75aa7..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/parent_pipeline_agg_writer.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IAggConfigs } from '../../agg_configs'; -import type { IMetricAggConfig } from '../metric_agg_type'; -export declare const parentPipelineAggWriter: (agg: IMetricAggConfig, output: Record, aggConfigs?: IAggConfigs) => void; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.d.ts deleted file mode 100644 index ae2f0f79d2581..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_helper.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IMetricAggConfig, MetricAggParam } from '../metric_agg_type'; -export declare const siblingPipelineType: string; -export declare const siblingPipelineAggHelper: { - subtype: string; - params(bucketFilter?: string[]): Array>; - getSerializedFormat(agg: IMetricAggConfig): any; -}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_writer.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_writer.d.ts deleted file mode 100644 index 61b6d2a59d6bd..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/lib/sibling_pipeline_agg_writer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { IMetricAggConfig } from '../metric_agg_type'; -export declare const siblingPipelineAggWriter: (agg: IMetricAggConfig, output: Record) => void; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/max.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/max.d.ts deleted file mode 100644 index 4e2915526ee23..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/max.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsMax extends BaseAggParams { - field: string; -} -export declare const getMaxMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/max_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/max_fn.d.ts deleted file mode 100644 index 25dc959056be7..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/max_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggMaxFnName = "aggMax"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggMax: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/median.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/median.d.ts deleted file mode 100644 index 74ab0f1d2a7cc..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/median.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsMedian extends BaseAggParams { - field: string; -} -export declare const getMedianMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/median_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/median_fn.d.ts deleted file mode 100644 index 29680b70c8321..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/median_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggMedianFnName = "aggMedian"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggMedian: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_type.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_type.d.ts deleted file mode 100644 index b67ac5e7bee47..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_type.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { AggTypeConfig } from '../agg_type'; -import { AggType } from '../agg_type'; -import type { AggParamType } from '../param_types/agg'; -import type { AggConfig } from '../agg_config'; -import type { FieldTypes } from '../param_types'; -export interface IMetricAggConfig extends AggConfig { - type: InstanceType; -} -export interface MetricAggParam extends AggParamType { - filterFieldTypes?: FieldTypes; - onlyAggregatable?: boolean; - scriptable?: boolean; -} -interface MetricAggTypeConfig extends AggTypeConfig> { - isScalable?: () => boolean; - subtype?: string; - enableEmptyAsNull?: boolean; -} -export type IMetricAggType = MetricAggType; -export declare class MetricAggType extends AggType> { - subtype: string; - isScalable: () => boolean; - type: string; - getKey: () => void; - constructor(config: MetricAggTypeConfig); -} -export declare function isMetricAggType(aggConfig: any): aggConfig is MetricAggType; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_types.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_types.d.ts deleted file mode 100644 index 97edd11582435..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/metric_agg_types.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export declare enum METRIC_TYPES { - AVG = "avg", - FILTERED_METRIC = "filtered_metric", - CARDINALITY = "cardinality", - VALUE_COUNT = "value_count", - AVG_BUCKET = "avg_bucket", - MAX_BUCKET = "max_bucket", - MIN_BUCKET = "min_bucket", - SUM_BUCKET = "sum_bucket", - COUNT = "count", - CUMULATIVE_SUM = "cumulative_sum", - DERIVATIVE = "derivative", - GEO_BOUNDS = "geo_bounds", - GEO_CENTROID = "geo_centroid", - MEDIAN = "median", - SINGLE_PERCENTILE = "single_percentile", - SINGLE_PERCENTILE_RANK = "single_percentile_rank", - MIN = "min", - MAX = "max", - MOVING_FN = "moving_avg", - SERIAL_DIFF = "serial_diff", - SUM = "sum", - TOP_HITS = "top_hits", - TOP_METRICS = "top_metrics", - PERCENTILES = "percentiles", - PERCENTILE_RANKS = "percentile_ranks", - RATE = "rate", - STD_DEV = "std_dev" -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/min.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/min.d.ts deleted file mode 100644 index c7c8906132dcd..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/min.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsMin extends BaseAggParams { - field: string; -} -export declare const getMinMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/min_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/min_fn.d.ts deleted file mode 100644 index d029fcb6d4c8d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/min_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggMinFnName = "aggMin"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggMin: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg.d.ts deleted file mode 100644 index fa387a6cfb1a7..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface CommonAggParamsMovingAvg extends BaseAggParams { - buckets_path?: string; - window?: number; - script?: string; - metricAgg?: string; -} -export interface AggParamsMovingAvgSerialized extends CommonAggParamsMovingAvg { - customMetric?: AggConfigSerialized; -} -export interface AggParamsMovingAvg extends CommonAggParamsMovingAvg { - customMetric?: IAggConfig; -} -export declare const getMovingAvgMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg_fn.d.ts deleted file mode 100644 index 9d93c1d08d857..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/moving_avg_fn.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggMovingAvgFnName = "aggMovingAvg"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggMovingAvg: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks.d.ts deleted file mode 100644 index ed80c8cf8518c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { AggTypesDependencies } from '../agg_types'; -import type { BaseAggParams } from '../types'; -import { MetricAggType } from './metric_agg_type'; -import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; -export interface AggParamsPercentileRanks extends BaseAggParams { - field: string; - values?: number[]; -} -export type IPercentileRanksAggConfig = IResponseAggConfig; -export interface PercentileRanksMetricAggDependencies { - getFieldFormatsStart: AggTypesDependencies['getFieldFormatsStart']; -} -export declare const getPercentileRanksMetricAgg: ({ getFieldFormatsStart, }: PercentileRanksMetricAggDependencies) => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks_fn.d.ts deleted file mode 100644 index 6bf83263f735a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentile_ranks_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggPercentileRanksFnName = "aggPercentileRanks"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggPercentileRanks: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles.d.ts deleted file mode 100644 index 8ea0af22cb3ee..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; -import type { BaseAggParams } from '../types'; -export interface AggParamsPercentiles extends BaseAggParams { - field: string; - percents?: number[]; -} -export type IPercentileAggConfig = IResponseAggConfig; -export declare const getPercentilesMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_fn.d.ts deleted file mode 100644 index ad84f2514130b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggPercentilesFnName = "aggPercentiles"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggPercentiles: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_get_value.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_get_value.d.ts deleted file mode 100644 index 2e185c609bb11..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/percentiles_get_value.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; -export declare const getPercentileValue: (agg: TAggConfig, bucket: any) => any; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/rate.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/rate.d.ts deleted file mode 100644 index 38b66291430cd..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/rate.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsRate extends BaseAggParams { - unit: string; - field?: string; -} -export declare const getRateMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/rate_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/rate_fn.d.ts deleted file mode 100644 index bf76d88b648bf..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/rate_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggRateFnName = "aggRate"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggRate: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff.d.ts deleted file mode 100644 index b4908f41191da..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { AggConfigSerialized, BaseAggParams, IAggConfig } from '../types'; -export interface CommonAggParamsSerialDiff extends BaseAggParams { - buckets_path?: string; - metricAgg?: string; -} -export interface AggParamsSerialDiffSerialized extends CommonAggParamsSerialDiff { - customMetric?: AggConfigSerialized; -} -export interface AggParamsSerialDiff extends CommonAggParamsSerialDiff { - customMetric?: IAggConfig; -} -export declare const getSerialDiffMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff_fn.d.ts deleted file mode 100644 index 109567d72c7c3..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/serial_diff_fn.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggSerialDiffFnName = "aggSerialDiff"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Arguments = Assign; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggSerialDiff: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile.d.ts deleted file mode 100644 index 54dec0889d56b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsSinglePercentile extends BaseAggParams { - field: string; - percentile: number; -} -export declare const getSinglePercentileMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_fn.d.ts deleted file mode 100644 index 0cfac84e4b70d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggSinglePercentileFnName = "aggSinglePercentile"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggSinglePercentile: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank.d.ts deleted file mode 100644 index cd2c812833f47..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; -import type { BaseAggParams } from '../types'; -export interface AggParamsSinglePercentileRank extends BaseAggParams { - field: string; - value: number; -} -export declare const getSinglePercentileRankMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank_fn.d.ts deleted file mode 100644 index 1d01b6147e6cc..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/single_percentile_rank_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggSinglePercentileRankFnName = "aggSinglePercentileRank"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggSinglePercentileRank: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation.d.ts deleted file mode 100644 index 80628d1150dca..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { IResponseAggConfig } from './lib/get_response_agg_config_class'; -import type { BaseAggParams } from '../types'; -export interface AggParamsStdDeviation extends BaseAggParams { - field: string; - showBounds?: boolean; -} -interface ValProp { - valProp: string[]; - title: string; -} -export interface IStdDevAggConfig extends IResponseAggConfig { - keyedDetails: (customLabel: string, fieldDisplayName?: string) => Record; - valProp: () => string[]; -} -export declare const getStdDeviationMetricAgg: () => MetricAggType; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation_fn.d.ts deleted file mode 100644 index 04a8915adc7f7..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/std_deviation_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggStdDeviationFnName = "aggStdDeviation"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggStdDeviation: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/sum.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/sum.d.ts deleted file mode 100644 index 0fe049235d603..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/sum.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsSum extends BaseAggParams { - field: string; - emptyAsNull?: boolean; -} -export declare const getSumMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/sum_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/sum_fn.d.ts deleted file mode 100644 index 56766f4fad5dc..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/sum_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggSumFnName = "aggSum"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggSum: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit.d.ts deleted file mode 100644 index b91baf376d6cd..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { DataViewField } from '@kbn/data-views-plugin/common'; -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface BaseAggParamsTopHit extends BaseAggParams { - field: string; - aggregate: 'min' | 'max' | 'sum' | 'average' | 'concat'; - size?: number; -} -export interface AggParamsTopHitSerialized extends BaseAggParamsTopHit { - sortOrder?: 'desc' | 'asc'; - sortField?: string; -} -export interface AggParamsTopHit extends BaseAggParamsTopHit { - sortOrder?: { - value: 'desc' | 'asc'; - text: string; - }; - sortField?: DataViewField; -} -export declare const getTopHitMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit_fn.d.ts deleted file mode 100644 index 311918f420277..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_hit_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggTopHitFnName = "aggTopHit"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggTopHit: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics.d.ts deleted file mode 100644 index 2ee0a4702df6b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { MetricAggType } from './metric_agg_type'; -import type { DataViewField } from '../../..'; -import type { BaseAggParams } from '../types'; -export interface BaseAggParamsTopMetrics extends BaseAggParams { - field: string; - size?: number; -} -export interface AggParamsTopMetricsSerialized extends BaseAggParamsTopMetrics { - sortOrder?: 'desc' | 'asc'; - sortField?: string; -} -export interface AggParamsTopMetrics extends BaseAggParamsTopMetrics { - sortOrder?: { - value: 'desc' | 'asc'; - text: string; - }; - sortField?: DataViewField; -} -export declare const getTopMetricsMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics_fn.d.ts deleted file mode 100644 index 81aa96cc22d4c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/top_metrics_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggTopMetricsFnName = "aggTopMetrics"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggTopMetrics: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count.d.ts deleted file mode 100644 index af31af8c4cdc9..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IMetricAggConfig } from './metric_agg_type'; -import { MetricAggType } from './metric_agg_type'; -import type { BaseAggParams } from '../types'; -export interface AggParamsValueCount extends BaseAggParams { - field: string; - emptyAsNull?: boolean; -} -export declare const getValueCountMetricAgg: () => MetricAggType; diff --git a/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count_fn.d.ts b/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count_fn.d.ts deleted file mode 100644 index cff25254bc16b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/metrics/value_count_fn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { AggExpressionType, AggExpressionFunctionArgs } from '..'; -import { METRIC_TYPES } from '..'; -export declare const aggValueCountFnName = "aggValueCount"; -type Input = any; -type AggArgs = AggExpressionFunctionArgs; -type Output = AggExpressionType; -type FunctionDefinition = ExpressionFunctionDefinition; -export declare const aggValueCount: () => FunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/agg.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/agg.d.ts deleted file mode 100644 index 8ca2336545845..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/param_types/agg.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IAggConfig, AggConfigSerialized } from '../agg_config'; -import { BaseParamType } from './base'; -export declare class AggParamType extends BaseParamType { - makeAgg: (agg: TAggConfig, state?: AggConfigSerialized) => TAggConfig; - allowedAggs: string[]; - constructor(config: Record); -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/base.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/base.d.ts deleted file mode 100644 index 1e85e1791d7f1..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/param_types/base.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { ExpressionAstExpression } from '@kbn/expressions-plugin/common'; -import type { ISearchOptions } from '@kbn/search-types'; -import type { ISearchSource } from '../../../../public'; -import type { IAggConfigs } from '../agg_configs'; -import type { IAggConfig } from '../agg_config'; -export declare class BaseParamType { - name: string; - type: string; - displayName: string; - required: boolean; - advanced: boolean; - default: any; - write: (aggConfig: TAggConfig, output: Record, aggConfigs?: IAggConfigs, locals?: Record) => void; - serialize: (value: any, aggConfig?: TAggConfig) => any; - deserialize: (value: any, aggConfig?: TAggConfig) => any; - toExpressionAst?: (value: any) => ExpressionAstExpression[] | ExpressionAstExpression | undefined; - options: any[]; - getValueType: (aggConfig: IAggConfig) => any; - onChange?(agg: TAggConfig): void; - shouldShow?(agg: TAggConfig): boolean; - /** - * A function that will be called before an aggConfig is serialized and sent to ES. - * Allows aggConfig to retrieve values needed for serialization - * Example usage: an aggregation needs to know the min/max of a field to determine an appropriate interval - * - * @param {AggConfig} aggConfig - * @param {Courier.SearchSource} searchSource - * @returns {Promise|undefined} - */ - modifyAggConfigOnSearchRequestStart: (aggConfig: TAggConfig, searchSource?: ISearchSource, options?: ISearchOptions) => void; - constructor(config: Record); -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/field.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/field.d.ts deleted file mode 100644 index 741e954eab373..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/param_types/field.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { DataViewField } from '@kbn/data-views-plugin/common'; -import type { IAggConfig } from '../agg_config'; -import { BaseParamType } from './base'; -import { KBN_FIELD_TYPES } from '../../../kbn_field_types/types'; -export type FieldTypes = KBN_FIELD_TYPES | KBN_FIELD_TYPES[] | '*'; -export type FilterFieldFn = (field: DataViewField) => boolean; -export type IFieldParamType = FieldParamType; -export declare class FieldParamType extends BaseParamType { - required: boolean; - scriptable: boolean; - filterFieldTypes: FieldTypes; - onlyAggregatable: boolean; - /** - * Filter available fields by passing filter fn on a {@link DataViewField} - * If used, takes precedence over filterFieldTypes and other filter params - */ - filterField?: FilterFieldFn; - constructor(config: Record); - /** - * filter the fields to the available ones - */ - getAvailableFields: (aggConfig: IAggConfig) => DataViewField[]; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/index.d.ts deleted file mode 100644 index 9c17532bf0a2d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/param_types/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './agg'; -export * from './base'; -export * from './field'; -export * from './json'; -export * from './optioned'; -export * from './string'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/json.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/json.d.ts deleted file mode 100644 index d6a716fd8766a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/param_types/json.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { BaseParamType } from './base'; -export declare class JsonParamType extends BaseParamType { - constructor(config: Record); -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/optioned.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/optioned.d.ts deleted file mode 100644 index ecc02be52368f..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/param_types/optioned.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { IAggConfig } from '../agg_config'; -import { BaseParamType } from './base'; -export interface OptionedValueProp { - value: string; - text: string; - disabled?: boolean; - isCompatible: (agg: IAggConfig) => boolean; -} -export declare class OptionedParamType extends BaseParamType { - options: OptionedValueProp[]; - constructor(config: Record); -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/param_types/string.d.ts b/src/platform/plugins/shared/data/common/search/aggs/param_types/string.d.ts deleted file mode 100644 index 4adbbeb54ae46..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/param_types/string.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { BaseParamType } from './base'; -export declare class StringParamType extends BaseParamType { - constructor(config: Record); -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/types.d.ts b/src/platform/plugins/shared/data/common/search/aggs/types.d.ts deleted file mode 100644 index 6f1f0f57e4c2d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/types.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { aggTimeSeries } from './buckets/time_series_fn'; -import type { aggAvg, aggBucketAvg, aggBucketMax, aggBucketMin, aggBucketSum, aggCardinality, aggValueCount, AggConfigs, AggConfigSerialized, aggCount, aggCumulativeSum, aggDateHistogram, aggDateRange, aggDerivative, aggFilter, aggFilters, aggGeoBounds, aggGeoCentroid, aggGeoTile, aggHistogram, aggIpPrefix, aggIpRange, aggMax, aggMedian, aggMin, aggMovingAvg, aggRate, AggParamsAvg, AggParamsBucketAvg, AggParamsBucketAvgSerialized, AggParamsBucketMax, AggParamsBucketMaxSerialized, AggParamsBucketMin, AggParamsBucketMinSerialized, AggParamsBucketSum, AggParamsBucketSumSerialized, AggParamsFilteredMetric, AggParamsCardinality, AggParamsValueCount, AggParamsCumulativeSum, AggParamsCumulativeSumSerialized, AggParamsDateHistogram, AggParamsDateRange, AggParamsDerivative, AggParamsFilter, AggParamsFilters, AggParamsGeoBounds, AggParamsGeoCentroid, AggParamsGeoTile, AggParamsHistogram, AggParamsIpPrefix, AggParamsIpRange, AggParamsMax, AggParamsMedian, AggParamsSinglePercentile, AggParamsSinglePercentileRank, AggParamsMin, AggParamsMovingAvg, AggParamsPercentileRanks, AggParamsPercentiles, AggParamsRange, AggParamsRate, AggParamsSerialDiff, AggParamsSignificantTerms, AggParamsStdDeviation, AggParamsSum, AggParamsTerms, AggParamsTermsSerialized, AggParamsMultiTerms, AggParamsMultiTermsSerialized, AggParamsRareTerms, AggParamsTopHit, AggParamsTopMetrics, AggParamsTopMetricsSerialized, aggPercentileRanks, aggPercentiles, aggRange, aggSerialDiff, aggSignificantTerms, aggStdDeviation, aggSum, aggTerms, aggMultiTerms, aggRareTerms, aggTopHit, AggTypesRegistry, AggTypesRegistrySetup, AggTypesRegistryStart, BUCKET_TYPES, CreateAggConfigParams, getCalculateAutoTimeExpression, METRIC_TYPES, aggFilteredMetric, aggSinglePercentile, aggSinglePercentileRank, AggConfigsOptions, AggParamsCount, AggParamsDerivativeSerialized, AggParamsFilteredMetricSerialized, AggParamsMovingAvgSerialized, AggParamsSerialDiffSerialized, AggParamsTopHitSerialized, AggParamsTimeSeries } from '.'; -import type { AggParamsSampler } from './buckets/sampler'; -import type { AggParamsDiversifiedSampler } from './buckets/diversified_sampler'; -import type { AggParamsSignificantText } from './buckets/significant_text'; -import type { aggTopMetrics } from './metrics/top_metrics_fn'; -export type { IAggConfig, AggConfigSerialized } from './agg_config'; -export type { CreateAggConfigParams, IAggConfigs, AggConfigsOptions } from './agg_configs'; -export type { IAggType } from './agg_type'; -export type { AggParam, AggParamOption } from './agg_params'; -export type { IFieldParamType } from './param_types'; -export type { IMetricAggType } from './metrics/metric_agg_type'; -export type { IpPrefixKey } from './buckets/lib/ip_prefix'; -export type { IpRangeKey } from './buckets/lib/ip_range'; -export type { OptionedValueProp } from './param_types/optioned'; -export interface AggsCommonSetup { - types: AggTypesRegistrySetup; -} -export interface AggsCommonStart { - calculateAutoTimeExpression: ReturnType; - createAggConfigs: (indexPattern: DataView, configStates?: CreateAggConfigParams[], options?: Partial) => InstanceType; - types: ReturnType; -} -/** - * AggsStart represents the actual external contract as AggsCommonStart - * is only used internally. The difference is that AggsStart includes the - * typings for the registry with initialized agg types. - * - * @public - */ -export type AggsStart = Assign; -export interface BaseAggParams { - json?: string; - customLabel?: string; - timeShift?: string; -} -export interface AggExpressionType { - type: 'agg_type'; - value: AggConfigSerialized; -} -/** @internal */ -export type AggExpressionFunctionArgs = SerializedAggParamsMapping[Name] & Pick; -/** - * A global list of the param interfaces for each agg type. - * For now this is internal, but eventually we will probably - * want to make it public. - * - * @internal - */ -interface SerializedAggParamsMapping { - [BUCKET_TYPES.RANGE]: AggParamsRange; - [BUCKET_TYPES.IP_PREFIX]: AggParamsIpPrefix; - [BUCKET_TYPES.IP_RANGE]: AggParamsIpRange; - [BUCKET_TYPES.DATE_RANGE]: AggParamsDateRange; - [BUCKET_TYPES.FILTER]: AggParamsFilter; - [BUCKET_TYPES.FILTERS]: AggParamsFilters; - [BUCKET_TYPES.SIGNIFICANT_TERMS]: AggParamsSignificantTerms; - [BUCKET_TYPES.SIGNIFICANT_TEXT]: AggParamsSignificantText; - [BUCKET_TYPES.GEOTILE_GRID]: AggParamsGeoTile; - [BUCKET_TYPES.HISTOGRAM]: AggParamsHistogram; - [BUCKET_TYPES.DATE_HISTOGRAM]: AggParamsDateHistogram; - [BUCKET_TYPES.TERMS]: AggParamsTermsSerialized; - [BUCKET_TYPES.TIME_SERIES]: AggParamsTimeSeries; - [BUCKET_TYPES.MULTI_TERMS]: AggParamsMultiTermsSerialized; - [BUCKET_TYPES.RARE_TERMS]: AggParamsRareTerms; - [BUCKET_TYPES.SAMPLER]: AggParamsSampler; - [BUCKET_TYPES.DIVERSIFIED_SAMPLER]: AggParamsDiversifiedSampler; - [METRIC_TYPES.AVG]: AggParamsAvg; - [METRIC_TYPES.CARDINALITY]: AggParamsCardinality; - [METRIC_TYPES.COUNT]: AggParamsCount; - [METRIC_TYPES.VALUE_COUNT]: AggParamsValueCount; - [METRIC_TYPES.GEO_BOUNDS]: AggParamsGeoBounds; - [METRIC_TYPES.GEO_CENTROID]: AggParamsGeoCentroid; - [METRIC_TYPES.MAX]: AggParamsMax; - [METRIC_TYPES.MEDIAN]: AggParamsMedian; - [METRIC_TYPES.SINGLE_PERCENTILE]: AggParamsSinglePercentile; - [METRIC_TYPES.SINGLE_PERCENTILE_RANK]: AggParamsSinglePercentileRank; - [METRIC_TYPES.MIN]: AggParamsMin; - [METRIC_TYPES.STD_DEV]: AggParamsStdDeviation; - [METRIC_TYPES.SUM]: AggParamsSum; - [METRIC_TYPES.AVG_BUCKET]: AggParamsBucketAvgSerialized; - [METRIC_TYPES.MAX_BUCKET]: AggParamsBucketMaxSerialized; - [METRIC_TYPES.MIN_BUCKET]: AggParamsBucketMinSerialized; - [METRIC_TYPES.SUM_BUCKET]: AggParamsBucketSumSerialized; - [METRIC_TYPES.FILTERED_METRIC]: AggParamsFilteredMetricSerialized; - [METRIC_TYPES.CUMULATIVE_SUM]: AggParamsCumulativeSumSerialized; - [METRIC_TYPES.DERIVATIVE]: AggParamsDerivativeSerialized; - [METRIC_TYPES.MOVING_FN]: AggParamsMovingAvgSerialized; - [METRIC_TYPES.PERCENTILE_RANKS]: AggParamsPercentileRanks; - [METRIC_TYPES.PERCENTILES]: AggParamsPercentiles; - [METRIC_TYPES.RATE]: AggParamsRate; - [METRIC_TYPES.SERIAL_DIFF]: AggParamsSerialDiffSerialized; - [METRIC_TYPES.TOP_HITS]: AggParamsTopHitSerialized; - [METRIC_TYPES.TOP_METRICS]: AggParamsTopMetricsSerialized; -} -export interface AggParamsMapping { - [BUCKET_TYPES.RANGE]: AggParamsRange; - [BUCKET_TYPES.IP_PREFIX]: AggParamsIpPrefix; - [BUCKET_TYPES.IP_RANGE]: AggParamsIpRange; - [BUCKET_TYPES.DATE_RANGE]: AggParamsDateRange; - [BUCKET_TYPES.FILTER]: AggParamsFilter; - [BUCKET_TYPES.FILTERS]: AggParamsFilters; - [BUCKET_TYPES.SIGNIFICANT_TERMS]: AggParamsSignificantTerms; - [BUCKET_TYPES.SIGNIFICANT_TEXT]: AggParamsSignificantText; - [BUCKET_TYPES.GEOTILE_GRID]: AggParamsGeoTile; - [BUCKET_TYPES.HISTOGRAM]: AggParamsHistogram; - [BUCKET_TYPES.DATE_HISTOGRAM]: AggParamsDateHistogram; - [BUCKET_TYPES.TERMS]: AggParamsTerms; - [BUCKET_TYPES.TIME_SERIES]: AggParamsTimeSeries; - [BUCKET_TYPES.MULTI_TERMS]: AggParamsMultiTerms; - [BUCKET_TYPES.RARE_TERMS]: AggParamsRareTerms; - [BUCKET_TYPES.SAMPLER]: AggParamsSampler; - [BUCKET_TYPES.DIVERSIFIED_SAMPLER]: AggParamsDiversifiedSampler; - [METRIC_TYPES.AVG]: AggParamsAvg; - [METRIC_TYPES.CARDINALITY]: AggParamsCardinality; - [METRIC_TYPES.COUNT]: AggParamsCount; - [METRIC_TYPES.VALUE_COUNT]: AggParamsValueCount; - [METRIC_TYPES.GEO_BOUNDS]: AggParamsGeoBounds; - [METRIC_TYPES.GEO_CENTROID]: AggParamsGeoCentroid; - [METRIC_TYPES.MAX]: AggParamsMax; - [METRIC_TYPES.MEDIAN]: AggParamsMedian; - [METRIC_TYPES.SINGLE_PERCENTILE]: AggParamsSinglePercentile; - [METRIC_TYPES.SINGLE_PERCENTILE_RANK]: AggParamsSinglePercentileRank; - [METRIC_TYPES.MIN]: AggParamsMin; - [METRIC_TYPES.STD_DEV]: AggParamsStdDeviation; - [METRIC_TYPES.SUM]: AggParamsSum; - [METRIC_TYPES.AVG_BUCKET]: AggParamsBucketAvg; - [METRIC_TYPES.MAX_BUCKET]: AggParamsBucketMax; - [METRIC_TYPES.MIN_BUCKET]: AggParamsBucketMin; - [METRIC_TYPES.SUM_BUCKET]: AggParamsBucketSum; - [METRIC_TYPES.FILTERED_METRIC]: AggParamsFilteredMetric; - [METRIC_TYPES.CUMULATIVE_SUM]: AggParamsCumulativeSum; - [METRIC_TYPES.DERIVATIVE]: AggParamsDerivative; - [METRIC_TYPES.MOVING_FN]: AggParamsMovingAvg; - [METRIC_TYPES.PERCENTILE_RANKS]: AggParamsPercentileRanks; - [METRIC_TYPES.PERCENTILES]: AggParamsPercentiles; - [METRIC_TYPES.RATE]: AggParamsRate; - [METRIC_TYPES.SERIAL_DIFF]: AggParamsSerialDiff; - [METRIC_TYPES.TOP_HITS]: AggParamsTopHit; - [METRIC_TYPES.TOP_METRICS]: AggParamsTopMetrics; -} -/** - * A global list of the expression function definitions for each agg type function. - */ -export interface AggFunctionsMapping { - aggFilter: ReturnType; - aggFilters: ReturnType; - aggSignificantTerms: ReturnType; - aggIpPrefix: ReturnType; - aggIpRange: ReturnType; - aggDateRange: ReturnType; - aggRange: ReturnType; - aggGeoTile: ReturnType; - aggHistogram: ReturnType; - aggDateHistogram: ReturnType; - aggTerms: ReturnType; - aggTimeSeries: ReturnType; - aggMultiTerms: ReturnType; - aggRareTerms: ReturnType; - aggAvg: ReturnType; - aggBucketAvg: ReturnType; - aggBucketMax: ReturnType; - aggBucketMin: ReturnType; - aggBucketSum: ReturnType; - aggFilteredMetric: ReturnType; - aggCardinality: ReturnType; - aggValueCount: ReturnType; - aggCount: ReturnType; - aggCumulativeSum: ReturnType; - aggDerivative: ReturnType; - aggGeoBounds: ReturnType; - aggGeoCentroid: ReturnType; - aggMax: ReturnType; - aggMedian: ReturnType; - aggSinglePercentile: ReturnType; - aggSinglePercentileRank: ReturnType; - aggMin: ReturnType; - aggMovingAvg: ReturnType; - aggPercentileRanks: ReturnType; - aggPercentiles: ReturnType; - aggSerialDiff: ReturnType; - aggStdDeviation: ReturnType; - aggSum: ReturnType; - aggTopHit: ReturnType; - aggTopMetrics: ReturnType; - aggRate: ReturnType; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/calculate_auto_time_expression.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/calculate_auto_time_expression.d.ts deleted file mode 100644 index d788875fb1806..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/calculate_auto_time_expression.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TimeBucketsInterval } from '../buckets/lib/time_buckets/time_buckets'; -import type { TimeRange } from '../../../query'; -export declare function getCalculateAutoTimeExpression(getConfig: (key: string) => any): { - (range: TimeRange): string | undefined; - (range: TimeRange, interval: string, asExpression?: true): string | undefined; - (range: TimeRange, interval: string, asExpression: false): TimeBucketsInterval | undefined; - (range: TimeRange, interval?: string, asExpression?: boolean): string | TimeBucketsInterval | undefined; -}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.d.ts deleted file mode 100644 index d24efdf2e02f9..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -type Interval = { - fixed_interval: string; -} | { - calendar_interval: string; -}; -/** - * Checks whether a given Elasticsearch interval is a calendar or fixed interval - * and returns an object containing the appropriate date_histogram property for that - * interval. So it will return either an object containing the fixed_interval key for - * that interval or a calendar_interval. If the specified interval was not a valid Elasticsearch - * interval this method will throw an error. - * - * You can simply spread the returned value of this method into your date_histogram. - * @example - * const aggregation = { - * date_histogram: { - * field: 'date', - * ...dateHistogramInterval('24h'), - * } - * }; - * - * @param interval The interval string to return the appropriate date_histogram key for. - */ -export declare function dateHistogramInterval(interval: string, shouldForceFixed?: boolean): Interval; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/index.d.ts deleted file mode 100644 index 748ff6e8586f8..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './date_histogram_interval'; -export * from './invalid_es_calendar_interval_error'; -export * from './invalid_es_interval_format_error'; -export * from './is_valid_es_interval'; -export * from './is_valid_interval'; -export * from './parse_interval'; -export * from './parse_es_interval'; -export * from './to_absolute_dates'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.d.ts deleted file mode 100644 index f294bd09e1218..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Unit } from '@kbn/datemath'; -export declare class InvalidEsCalendarIntervalError extends Error { - readonly interval: string; - readonly value: number; - readonly unit: Unit; - readonly type: string; - constructor(interval: string, value: number, unit: Unit, type: string); -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_interval_format_error.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_interval_format_error.d.ts deleted file mode 100644 index 22c427322d424..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/invalid_es_interval_format_error.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare class InvalidEsIntervalFormatError extends Error { - readonly interval: string; - constructor(interval: string); -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.d.ts deleted file mode 100644 index a530a13428033..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Checks whether a given interval string (e.g. 1w, 24h, ...) is a valid Elasticsearch interval. - * Will return false if the interval is not valid in Elasticsearch, otherwise true. - * Invalid intervals might be: 2f, since there is no unit 'f'; 2w, since weeks and month intervals - * are only allowed with a value of 1, etc. - * - * @param interval The interval string like 1w, 24h - * @returns True if the interval is valid for Elasticsearch - */ -export declare function isValidEsInterval(interval: string): boolean; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.d.ts deleted file mode 100644 index 8cb0d144e15e5..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function isValidInterval(value: string, baseInterval?: string): boolean; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_interval.d.ts deleted file mode 100644 index 554ec8c2a512a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_interval.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Finds the lowest common interval between two given ES date histogram intervals - * in the format of (value)(unit) - * - * - `ms` units are fixed-length intervals - * - `s, m, h, d` units are fixed-length intervals when value > 1 (i.e. 2m, 24h, 7d), - * but calendar interval when value === 1 - * - `w, M, q, y` units are calendar intervals and do not support multiple, aka - * value must === 1 - * - * @returns {string} - */ -export declare function leastCommonInterval(a: string, b: string): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_multiple.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_multiple.d.ts deleted file mode 100644 index d4587693ebe03..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/least_common_multiple.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Calculates the least common multiple of two numbers. The least common multiple - * is the smallest positive integer number, that is divisible by both input parameters. - * - * Since this calculation suffers from rounding issues in decimal values, this method - * won't work for passing in fractional (non integer) numbers. It will return a value, - * but that value won't necessarily be the mathematical correct least common multiple. - * - * @internal - */ -export declare function leastCommonMultiple(a: number, b: number): number; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.d.ts deleted file mode 100644 index 3bc23bf972969..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { Unit } from '@kbn/datemath'; -export type ParsedInterval = ReturnType; -/** - * Extracts interval properties from an ES interval string. Disallows unrecognized interval formats - * and fractional values. Converts some intervals from "calendar" to "fixed" when the number of - * units is larger than 1, and throws an error for others. - * - * Conversion rules: - * - * | Interval | Single unit type | Multiple units type | - * | -------- | ---------------- | ------------------- | - * | ms | fixed | fixed | - * | s | fixed | fixed | - * | m | calendar | fixed | - * | h | calendar | fixed | - * | d | calendar | fixed | - * | w | calendar | N/A - disallowed | - * | M | calendar | N/A - disallowed | - * | y | calendar | N/A - disallowed | - * - */ -export declare function parseEsInterval(interval: string): { - value: number; - unit: Unit; - type: "fixed" | "calendar"; -}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_interval.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_interval.d.ts deleted file mode 100644 index 6260bcd61dbca..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/parse_interval.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import moment from 'moment'; -import type { Unit } from '@kbn/datemath'; -export declare const splitStringInterval: (interval: string) => { - value: number; - unit: Unit; -} | null; -export declare function parseInterval(interval: string): moment.Duration | null; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.d.ts deleted file mode 100644 index a3d6727d3c40d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { TimeRange } from '@kbn/es-query'; -export declare function toAbsoluteDates(range: TimeRange): { - from: Date; - to: Date; -} | undefined; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/get_aggs_formats.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/get_aggs_formats.d.ts deleted file mode 100644 index b4f0a1efcc91b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/get_aggs_formats.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { FieldFormatInstanceType, IFieldFormat, SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; -type GetFieldFormat = (mapping: SerializedFieldFormat) => IFieldFormat; -/** - * Certain aggs have custom field formats that have dependency on aggs code. - * This function creates such field formats types and then those are added to field formatters registry - * - * These formats can't be used from field format editor UI - * - * This function is internal to the data plugin, and only exists for use inside - * the field formats service. - * - * @internal - */ -export declare function getAggsFormats(getFieldFormat: GetFieldFormat): FieldFormatInstanceType[]; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/index.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/index.d.ts deleted file mode 100644 index 88cb369f4f70f..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './calculate_auto_time_expression'; -export * from './date_interval_utils'; -export * from './get_aggs_formats'; -export * from './ip_address'; -export * from './prop_filter'; -export * from './infer_time_zone'; -export * from './parse_time_shift'; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/infer_time_zone.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/infer_time_zone.d.ts deleted file mode 100644 index e525145436c4e..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/infer_time_zone.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DataView, DataViewField } from '@kbn/data-views-plugin/common'; -import type { AggTypesDependencies } from '../../..'; -export declare function inferTimeZone(params: { - field?: DataViewField | string; - time_zone?: string; -}, dataView: DataView, aggName: 'date_histogram' | 'date_range', getConfig: AggTypesDependencies['getConfig'], { shouldDetectTimeZone }?: AggTypesDependencies['aggExecutionContext']): string; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/ip_address.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/ip_address.d.ts deleted file mode 100644 index 389423f3bdda8..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/ip_address.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare class IpAddress { - private value; - constructor(ipAddress: string | number | number[]); - toString(): string; -} diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/parse_time_shift.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/parse_time_shift.d.ts deleted file mode 100644 index 95672924f6a20..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/parse_time_shift.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import moment from 'moment'; -import type { TimeRange } from '../../../types'; -declare const INVALID_DATE = "invalid"; -declare const PREVIOUS_DATE = "previous"; -type PreviousDateType = typeof PREVIOUS_DATE; -type InvalidDateType = typeof INVALID_DATE; -/** - * This method parses a string into a time shift duration. - * If parsing fails, 'invalid' is returned. - * Allowed values are the string 'previous' and an integer followed by the units s,m,h,d,w,M,y - * */ -export declare const parseTimeShift: (val: string) => moment.Duration | PreviousDateType | InvalidDateType; -/** - * Check function to detect an absolute time shift. - * The check is performed only on the string format and the timestamp is not validated: - * use the validateAbsoluteTimeShift fucntion to perform more in depth checks - * @param val the string to parse (it assumes it has been trimmed already) - * @returns true if an absolute time shift - */ -export declare const isAbsoluteTimeShift: (val?: string) => boolean; -export declare const REASON_IDS: { - readonly missingTimerange: "missingTimerange"; - readonly notAbsoluteTimeShift: "notAbsoluteTimeShift"; - readonly invalidDate: "invalidDate"; - readonly shiftAfterTimeRange: "shiftAfterTimeRange"; -}; -export type REASON_ID_TYPES = keyof typeof REASON_IDS; -/** - * Parses an absolute time shift string and returns its equivalent duration - * @param val the string to parse - * @param timeRange the current date histogram interval - * @returns - */ -export declare const parseAbsoluteTimeShift: (val: string, timeRange: TimeRange | undefined) => { - value: moment.Duration; - reason: null; -} | { - value: InvalidDateType; - reason: REASON_ID_TYPES; -}; -/** - * Relaxed version of the parsing validation - * This version of the validation applies the timeRange validation only when passed - * @param val - * @param timeRange - * @returns the reason id if the absolute shift is not valid, undefined otherwise - */ -export declare function validateAbsoluteTimeShift(val: string, timeRange?: TimeRange): REASON_ID_TYPES | undefined; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/prop_filter.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/prop_filter.d.ts deleted file mode 100644 index 4bfa08721e77b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/prop_filter.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -type FilterFunc

= (item: T[P]) => boolean; -/** - * Filters out a list by a given filter. This is currently used to implement: - * - fieldType filters a list of fields by their type property - * - aggFilter filters a list of aggs by their name property - * - * @returns the filter function which can be registered with angular - */ -export declare function propFilter

(prop: P): (list: T[], filters?: string[] | string | FilterFunc) => T[]; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/sampler.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/sampler.d.ts deleted file mode 100644 index 910452e492d84..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/sampler.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export declare function createSamplerAgg({ type, probability, seed, }: { - type?: string; - probability: number; - seed?: number; -}): { - [type]: { - probability: number; - seed: number | undefined; - }; - aggs: {}; -}; -export declare function isSamplingEnabled(probability: number | undefined): boolean; diff --git a/src/platform/plugins/shared/data/common/search/aggs/utils/time_splits.d.ts b/src/platform/plugins/shared/data/common/search/aggs/utils/time_splits.d.ts deleted file mode 100644 index e8f8d289b0f14..0000000000000 --- a/src/platform/plugins/shared/data/common/search/aggs/utils/time_splits.d.ts +++ /dev/null @@ -1,251 +0,0 @@ -import moment from 'moment-timezone'; -import type { estypes } from '@elastic/elasticsearch'; -import type { AggConfigs, AggConfig } from '../../..'; -/** - * This function will transform an ES response containg a time split (using a filters aggregation before the metrics or date histogram aggregation), - * merging together all branches for the different time ranges into a single response structure which can be tabified into a single table. - * - * If there is just a single time shift, there are no separate branches per time range - in this case only the date histogram keys are shifted by the - * configured amount of time. - * - * To do this, the following steps are taken: - * * Traverse the response tree, tracking the current agg config - * * Once the node which would contain the time split object is found, merge all separate time range buckets into a single layer of buckets of the parent agg - * * Recursively repeat this process for all nested sub-buckets - * - * Example input: - * ``` - * "aggregations" : { - "product" : { - "buckets" : [ - { - "key" : "Product A", - "doc_count" : 512, - "first_year" : { - "doc_count" : 418, - "overall_revenue" : { - "value" : 2163634.0 - } - }, - "time_offset_split" : { - "buckets" : { - "-1y" : { - "doc_count" : 420, - "year" : { - "buckets" : [ - { - "key_as_string" : "2018", - "doc_count" : 81, - "revenue" : { - "value" : 505124.0 - } - }, - { - "key_as_string" : "2019", - "doc_count" : 65, - "revenue" : { - "value" : 363058.0 - } - } - ] - } - }, - "regular" : { - "doc_count" : 418, - "year" : { - "buckets" : [ - { - "key_as_string" : "2019", - "doc_count" : 65, - "revenue" : { - "value" : 363058.0 - } - }, - { - "key_as_string" : "2020", - "doc_count" : 84, - "revenue" : { - "value" : 392924.0 - } - } - ] - } - } - } - } - }, - { - "key" : "Product B", - "doc_count" : 248, - "first_year" : { - "doc_count" : 215, - "overall_revenue" : { - "value" : 1315547.0 - } - }, - "time_offset_split" : { - "buckets" : { - "-1y" : { - "doc_count" : 211, - "year" : { - "buckets" : [ - { - "key_as_string" : "2018", - "key" : 1618963200000, - "doc_count" : 28, - "revenue" : { - "value" : 156543.0 - } - }, - // ... - * ``` - * - * Example output: - * ``` - * "aggregations" : { - "product" : { - "buckets" : [ - { - "key" : "Product A", - "doc_count" : 512, - "first_year" : { - "doc_count" : 418, - "overall_revenue" : { - "value" : 2163634.0 - } - }, - "year" : { - "buckets" : [ - { - "key_as_string" : "2019", - "doc_count" : 81, - "revenue_regular" : { - "value" : 505124.0 - }, - "revenue_-1y" : { - "value" : 302736.0 - } - }, - { - "key_as_string" : "2020", - "doc_count" : 78, - "revenue_regular" : { - "value" : 392924.0 - }, - "revenue_-1y" : { - "value" : 363058.0 - }, - } - // ... - * ``` - * - * - * @param aggConfigs The agg configs instance - * @param aggCursor The root aggregations object from the response which will be mutated in place - */ -export declare function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record): void; -/** - * Inserts a filters aggregation into the aggregation tree which splits buckets to fetch data for all time ranges - * configured in metric aggregations. - * - * The current agg config can implement `splitForTimeShift` to force insertion of the time split filters aggregation - * before the dsl of the agg config (date histogram and metrics aggregations do this) - * - * Example aggregation tree without time split: - * ``` - * "aggs": { - "product": { - "terms": { - "field": "product", - "size": 3, - "order": { "overall_revenue": "desc" } - }, - "aggs": { - "overall_revenue": { - "sum": { - "field": "sales" - } - }, - "year": { - "date_histogram": { - "field": "timestamp", - "interval": "year" - }, - "aggs": { - "revenue": { - "sum": { - "field": "sales" - } - } - } - // ... - * ``` - * - * Same aggregation tree with inserted time split: - * ``` - * "aggs": { - "product": { - "terms": { - "field": "product", - "size": 3, - "order": { "first_year>overall_revenue": "desc" } - }, - "aggs": { - "first_year": { - "filter": { - "range": { - "timestamp": { - "gte": "2019", - "lte": "2020" - } - } - }, - "aggs": { - "overall_revenue": { - "sum": { - "field": "sales" - } - } - } - }, - "time_offset_split": { - "filters": { - "filters": { - "regular": { - "range": { - "timestamp": { - "gte": "2019", - "lte": "2020" - } - } - }, - "-1y": { - "range": { - "timestamp": { - "gte": "2018", - "lte": "2019" - } - } - } - } - }, - "aggs": { - "year": { - "date_histogram": { - "field": "timestamp", - "interval": "year" - }, - "aggs": { - "revenue": { - "sum": { - "field": "sales" - } - } - } - } - } - } - } - * ``` - */ -export declare function insertTimeShiftSplit(aggConfigs: AggConfigs, config: AggConfig, timeShifts: Record, dslLvlCursor: Record, defaultTimeZone: string): any; diff --git a/src/platform/plugins/shared/data/common/search/expressions/aggregate_query_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/aggregate_query_to_ast.d.ts deleted file mode 100644 index f5b150f3501c7..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/aggregate_query_to_ast.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ExpressionAstFunction } from '@kbn/expressions-plugin/common'; -import type { AggregateQuery } from '../../query'; -export declare const aggregateQueryToAst: ({ query, timeField, titleForInspector, descriptionForInspector, ignoreGlobalFilters, }: { - query: AggregateQuery; - timeField?: string; - titleForInspector?: string; - descriptionForInspector?: string; - ignoreGlobalFilters?: boolean; -}) => undefined | ExpressionAstFunction; diff --git a/src/platform/plugins/shared/data/common/search/expressions/cidr.d.ts b/src/platform/plugins/shared/data/common/search/expressions/cidr.d.ts deleted file mode 100644 index 3f5b7e4152a7b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/cidr.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -export interface Cidr { - mask: string; -} -export type CidrOutput = ExpressionValueBoxed<'cidr', Cidr>; -export type ExpressionFunctionCidr = ExpressionFunctionDefinition<'cidr', null, Cidr, CidrOutput>; -export declare const cidrFunction: ExpressionFunctionCidr; diff --git a/src/platform/plugins/shared/data/common/search/expressions/cidr_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/cidr_to_ast.d.ts deleted file mode 100644 index 97c0784b04bf2..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/cidr_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Cidr } from './cidr'; -export declare const cidrToAst: (cidr: Cidr) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/date_range.d.ts b/src/platform/plugins/shared/data/common/search/expressions/date_range.d.ts deleted file mode 100644 index f08c974774793..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/date_range.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -export interface DateRange { - from: number | string; - to: number | string; -} -export type DateRangeOutput = ExpressionValueBoxed<'date_range', DateRange>; -export type ExpressionFunctionDateRange = ExpressionFunctionDefinition<'dateRange', null, DateRange, DateRangeOutput>; -export declare const dateRangeFunction: ExpressionFunctionDateRange; diff --git a/src/platform/plugins/shared/data/common/search/expressions/date_range_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/date_range_to_ast.d.ts deleted file mode 100644 index f3b45383f485c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/date_range_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { DateRange } from './date_range'; -export declare const dateRangeToAst: (dateRange: DateRange) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/eql.d.ts b/src/platform/plugins/shared/data/common/search/expressions/eql.d.ts deleted file mode 100644 index 633fc0f6621d8..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/eql.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { KibanaContext } from '..'; -import type { DataViewsContract, UiSettingsCommon } from '../..'; -import type { EqlRawResponse } from './eql_raw_response'; -declare const name = "eql"; -type Input = KibanaContext | null; -type Output = Promise; -interface Arguments { - query: string; - index: string; - size: number; - field: string[]; -} -export type EqlExpressionFunctionDefinition = ExpressionFunctionDefinition; -interface EqlStartDependencies { - search: ISearchGeneric; - uiSettingsClient: UiSettingsCommon; - dataViews: DataViewsContract; -} -export declare const getEqlFn: ({ getStartDependencies, }: { - getStartDependencies: (getKibanaRequest: any) => Promise; -}) => EqlExpressionFunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/eql_raw_response.d.ts b/src/platform/plugins/shared/data/common/search/expressions/eql_raw_response.d.ts deleted file mode 100644 index 2b15c3cbc653e..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/eql_raw_response.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { ExpressionTypeDefinition } from '@kbn/expressions-plugin/common'; -import type { EqlSearchStrategyResponse } from '..'; -declare const name = "eql_raw_response"; -export interface EqlRawResponse { - type: typeof name; - body: EqlSearchStrategyResponse['rawResponse']; -} -export type SearchTypes = string | string[] | number | number[] | boolean | boolean[] | object | object[] | undefined; -export interface TotalValue { - value: number; - relation: string; -} -export interface BaseHit { - _index: string; - _id: string; - _source: T; - fields?: Record; -} -export interface EqlSequence { - join_keys: SearchTypes[]; - events: Array>; -} -export interface EqlSearchResponse { - is_partial: boolean; - is_running: boolean; - took: number; - timed_out: boolean; - hits: { - total: TotalValue; - sequences?: Array>; - events?: Array>; - }; -} -export type EqlRawResponseExpressionTypeDefinition = ExpressionTypeDefinition; -export declare const eqlRawResponse: EqlRawResponseExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/es_raw_response.d.ts b/src/platform/plugins/shared/data/common/search/expressions/es_raw_response.d.ts deleted file mode 100644 index 4d6f0d51400b9..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/es_raw_response.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { ExpressionTypeDefinition } from '@kbn/expressions-plugin/common'; -declare const name = "es_raw_response"; -export interface EsRawResponse { - type: typeof name; - body: estypes.SearchResponse; -} -export type EsRawResponseExpressionTypeDefinition = ExpressionTypeDefinition; -export declare const esRawResponse: EsRawResponseExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esaggs/esaggs_fn.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esaggs/esaggs_fn.d.ts deleted file mode 100644 index 4ca8a642fa6e7..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/esaggs/esaggs_fn.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { IndexPatternExpressionType } from '@kbn/data-views-plugin/common/expressions'; -import type { DataViewsContract } from '@kbn/data-views-plugin/common'; -import type { AggsStart, AggExpressionType } from '../../aggs'; -import type { ISearchStartSearchSource } from '../../search_source'; -import type { KibanaContext } from '../kibana_context_type'; -import { handleRequest } from './request_handler'; -type Input = KibanaContext | null; -type Output = Observable; -interface Arguments { - index: IndexPatternExpressionType; - aggs?: AggExpressionType[]; - metricsAtAllLevels?: boolean; - partialRows?: boolean; - timeFields?: string[]; - probability?: number; - samplerSeed?: number; - ignoreGlobalFilters?: boolean; -} -export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input, Arguments, Output>; -/** @internal */ -export interface EsaggsStartDependencies { - aggs: AggsStart; - dataViews: DataViewsContract; - searchSource: ISearchStartSearchSource; - getNow?: () => Date; -} -/** @internal */ -export declare const getEsaggsMeta: () => Omit; -export { handleRequest as handleEsaggsRequest }; -export type { RequestHandlerParams } from './request_handler'; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esaggs/index.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esaggs/index.d.ts deleted file mode 100644 index 4b83d1171776b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/esaggs/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './esaggs_fn'; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esaggs/request_handler.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esaggs/request_handler.d.ts deleted file mode 100644 index a30bc46be056a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/esaggs/request_handler.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { KibanaExecutionContext } from '@kbn/core/public'; -import type { Adapters } from '@kbn/inspector-plugin/common'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { Filter, ProjectRouting, TimeRange } from '@kbn/es-query'; -import type { Query } from '../../..'; -import type { IAggConfigs } from '../../aggs'; -import type { ISearchStartSearchSource } from '../../search_source'; -export interface RequestHandlerParams { - abortSignal?: AbortSignal; - aggs: IAggConfigs; - filters?: Filter[]; - indexPattern?: DataView; - inspectorAdapters: Adapters; - query?: Query; - searchSessionId?: string; - searchSourceService: ISearchStartSearchSource; - timeFields?: string[]; - timeRange?: TimeRange; - disableWarningToasts?: boolean; - getNow?: () => Date; - executionContext?: KibanaExecutionContext; - title?: string; - description?: string; - projectRouting?: ProjectRouting; -} -export declare const handleRequest: ({ abortSignal, aggs, filters, indexPattern, inspectorAdapters, query, searchSessionId, searchSourceService, timeFields, timeRange, disableWarningToasts, getNow, executionContext, title, description, projectRouting, }: RequestHandlerParams) => import("rxjs").Observable; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esdsl.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esdsl.d.ts deleted file mode 100644 index 5dc1bd97d76b1..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/esdsl.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { EsRawResponse } from './es_raw_response'; -import type { KibanaContext } from '..'; -import type { UiSettingsCommon } from '../..'; -declare const name = "esdsl"; -type Input = KibanaContext | null; -type Output = Promise; -interface Arguments { - dsl: string; - index: string; - size: number; -} -export type EsdslExpressionFunctionDefinition = ExpressionFunctionDefinition; -interface EsdslStartDependencies { - search: ISearchGeneric; - uiSettingsClient: UiSettingsCommon; -} -export declare const getEsdslFn: ({ getStartDependencies, }: { - getStartDependencies: (getKibanaRequest: any) => Promise; -}) => EsdslExpressionFunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/esql.d.ts b/src/platform/plugins/shared/data/common/search/expressions/esql.d.ts deleted file mode 100644 index 38d8ec83d1e3a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/esql.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { Observable } from 'rxjs'; -import { type KibanaContext } from '..'; -import type { UiSettingsCommon } from '../..'; -declare global { - interface Window { - /** - * Debug setting to make requests complete slower than normal. Only available on snapshots where `error_query` is enabled in ES. - */ - ELASTIC_ESQL_DELAY_SECONDS?: number; - } -} -type Input = KibanaContext | null; -type Output = Observable; -interface Arguments { - query: string; - timeField?: string; - locale?: string; - /** - * Requests' meta for showing in Inspector - */ - titleForInspector?: string; - descriptionForInspector?: string; - ignoreGlobalFilters?: boolean; -} -export type EsqlExpressionFunctionDefinition = ExpressionFunctionDefinition<'esql', Input, Arguments, Output>; -interface EsqlFnArguments { - getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; -} -interface EsqlStartDependencies { - search: ISearchGeneric; - uiSettings: UiSettingsCommon; -} -export declare const getEsqlFn: ({ getStartDependencies }: EsqlFnArguments) => EsqlExpressionFunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/essql.d.ts b/src/platform/plugins/shared/data/common/search/expressions/essql.d.ts deleted file mode 100644 index f7c1c4f3fc5a6..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/essql.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { Observable } from 'rxjs'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { NowProviderPublicContract } from '../../../public'; -import type { UiSettingsCommon } from '../..'; -import type { KibanaContext } from '..'; -type Input = KibanaContext | null; -type Output = Observable; -interface Arguments { - query: string; - parameter?: Array; - count?: number; - timezone?: string; - timeField?: string; -} -export type EssqlExpressionFunctionDefinition = ExpressionFunctionDefinition<'essql', Input, Arguments, Output>; -interface EssqlFnArguments { - getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; -} -interface EssqlStartDependencies { - nowProvider?: NowProviderPublicContract; - search: ISearchGeneric; - uiSettings: UiSettingsCommon; -} -export declare const getEssqlFn: ({ getStartDependencies }: EssqlFnArguments) => EssqlExpressionFunctionDefinition; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/exists_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/exists_filter.d.ts deleted file mode 100644 index 4d74ec66ac245..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/exists_filter.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaField, KibanaFilter } from './kibana_context_type'; -interface Arguments { - field: KibanaField; - negate?: boolean; -} -export type ExpressionFunctionExistsFilter = ExpressionFunctionDefinition<'existsFilter', null, Arguments, KibanaFilter>; -export declare const existsFilterFunction: ExpressionFunctionExistsFilter; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/extended_bounds.d.ts b/src/platform/plugins/shared/data/common/search/expressions/extended_bounds.d.ts deleted file mode 100644 index d7798b77d3753..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/extended_bounds.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -export interface ExtendedBounds { - min?: number; - max?: number; -} -export type ExtendedBoundsOutput = ExpressionValueBoxed<'extended_bounds', ExtendedBounds>; -export type ExpressionFunctionExtendedBounds = ExpressionFunctionDefinition<'extendedBounds', null, ExtendedBounds, ExtendedBoundsOutput>; -export declare const extendedBoundsFunction: ExpressionFunctionExtendedBounds; diff --git a/src/platform/plugins/shared/data/common/search/expressions/extended_bounds_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/extended_bounds_to_ast.d.ts deleted file mode 100644 index d93999fbb03e3..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/extended_bounds_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ExtendedBounds } from './extended_bounds'; -export declare const extendedBoundsToAst: (extendedBounds: ExtendedBounds) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/field.d.ts b/src/platform/plugins/shared/data/common/search/expressions/field.d.ts deleted file mode 100644 index ab1ebeb71fddf..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/field.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaField } from './kibana_context_type'; -interface Arguments { - name: string; - type: string; - script?: string; -} -export type ExpressionFunctionField = ExpressionFunctionDefinition<'field', null, Arguments, KibanaField>; -export declare const fieldFunction: ExpressionFunctionField; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/filters_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/filters_to_ast.d.ts deleted file mode 100644 index 6122fcff6f194..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/filters_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -export declare const filtersToAst: (filters: Filter[] | Filter) => import("@kbn/expressions-plugin/common").ExpressionAstExpression[]; diff --git a/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box.d.ts b/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box.d.ts deleted file mode 100644 index 1997d48e44a95..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -import type { GeoPoint, GeoPointOutput } from './geo_point'; -type GeoBox = { - top: number; - left: number; - bottom: number; - right: number; -}; -type GeoPoints = { - top_left: GeoPoint; - bottom_right: GeoPoint; -} | { - top_right: GeoPoint; - bottom_left: GeoPoint; -}; -type WellKnownText = { - wkt: string; -}; -/** GeoBoundingBox Accepted Formats: - * Lat Lon As Properties: - * "top_left" : { - * "lat" : 40.73, "lon" : -74.1 - * }, - * "bottom_right" : { - * "lat" : 40.01, "lon" : -71.12 - * } - * - * Lat Lon As Array: - * { - * "top_left" : [-74.1, 40.73], - * "bottom_right" : [-71.12, 40.01] - * } - * - * Lat Lon As String: - * { - * "top_left" : "40.73, -74.1", - * "bottom_right" : "40.01, -71.12" - * } - * - * Bounding Box as Well-Known Text (WKT): - * { - * "wkt" : "BBOX (-74.1, -71.12, 40.73, 40.01)" - * } - * - * Geohash: - * { - * "top_right" : "dr5r9ydj2y73", - * "bottom_left" : "drj7teegpus6" - * } - * - * Vertices: - * { - * "top" : 40.73, - * "left" : -74.1, - * "bottom" : 40.01, - * "right" : -71.12 - * } - * - * **/ -export type GeoBoundingBox = GeoBox | GeoPoints | WellKnownText; -export type GeoBoundingBoxOutput = ExpressionValueBoxed<'geo_bounding_box', GeoBoundingBox>; -type GeoPointsArguments = { - topLeft: GeoPointOutput; - bottomRight: GeoPointOutput; -} | { - topRight: GeoPointOutput; - bottomLeft: GeoPointOutput; -}; -type GeoBoundingBoxArguments = GeoBox | GeoPointsArguments | WellKnownText; -export type ExpressionFunctionGeoBoundingBox = ExpressionFunctionDefinition<'geoBoundingBox', null, GeoBoundingBoxArguments, GeoBoundingBoxOutput>; -export declare const geoBoundingBoxFunction: ExpressionFunctionGeoBoundingBox; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box_to_ast.d.ts deleted file mode 100644 index 994e902227a1a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/geo_bounding_box_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { GeoBoundingBox } from './geo_bounding_box'; -export declare const geoBoundingBoxToAst: (geoBoundingBox: GeoBoundingBox) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/geo_point.d.ts b/src/platform/plugins/shared/data/common/search/expressions/geo_point.d.ts deleted file mode 100644 index eb59fa27e3259..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/geo_point.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -interface Point { - lat: number; - lon: number; -} -export type GeoPoint = Point | string | [number, number]; -export type GeoPointOutput = ExpressionValueBoxed<'geo_point', { - value: GeoPoint; -}>; -interface GeoPointArguments extends Partial { - point?: Array; -} -export type ExpressionFunctionGeoPoint = ExpressionFunctionDefinition<'geoPoint', null, GeoPointArguments, GeoPointOutput>; -export declare const geoPointFunction: ExpressionFunctionGeoPoint; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/geo_point_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/geo_point_to_ast.d.ts deleted file mode 100644 index 9cb6ba5d9494a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/geo_point_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { GeoPoint } from './geo_point'; -export declare const geoPointToAst: (point: GeoPoint) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/index.d.ts b/src/platform/plugins/shared/data/common/search/expressions/index.d.ts deleted file mode 100644 index 04907302a1af2..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/index.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -export * from './cidr'; -export * from './cidr_to_ast'; -export * from './date_range'; -export * from './date_range_to_ast'; -export * from './extended_bounds'; -export * from './extended_bounds_to_ast'; -export * from './geo_bounding_box'; -export * from './geo_bounding_box_to_ast'; -export * from './geo_point'; -export * from './geo_point_to_ast'; -export * from './ip_prefix'; -export * from './ip_prefix_to_ast'; -export * from './ip_range'; -export * from './ip_range_to_ast'; -export * from './kibana'; -export type * from './kibana_context'; -export * from './kql'; -export * from './lucene'; -export * from './numerical_range'; -export * from './numerical_range_to_ast'; -export * from './query_filter'; -export * from './query_filter_to_ast'; -export * from './query_to_ast'; -export * from './aggregate_query_to_ast'; -export * from './timerange_to_ast'; -export type * from './kibana_context_type'; -export * from './esaggs'; -export * from './utils'; -export * from './range'; -export * from './field'; -export * from './phrase_filter'; -export * from './exists_filter'; -export * from './range_filter'; -export * from './remove_filter'; -export * from './select_filter'; -export * from './kibana_filter'; -export * from './filters_to_ast'; -export * from './timerange'; -export * from './es_raw_response'; -export * from './eql_raw_response'; -export * from './esdsl'; -export * from './eql'; -export * from './esql'; diff --git a/src/platform/plugins/shared/data/common/search/expressions/ip_prefix.d.ts b/src/platform/plugins/shared/data/common/search/expressions/ip_prefix.d.ts deleted file mode 100644 index 5f41a25d64484..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/ip_prefix.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -export interface IpPrefix { - prefixLength?: number; - isIpv6?: boolean; -} -export type IpPrefixOutput = ExpressionValueBoxed<'ip_prefix', IpPrefix>; -export type ExpressionFunctionIpPrefix = ExpressionFunctionDefinition<'ipPrefix', null, IpPrefix, IpPrefixOutput>; -export declare const ipPrefixFunction: ExpressionFunctionIpPrefix; diff --git a/src/platform/plugins/shared/data/common/search/expressions/ip_prefix_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/ip_prefix_to_ast.d.ts deleted file mode 100644 index d3a564ab7c0c2..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/ip_prefix_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { IpPrefix } from './ip_prefix'; -export declare const ipPrefixToAst: (ipPrefix: IpPrefix) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/ip_range.d.ts b/src/platform/plugins/shared/data/common/search/expressions/ip_range.d.ts deleted file mode 100644 index a61c4f222be5d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/ip_range.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -export interface IpRange { - from: string; - to: string; -} -export type IpRangeOutput = ExpressionValueBoxed<'ip_range', IpRange>; -export type ExpressionFunctionIpRange = ExpressionFunctionDefinition<'ipRange', null, IpRange, IpRangeOutput>; -export declare const ipRangeFunction: ExpressionFunctionIpRange; diff --git a/src/platform/plugins/shared/data/common/search/expressions/ip_range_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/ip_range_to_ast.d.ts deleted file mode 100644 index f96bcce87e1bd..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/ip_range_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { IpRange } from './ip_range'; -export declare const ipRangeToAst: (ipRange: IpRange) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kibana.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kibana.d.ts deleted file mode 100644 index 46655fe7fd49c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/kibana.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ExecutionContext, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { Adapters } from '@kbn/inspector-plugin/common'; -import type { ExpressionValueSearchContext } from './kibana_context_type'; -export type ExpressionFunctionKibana = ExpressionFunctionDefinition<'kibana', ExpressionValueSearchContext | null, object, ExpressionValueSearchContext, ExecutionContext>; -export declare const kibana: ExpressionFunctionKibana; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kibana_context.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kibana_context.d.ts deleted file mode 100644 index 08bcf77082d0c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/kibana_context.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ExpressionFunctionDefinition, ExecutionContext } from '@kbn/expressions-plugin/common'; -import type { Adapters } from '@kbn/inspector-plugin/common'; -import type { KibanaTimerangeOutput, KibanaContext, KibanaFilter, KibanaQueryOutput } from '../..'; -interface Arguments { - q?: KibanaQueryOutput[] | null; - filters?: KibanaFilter[] | null; - timeRange?: KibanaTimerangeOutput | null; - savedSearchId?: string | null; -} -export type ExpressionFunctionKibanaContext = ExpressionFunctionDefinition<'kibana_context', KibanaContext | null, Arguments, Promise, ExecutionContext>; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kibana_context_type.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kibana_context_type.d.ts deleted file mode 100644 index ab650f15fcdc0..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/kibana_context_type.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Filter, ExecutionContextSearch } from '@kbn/es-query'; -import type { ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -import type { Query } from '../../query'; -import type { DataViewField } from '../..'; -export type ExpressionValueSearchContext = ExpressionValueBoxed<'kibana_context', ExecutionContextSearch>; -export type KibanaQueryOutput = ExpressionValueBoxed<'kibana_query', Query>; -export type KibanaFilter = ExpressionValueBoxed<'kibana_filter', Filter>; -export type KibanaField = ExpressionValueBoxed<'kibana_field', DataViewField>; -export type KIBANA_CONTEXT_NAME = 'kibana_context'; -export type KibanaContext = ExpressionValueSearchContext; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kibana_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kibana_filter.d.ts deleted file mode 100644 index aae324ffd8b6d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/kibana_filter.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaFilter } from './kibana_context_type'; -interface Arguments { - query: string; - negate?: boolean; - disabled?: boolean; -} -export type ExpressionFunctionKibanaFilter = ExpressionFunctionDefinition<'kibanaFilter', null, Arguments, KibanaFilter>; -export declare const kibanaFilterFunction: ExpressionFunctionKibanaFilter; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/kql.d.ts b/src/platform/plugins/shared/data/common/search/expressions/kql.d.ts deleted file mode 100644 index 9d2107d65289f..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/kql.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaQueryOutput } from './kibana_context_type'; -interface Arguments { - q: string; -} -export type ExpressionFunctionKql = ExpressionFunctionDefinition<'kql', null, Arguments, KibanaQueryOutput>; -export declare const kqlFunction: ExpressionFunctionKql; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/lucene.d.ts b/src/platform/plugins/shared/data/common/search/expressions/lucene.d.ts deleted file mode 100644 index af13121239df4..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/lucene.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaQueryOutput } from './kibana_context_type'; -interface Arguments { - q: string; -} -export type ExpressionFunctionLucene = ExpressionFunctionDefinition<'lucene', null, Arguments, KibanaQueryOutput>; -export declare const luceneFunction: ExpressionFunctionLucene; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/numerical_range.d.ts b/src/platform/plugins/shared/data/common/search/expressions/numerical_range.d.ts deleted file mode 100644 index 9a24c1f3f731d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/numerical_range.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -export interface NumericalRange { - from?: number; - to?: number; - label?: string; -} -export type NumericalRangeOutput = ExpressionValueBoxed<'numerical_range', NumericalRange>; -export type ExpressionFunctionNumericalRange = ExpressionFunctionDefinition<'numericalRange', null, NumericalRange, NumericalRangeOutput>; -export declare const numericalRangeFunction: ExpressionFunctionNumericalRange; diff --git a/src/platform/plugins/shared/data/common/search/expressions/numerical_range_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/numerical_range_to_ast.d.ts deleted file mode 100644 index 1d35532876708..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/numerical_range_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { NumericalRange } from './numerical_range'; -export declare const numericalRangeToAst: (numericalRange: NumericalRange) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/phrase_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/phrase_filter.d.ts deleted file mode 100644 index f1657426feef8..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/phrase_filter.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaField, KibanaFilter } from './kibana_context_type'; -interface Arguments { - field: KibanaField; - phrase: string[]; - negate?: boolean; -} -export type ExpressionFunctionPhraseFilter = ExpressionFunctionDefinition<'phraseFilter', null, Arguments, KibanaFilter>; -export declare const phraseFilterFunction: ExpressionFunctionPhraseFilter; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/query_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/query_filter.d.ts deleted file mode 100644 index 2a55a021282f9..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/query_filter.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -import type { Query } from '../../query'; -import type { KibanaQueryOutput } from './kibana_context_type'; -export interface QueryFilter { - input: Query; - label?: string; -} -export type QueryFilterOutput = ExpressionValueBoxed<'kibana_query_filter', QueryFilter>; -interface QueryFilterArguments { - input: KibanaQueryOutput; - label?: string; -} -export type ExpressionFunctionQueryFilter = ExpressionFunctionDefinition<'queryFilter', null, QueryFilterArguments, QueryFilterOutput>; -export declare const queryFilterFunction: ExpressionFunctionQueryFilter; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/query_filter_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/query_filter_to_ast.d.ts deleted file mode 100644 index 14d484bf01d92..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/query_filter_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { QueryFilter } from './query_filter'; -export declare const queryFilterToAst: ({ input, label }: QueryFilter) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/query_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/query_to_ast.d.ts deleted file mode 100644 index 2acc127265a5a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/query_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Query } from '../../query'; -export declare const queryToAst: (query: Query) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/range.d.ts b/src/platform/plugins/shared/data/common/search/expressions/range.d.ts deleted file mode 100644 index 4197d89a26e9a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/range.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -interface Arguments { - gt?: number | string; - lt?: number | string; - gte?: number | string; - lte?: number | string; -} -export type KibanaRange = ExpressionValueBoxed<'kibana_range', Arguments>; -export type ExpressionFunctionRange = ExpressionFunctionDefinition<'range', null, Arguments, KibanaRange>; -export declare const rangeFunction: ExpressionFunctionRange; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/range_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/range_filter.d.ts deleted file mode 100644 index 0f33a194af14e..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/range_filter.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaField, KibanaFilter } from './kibana_context_type'; -import type { KibanaRange } from './range'; -interface Arguments { - field: KibanaField; - range: KibanaRange; - negate?: boolean; -} -export type ExpressionFunctionRangeFilter = ExpressionFunctionDefinition<'rangeFilter', null, Arguments, KibanaFilter>; -export declare const rangeFilterFunction: ExpressionFunctionRangeFilter; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/remove_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/remove_filter.d.ts deleted file mode 100644 index a767bac6ea49d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/remove_filter.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaContext } from './kibana_context_type'; -interface Arguments { - group?: string; - from?: string; - ungrouped?: boolean; -} -export type ExpressionFunctionRemoveFilter = ExpressionFunctionDefinition<'removeFilter', KibanaContext, Arguments, KibanaContext>; -export declare const removeFilterFunction: ExpressionFunctionRemoveFilter; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/select_filter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/select_filter.d.ts deleted file mode 100644 index 92a9683b8e9a3..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/select_filter.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { KibanaContext } from './kibana_context_type'; -interface Arguments { - group: string[]; - from?: string; - ungrouped?: boolean; -} -export type ExpressionFunctionSelectFilter = ExpressionFunctionDefinition<'selectFilter', KibanaContext, Arguments, KibanaContext>; -export declare const selectFilterFunction: ExpressionFunctionSelectFilter; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/expressions/timerange.d.ts b/src/platform/plugins/shared/data/common/search/expressions/timerange.d.ts deleted file mode 100644 index b76a5c21fa372..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/timerange.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ExpressionFunctionDefinition, ExpressionValueBoxed } from '@kbn/expressions-plugin/common'; -import type { TimeRange } from '../../query'; -export type KibanaTimerangeOutput = ExpressionValueBoxed<'timerange', TimeRange>; -export type ExpressionFunctionKibanaTimerange = ExpressionFunctionDefinition<'timerange', null, TimeRange, KibanaTimerangeOutput>; -export declare const kibanaTimerangeFunction: ExpressionFunctionKibanaTimerange; diff --git a/src/platform/plugins/shared/data/common/search/expressions/timerange_to_ast.d.ts b/src/platform/plugins/shared/data/common/search/expressions/timerange_to_ast.d.ts deleted file mode 100644 index 5ff192cdaafe4..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/timerange_to_ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TimeRange } from '../../query'; -export declare const timerangeToAst: (timerange: TimeRange) => import("@kbn/expressions-plugin/common").ExpressionAstExpression; diff --git a/src/platform/plugins/shared/data/common/search/expressions/utils/filters_adapter.d.ts b/src/platform/plugins/shared/data/common/search/expressions/utils/filters_adapter.d.ts deleted file mode 100644 index d9888e9f85416..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/utils/filters_adapter.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import type { ExpressionValueFilter } from '@kbn/expressions-plugin/common'; -export declare function adaptToExpressionValueFilter(filter: Filter): ExpressionValueFilter; diff --git a/src/platform/plugins/shared/data/common/search/expressions/utils/function_wrapper.d.ts b/src/platform/plugins/shared/data/common/search/expressions/utils/function_wrapper.d.ts deleted file mode 100644 index eaa64e3bb4878..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/utils/function_wrapper.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AnyExpressionFunctionDefinition, ExecutionContext } from '@kbn/expressions-plugin/common'; -/** - * Takes a function spec and passes in default args, - * overriding with any provided args. - */ -export declare const functionWrapper: (spec: AnyExpressionFunctionDefinition) => (context: object | null, args?: Record, handlers?: ExecutionContext) => any; diff --git a/src/platform/plugins/shared/data/common/search/expressions/utils/index.d.ts b/src/platform/plugins/shared/data/common/search/expressions/utils/index.d.ts deleted file mode 100644 index 717f8bed82dcd..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/utils/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './function_wrapper'; -export { adaptToExpressionValueFilter } from './filters_adapter'; -export { getSideEffectFunction } from './requests_side_effects'; diff --git a/src/platform/plugins/shared/data/common/search/expressions/utils/requests_side_effects.d.ts b/src/platform/plugins/shared/data/common/search/expressions/utils/requests_side_effects.d.ts deleted file mode 100644 index 99a5d4157388b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/expressions/utils/requests_side_effects.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Adapters } from '@kbn/inspector-plugin/common'; -export declare const getSideEffectFunction: (adapters: Adapters) => () => void; diff --git a/src/platform/plugins/shared/data/common/search/index.d.ts b/src/platform/plugins/shared/data/common/search/index.d.ts deleted file mode 100644 index ef06457721385..0000000000000 --- a/src/platform/plugins/shared/data/common/search/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * from './aggs'; -export * from './expressions'; -export * from './search_source'; -export * from './tabify'; -export * from './utils'; -export * from './session'; -export * from './poll_search'; -export * from './strategies/es_search'; -export * from './strategies/eql_search'; -export * from './strategies/ese_search'; -export * from './strategies/sql_search'; -export * from './strategies/esql_search'; diff --git a/src/platform/plugins/shared/data/common/search/poll_search.d.ts b/src/platform/plugins/shared/data/common/search/poll_search.d.ts deleted file mode 100644 index 57a53ac6f5fd4..0000000000000 --- a/src/platform/plugins/shared/data/common/search/poll_search.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { IKibanaSearchResponse } from '@kbn/search-types'; -import type { IAsyncSearchOptions } from '..'; -export declare const pollSearch: (search: () => Promise, cancel?: () => Promise, { pollInterval, abortSignal }?: IAsyncSearchOptions) => Observable; diff --git a/src/platform/plugins/shared/data/common/search/search_source/create_search_source.d.ts b/src/platform/plugins/shared/data/common/search/search_source/create_search_source.d.ts deleted file mode 100644 index b9a84a53024a0..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/create_search_source.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { DataViewsContract } from '@kbn/data-views-plugin/common'; -import type { SearchSourceDependencies } from './search_source'; -import { SearchSource } from './search_source'; -import type { SerializedSearchSourceFields } from '../..'; -/** - * Deserializes a json string and a set of referenced objects to a `SearchSource` instance. - * Use this method to re-create the search source serialized using `searchSource.serialize`. - * - * This function is a factory function that returns the actual utility when calling it with the - * required service dependency (index patterns contract). A pre-wired version is also exposed in - * the start contract of the data plugin as part of the search service - * - * @param indexPatterns The index patterns contract of the data plugin - * @param searchSourceDependencies - * - * @return Wired utility function taking two parameters `searchSourceJson`, the json string - * returned by `serializeSearchSource` and `references`, a list of references including the ones - * returned by `serializeSearchSource`. - * - * - * @public */ -export declare const createSearchSource: (indexPatterns: DataViewsContract, searchSourceDependencies: SearchSourceDependencies) => (searchSourceFields?: SerializedSearchSourceFields, useDataViewLazy?: boolean) => Promise; diff --git a/src/platform/plugins/shared/data/common/search/search_source/extract_references.d.ts b/src/platform/plugins/shared/data/common/search/search_source/extract_references.d.ts deleted file mode 100644 index e50e9d7435f95..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/extract_references.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { SavedObjectReference } from '@kbn/core/server'; -import type { SerializedSearchSourceFields } from './types'; -export declare const extractReferences: (state: SerializedSearchSourceFields, options?: { - refNamePrefix?: string; -}) => [SerializedSearchSourceFields, SavedObjectReference[]]; diff --git a/src/platform/plugins/shared/data/common/search/search_source/fetch/get_search_params.d.ts b/src/platform/plugins/shared/data/common/search/search_source/fetch/get_search_params.d.ts deleted file mode 100644 index 7833b95aceb8c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/fetch/get_search_params.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ISearchRequestParams } from '@kbn/search-types'; -import type { GetConfigFn } from '../../../types'; -import type { SearchRequest } from './types'; -export declare function getEsPreference(getConfigFn: GetConfigFn, sessionId?: string): SearchRequest['preference']; -/** @public */ -export declare function getSearchParamsFromRequest(searchRequest: SearchRequest, dependencies: { - getConfig: GetConfigFn; -}): ISearchRequestParams; diff --git a/src/platform/plugins/shared/data/common/search/search_source/fetch/index.d.ts b/src/platform/plugins/shared/data/common/search/search_source/fetch/index.d.ts deleted file mode 100644 index 0beb531e2996b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/fetch/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { getSearchParamsFromRequest, getEsPreference } from './get_search_params'; -export { RequestFailure } from './request_error'; -export type * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/search_source/fetch/request_error.d.ts b/src/platform/plugins/shared/data/common/search/search_source/fetch/request_error.d.ts deleted file mode 100644 index affaa0ae25cab..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/fetch/request_error.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { KbnError } from '@kbn/kibana-utils-plugin/common'; -import type { IKibanaSearchResponse } from '@kbn/search-types'; -import type { SearchError } from './types'; -/** - * Request Failure - When an entire multi request fails - * @param {Error} err - the Error that came back - * @param {Object} resp - optional HTTP response - */ -export declare class RequestFailure extends KbnError { - resp?: IKibanaSearchResponse; - constructor(err?: SearchError | null, resp?: IKibanaSearchResponse); -} diff --git a/src/platform/plugins/shared/data/common/search/search_source/fetch/types.d.ts b/src/platform/plugins/shared/data/common/search/search_source/fetch/types.d.ts deleted file mode 100644 index f235504f2dd46..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/fetch/types.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { IKibanaSearchResponse } from '@kbn/search-types'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { AggregateQuery, Filter, Query } from '@kbn/es-query'; -import type { SearchSourceSearchOptions } from '../../..'; -import type { GetConfigFn } from '../../../types'; -/** - * @internal - * - * This type is used when flattenning a SearchSource and passing it down to legacy search. - * Once legacy search is removed, this type should become internal to `SearchSource`, - * where `ISearchRequestParams` is used externally instead. - * FIXME: replace with estypes.SearchRequest? - */ -export type SearchRequest = Record> = { - index?: DataView | string; - query?: Array; - filters?: Filter[] | (() => Filter[]); -} & Omit; -export interface FetchHandlers { - getConfig: GetConfigFn; - /** - * Callback which can be used to hook into responses, modify them, or perform - * side effects like displaying UI errors on the client. - */ - onResponse: (request: SearchRequest, response: IKibanaSearchResponse, options: SearchSourceSearchOptions) => IKibanaSearchResponse; -} -export interface SearchError { - name: string; - status: string; - title: string; - message: string; - path: string; - type: string; -} diff --git a/src/platform/plugins/shared/data/common/search/search_source/index.d.ts b/src/platform/plugins/shared/data/common/search/search_source/index.d.ts deleted file mode 100644 index 77326f52f6002..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export { createSearchSource } from './create_search_source'; -export { injectReferences } from './inject_references'; -export { extractReferences } from './extract_references'; -export { parseSearchSourceJSON } from './parse_json'; -export { getResponseInspectorStats } from './inspect'; -export * from './fetch'; -export * from './search_source'; -export * from './search_source_service'; -export * from './types'; -export * from './query_to_fields'; diff --git a/src/platform/plugins/shared/data/common/search/search_source/inject_references.d.ts b/src/platform/plugins/shared/data/common/search/search_source/inject_references.d.ts deleted file mode 100644 index fcdf06be6d954..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/inject_references.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { SavedObjectReference } from '@kbn/core/server'; -import type { SerializedSearchSourceFields } from './types'; -export declare const injectReferences: (searchSourceFields: SerializedSearchSourceFields & { - indexRefName?: string; -}, references: SavedObjectReference[]) => SerializedSearchSourceFields; diff --git a/src/platform/plugins/shared/data/common/search/search_source/inspect/index.d.ts b/src/platform/plugins/shared/data/common/search/search_source/inspect/index.d.ts deleted file mode 100644 index 42ad2c986be0f..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/inspect/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './inspector_stats'; diff --git a/src/platform/plugins/shared/data/common/search/search_source/inspect/inspector_stats.d.ts b/src/platform/plugins/shared/data/common/search/search_source/inspect/inspector_stats.d.ts deleted file mode 100644 index 81d20707c49b3..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/inspect/inspector_stats.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { RequestStatistics } from '@kbn/inspector-plugin/common'; -import type { ISearchSource } from '../../../../public'; -/** @public */ -export declare function getRequestInspectorStats(searchSource: ISearchSource): RequestStatistics; -/** @public */ -export declare function getResponseInspectorStats(resp?: estypes.SearchResponse, searchSource?: ISearchSource): RequestStatistics; diff --git a/src/platform/plugins/shared/data/common/search/search_source/migrate_legacy_query.d.ts b/src/platform/plugins/shared/data/common/search/search_source/migrate_legacy_query.d.ts deleted file mode 100644 index ed973f6b4a219..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/migrate_legacy_query.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Query, AggregateQuery } from '@kbn/es-query'; -/** - * Creates a standardized query object from old queries that were either strings or pure ES query DSL - * - * @param query - a legacy query, what used to be stored in SearchSource's query property - * @return Object - */ -export declare function migrateLegacyQuery(query: Query | { - [key: string]: any; -} | string | AggregateQuery): Query | AggregateQuery; diff --git a/src/platform/plugins/shared/data/common/search/search_source/normalize_sort_request.d.ts b/src/platform/plugins/shared/data/common/search/search_source/normalize_sort_request.d.ts deleted file mode 100644 index b9feb666185ee..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/normalize_sort_request.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { EsQuerySortValue } from './types'; -type FieldSortOptions = estypes.FieldSort & estypes.ScoreSort & estypes.GeoDistanceSort & Omit & { - script?: estypes.ScriptSort['script']; -}; -export declare function normalizeSortRequest(sortObject: EsQuerySortValue | EsQuerySortValue[], indexPattern: DataView | string | undefined, defaultSortOptions?: FieldSortOptions | string): ({ - _script: { - order: import("./types").SortDirection; - numeric_type?: "double" | "long" | "date" | "date_nanos"; - script: { - source: string | undefined; - lang: string | undefined; - }; - type: string; - } | { - order: import("./types").SortDirection; - format?: string; - script: { - source: string | undefined; - lang: string | undefined; - }; - type: string; - }; -} | { - [x: string]: { - missing?: estypes.AggregationsMissing; - mode?: estypes.SortMode; - nested?: estypes.NestedSortValue; - order: import("./types").SortDirection | estypes.SortOrder; - numeric_type?: estypes.FieldSortNumericType | undefined; - format?: string; - distance_type?: estypes.GeoDistanceType; - ignore_unmapped?: boolean; - unit?: estypes.DistanceUnit; - type?: estypes.ScriptSortType | undefined; - script?: estypes.ScriptSort["script"]; - } | { - missing?: estypes.AggregationsMissing; - mode?: estypes.SortMode; - nested?: estypes.NestedSortValue; - order: import("./types").SortDirection | estypes.SortOrder; - numeric_type?: estypes.FieldSortNumericType; - format?: string; - distance_type?: estypes.GeoDistanceType; - ignore_unmapped?: boolean; - unit?: estypes.DistanceUnit; - type?: estypes.ScriptSortType | undefined; - script?: estypes.ScriptSort["script"]; - }; - _script?: undefined; -})[]; -export {}; diff --git a/src/platform/plugins/shared/data/common/search/search_source/parse_json.d.ts b/src/platform/plugins/shared/data/common/search/search_source/parse_json.d.ts deleted file mode 100644 index 12476fbfc6d7b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/parse_json.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SerializedSearchSourceFields } from './types'; -export declare const parseSearchSourceJSON: (searchSourceJSON: string) => SerializedSearchSourceFields; diff --git a/src/platform/plugins/shared/data/common/search/search_source/query_to_fields.d.ts b/src/platform/plugins/shared/data/common/search/search_source/query_to_fields.d.ts deleted file mode 100644 index 001cd35132b01..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/query_to_fields.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { DataViewLazy } from '@kbn/data-views-plugin/common'; -import type { SearchRequest } from './fetch'; -import type { EsQuerySortValue } from '../..'; -export declare function queryToFields({ dataView, sort, request, }: { - dataView: DataViewLazy; - sort?: EsQuerySortValue | EsQuerySortValue[]; - request: SearchRequest; -}): Promise>; diff --git a/src/platform/plugins/shared/data/common/search/search_source/search_source.d.ts b/src/platform/plugins/shared/data/common/search/search_source/search_source.d.ts deleted file mode 100644 index 949909726fe30..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/search_source.d.ts +++ /dev/null @@ -1,205 +0,0 @@ -import { Observable } from 'rxjs'; -import type { estypes } from '@elastic/elasticsearch'; -import type { DataViewLazy, DataViewsContract } from '@kbn/data-views-plugin/common'; -import type { ExpressionAstExpression } from '@kbn/expressions-plugin/common'; -import type { ISearchGeneric, IKibanaSearchResponse } from '@kbn/search-types'; -import type { DataViewField, SerializedSearchSourceFields } from '../..'; -import type { ISearchSource, SearchSourceFields, SearchSourceOptions, SearchSourceSearchOptions } from './types'; -import type { FetchHandlers, SearchRequest } from './fetch'; -import type { AggsStart } from '../aggs'; -/** @internal */ -export declare const searchSourceRequiredUiSettings: string[]; -export interface SearchSourceDependencies extends FetchHandlers { - aggs: AggsStart; - search: ISearchGeneric; - dataViews: DataViewsContract; - scriptedFieldsEnabled: boolean; -} -interface ExpressionAstOptions { - /** - * When truthy, it will include either `esaggs` or `esdsl` function to the expression chain. - * In this case, the expression will perform a search and return the `datatable` structure. - * @default true - */ - asDatatable?: boolean; -} -/** @public **/ -export declare class SearchSource { - private id; - private shouldOverwriteDataViewType; - private overwriteDataViewType?; - private parent?; - private requestStartHandlers; - private inheritOptions; - history: SearchRequest[]; - private fields; - private readonly dependencies; - constructor(fields: SearchSourceFields | undefined, dependencies: SearchSourceDependencies); - /** *** - * PUBLIC API - *****/ - /** - * Used to make the search source overwrite the actual data view type for the - * specific requests done. This should only be needed very rarely, since it means - * e.g. we'd be treating a rollup index pattern as a regular one. Be very sure - * you understand the consequences of using this method before using it. - * - * @param overwriteType If `false` is passed in it will disable the overwrite, otherwise - * the passed in value will be used as the data view type for this search source. - */ - setOverwriteDataViewType(overwriteType: string | undefined | false): void; - /** - * sets value to a single search source field - * @param field: field name - * @param value: value for the field - */ - setField(field: K, value: SearchSourceFields[K]): this; - /** - * remove field - * @param field: field name - */ - removeField(field: K): this; - /** - * Internal, do not use. Overrides all search source fields with the new field array. - * - * @internal - * @param newFields New field array. - */ - private setFields; - /** - * returns search source id - */ - getId(): string; - /** - * returns all search source fields - */ - getFields(): SearchSourceFields; - /** - * Gets a single field from the fields - */ - getField(field: K, recurse?: boolean): SearchSourceFields[K]; - getActiveIndexFilter(): any[]; - /** - * Get the field from our own fields, don't traverse up the chain - */ - getOwnField(field: K): SearchSourceFields[K]; - /** - * @deprecated Don't use. - */ - create(): SearchSource; - /** - * creates a copy of this search source (without its children) - */ - createCopy(): SearchSource; - /** - * creates a new child search source - * @param options - */ - createChild(options?: {}): SearchSource; - /** - * Set a searchSource that this source should inherit from - * @param {SearchSource} parent - the parent searchSource - * @param {SearchSourceOptions} options - the inherit options - */ - setParent(parent?: ISearchSource, options?: SearchSourceOptions): this; - /** - * Get the parent of this SearchSource - */ - getParent(): SearchSource | undefined; - /** - * Fetch this source from Elasticsearch, returning an observable over the response(s) - * @param options - */ - fetch$(options?: SearchSourceSearchOptions): Observable>>; - /** - * Fetch this source and reject the returned Promise on error - * @deprecated Use the `fetch$` method instead - */ - fetch(options?: SearchSourceSearchOptions): Promise>>; - /** - * Add a handler that will be notified whenever requests start - * @param {Function} handler - */ - onRequestStart(handler: (searchSource: SearchSource, options?: SearchSourceSearchOptions) => Promise): void; - /** - * Returns body contents of the search request, often referred as query DSL. - */ - getSearchRequestBody(): any; - /** - * Completely destroy the SearchSource. - */ - destroy(): void; - /** **** - * PRIVATE APIS - ******/ - private inspectSearch; - private hasPostFlightRequests; - private postFlightTransform; - private fetchOthers; - /** - * Run a search using the search service - */ - private fetchSearch$; - /** - * Called by requests of this search source when they are started - * @param options - */ - private requestIsStarting; - /** - * Used to merge properties into the data within ._flatten(). - * The data is passed in and modified by the function - * - * @param {object} data - the current merged data - * @param {*} val - the value at `key` - * @param {*} key - The key of `val` - */ - private mergeProp; - /** - * Walk the inheritance chain of a source and return its - * flat representation (taking into account merging rules) - * @resolved {Object|null} - the flat data of the SearchSource - */ - private mergeProps; - private getIndexType; - private getDataView; - private readonly getFieldName; - private getFieldsWithoutSourceFilters; - private getFieldFromDocValueFieldsOrIndexPattern; - loadDataViewFields(dataView: DataViewLazy): Promise>; - private flatten; - private getFieldFilter; - private getUniqueFieldNames; - private filterScriptFields; - private getBuiltEsQuery; - private getRemainingFields; - private getFieldsList; - private getUniqueFields; - /** - * serializes search source fields (which can later be passed to {@link ISearchStartSearchSource}) - */ - getSerializedFields(recurse?: boolean): SerializedSearchSourceFields; - /** - * Serializes the instance to a JSON string and a set of referenced objects. - * Use this method to get a representation of the search source which can be stored in a saved object. - * - * The references returned by this function can be mixed with other references in the same object, - * however make sure there are no name-collisions. The references will be named `kibanaSavedObjectMeta.searchSourceJSON.index` - * and `kibanaSavedObjectMeta.searchSourceJSON.filter[].meta.index`. - * - * Using `createSearchSource`, the instance can be re-created. - * @public */ - serialize(): { - searchSourceJSON: string; - references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; - }; - private getFilters; - /** - * Generates an expression abstract syntax tree using the fields set in the current search source and its ancestors. - * The produced expression from the returned AST will return the `datatable` structure. - * If the `asDatatable` option is truthy or omitted, the generator will use the `esdsl` function to perform the search. - * When the `aggs` field is present, it will use the `esaggs` function instead. - */ - toExpressionAst({ asDatatable }?: ExpressionAstOptions): ExpressionAstExpression; - parseActiveIndexPatternFromQueryString(queryString: string): string[]; -} -export {}; diff --git a/src/platform/plugins/shared/data/common/search/search_source/search_source_service.d.ts b/src/platform/plugins/shared/data/common/search/search_source/search_source_service.d.ts deleted file mode 100644 index 6a3e028763d78..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/search_source_service.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { MigrateFunctionsObject } from '@kbn/kibana-utils-plugin/common'; -import type { DataViewsContract } from '@kbn/data-views-plugin/common'; -import type { SearchSourceDependencies, SerializedSearchSourceFields } from '.'; -import { SearchSource } from '.'; -export declare class SearchSourceService { - setup(): { - getAllMigrations: () => MigrateFunctionsObject; - }; - start(indexPatterns: DataViewsContract, dependencies: SearchSourceDependencies): { - /** - * creates searchsource based on serialized search source fields - */ - create: (searchSourceFields?: SerializedSearchSourceFields, useDataViewLazy?: boolean) => Promise; - createLazy: (searchSourceFields?: SerializedSearchSourceFields) => Promise; - /** - * creates an enpty search source - */ - createEmpty: () => SearchSource; - extract: (state: SerializedSearchSourceFields) => { - state: SerializedSearchSourceFields; - references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; - }; - inject: (searchSourceFields: SerializedSearchSourceFields & { - indexRefName?: string; - }, references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]) => SerializedSearchSourceFields; - getAllMigrations: () => MigrateFunctionsObject; - telemetry: () => {}; - }; - stop(): void; -} diff --git a/src/platform/plugins/shared/data/common/search/search_source/types.d.ts b/src/platform/plugins/shared/data/common/search/search_source/types.d.ts deleted file mode 100644 index cd4e6e880eed5..0000000000000 --- a/src/platform/plugins/shared/data/common/search/search_source/types.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { RequestAdapter } from '@kbn/inspector-plugin/common'; -import type { AggregateQuery, Filter, ProjectRouting, Query } from '@kbn/es-query'; -import type { Serializable, SerializableRecord } from '@kbn/utility-types'; -import type { PersistableStateService } from '@kbn/kibana-utils-plugin/common'; -import type { ISearchOptions } from '@kbn/search-types'; -import type { DataView, DataViewSpec } from '@kbn/data-views-plugin/common'; -import type { SearchField } from '@kbn/es-types'; -import type { AggConfigSerialized, IAggConfigs } from '../../../public'; -import type { SearchSource } from './search_source'; -/** - * search source interface - * @public - */ -export type ISearchSource = Pick; -/** - * high level search service - * @public - */ -export interface ISearchStartSearchSource extends PersistableStateService { - /** - * creates {@link SearchSource} based on provided serialized {@link SearchSourceFields} - * @param fields - */ - create: (fields?: SerializedSearchSourceFields) => Promise; - createLazy: (fields?: SerializedSearchSourceFields) => Promise; - /** - * creates empty {@link SearchSource} - */ - createEmpty: () => ISearchSource; -} -export declare enum SortDirection { - asc = "asc", - desc = "desc" -} -export type SortDirectionFormat = { - order: SortDirection; - format?: string; -}; -export type SortDirectionNumeric = { - order: SortDirection; - numeric_type?: 'double' | 'long' | 'date' | 'date_nanos'; -}; -export type EsQuerySortValue = Record; -export type SearchFieldValue = SearchField & Serializable; -/** - * search source fields - */ -export interface SearchSourceFields { - type?: string; - /** - * {@link Query} - */ - query?: Query | AggregateQuery; - /** - * {@link Filter} - */ - filter?: Filter[] | Filter | (() => Filter[] | Filter | undefined); - /** - * Filters that should not trigger highlighting. - * These filters will be included in the search query for document retrieval, - * but excluded from the highlight_query parameter in Elasticsearch. - * {@link Filter} - */ - nonHighlightingFilters?: Filter[]; - /** - * {@link EsQuerySortValue} - */ - sort?: EsQuerySortValue | EsQuerySortValue[]; - highlight?: any; - highlightAll?: boolean; - trackTotalHits?: boolean | number; - /** - * {@link AggConfigs} - */ - aggs?: object | IAggConfigs | (() => object); - from?: number; - size?: number; - source?: boolean | estypes.Fields; - version?: boolean; - /** - * Retrieve fields via the search Fields API - */ - fields?: SearchFieldValue[]; - /** - * Retreive fields directly from _source (legacy behavior) - * - * @deprecated It is recommended to use `fields` wherever possible. - */ - fieldsFromSource?: estypes.Fields; - /** - * {@link IndexPatternService} - */ - index?: DataView; - timeout?: string; - terminate_after?: number; - searchAfter?: estypes.SortResults; - /** - * Allow querying to use a point-in-time ID for paging results - */ - pit?: estypes.SearchPointInTimeReference; - /** - * {@link ProjectRouting} - */ - projectRouting?: ProjectRouting; - timezone?: string; - parent?: SearchSourceFields; -} -export type SerializedSearchSourceFields = { - type?: string; - /** - * {@link Query} - */ - query?: Query | AggregateQuery; - /** - * {@link Filter} - */ - filter?: Filter[]; - /** - * Filters that should not trigger highlighting. - * These filters will be included in the search query for document retrieval, - * but excluded from the highlight_query parameter in Elasticsearch. - * {@link Filter} - */ - nonHighlightingFilters?: Filter[]; - /** - * {@link EsQuerySortValue} - */ - sort?: EsQuerySortValue[]; - highlight?: SerializableRecord; - highlightAll?: boolean; - trackTotalHits?: boolean | number; - /** - * {@link AggConfigs} - */ - aggs?: AggConfigSerialized[]; - from?: number; - size?: number; - source?: boolean | estypes.Fields; - version?: boolean; - /** - * Retrieve fields via the search Fields API - */ - fields?: SearchFieldValue[]; - /** - * Retreive fields directly from _source (legacy behavior) - * - * @deprecated It is recommended to use `fields` wherever possible. - */ - fieldsFromSource?: estypes.Fields; - /** - * {@link IndexPatternService} - */ - index?: string | DataViewSpec; - searchAfter?: estypes.SortResults; - timeout?: string; - terminate_after?: number; - /** - * {@link ProjectRouting} - */ - projectRouting?: ProjectRouting; - timezone?: string; - parent?: SerializedSearchSourceFields; -}; -export interface SearchSourceOptions { - callParentStartHandlers?: boolean; -} -export declare function isSerializedSearchSource(maybeSerializedSearchSource: unknown): maybeSerializedSearchSource is SerializedSearchSourceFields; -export interface IInspectorInfo { - adapter?: RequestAdapter; - title: string; - id?: string; - description?: string; -} -export interface SearchSourceSearchOptions extends ISearchOptions { - /** - * Inspector integration options - */ - inspector?: IInspectorInfo; - /** - * Set to true to disable warning toasts and customize warning display - */ - disableWarningToasts?: boolean; -} diff --git a/src/platform/plugins/shared/data/common/search/session/ebt_utils.d.ts b/src/platform/plugins/shared/data/common/search/session/ebt_utils.d.ts deleted file mode 100644 index dedd50509c7ef..0000000000000 --- a/src/platform/plugins/shared/data/common/search/session/ebt_utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AggregateQuery, Query } from '@kbn/es-query'; -export declare function getQueryLanguage(query: Query | AggregateQuery | undefined): string; -export declare function getQueryString(query: Query | AggregateQuery | undefined): string; -export declare function getQueryStringCharCount(queryString: string): number; -export declare function getQueryStringLineCount(queryString: string): number; diff --git a/src/platform/plugins/shared/data/common/search/session/index.d.ts b/src/platform/plugins/shared/data/common/search/session/index.d.ts deleted file mode 100644 index 882cb38f014fc..0000000000000 --- a/src/platform/plugins/shared/data/common/search/session/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './status'; -export * from './types'; -export * from './ebt_utils'; -export declare const SEARCH_SESSIONS_TABLE_ID = "searchSessionsMgmtUiTable"; diff --git a/src/platform/plugins/shared/data/common/search/session/status.d.ts b/src/platform/plugins/shared/data/common/search/session/status.d.ts deleted file mode 100644 index 3959b2d1eed40..0000000000000 --- a/src/platform/plugins/shared/data/common/search/session/status.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export declare enum SearchSessionStatus { - IN_PROGRESS = "in_progress", - ERROR = "error", - COMPLETE = "complete", - CANCELLED = "cancelled", - EXPIRED = "expired" -} -export declare enum SearchStatus { - IN_PROGRESS = "in_progress", - ERROR = "error", - COMPLETE = "complete" -} diff --git a/src/platform/plugins/shared/data/common/search/session/types.d.ts b/src/platform/plugins/shared/data/common/search/session/types.d.ts deleted file mode 100644 index 490f2a7fe2a70..0000000000000 --- a/src/platform/plugins/shared/data/common/search/session/types.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -import type { SavedObjectsFindResponse } from '@kbn/core/server'; -import type { SerializableRecord } from '@kbn/utility-types'; -import type { SearchSessionStatus, SearchStatus } from './status'; -export declare const SEARCH_SESSION_TYPE = "search-session"; -export interface SearchSessionSavedObjectAttributes { - sessionId: string; - /** - * User-facing session name to be displayed in session management - */ - name?: string; - /** - * App that created the session. e.g 'discover' - */ - appId?: string; - /** - * Creation time of the session - */ - created: string; - /** - * Expiration time of the session. Expiration itself is managed by Elasticsearch. - */ - expires: string; - /** - * locatorId (see share.url.locators service) - */ - locatorId?: string; - /** - * The application state that was used to create the session. - * Should be used, for example, to re-load an expired search session. - */ - initialState?: SerializableRecord; - /** - * Application state that should be used to restore the session. - * For example, relative dates are conveted to absolute ones. - */ - restoreState?: SerializableRecord; - /** - * Mapping of search request hashes to their corresponsing info (async search id, etc.) - */ - idMapping: Record; - /** - * The realm type/name & username uniquely identifies the user who created this search session - */ - realmType?: string; - realmName?: string; - username?: string; - /** - * Version information to display warnings when trying to restore a session from a different version - */ - version: string; - /** - * `true` if session was cancelled - */ - isCanceled?: boolean; - /** - * Search status - used to avoid extra calls to ES when tracking search IDs - */ - status?: SearchSessionStatus; -} -export interface SearchSessionRequestInfo extends Omit { - /** - * ID of the async search request - */ - id: string; - /** - * Search strategy used to submit the search request - */ - strategy: string; - /** - * Search status - used to avoid extra calls to ES when tracking search IDs - */ - status?: SearchStatus; -} -export interface SearchSessionRequestStatus { - status: SearchStatus; - /** - * Optional start time. May be undefined if ES doesn't return it. - */ - startedAt?: string; - /** - * Optional completion time. May be undefined if the search is still in progress - */ - completedAt?: string; - /** - * An optional error. Set if status is set to error. - */ - error?: { - code: number; - message?: string; - }; -} -/** - * On-the-fly calculated search session status - */ -export interface SearchSessionStatusResponse { - status: SearchSessionStatus; - errors?: string[]; -} -export interface SearchSessionStatusesResponse { - /** - * When a session enters a completed state (success or error), we show a notification in the cliend side, but we need - * to know the minimal information to display the notification. - */ - sessions: Record>; - /** - * Map containing calculated statuses of search sessions - */ - statuses: Record; -} -/** - * List of search session objects with on-the-fly calculated search session statuses - */ -export type SearchSessionsFindResponse = SavedObjectsFindResponse & { - statuses: Record; -}; diff --git a/src/platform/plugins/shared/data/common/search/strategies/eql_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/eql_search/index.d.ts deleted file mode 100644 index fcb073fefcd6b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/eql_search/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/eql_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/eql_search/types.d.ts deleted file mode 100644 index 23f079ee12966..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/eql_search/types.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; -import type { EqlSearchRequest } from '@elastic/elasticsearch/lib/api/types'; -import type { TransportRequestOptions } from '@elastic/elasticsearch'; -export declare const EQL_SEARCH_STRATEGY = "eql"; -export type EqlRequestParams = EqlSearchRequest; -export interface EqlSearchStrategyRequest extends IKibanaSearchRequest { - /** - * @deprecated: use IAsyncSearchOptions.transport instead. - */ - options?: TransportRequestOptions; -} -export type EqlSearchStrategyResponse = IKibanaSearchResponse; diff --git a/src/platform/plugins/shared/data/common/search/strategies/es_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/es_search/index.d.ts deleted file mode 100644 index b3c378665aa1d..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/es_search/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './types'; -export * from './response_utils'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/es_search/response_utils.d.ts b/src/platform/plugins/shared/data/common/search/strategies/es_search/response_utils.d.ts deleted file mode 100644 index b6d8e15485a65..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/es_search/response_utils.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { ISearchOptions } from '@kbn/search-types'; -/** - * Get the `total`/`loaded` for this response (see `IKibanaSearchResponse`). Note that `skipped` is - * not included as it is already included in `successful`. - * @internal - */ -export declare function getTotalLoaded(response: estypes.SearchResponse): { - total: number; - loaded: number; -}; -/** - * Temporary workaround until https://github.com/elastic/kibana/issues/26356 is addressed. - * Since we are setting `track_total_hits` in the request, `hits.total` will be an object - * containing the `value`. - * - * @internal - */ -export declare function shimHitsTotal(response: estypes.SearchResponse, { legacyHitsTotal }?: ISearchOptions): estypes.SearchResponse> | { - hits: { - total: any; - hits: estypes.SearchHit[]; - max_score?: estypes.double | null; - }; - took: estypes.long; - timed_out: boolean; - _shards: estypes.ShardStatistics; - aggregations?: Record | undefined; - _clusters?: estypes.ClusterStatistics; - fields?: Record; - max_score?: estypes.double; - num_reduce_phases?: estypes.long; - profile?: estypes.SearchProfile; - pit_id?: estypes.Id; - _scroll_id?: estypes.ScrollId; - suggest?: Record[]> | undefined; - terminated_early?: boolean; -}; diff --git a/src/platform/plugins/shared/data/common/search/strategies/es_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/es_search/types.d.ts deleted file mode 100644 index 786f4b28e8be0..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/es_search/types.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const ES_SEARCH_STRATEGY = "es"; diff --git a/src/platform/plugins/shared/data/common/search/strategies/ese_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/ese_search/index.d.ts deleted file mode 100644 index fcb073fefcd6b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/ese_search/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/ese_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/ese_search/types.d.ts deleted file mode 100644 index ce7dcdf3bba24..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/ese_search/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { SearchSourceSearchOptions } from '../../search_source/types'; -export declare const ENHANCED_ES_SEARCH_STRATEGY = "ese"; -export interface IAsyncSearchOptions extends SearchSourceSearchOptions { - /** - * The number of milliseconds to wait between receiving a response and sending another request - * If not provided, then it defaults to 0 (no wait time) - */ - pollInterval?: number; - /** - * The length of time to wait for results before initiating a new poll request. - */ - pollLength?: string; -} diff --git a/src/platform/plugins/shared/data/common/search/strategies/esql_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/esql_search/index.d.ts deleted file mode 100644 index fcb073fefcd6b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/esql_search/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/esql_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/esql_search/types.d.ts deleted file mode 100644 index 0545fd1ac8fcb..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/esql_search/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const ESQL_SEARCH_STRATEGY = "esql"; -export declare const ESQL_ASYNC_SEARCH_STRATEGY = "esql_async"; -export declare const ESQL_TABLE_TYPE = "es_ql"; diff --git a/src/platform/plugins/shared/data/common/search/strategies/sql_search/index.d.ts b/src/platform/plugins/shared/data/common/search/strategies/sql_search/index.d.ts deleted file mode 100644 index fcb073fefcd6b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/sql_search/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './types'; diff --git a/src/platform/plugins/shared/data/common/search/strategies/sql_search/types.d.ts b/src/platform/plugins/shared/data/common/search/strategies/sql_search/types.d.ts deleted file mode 100644 index f8fa3fcaf5c89..0000000000000 --- a/src/platform/plugins/shared/data/common/search/strategies/sql_search/types.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SqlGetAsyncRequest, SqlQueryRequest, SqlQueryResponse } from '@elastic/elasticsearch/lib/api/types'; -import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; -export declare const SQL_SEARCH_STRATEGY = "sql"; -export type SqlRequestParams = (Omit | Omit) & { - /** - * Does not close the cursor on search completion. - */ - keep_cursor?: boolean; -}; -export type SqlSearchStrategyRequest = IKibanaSearchRequest; -export interface SqlSearchStrategyResponse extends IKibanaSearchResponse { - /** - * A metric showing how long did the search take. - */ - took: number; -} diff --git a/src/platform/plugins/shared/data/common/search/tabify/buckets.d.ts b/src/platform/plugins/shared/data/common/search/tabify/buckets.d.ts deleted file mode 100644 index 161ed3deb7718..0000000000000 --- a/src/platform/plugins/shared/data/common/search/tabify/buckets.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { IAggConfig } from '../aggs'; -import type { TimeRangeInformation } from './types'; -export declare class TabifyBuckets { - length: number; - objectMode: boolean; - buckets: any; - _keys: any[]; - constructor(aggResp: any, agg?: IAggConfig, timeRange?: TimeRangeInformation); - forEach(fn: (bucket: any, key: any) => void): void; - private orderBucketsAccordingToParams; - private dropPartials; -} diff --git a/src/platform/plugins/shared/data/common/search/tabify/get_columns.d.ts b/src/platform/plugins/shared/data/common/search/tabify/get_columns.d.ts deleted file mode 100644 index d499e077e4d4c..0000000000000 --- a/src/platform/plugins/shared/data/common/search/tabify/get_columns.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { IAggConfig } from '../aggs'; -import type { TabbedAggColumn } from './types'; -/** - * Builds tabify columns. - * - * @param {AggConfigs} aggs - the agg configs object to which the aggregation response correlates - * @param {boolean} minimalColumns - setting to true will only return a column for the last bucket/metric instead of one for each level - */ -export declare function tabifyGetColumns(aggs: IAggConfig[], minimalColumns: boolean): TabbedAggColumn[]; diff --git a/src/platform/plugins/shared/data/common/search/tabify/index.d.ts b/src/platform/plugins/shared/data/common/search/tabify/index.d.ts deleted file mode 100644 index 2862fbb19ce1a..0000000000000 --- a/src/platform/plugins/shared/data/common/search/tabify/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { tabifyDocs, flattenHit } from '@kbn/data-service/src/search/tabify'; -export { tabifyAggResponse } from './tabify'; -export { tabifyGetColumns } from './get_columns'; diff --git a/src/platform/plugins/shared/data/common/search/tabify/response_writer.d.ts b/src/platform/plugins/shared/data/common/search/tabify/response_writer.d.ts deleted file mode 100644 index 3f40e24ece3f8..0000000000000 --- a/src/platform/plugins/shared/data/common/search/tabify/response_writer.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { Datatable } from '@kbn/expressions-plugin/common/expression_types/specs'; -import type { IAggConfigs } from '../aggs'; -import type { TabbedResponseWriterOptions, TabbedAggColumn, TabbedAggRow } from './types'; -interface BufferColumn { - id: string; - value: string | number; -} -/** - * Writer class that collects information about an aggregation response and - * produces a table, or a series of tables. - */ -export declare class TabbedAggResponseWriter { - columns: TabbedAggColumn[]; - rows: TabbedAggRow[]; - bucketBuffer: BufferColumn[]; - metricBuffer: BufferColumn[]; - private readonly partialRows; - private readonly params; - /** - * @param {AggConfigs} aggs - the agg configs object to which the aggregation response correlates - * @param {boolean} metricsAtAllLevels - setting to true will produce metrics for every bucket - * @param {boolean} partialRows - setting to true will not remove rows with missing values - */ - constructor(aggs: IAggConfigs, params: Partial); - /** - * Create a new row by reading the row buffer and bucketBuffer - */ - row(): void; - response(): Datatable; -} -export {}; diff --git a/src/platform/plugins/shared/data/common/search/tabify/tabify.d.ts b/src/platform/plugins/shared/data/common/search/tabify/tabify.d.ts deleted file mode 100644 index 4253265f0c368..0000000000000 --- a/src/platform/plugins/shared/data/common/search/tabify/tabify.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Datatable } from '@kbn/expressions-plugin/common'; -import type { TabbedResponseWriterOptions } from './types'; -import type { IAggConfigs } from '../aggs'; -/** - * Sets up the ResponseWriter and kicks off bucket collection. - */ -export declare function tabifyAggResponse(aggConfigs: IAggConfigs, esResponse: Record, respOpts?: Partial): Datatable; diff --git a/src/platform/plugins/shared/data/common/search/tabify/types.d.ts b/src/platform/plugins/shared/data/common/search/tabify/types.d.ts deleted file mode 100644 index 7e69a1cfcff88..0000000000000 --- a/src/platform/plugins/shared/data/common/search/tabify/types.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Moment } from 'moment'; -import type { RangeFilterParams } from '@kbn/es-query'; -import type { IAggConfig } from '../aggs'; -/** @internal **/ -export interface TabbedRangeFilterParams extends RangeFilterParams { - name: string; -} -/** @internal */ -export interface TimeRangeInformation { - from?: Moment; - to?: Moment; - timeFields: string[]; -} -export interface TabbedResponseWriterOptions { - metricsAtAllLevels: boolean; - partialRows: boolean; - timeRange?: TimeRangeInformation; -} -/** @internal */ -export interface AggResponseBucket { - key_as_string: string; - key: number; - doc_count: number; -} -/** @public **/ -export interface TabbedAggColumn { - aggConfig: IAggConfig; - id: string; - name: string; - hasPrecisionError?: boolean; -} -/** @public **/ -export type TabbedAggRow = Record; diff --git a/src/platform/plugins/shared/data/common/search/utils.d.ts b/src/platform/plugins/shared/data/common/search/utils.d.ts deleted file mode 100644 index bf464b316e11b..0000000000000 --- a/src/platform/plugins/shared/data/common/search/utils.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IKibanaSearchResponse } from '@kbn/search-types'; -import type { AggTypesDependencies } from '..'; -/** - * @returns true if response is abort - */ -export declare const isAbortResponse: (response?: IKibanaSearchResponse | { - response: IKibanaSearchResponse; -}) => response is undefined; -/** - * @returns true if request is still running - */ -export declare const isRunningResponse: (response?: IKibanaSearchResponse) => boolean; -export declare const getUserTimeZone: (getConfig: AggTypesDependencies["getConfig"], shouldDetectTimezone?: boolean) => string; -export declare function strategyToString(strategy?: string | symbol): string; diff --git a/src/platform/plugins/shared/data/common/serializable_field.d.ts b/src/platform/plugins/shared/data/common/serializable_field.d.ts deleted file mode 100644 index 69383f898aaed..0000000000000 --- a/src/platform/plugins/shared/data/common/serializable_field.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Alias for unknown raw field value, could be instance of a field Class - */ -export type RawValue = number | string | unknown; -/** - * Class to extends that enabled serializing and deserializing instance values - */ -export declare abstract class SerializableField { - static isSerializable(field: RawValue): field is SerializableField; - /** - * Serializes the class instance to a known `SerializedValue` that can be used to instantiate a new instance - * - * Ideally this returns the same params as found in the constructor. - */ - abstract serialize(): S; - /** - * typescript forbids abstract static methods but this is a workaround to require it - * - * @param serializedValue type of `SerializedValue` - * @returns `instanceValue` should same type as instantiating class - */ - static deserialize(serializedValue: unknown): unknown; -} diff --git a/src/platform/plugins/shared/data/common/serialize_utils.d.ts b/src/platform/plugins/shared/data/common/serialize_utils.d.ts deleted file mode 100644 index d42e6c73b499b..0000000000000 --- a/src/platform/plugins/shared/data/common/serialize_utils.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { SerializedRangeKey } from './search'; -import type { SerializedMultiFieldKey } from './search/aggs/buckets/multi_field_key'; -import type { RawValue } from './serializable_field'; -/** - * All available serialized forms of complex/instance fields. Excludes non-complex/primitive fields. - * - * Use `SerializedValue` for all generalize serial values which includes non-complex/primitive fields. - * - * Currently includes: - * - `RangeKey` - * - `MultiFieldKey` - */ -export type SerializedField = SerializedMultiFieldKey | SerializedRangeKey; -/** - * Alias for unknown serialized value. This value is what we store in the SO and app state - * to persist the color assignment based on the raw row value. - * - * In most cases this is a `string` or `number` or plain `object`, in other cases this is an - * object serialized from an instance of a given field (i.e. `RangeKey` or `MultiFieldKey`). - */ -export type SerializedValue = number | string | SerializedField | unknown; -export declare const SerializableType: { - MultiFieldKey: "multiFieldKey"; - RangeKey: "rangeKey"; -}; -export declare function deserializeField(field: SerializedValue): unknown; -export declare function serializeField(field: RawValue): SerializedValue; diff --git a/src/platform/plugins/shared/data/common/types.d.ts b/src/platform/plugins/shared/data/common/types.d.ts deleted file mode 100644 index 19d55f41fad52..0000000000000 --- a/src/platform/plugins/shared/data/common/types.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { GetConfigFn } from '@kbn/data-service/src/types'; -export type { RefreshInterval } from '@kbn/data-service-server'; -export type * from './query/types'; -export * from './kbn_field_types/types'; diff --git a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_multi_value_click.d.ts b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_multi_value_click.d.ts deleted file mode 100644 index 45cae761c6c24..0000000000000 --- a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_multi_value_click.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import type { Truthy } from 'lodash'; -import type { MultiValueClickContext } from '../multi_value_click_action'; -export type MultiValueClickDataContext = MultiValueClickContext['data']; -export declare const truthy: (value: T) => value is Truthy; -/** @public */ -export declare const createFiltersFromMultiValueClickAction: ({ data, negate, }: MultiValueClickDataContext) => Promise; diff --git a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_range_select.d.ts b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_range_select.d.ts deleted file mode 100644 index ca4c2b7833a19..0000000000000 --- a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_range_select.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Datatable } from '@kbn/expressions-plugin/common'; -import { type AggregateQuery } from '@kbn/es-query'; -export interface RangeSelectDataContext { - table: Datatable; - column: number; - range: number[]; - timeFieldName?: string; - query?: AggregateQuery; -} -export declare function createFiltersFromRangeSelectAction(event: RangeSelectDataContext): Promise; diff --git a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_value_click.d.ts b/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_value_click.d.ts deleted file mode 100644 index 3343fe1f68434..0000000000000 --- a/src/platform/plugins/shared/data/public/actions/filters/create_filters_from_value_click.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { Datatable } from '@kbn/expressions-plugin/public'; -import type { Filter } from '@kbn/es-query'; -import { type AggregateQuery } from '@kbn/es-query'; -export interface ValueClickDataContext { - data: Array<{ - table: Pick; - column: number; - row: number; - value: any; - }>; - timeFieldName?: string; - negate?: boolean; - query?: AggregateQuery; -} -/** - * Assembles the filters needed to apply filtering against a specific cell value, while accounting - * for cases like if the value is a terms agg in an `__other__` or `__missing__` bucket. - * - * @param {EventData['table']} table - tabified table data - * @param {number} columnIndex - current column index - * @param {number} rowIndex - current row index - * @param {string} cellValue - value of the current cell - * @return {Filter[]|undefined} - list of filters to provide to queryFilter.addFilters() - */ -export declare const createFilter: (table: Pick, columnIndex: number, rowIndex: number) => Promise; -export declare const createFilterESQL: (table: Pick, columnIndex: number, rowIndex: number) => Promise; -/** @public */ -export declare const createFiltersFromValueClickAction: ({ data, negate, }: ValueClickDataContext) => Promise; -/** @public */ -export declare const appendFilterToESQLQueryFromValueClickAction: ({ data, query, negate, }: ValueClickDataContext) => string | undefined; diff --git a/src/platform/plugins/shared/data/public/actions/filters/index.d.ts b/src/platform/plugins/shared/data/public/actions/filters/index.d.ts deleted file mode 100644 index a660f7671e3ca..0000000000000 --- a/src/platform/plugins/shared/data/public/actions/filters/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { MultiValueClickDataContext } from './create_filters_from_multi_value_click'; -export type { RangeSelectDataContext } from './create_filters_from_range_select'; -export type { ValueClickDataContext } from './create_filters_from_value_click'; -export { createFiltersFromValueClickAction, appendFilterToESQLQueryFromValueClickAction, } from './create_filters_from_value_click'; -export { createFiltersFromRangeSelectAction } from './create_filters_from_range_select'; -export { createFiltersFromMultiValueClickAction } from './create_filters_from_multi_value_click'; diff --git a/src/platform/plugins/shared/data/public/actions/index.d.ts b/src/platform/plugins/shared/data/public/actions/index.d.ts deleted file mode 100644 index 05f7ab9d6fd53..0000000000000 --- a/src/platform/plugins/shared/data/public/actions/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './select_range_action'; -export * from './value_click_action'; -export * from './multi_value_click_action'; diff --git a/src/platform/plugins/shared/data/public/actions/multi_value_click_action.d.ts b/src/platform/plugins/shared/data/public/actions/multi_value_click_action.d.ts deleted file mode 100644 index a21550726c52b..0000000000000 --- a/src/platform/plugins/shared/data/public/actions/multi_value_click_action.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Datatable } from '@kbn/expressions-plugin/public'; -import type { UiActionsActionDefinition } from '@kbn/ui-actions-plugin/public'; -import type { BooleanRelation } from '@kbn/es-query'; -import type { QueryStart } from '../query'; -export type MultiValueClickActionContext = MultiValueClickContext; -export declare const ACTION_MULTI_VALUE_CLICK = "ACTION_MULTI_VALUE_CLICK"; -export interface MultiValueClickContext { - embeddable?: unknown; - data: { - data: Array<{ - cells: Array<{ - column: number; - row: number; - }>; - table: Pick; - relation?: BooleanRelation; - }>; - timeFieldName?: string; - negate?: boolean; - }; -} -export declare function createMultiValueClickActionDefinition(getStartServices: () => { - query: QueryStart; -}): UiActionsActionDefinition; diff --git a/src/platform/plugins/shared/data/public/actions/select_range_action.d.ts b/src/platform/plugins/shared/data/public/actions/select_range_action.d.ts deleted file mode 100644 index 038730cb3bb85..0000000000000 --- a/src/platform/plugins/shared/data/public/actions/select_range_action.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { AggregateQuery } from '@kbn/es-query'; -import type { Datatable } from '@kbn/expressions-plugin/public'; -import type { UiActionsActionDefinition, UiActionsStart } from '@kbn/ui-actions-plugin/public'; -export interface SelectRangeActionContext { - embeddable?: unknown; - data: { - table: Datatable; - column: number; - range: number[]; - timeFieldName?: string; - query?: AggregateQuery; - }; -} -export declare const ACTION_SELECT_RANGE = "ACTION_SELECT_RANGE"; -export declare function createSelectRangeActionDefinition(getStartServices: () => { - uiActions: UiActionsStart; -}): UiActionsActionDefinition; diff --git a/src/platform/plugins/shared/data/public/actions/value_click_action.d.ts b/src/platform/plugins/shared/data/public/actions/value_click_action.d.ts deleted file mode 100644 index 0d736d32cadd8..0000000000000 --- a/src/platform/plugins/shared/data/public/actions/value_click_action.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { AggregateQuery } from '@kbn/es-query'; -import type { Datatable } from '@kbn/expressions-plugin/public'; -import type { UiActionsActionDefinition, UiActionsStart } from '@kbn/ui-actions-plugin/public'; -export type ValueClickActionContext = ValueClickContext; -export declare const ACTION_VALUE_CLICK = "ACTION_VALUE_CLICK"; -export interface ValueClickContext { - embeddable?: unknown; - data: { - data: Array<{ - table: Pick; - column: number; - row: number; - value: any; - }>; - timeFieldName?: string; - negate?: boolean; - query?: AggregateQuery; - }; -} -export declare function createValueClickActionDefinition(getStartServices: () => { - uiActions: UiActionsStart; -}): UiActionsActionDefinition; diff --git a/src/platform/plugins/shared/data/public/index.d.ts b/src/platform/plugins/shared/data/public/index.d.ts deleted file mode 100644 index 47b59814b7a84..0000000000000 --- a/src/platform/plugins/shared/data/public/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import type { ConfigSchema } from '../server/config'; -export { getEsQueryConfig } from '../common'; -export { getDisplayValueFromFilter, getFieldDisplayValueFromFilter, generateFilters, getIndexPatternFromFilter, } from './query'; -export { convertIntervalToEsInterval } from '../common/search/aggs/buckets/lib/time_buckets/calc_es_interval'; -/** - * Exporters (CSV) - */ -import { datatableToCSV } from '../common'; -export declare const exporters: { - datatableToCSV: typeof datatableToCSV; - CSV_MIME_TYPE: string; - cellHasFormulas: (val: string) => boolean; - tableHasFormulas: (columns: import("../../expressions/common").Datatable["columns"], rows: import("../../expressions/common").Datatable["rows"]) => boolean; -}; -export type { AggregationRestrictions as IndexPatternAggRestrictions, IndexPatternLoadExpressionFunctionDefinition, GetFieldsOptions, AggregationRestrictions, DataViewListItem, } from '../common'; -export { ES_FIELD_TYPES, KBN_FIELD_TYPES, UI_SETTINGS, fieldList, DuplicateDataViewError, } from '../common'; -import { CidrMask, isDateHistogramBucketAggConfig, propFilter, dateHistogramInterval, InvalidEsCalendarIntervalError, InvalidEsIntervalFormatError, IpAddress, isValidEsInterval, isValidInterval, parseEsInterval, parseInterval, toAbsoluteDates, getResponseInspectorStats, calcAutoIntervalLessThan, tabifyAggResponse, tabifyGetColumns } from '../common'; -export { AggGroupLabels, AggGroupNames, METRIC_TYPES, BUCKET_TYPES } from '../common'; -export type { AggConfigSerialized, AggGroupName, AggFunctionsMapping, AggParam, AggParamOption, AggParamType, AggConfigOptions, EsaggsExpressionFunctionDefinition, IAggConfig, IAggConfigs, IAggType, IFieldParamType, IMetricAggType, OptionedParamType, OptionedValueProp, ParsedInterval, ExpressionFunctionKql, ExpressionFunctionLucene, ExpressionFunctionKibana, ExpressionFunctionKibanaContext, ExpressionValueSearchContext, KibanaContext, } from '../common'; -export type { AggConfigs, AggConfig } from '../common'; -export type { ES_SEARCH_STRATEGY, EsQuerySortValue, ISearchSetup, ISearchStart, ISearchStartSearchSource, ISearchSource, SearchRequest, SearchSourceFields, SerializedSearchSourceFields, WaitUntilNextSessionCompletesOptions, } from './search'; -export { parseSearchSourceJSON, injectSearchSourceReferences, extractSearchSourceReferences, getSearchParamsFromRequest, noSearchSessionStorageCapabilityMessage, SEARCH_SESSIONS_MANAGEMENT_ID, waitUntilNextSessionCompletes$, SearchSource, SearchSessionState, SortDirection, } from './search'; -export type { ISessionService, SearchSessionInfoProvider, ISessionsClient, SearchUsageCollector, } from './search'; -export { isRunningResponse } from '../common'; -export declare const search: { - aggs: { - CidrMask: typeof CidrMask; - dateHistogramInterval: typeof dateHistogramInterval; - intervalOptions: ({ - display: string; - val: string; - enabled(agg: import("../common").IBucketAggConfig): boolean; - } | { - display: string; - val: string; - enabled?: undefined; - })[]; - InvalidEsCalendarIntervalError: typeof InvalidEsCalendarIntervalError; - InvalidEsIntervalFormatError: typeof InvalidEsIntervalFormatError; - IpAddress: typeof IpAddress; - isDateHistogramBucketAggConfig: typeof isDateHistogramBucketAggConfig; - isNumberType: (agg: import("../common").IAggConfig) => boolean; - isStringType: (agg: import("../common").IAggConfig) => boolean; - isType: (...types: string[]) => (agg: import("../common").IAggConfig) => boolean; - isValidEsInterval: typeof isValidEsInterval; - isValidInterval: typeof isValidInterval; - parentPipelineType: string; - parseEsInterval: typeof parseEsInterval; - parseInterval: typeof parseInterval; - propFilter: typeof propFilter; - siblingPipelineType: string; - termsAggFilter: string[]; - toAbsoluteDates: typeof toAbsoluteDates; - boundsDescendingRaw: ({ - bound: number; - interval: import("moment").Duration; - boundLabel: string; - intervalLabel: string; - } | { - bound: import("moment").Duration; - interval: import("moment").Duration; - boundLabel: string; - intervalLabel: string; - })[]; - calcAutoIntervalLessThan: typeof calcAutoIntervalLessThan; - }; - getResponseInspectorStats: typeof getResponseInspectorStats; - tabifyAggResponse: typeof tabifyAggResponse; - tabifyGetColumns: typeof tabifyGetColumns; -}; -/** - * Types to be shared externally - * @public - */ -export type { RefreshInterval } from '../common'; -export { createSavedQueryService, connectToQueryState, syncQueryStateWithUrl, syncGlobalQueryStateWithUrl, getDefaultQuery, FilterManager, TimeHistory, getQueryLog, mapAndFlattenFilters, QueryService, } from './query'; -export { NowProvider } from './now_provider'; -export type { NowProviderInternalContract, NowProviderPublicContract } from './now_provider'; -export type { QueryState, QueryState$, SavedQuery, SavedQueryService, SavedQueryTimeFilter, TimefilterContract, TimeHistoryContract, QueryStateChange, QueryStart, AutoRefreshDoneFn, PersistedLog, QueryStringContract, QuerySetup, TimefilterSetup, GlobalQueryStateFromUrl, TimefilterHook, } from './query'; -export type { AggsStart } from './search/aggs'; -export { getTime } from '../common'; -export type { SavedObject } from '../common'; -export { isTimeRange, isQuery, flattenHit, calculateBounds, tabifyAggResponse } from '../common'; -import { DataPublicPlugin } from './plugin'; -export declare function plugin(initializerContext: PluginInitializerContext): DataPublicPlugin; -export type { DataPublicPluginSetup, DataPublicPluginStart, DataPublicPluginStartActions, } from './types'; -export type { DataPublicPlugin as DataPlugin }; diff --git a/src/platform/plugins/shared/data/public/now_provider/index.d.ts b/src/platform/plugins/shared/data/public/now_provider/index.d.ts deleted file mode 100644 index 5579772ffa9a2..0000000000000 --- a/src/platform/plugins/shared/data/public/now_provider/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { NowProviderInternalContract, NowProviderPublicContract } from './now_provider'; -export { NowProvider } from './now_provider'; diff --git a/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.d.ts b/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.d.ts deleted file mode 100644 index f70406a03973b..0000000000000 --- a/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** @internal */ -export declare function getForceNowFromUrl(): Date | undefined; diff --git a/src/platform/plugins/shared/data/public/now_provider/lib/index.d.ts b/src/platform/plugins/shared/data/public/now_provider/lib/index.d.ts deleted file mode 100644 index 2dcc88ddac453..0000000000000 --- a/src/platform/plugins/shared/data/public/now_provider/lib/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { getForceNowFromUrl } from './get_force_now_from_url'; diff --git a/src/platform/plugins/shared/data/public/now_provider/now_provider.d.ts b/src/platform/plugins/shared/data/public/now_provider/now_provider.d.ts deleted file mode 100644 index 652c832d45bbc..0000000000000 --- a/src/platform/plugins/shared/data/public/now_provider/now_provider.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { PublicMethodsOf } from '@kbn/utility-types'; -export type NowProviderInternalContract = PublicMethodsOf; -export type NowProviderPublicContract = Pick; -/** - * Used to synchronize time between parallel searches with relative time range that rely on `now`. - */ -export declare class NowProvider { - private readonly nowFromUrl; - private now?; - constructor(); - get(): Date; - set(now: Date): void; - reset(): void; -} diff --git a/src/platform/plugins/shared/data/public/plugin.d.ts b/src/platform/plugins/shared/data/public/plugin.d.ts deleted file mode 100644 index 0d4eab4681ed5..0000000000000 --- a/src/platform/plugins/shared/data/public/plugin.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import type { ConfigSchema } from '../server/config'; -import type { DataPublicPluginSetup, DataPublicPluginStart, DataSetupDependencies, DataStartDependencies } from './types'; -export declare class DataPublicPlugin implements Plugin { - private readonly searchService; - private readonly queryService; - private readonly storage; - private readonly nowProvider; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup, { expressions, uiActions, usageCollection, inspector, fieldFormats, management, }: DataSetupDependencies): DataPublicPluginSetup; - start(core: CoreStart, { uiActions, fieldFormats, dataViews, inspector, screenshotMode, share, cps, }: DataStartDependencies): DataPublicPluginStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/filter_manager.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/filter_manager.d.ts deleted file mode 100644 index 941a1016dda8a..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/filter_manager.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { IUiSettingsClient } from '@kbn/core/public'; -import { FilterStateStore } from '@kbn/es-query'; -import type { Filter } from '@kbn/es-query'; -import type { PersistableStateService } from '@kbn/kibana-utils-plugin/common/persistable_state'; -interface PartitionedFilters { - globalFilters: Filter[]; - appFilters: Filter[]; -} -export declare class FilterManager implements PersistableStateService { - private filters; - private updated$; - private fetch$; - private uiSettings; - constructor(uiSettings: IUiSettingsClient); - private mergeIncomingFilters; - private static mergeFilters; - private static partitionFilters; - private handleStateUpdate; - getFilters(): Filter[]; - getAppFilters(): Filter[]; - getGlobalFilters(): Filter[]; - getPartitionedFilters(): PartitionedFilters; - getUpdates$(): import("rxjs").Observable; - getFetches$(): import("rxjs").Observable; - addFilters(filters: Filter[] | Filter, pinFilterStatus?: boolean): void; - setFilters(newFilters: Filter[], pinFilterStatus?: boolean): void; - /** - * Sets new global filters and leaves app filters untouched, - * Removes app filters for which there is a duplicate within new global filters - * @param newGlobalFilters - */ - setGlobalFilters(newGlobalFilters: Filter[]): void; - /** - * Sets new app filters and leaves global filters untouched, - * Removes app filters for which there is a duplicate within new global filters - * @param newAppFilters - */ - setAppFilters(newAppFilters: Filter[]): void; - removeFilter(filter: Filter): void; - removeAll(): void; - static setFiltersStore(filters: Filter[], store: FilterStateStore, shouldOverrideStore?: boolean): void; - extract: (filters: Filter[]) => { - state: Filter[]; - references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; - }; - inject: (filters: Filter[], references: import("@kbn/core/public").SavedObjectReference[]) => Filter[]; - telemetry: (filters: Filter[], collector: unknown) => {}; - getAllMigrations: () => import("@kbn/kibana-utils-plugin/common/persistable_state").MigrateFunctionsObject; -} -export {}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/index.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/index.d.ts deleted file mode 100644 index 79a504a71a791..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { FilterManager } from './filter_manager'; -export { mapAndFlattenFilters } from './lib/map_and_flatten_filters'; -export { generateFilters } from './lib/generate_filters'; -export { getDisplayValueFromFilter, getFieldDisplayValueFromFilter } from './lib/get_display_value'; -export { getIndexPatternFromFilter } from './lib/get_index_pattern_from_filter'; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_filters.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_filters.d.ts deleted file mode 100644 index 7864535a4e5f9..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_filters.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Filter, DataViewFieldBase, DataViewBase } from '@kbn/es-query'; -import type { FilterManager } from '../filter_manager'; -/** - * Generate filter objects, as a result of triggering a filter action on a - * specific index pattern field. - * - * @param {FilterManager} filterManager - The active filter manager to lookup for existing filters - * @param {Field | string} field - The field for which filters should be generated - * @param {any} values - One or more values to filter for. - * @param {string} operation - "-" to create a negated filter - * @param {string} index - Index string to generate filters for - * - * @returns {object} An array of filters to be added back to filterManager - */ -export declare function generateFilters(filterManager: FilterManager, field: DataViewFieldBase | string, values: any, operation: string, index: DataViewBase): Filter[]; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_mapping_chain.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_mapping_chain.d.ts deleted file mode 100644 index 5b58037f7e56b..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/generate_mapping_chain.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -export declare const generateMappingChain: (fn: Function, next?: Function) => (filter: Filter) => any; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_display_value.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_display_value.d.ts deleted file mode 100644 index 8598d1ce05467..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_display_value.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { DataView } from '@kbn/data-views-plugin/public'; -import type { Filter, DataViewBase } from '@kbn/es-query'; -export declare function getFieldDisplayValueFromFilter(filter: Filter, indexPatterns: DataView[] | DataViewBase[]): string; -export declare function getDisplayValueFromFilter(filter: Filter, indexPatterns: DataViewBase[]): string; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_index_pattern_from_filter.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_index_pattern_from_filter.d.ts deleted file mode 100644 index 22130265f3907..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/get_index_pattern_from_filter.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Filter, DataViewBase } from '@kbn/es-query'; -export declare function getIndexPatternFromFilter(filter: Filter, indexPatterns: T[]): T | undefined; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_and_flatten_filters.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_and_flatten_filters.d.ts deleted file mode 100644 index 6ae6ea7020c77..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_and_flatten_filters.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -export declare const mapAndFlattenFilters: (filters: Filter[]) => Filter[]; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_filter.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_filter.d.ts deleted file mode 100644 index 7cf5d585ed274..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/map_filter.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -export declare function mapFilter(filter: Filter): Filter; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_combined.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_combined.d.ts deleted file mode 100644 index edd0ba426ba12..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_combined.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -export declare const mapCombined: (filter: Filter) => { - type: import("@kbn/es-query").FILTERS.COMBINED; - key: string | undefined; - params: Filter[]; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_default.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_default.d.ts deleted file mode 100644 index b9278d0af73d8..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_default.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import { FILTERS } from '@kbn/es-query'; -export declare const mapDefault: (filter: Filter) => { - type: FILTERS; - key: string; - value: string; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_exists.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_exists.d.ts deleted file mode 100644 index 4d5d1583e4bba..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_exists.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import { FILTERS } from '@kbn/es-query'; -export declare const mapExists: (filter: Filter) => { - type: FILTERS; - value: FILTERS; - key: string | undefined; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_match_all.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_match_all.d.ts deleted file mode 100644 index abb0486cce471..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_match_all.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import { FILTERS } from '@kbn/es-query'; -export declare const mapMatchAll: (filter: Filter) => { - type: FILTERS; - key: string; - value: string; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrase.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrase.d.ts deleted file mode 100644 index 3a5341e759573..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrase.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Filter, PhraseFilter, ScriptedPhraseFilter } from '@kbn/es-query'; -import { FILTERS } from '@kbn/es-query'; -import type { FieldFormat } from '@kbn/field-formats-plugin/common'; -export declare function getPhraseDisplayValue(filter: PhraseFilter | ScriptedPhraseFilter, formatter?: FieldFormat, fieldType?: string): string; -export declare const isMapPhraseFilter: (filter: any) => filter is PhraseFilter; -export declare const mapPhrase: (filter: Filter) => { - key: string; - params: { - query: any; - }; - type: FILTERS; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.d.ts deleted file mode 100644 index 6927e6fe3c14f..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Filter, PhrasesFilter } from '@kbn/es-query'; -import type { FieldFormat } from '@kbn/field-formats-plugin/common'; -export declare function getPhrasesDisplayValue(filter: PhrasesFilter, formatter?: FieldFormat): string; -export declare const mapPhrases: (filter: Filter) => { - type: string | undefined; - key: string | undefined; - value: (import("@kbn/es-query/src/filters/build_filters").FilterMetaParams | undefined) & import("@kbn/es-query/src/filters/build_filters").PhraseFilterValue[]; - params: (import("@kbn/es-query/src/filters/build_filters").FilterMetaParams | undefined) & import("@kbn/es-query/src/filters/build_filters").PhraseFilterValue[]; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_query_string.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_query_string.d.ts deleted file mode 100644 index 51a1935f88202..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_query_string.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import { FILTERS } from '@kbn/es-query'; -export declare const mapQueryString: (filter: Filter) => { - type: FILTERS; - key: string; - value: string | undefined; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.d.ts deleted file mode 100644 index c79c3098c43d3..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ScriptedRangeFilter, RangeFilter, Filter } from '@kbn/es-query'; -import { FILTERS } from '@kbn/es-query'; -import type { FieldFormat } from '@kbn/field-formats-plugin/common'; -export declare function getRangeDisplayValue({ meta: { params } }: RangeFilter | ScriptedRangeFilter, formatter?: FieldFormat): string; -export declare const isMapRangeFilter: (filter: any) => filter is RangeFilter; -export declare const mapRange: (filter: Filter) => { - type: FILTERS; - key: string; - value: any; - params: any; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_spatial_filter.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_spatial_filter.d.ts deleted file mode 100644 index b190b9d990664..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_spatial_filter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import { FILTERS } from '@kbn/es-query'; -export declare const mapSpatialFilter: (filter: Filter) => { - type: FILTERS; - key: undefined; - value: undefined; -}; diff --git a/src/platform/plugins/shared/data/public/query/filter_manager/lib/sort_filters.d.ts b/src/platform/plugins/shared/data/public/query/filter_manager/lib/sort_filters.d.ts deleted file mode 100644 index a9e3d3c1e5b0f..0000000000000 --- a/src/platform/plugins/shared/data/public/query/filter_manager/lib/sort_filters.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -/** - * Sort filters according to their store - global filters go first - * - * @param {object} first The first filter to compare - * @param {object} second The second filter to compare - * - * @returns {number} Sorting order of filters - */ -export declare const sortFilters: ({ $state: a }: Filter, { $state: b }: Filter) => number; diff --git a/src/platform/plugins/shared/data/public/query/index.d.ts b/src/platform/plugins/shared/data/public/query/index.d.ts deleted file mode 100644 index cc1e390f910d6..0000000000000 --- a/src/platform/plugins/shared/data/public/query/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './lib'; -export * from './query_service'; -export * from './filter_manager'; -export * from './timefilter'; -export * from './saved_query'; -export * from './persisted_log'; -export * from './state_sync'; -export type { QueryStringContract } from './query_string'; -export type { QueryState } from './query_state'; diff --git a/src/platform/plugins/shared/data/public/query/lib/add_to_query_log.d.ts b/src/platform/plugins/shared/data/public/query/lib/add_to_query_log.d.ts deleted file mode 100644 index 82443bbb28662..0000000000000 --- a/src/platform/plugins/shared/data/public/query/lib/add_to_query_log.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import type { Query } from '../../../common'; -interface AddToQueryLogDependencies { - uiSettings: IUiSettingsClient; - storage: IStorageWrapper; -} -export declare function createAddToQueryLog({ storage, uiSettings }: AddToQueryLogDependencies): (appName: string, { language, query }: Query) => void; -export {}; diff --git a/src/platform/plugins/shared/data/public/query/lib/get_default_query.d.ts b/src/platform/plugins/shared/data/public/query/lib/get_default_query.d.ts deleted file mode 100644 index 144e6eb28a6bf..0000000000000 --- a/src/platform/plugins/shared/data/public/query/lib/get_default_query.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -type QueryLanguage = 'kuery' | 'lucene'; -export declare function getDefaultQuery(language?: QueryLanguage): { - query: string; - language: QueryLanguage; -}; -export {}; diff --git a/src/platform/plugins/shared/data/public/query/lib/get_query_log.d.ts b/src/platform/plugins/shared/data/public/query/lib/get_query_log.d.ts deleted file mode 100644 index 3dc8d15c75245..0000000000000 --- a/src/platform/plugins/shared/data/public/query/lib/get_query_log.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import { PersistedLog } from '../persisted_log'; -/** @internal */ -export declare function getQueryLog(uiSettings: IUiSettingsClient, storage: IStorageWrapper, appName: string, language: string): PersistedLog; diff --git a/src/platform/plugins/shared/data/public/query/lib/index.d.ts b/src/platform/plugins/shared/data/public/query/lib/index.d.ts deleted file mode 100644 index 3db48ad68187b..0000000000000 --- a/src/platform/plugins/shared/data/public/query/lib/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './add_to_query_log'; -export * from './get_default_query'; -export * from './get_query_log'; diff --git a/src/platform/plugins/shared/data/public/query/persisted_log/index.d.ts b/src/platform/plugins/shared/data/public/query/persisted_log/index.d.ts deleted file mode 100644 index e63b333894bb5..0000000000000 --- a/src/platform/plugins/shared/data/public/query/persisted_log/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './persisted_log'; diff --git a/src/platform/plugins/shared/data/public/query/persisted_log/persisted_log.d.ts b/src/platform/plugins/shared/data/public/query/persisted_log/persisted_log.d.ts deleted file mode 100644 index 30853b20fa1c5..0000000000000 --- a/src/platform/plugins/shared/data/public/query/persisted_log/persisted_log.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -interface PersistedLogOptions { - maxLength?: number | string; - filterDuplicates?: boolean; - isDuplicate?: (oldItem: T, newItem: T) => boolean; - enableBrowserTabsSync?: boolean; -} -export declare class PersistedLog { - name: string; - maxLength?: number; - filterDuplicates?: boolean; - isDuplicate: (oldItem: T, newItem: T) => boolean; - storage: IStorageWrapper; - items: T[]; - private update$; - private storageEventListener?; - private enableBrowserTabsSync; - private subscriberCount; - constructor(name: string, options: PersistedLogOptions | undefined, storage: IStorageWrapper); - /** Keeps browser tabs in sync. */ - private addStorageEventListener; - private removeStorageEventListener; - add(val: any): T[]; - get(): T[]; - get$(): Observable; -} -export {}; diff --git a/src/platform/plugins/shared/data/public/query/query_service.d.ts b/src/platform/plugins/shared/data/public/query/query_service.d.ts deleted file mode 100644 index eb92c0972e375..0000000000000 --- a/src/platform/plugins/shared/data/public/query/query_service.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import type { HttpStart, IUiSettingsClient } from '@kbn/core/public'; -import type { PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common'; -import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import type { TimeRange } from '@kbn/es-query'; -import { buildEsQuery } from '@kbn/es-query'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import { FilterManager } from './filter_manager'; -import { createAddToQueryLog } from './lib'; -import type { TimefilterSetup } from './timefilter'; -import { createSavedQueryService } from './saved_query/saved_query_service'; -import type { QueryState$ } from './state_sync/create_query_state_observable'; -import type { QueryState } from './query_state'; -import type { QueryStringContract } from './query_string'; -import type { NowProviderInternalContract } from '../now_provider'; -interface QueryServiceSetupDependencies { - storage: IStorageWrapper; - uiSettings: IUiSettingsClient; - nowProvider: NowProviderInternalContract; - minRefreshInterval?: number; -} -interface QueryServiceStartDependencies { - storage: IStorageWrapper; - uiSettings: IUiSettingsClient; - http: HttpStart; -} -export interface QuerySetup extends PersistableStateService { - filterManager: FilterManager; - timefilter: TimefilterSetup; - queryString: QueryStringContract; - state$: QueryState$; - getState(): QueryState; -} -export interface QueryStart extends PersistableStateService { - filterManager: FilterManager; - timefilter: TimefilterSetup; - queryString: QueryStringContract; - state$: QueryState$; - getState(): QueryState; - addToQueryLog: ReturnType; - savedQueries: ReturnType; - getEsQuery(indexPattern: DataView, timeRange?: TimeRange): ReturnType; -} -/** - * Query Service - * @internal - */ -export declare class QueryService implements PersistableStateService { - private minRefreshInterval; - filterManager: FilterManager; - timefilter: TimefilterSetup; - queryStringManager: QueryStringContract; - state$: QueryState$; - constructor(minRefreshInterval?: number); - setup({ storage, uiSettings, nowProvider, minRefreshInterval, }: QueryServiceSetupDependencies): QuerySetup; - start({ storage, uiSettings, http }: QueryServiceStartDependencies): QueryStart; - stop(): void; - private getQueryState; - extract: (queryState: QueryState) => { - state: { - filters: import("@kbn/es-query").Filter[]; - time?: import("../../common").TimeRange; - refreshInterval?: import("@kbn/data-service-server/src/types").RefreshInterval; - query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; - }; - references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; - }; - inject: (queryState: QueryState, references: import("@kbn/core/public").SavedObjectReference[]) => { - filters: import("@kbn/es-query").Filter[]; - time?: import("../../common").TimeRange; - refreshInterval?: import("@kbn/data-service-server/src/types").RefreshInterval; - query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; - }; - telemetry: (queryState: QueryState, collector: unknown) => {}; - getAllMigrations: () => import("@kbn/kibana-utils-plugin/common").MigrateFunctionsObject; - migrateToLatest: (versionedState: VersionedState) => { - filters: import("@kbn/es-query").Filter[]; - time?: import("../../common").TimeRange; - refreshInterval?: import("@kbn/data-service-server/src/types").RefreshInterval; - query?: import("@kbn/es-query").Query | import("@kbn/es-query").AggregateQuery; - }; - private getPersistableStateMethods; -} -export {}; diff --git a/src/platform/plugins/shared/data/public/query/query_state.d.ts b/src/platform/plugins/shared/data/public/query/query_state.d.ts deleted file mode 100644 index 528776aff907f..0000000000000 --- a/src/platform/plugins/shared/data/public/query/query_state.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { QueryState } from '../../common'; -import type { TimefilterSetup } from './timefilter'; -import type { FilterManager } from './filter_manager'; -import type { QueryStringContract } from './query_string'; -export type { QueryState }; -export declare function getQueryState({ timefilter: { timefilter }, filterManager, queryString, }: { - timefilter: TimefilterSetup; - filterManager: FilterManager; - queryString: QueryStringContract; -}): QueryState; diff --git a/src/platform/plugins/shared/data/public/query/query_string/index.d.ts b/src/platform/plugins/shared/data/public/query/query_string/index.d.ts deleted file mode 100644 index 9e4a7ad8396c2..0000000000000 --- a/src/platform/plugins/shared/data/public/query/query_string/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { QueryStringContract } from './query_string_manager'; -export { QueryStringManager } from './query_string_manager'; diff --git a/src/platform/plugins/shared/data/public/query/query_string/query_string_manager.d.ts b/src/platform/plugins/shared/data/public/query/query_string/query_string_manager.d.ts deleted file mode 100644 index cc325dda0f4fb..0000000000000 --- a/src/platform/plugins/shared/data/public/query/query_string/query_string_manager.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { PublicMethodsOf } from '@kbn/utility-types'; -import type { CoreStart } from '@kbn/core/public'; -import type { Query, AggregateQuery } from '@kbn/es-query'; -import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -export declare class QueryStringManager { - private readonly storage; - private readonly uiSettings; - private query$; - constructor(storage: IStorageWrapper, uiSettings: CoreStart['uiSettings']); - private getDefaultLanguage; - getDefaultQuery(): { - query: string; - language: any; - }; - formatQuery(query: Query | AggregateQuery | string | undefined): Query | AggregateQuery; - getUpdates$: () => import("rxjs").Observable; - getQuery: () => Query | AggregateQuery; - /** - * Updates the query. - * @param {Query | AggregateQuery} query - */ - setQuery: (query: Query | AggregateQuery) => void; - /** - * Resets the query to the default one. - */ - clearQuery: () => void; -} -export type QueryStringContract = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data/public/query/saved_query/index.d.ts b/src/platform/plugins/shared/data/public/query/saved_query/index.d.ts deleted file mode 100644 index 866db703b75d9..0000000000000 --- a/src/platform/plugins/shared/data/public/query/saved_query/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { SavedQuery, SavedQueryAttributes, SavedQueryService, SavedQueryTimeFilter, } from './types'; -export { createSavedQueryService } from './saved_query_service'; diff --git a/src/platform/plugins/shared/data/public/query/saved_query/saved_query_service.d.ts b/src/platform/plugins/shared/data/public/query/saved_query/saved_query_service.d.ts deleted file mode 100644 index 9deb81c84a694..0000000000000 --- a/src/platform/plugins/shared/data/public/query/saved_query/saved_query_service.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import type { SavedQuery } from './types'; -import type { SavedQueryAttributes } from '../../../common'; -export declare const createSavedQueryService: (http: HttpStart) => { - isDuplicateTitle: (title: string, id?: string) => Promise; - createQuery: (attributes: SavedQueryAttributes, { overwrite }?: { - overwrite?: boolean | undefined; - }) => Promise; - updateQuery: (id: string, attributes: SavedQueryAttributes) => Promise; - findSavedQueries: (search?: string, perPage?: number, page?: number) => Promise<{ - total: number; - queries: SavedQuery[]; - }>; - getSavedQuery: (id: string) => Promise; - deleteSavedQuery: (id: string) => Promise<{}>; - getSavedQueryCount: () => Promise; -}; diff --git a/src/platform/plugins/shared/data/public/query/saved_query/types.d.ts b/src/platform/plugins/shared/data/public/query/saved_query/types.d.ts deleted file mode 100644 index 987d8dc513aff..0000000000000 --- a/src/platform/plugins/shared/data/public/query/saved_query/types.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { TimeRange } from '@kbn/es-query'; -import type { RefreshInterval } from '@kbn/data-service-server'; -import type { SavedQuery, SavedQueryAttributes } from '../../../common/types'; -export type SavedQueryTimeFilter = TimeRange & { - refreshInterval: RefreshInterval; -}; -export type { SavedQuery, SavedQueryAttributes }; -export interface SavedQueryService { - isDuplicateTitle: (title: string, id?: string) => Promise; - createQuery: (attributes: SavedQueryAttributes) => Promise; - updateQuery: (id: string, attributes: SavedQueryAttributes) => Promise; - findSavedQueries: (searchText?: string, perPage?: number, activePage?: number) => Promise<{ - total: number; - queries: SavedQuery[]; - }>; - getSavedQuery: (id: string) => Promise; - deleteSavedQuery: (id: string) => Promise<{}>; - getSavedQueryCount: () => Promise; -} diff --git a/src/platform/plugins/shared/data/public/query/state_sync/connect_to_query_state.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/connect_to_query_state.d.ts deleted file mode 100644 index a2553bb7ddefe..0000000000000 --- a/src/platform/plugins/shared/data/public/query/state_sync/connect_to_query_state.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { FilterStateStore } from '@kbn/es-query'; -import type { BaseStateContainer } from '@kbn/kibana-utils-plugin/public'; -import type { QuerySetup, QueryStart } from '../query_service'; -import type { QueryState } from '../query_state'; -/** - * Helper to setup two-way syncing of global data and a state container - * @param QueryService: either setup or start - * @param stateContainer to use for syncing - */ -export declare const connectToQueryState: ({ timefilter: { timefilter }, filterManager, queryString, state$, }: Pick, stateContainer: BaseStateContainer, syncConfig: { - time?: boolean; - refreshInterval?: boolean; - filters?: FilterStateStore | boolean; - query?: boolean; -}) => () => void; diff --git a/src/platform/plugins/shared/data/public/query/state_sync/create_query_state_observable.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/create_query_state_observable.d.ts deleted file mode 100644 index c3d0e71a80776..0000000000000 --- a/src/platform/plugins/shared/data/public/query/state_sync/create_query_state_observable.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Observable } from 'rxjs'; -import type { TimefilterSetup } from '../timefilter'; -import type { FilterManager } from '../filter_manager'; -import type { QueryState } from '../query_state'; -import type { QueryStateChange } from './types'; -import type { QueryStringContract } from '../query_string'; -export type QueryState$ = Observable<{ - changes: QueryStateChange; - state: QueryState; -}>; -export declare function createQueryStateObservable({ timefilter, filterManager, queryString, }: { - timefilter: TimefilterSetup; - filterManager: FilterManager; - queryString: QueryStringContract; -}): QueryState$; diff --git a/src/platform/plugins/shared/data/public/query/state_sync/index.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/index.d.ts deleted file mode 100644 index 54a356f4782df..0000000000000 --- a/src/platform/plugins/shared/data/public/query/state_sync/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { connectToQueryState } from './connect_to_query_state'; -export { syncQueryStateWithUrl, syncGlobalQueryStateWithUrl } from './sync_state_with_url'; -export type { QueryStateChange, GlobalQueryStateFromUrl } from './types'; -export type { QueryState$ } from './create_query_state_observable'; diff --git a/src/platform/plugins/shared/data/public/query/state_sync/sync_state_with_url.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/sync_state_with_url.d.ts deleted file mode 100644 index 874abe4533667..0000000000000 --- a/src/platform/plugins/shared/data/public/query/state_sync/sync_state_with_url.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; -import type { QuerySetup, QueryStart } from '../query_service'; -/** - * Helper to sync global query state {@link GlobalQueryStateFromUrl} with the URL (`_g` query param that is preserved between apps) - * @param QueryService: either setup or start - * @param kbnUrlStateStorage to use for syncing - */ -export declare const syncGlobalQueryStateWithUrl: (query: Pick, kbnUrlStateStorage: IKbnUrlStateStorage) => { - stop: () => void; - hasInheritedQueryFromUrl: boolean; -}; -/** - * @deprecated use {@link syncGlobalQueryStateWithUrl} instead - */ -export declare const syncQueryStateWithUrl: (query: Pick, kbnUrlStateStorage: IKbnUrlStateStorage) => { - stop: () => void; - hasInheritedQueryFromUrl: boolean; -}; diff --git a/src/platform/plugins/shared/data/public/query/state_sync/types.d.ts b/src/platform/plugins/shared/data/public/query/state_sync/types.d.ts deleted file mode 100644 index a56a2b3649838..0000000000000 --- a/src/platform/plugins/shared/data/public/query/state_sync/types.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Filter } from '@kbn/es-query'; -import type { RefreshInterval } from '@kbn/data-service-server'; -import type { QueryState } from '../query_state'; -import type { TimeRange } from '../../../common/types'; -type QueryStateChangePartial = { - [P in keyof QueryState]?: boolean; -}; -export interface QueryStateChange extends QueryStateChangePartial { - appFilters?: boolean; - globalFilters?: boolean; -} -/** - * Part of {@link QueryState} serialized in the `_g` portion of Url - */ -export interface GlobalQueryStateFromUrl { - time?: TimeRange; - refreshInterval?: RefreshInterval; - filters?: Filter[]; -} -export {}; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/index.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/index.d.ts deleted file mode 100644 index be80859fa358b..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type { TimefilterSetup } from './timefilter_service'; -export { TimefilterService } from './timefilter_service'; -export type * from './types'; -export type { TimefilterContract, AutoRefreshDoneFn } from './timefilter'; -export { Timefilter } from './timefilter'; -export type { TimeHistoryContract } from './time_history'; -export { TimeHistory } from './time_history'; -export { validateTimeRange } from './lib/validate_timerange'; -export type { TimefilterHook } from './use_timefilter'; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/lib/auto_refresh_loop.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/lib/auto_refresh_loop.d.ts deleted file mode 100644 index dcc1bf7a11fc7..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/lib/auto_refresh_loop.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export type AutoRefreshDoneFn = () => void; -/** - * Creates a loop for timepicker's auto refresh - * It has a "confirmation" mechanism: - * When auto refresh loop emits, it won't continue automatically, - * until each subscriber calls received `done` function. - * - * Also, it will pause when the page is not visible. - * - * @internal - */ -export declare const createAutoRefreshLoop: () => { - stop: () => void; - start: (timeout: number) => void; - loop$: import("rxjs").Observable; -}; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/lib/diff_time_picker_vals.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/lib/diff_time_picker_vals.d.ts deleted file mode 100644 index ce758e1baa46a..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/lib/diff_time_picker_vals.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { RefreshInterval } from '@kbn/data-service-server'; -import type { InputTimeRange } from '../types'; -export declare function areRefreshIntervalsDifferent(rangeA: RefreshInterval, rangeB: RefreshInterval): boolean; -export declare function areTimeRangesDifferent(rangeA: InputTimeRange, rangeB: InputTimeRange): boolean; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/lib/page_visibility.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/lib/page_visibility.d.ts deleted file mode 100644 index a333da28bc25e..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/lib/page_visibility.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Observable } from 'rxjs'; -export declare function createPageVisibility$(): Observable; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/lib/validate_timerange.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/lib/validate_timerange.d.ts deleted file mode 100644 index 34ed35add082c..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/lib/validate_timerange.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TimeRange } from '@kbn/es-query'; -export declare function validateTimeRange(time?: TimeRange): boolean; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/time_history.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/time_history.d.ts deleted file mode 100644 index 2705c239f430e..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/time_history.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { PublicMethodsOf } from '@kbn/utility-types'; -import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import type { TimeRange } from '@kbn/es-query'; -export declare class TimeHistory { - private history; - constructor(storage: IStorageWrapper); - add(time: TimeRange): void; - get(): TimeRange[]; - get$(): import("rxjs").Observable; -} -export type TimeHistoryContract = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/timefilter.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/timefilter.d.ts deleted file mode 100644 index 6570a63829268..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/timefilter.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -import type { PublicMethodsOf } from '@kbn/utility-types'; -import type { TimeRange } from '@kbn/es-query'; -import type { RefreshInterval } from '@kbn/data-service-server'; -import type { DataView } from '@kbn/data-views-plugin/common'; -import type { TimefilterConfig, InputTimeRange, TimeRangeBounds } from './types'; -import type { NowProviderInternalContract } from '../../now_provider'; -import type { TimeHistoryContract } from './time_history'; -import type { AutoRefreshDoneFn } from './lib/auto_refresh_loop'; -import type { TimefilterHook } from './use_timefilter'; -export type { AutoRefreshDoneFn }; -export declare class Timefilter { - private readonly nowProvider; - private enabledUpdated$; - private timeUpdate$; - private refreshIntervalUpdate$; - private fetch$; - private _time; - private _isTimeTouched; - private _refreshInterval; - private _minRefreshInterval; - private _isRefreshIntervalTouched; - private _history; - private _isTimeRangeSelectorEnabled; - private _isAutoRefreshSelectorEnabled; - private readonly timeDefaults; - private readonly refreshIntervalDefaults; - readonly useTimefilter: () => TimefilterHook; - private readonly autoRefreshLoop; - constructor(config: TimefilterConfig, timeHistory: TimeHistoryContract, nowProvider: NowProviderInternalContract); - isTimeRangeSelectorEnabled(): boolean; - isAutoRefreshSelectorEnabled(): boolean; - isTimeTouched(): boolean; - isRefreshIntervalTouched(): boolean; - getEnabledUpdated$: () => import("rxjs").Observable; - getTimeUpdate$: () => import("rxjs").Observable; - getRefreshIntervalUpdate$: () => import("rxjs").Observable; - /** - * Get an observable that emits when it is time to refetch data due to refresh interval - * Each subscription to this observable resets internal interval - * Emitted value is a callback {@link AutoRefreshDoneFn} that must be called to restart refresh interval loop - * Apps should use this callback to start next auto refresh loop when view finished updating - */ - getAutoRefreshFetch$: () => import("rxjs").Observable; - triggerFetch: () => void; - getFetch$: () => import("rxjs").Observable; - getTime: () => TimeRange; - /** - * Same as {@link getTime}, but also converts relative time range to absolute time range - */ - getAbsoluteTime(): TimeRange; - /** - * Updates timefilter time. - * Emits 'timeUpdate' and 'fetch' events when time changes - * @param {Object} time - * @property {string|moment} time.from - * @property {string|moment} time.to - */ - setTime: (time: InputTimeRange) => void; - getRefreshInterval: () => Readonly<{} & { - value: number; - pause: boolean; - }>; - getMinRefreshInterval: () => number; - /** - * Set timefilter refresh interval. - * @param {Object} refreshInterval - * @property {number} time.value Refresh interval in milliseconds. Positive integer - * @property {boolean} time.pause - */ - setRefreshInterval: (refreshInterval: Partial) => void; - /** - * Create a time filter that coerces all time values to absolute time. - * - * This is useful for creating a filter that ensures all ES queries will fetch the exact same data - * and leverages ES query cache for performance improvement. - * - * One use case is keeping different elements embedded in the same UI in sync. - */ - createFilter: (indexPattern: DataView, timeRange?: TimeRange) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter | undefined; - /** - * Create a time filter that converts only absolute time to ISO strings, it leaves relative time - * values unchanged (e.g. "now-1"). - * - * This is useful for sending datemath values to ES endpoints to generate reports over time. - * - * @note Consumers of this function need to ensure that the ES endpoint supports datemath. - */ - createRelativeFilter: (indexPattern: DataView, timeRange?: TimeRange) => import("@kbn/es-query").RangeFilter | import("@kbn/es-query").ScriptedRangeFilter | import("@kbn/es-query/src/filters/build_filters").MatchAllRangeFilter | undefined; - getBounds(): TimeRangeBounds; - calculateBounds(timeRange: TimeRange): TimeRangeBounds; - getActiveBounds(): TimeRangeBounds | undefined; - /** - * Show the time bounds selector part of the time filter - */ - enableTimeRangeSelector: () => void; - /** - * Hide the time bounds selector part of the time filter - */ - disableTimeRangeSelector: () => void; - /** - * Show the auto refresh part of the time filter - */ - enableAutoRefreshSelector: () => void; - /** - * Hide the auto refresh part of the time filter - */ - disableAutoRefreshSelector: () => void; - getTimeDefaults(): TimeRange; - getRefreshIntervalDefaults(): RefreshInterval; -} -export type TimefilterContract = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/timefilter_service.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/timefilter_service.d.ts deleted file mode 100644 index 795700b20604c..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/timefilter_service.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import type { TimeHistoryContract, TimefilterContract } from '.'; -import type { NowProviderInternalContract } from '../../now_provider'; -export interface TimeFilterServiceDependencies { - uiSettings: IUiSettingsClient; - storage: IStorageWrapper; - minRefreshInterval: number; -} -/** - * Filter Service - * @internal - */ -export declare class TimefilterService { - private readonly nowProvider; - constructor(nowProvider: NowProviderInternalContract); - setup({ uiSettings, storage, minRefreshInterval, }: TimeFilterServiceDependencies): TimefilterSetup; - start(): void; - stop(): void; -} -/** @public */ -export interface TimefilterSetup { - timefilter: TimefilterContract; - history: TimeHistoryContract; -} diff --git a/src/platform/plugins/shared/data/public/query/timefilter/types.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/types.d.ts deleted file mode 100644 index 94241ebb013d8..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Moment } from 'moment'; -import type { TimeRange } from '@kbn/es-query'; -import type { RefreshInterval } from '@kbn/data-service-server'; -export interface TimefilterConfig { - timeDefaults: TimeRange; - refreshIntervalDefaults: RefreshInterval; - minRefreshIntervalDefault: number; -} -export type InputTimeRange = TimeRange | { - from: Moment | string; - to: Moment | string; -}; -export type { TimeRangeBounds } from '../../../common'; diff --git a/src/platform/plugins/shared/data/public/query/timefilter/use_timefilter.d.ts b/src/platform/plugins/shared/data/public/query/timefilter/use_timefilter.d.ts deleted file mode 100644 index 3e68d0031e53e..0000000000000 --- a/src/platform/plugins/shared/data/public/query/timefilter/use_timefilter.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { TimeState } from '@kbn/es-query'; -import type { Observable } from 'rxjs'; -import type { Timefilter } from './timefilter'; -import type { NowProviderInternalContract } from '../../now_provider'; -type TimeStateChange = 'initial' | 'shift' | 'override'; -export interface TimeStateUpdate { - timeState: TimeState; - kind: TimeStateChange; -} -export interface TimefilterHook { - timeState: TimeState; - refresh: () => void; - timeState$: Observable; -} -/** - * Creates a useTimefilter hook that can be used in applications. Here's - * how the hook works: any time fetch$ (from Timefilter) emits, it will - * materialize the input time range (where it converts possibly relative - * time ranges into an absolute time range). This is referred to as the - * TimeState. It's both returned as state, and an observable. It also - * exposes a refresh callback - it will simply refresh the current time - * range. While timeFilter.setTime is memoized, refresh() is not - that - * means that even if the time changes, timeState$ will emit a new - * value. Additionally, the kind of change is included: - * - 'initial' means that this is the first emitted value, based on - * timeFilter.getTime(). - * - 'shift' means that the absolute time has changed. - * - 'override' means that the absolute time did NOT change. - * - * The reason for 'override' is that quite often, consumers will use - * the absolute timestamps (in epoch or ISO) to determine whether - * their state needs to be recalculated (commonly an API request) - but - * these values will not change in this case. Subscribe to state$, and - * check for `kind == 'override'` to determine whether a manual refresh - * is needed. - */ -export declare function createUseTimefilterHook(timefilter: Timefilter, nowProvider: NowProviderInternalContract): () => TimefilterHook; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/aggs/aggs_service.d.ts b/src/platform/plugins/shared/data/public/search/aggs/aggs_service.d.ts deleted file mode 100644 index a0828cba19c4c..0000000000000 --- a/src/platform/plugins/shared/data/public/search/aggs/aggs_service.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { Subscription } from 'rxjs'; -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { ExpressionsServiceSetup } from '@kbn/expressions-plugin/common'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { DataViewsContract } from '@kbn/data-views-plugin/common'; -import type { AggsCommonStartDependencies } from '../../../common/search/aggs'; -import type { AggsSetup, AggsStart } from './types'; -import type { NowProviderInternalContract } from '../../now_provider'; -/** - * Aggs needs synchronous access to specific uiSettings. Since settings can change - * without a page refresh, we create a cache that subscribes to changes from - * uiSettings.get$ and keeps everything up-to-date. - * - * @internal - */ -export declare function createGetConfig(uiSettings: IUiSettingsClient, requiredSettings: string[], subscriptions: Subscription[]): AggsCommonStartDependencies['getConfig']; -/** @internal */ -export interface AggsSetupDependencies { - uiSettings: IUiSettingsClient; - registerFunction: ExpressionsServiceSetup['registerFunction']; - nowProvider: NowProviderInternalContract; -} -/** @internal */ -export interface AggsStartDependencies { - fieldFormats: FieldFormatsStart; - dataViews: DataViewsContract; -} -/** - * The aggs service provides a means of modeling and manipulating the various - * Elasticsearch aggregations supported by Kibana, providing the ability to - * output the correct DSL when you are ready to send your request to ES. - */ -export declare class AggsService { - private readonly aggsCommonService; - private getConfig?; - private subscriptions; - private nowProvider; - /** - * NowGetter uses window.location, so we must have a separate implementation - * of calculateBounds on the client and the server. - */ - private calculateBounds; - setup({ registerFunction, uiSettings, nowProvider }: AggsSetupDependencies): AggsSetup; - start({ dataViews, fieldFormats }: AggsStartDependencies): AggsStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/data/public/search/aggs/index.d.ts b/src/platform/plugins/shared/data/public/search/aggs/index.d.ts deleted file mode 100644 index 2229ad24f5da5..0000000000000 --- a/src/platform/plugins/shared/data/public/search/aggs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './aggs_service'; -export type * from './types'; diff --git a/src/platform/plugins/shared/data/public/search/aggs/types.d.ts b/src/platform/plugins/shared/data/public/search/aggs/types.d.ts deleted file mode 100644 index 10b8423885b59..0000000000000 --- a/src/platform/plugins/shared/data/public/search/aggs/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AggsCommonSetup } from '../../../common'; -export type AggsSetup = AggsCommonSetup; -export type { AggsStart } from '../../../common'; diff --git a/src/platform/plugins/shared/data/public/search/collectors/create_usage_collector.d.ts b/src/platform/plugins/shared/data/public/search/collectors/create_usage_collector.d.ts deleted file mode 100644 index 3d65cf7535ad3..0000000000000 --- a/src/platform/plugins/shared/data/public/search/collectors/create_usage_collector.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/public'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import type { SearchUsageCollector } from './types'; -export declare const createUsageCollector: (getStartServices: StartServicesAccessor, usageCollection?: UsageCollectionSetup) => SearchUsageCollector; diff --git a/src/platform/plugins/shared/data/public/search/collectors/index.d.ts b/src/platform/plugins/shared/data/public/search/collectors/index.d.ts deleted file mode 100644 index 1a2c8447d39e6..0000000000000 --- a/src/platform/plugins/shared/data/public/search/collectors/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { createUsageCollector } from './create_usage_collector'; -export type { SearchUsageCollector } from './types'; -export { SEARCH_EVENT_TYPE } from './types'; diff --git a/src/platform/plugins/shared/data/public/search/collectors/types.d.ts b/src/platform/plugins/shared/data/public/search/collectors/types.d.ts deleted file mode 100644 index eb9b1c43c4411..0000000000000 --- a/src/platform/plugins/shared/data/public/search/collectors/types.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @internal - */ -export declare enum SEARCH_EVENT_TYPE { - /** - * A search reached the timeout configured in UI setting search:timeout - */ - QUERY_TIMED_OUT = "queryTimedOut", - /** - * The session indicator was automatically brought up because of a long running query - */ - SESSION_INDICATOR_TOUR_LOADING = "sessionIndicatorTourLoading", - /** - * The session indicator was automatically brought up because of a restored session - */ - SESSION_INDICATOR_TOUR_RESTORED = "sessionIndicatorTourRestored", - /** - * The session indicator was disabled because of a completion timeout - */ - SESSION_INDICATOR_SAVE_DISABLED = "sessionIndicatorSaveDisabled", - /** - * The user clicked to continue a session in the background (prior to results completing) - */ - SESSION_SENT_TO_BACKGROUND = "sessionSentToBackground", - /** - * The user clicked to save the session (after results completing) - */ - SESSION_SAVED_RESULTS = "sessionSavedResults", - /** - * The user clicked to view a completed session - */ - SESSION_VIEW_RESTORED = "sessionViewRestored", - /** - * The session was successfully restored upon a user navigating - */ - SESSION_IS_RESTORED = "sessionIsRestored", - /** - * The user clicked to reload an expired/cancelled session - */ - SESSION_RELOADED = "sessionReloaded", - /** - * The user clicked to extend the expiration of a session - */ - SESSION_EXTENDED = "sessionExtended", - /** - * The user clicked to cancel a session - */ - SESSION_CANCELLED = "sessionCancelled", - /** - * The user clicked to delete a session - */ - SESSION_DELETED = "sessionDeleted", - /** - * The user clicked a link to view the list of sessions - */ - SESSION_VIEW_LIST = "sessionViewList", - /** - * The user landed on the sessions management page - */ - SESSIONS_LIST_LOADED = "sessionsListLoaded" -} -export interface SearchUsageCollector { - trackQueryTimedOut: () => Promise; - trackSessionIndicatorTourLoading: () => Promise; - trackSessionIndicatorTourRestored: () => Promise; - trackSessionIndicatorSaveDisabled: () => Promise; - trackSessionSentToBackground: () => Promise; - trackSessionSavedResults: () => Promise; - trackSessionViewRestored: () => Promise; - trackSessionIsRestored: () => Promise; - trackSessionReloaded: () => Promise; - trackSessionExtended: () => Promise; - trackSessionCancelled: () => Promise; - trackSessionDeleted: () => Promise; - trackViewSessionsList: () => Promise; - trackSessionsListLoaded: () => Promise; -} diff --git a/src/platform/plugins/shared/data/public/search/constants.d.ts b/src/platform/plugins/shared/data/public/search/constants.d.ts deleted file mode 100644 index 3e8deed75e247..0000000000000 --- a/src/platform/plugins/shared/data/public/search/constants.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const EVENT_TYPE_DATA_SEARCH_TIMEOUT = "data_search_timeout"; -export declare const EVENT_PROPERTY_SEARCH_TIMEOUT_MS = "timeout_ms"; -export declare const EVENT_PROPERTY_EXECUTION_CONTEXT = "execution_context"; diff --git a/src/platform/plugins/shared/data/public/search/expressions/eql.d.ts b/src/platform/plugins/shared/data/public/search/expressions/eql.d.ts deleted file mode 100644 index 521d8cb963187..0000000000000 --- a/src/platform/plugins/shared/data/public/search/expressions/eql.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/public'; -import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; -/** - * This is some glue code that takes in `core.getStartServices`, extracts the dependencies - * needed for this function, and wraps them behind a `getStartDependencies` function that - * is then called at runtime. - * - * We do this so that we can be explicit about exactly which dependencies the function - * requires, without cluttering up the top-level `plugin.ts` with this logic. It also - * makes testing the expression function a bit easier since `getStartDependencies` is - * the only thing you should need to mock. - * - * @param getStartServices - core's StartServicesAccessor for this plugin - * - * @internal - */ -export declare function getEql({ getStartServices, }: { - getStartServices: StartServicesAccessor; -}): import("../../../common").EqlExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/esaggs.d.ts b/src/platform/plugins/shared/data/public/search/expressions/esaggs.d.ts deleted file mode 100644 index 92c26638fb801..0000000000000 --- a/src/platform/plugins/shared/data/public/search/expressions/esaggs.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/public'; -import type { EsaggsExpressionFunctionDefinition, EsaggsStartDependencies } from '../../../common/search/expressions'; -import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; -/** - * Returns the expression function definition. Any stateful dependencies are accessed - * at runtime via the `getStartDependencies` param, which provides the specific services - * needed for this function to run. - * - * This function is an implementation detail of this module, and is exported separately - * only for testing purposes. - * - * @param getStartDependencies - async function that resolves with EsaggsStartDependencies - * - * @internal - */ -export declare function getFunctionDefinition({ getStartDependencies, }: { - getStartDependencies: () => Promise; -}): () => EsaggsExpressionFunctionDefinition; -/** - * This is some glue code that takes in `core.getStartServices`, extracts the dependencies - * needed for this function, and wraps them behind a `getStartDependencies` function that - * is then called at runtime. - * - * We do this so that we can be explicit about exactly which dependencies the function - * requires, without cluttering up the top-level `plugin.ts` with this logic. It also - * makes testing the expression function a bit easier since `getStartDependencies` is - * the only thing you should need to mock. - * - * @param getStartServices - core's StartServicesAccessor for this plugin - * - * @internal - */ -export declare function getEsaggs({ getStartServices, }: { - getStartServices: StartServicesAccessor; -}): () => EsaggsExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/esdsl.d.ts b/src/platform/plugins/shared/data/public/search/expressions/esdsl.d.ts deleted file mode 100644 index 1c351f6c277dc..0000000000000 --- a/src/platform/plugins/shared/data/public/search/expressions/esdsl.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/public'; -import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; -/** - * This is some glue code that takes in `core.getStartServices`, extracts the dependencies - * needed for this function, and wraps them behind a `getStartDependencies` function that - * is then called at runtime. - * - * We do this so that we can be explicit about exactly which dependencies the function - * requires, without cluttering up the top-level `plugin.ts` with this logic. It also - * makes testing the expression function a bit easier since `getStartDependencies` is - * the only thing you should need to mock. - * - * @param getStartServices - core's StartServicesAccessor for this plugin - * - * @internal - */ -export declare function getEsdsl({ getStartServices, }: { - getStartServices: StartServicesAccessor; -}): import("../../../common").EsdslExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/esql.d.ts b/src/platform/plugins/shared/data/public/search/expressions/esql.d.ts deleted file mode 100644 index afa0cbc865d1c..0000000000000 --- a/src/platform/plugins/shared/data/public/search/expressions/esql.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/public'; -import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; -/** - * This is some glue code that takes in `core.getStartServices`, extracts the dependencies - * needed for this function, and wraps them behind a `getStartDependencies` function that - * is then called at runtime. - * - * We do this so that we can be explicit about exactly which dependencies the function - * requires, without cluttering up the top-level `plugin.ts` with this logic. It also - * makes testing the expression function a bit easier since `getStartDependencies` is - * the only thing you should need to mock. - * - * @param getStartServices - core's StartServicesAccessor for this plugin - * @internal - */ -export declare function getEsql({ getStartServices, }: { - getStartServices: StartServicesAccessor; -}): import("../../../common").EsqlExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/essql.d.ts b/src/platform/plugins/shared/data/public/search/expressions/essql.d.ts deleted file mode 100644 index e91df4dede195..0000000000000 --- a/src/platform/plugins/shared/data/public/search/expressions/essql.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/public'; -import type { DataPublicPluginStart, DataStartDependencies } from '../../types'; -/** - * This is some glue code that takes in `core.getStartServices`, extracts the dependencies - * needed for this function, and wraps them behind a `getStartDependencies` function that - * is then called at runtime. - * - * We do this so that we can be explicit about exactly which dependencies the function - * requires, without cluttering up the top-level `plugin.ts` with this logic. It also - * makes testing the expression function a bit easier since `getStartDependencies` is - * the only thing you should need to mock. - * - * @param getStartServices - core's StartServicesAccessor for this plugin - * @internal - */ -export declare function getEssql({ getStartServices, }: { - getStartServices: StartServicesAccessor; -}): import("../../../common/search/expressions/essql").EssqlExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data/public/search/expressions/index.d.ts b/src/platform/plugins/shared/data/public/search/expressions/index.d.ts deleted file mode 100644 index 348fffda3d4cb..0000000000000 --- a/src/platform/plugins/shared/data/public/search/expressions/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './esaggs'; -export * from './esdsl'; -export * from './essql'; -export * from './esql'; -export * from '../../../common/search/expressions'; -export * from './eql'; diff --git a/src/platform/plugins/shared/data/public/search/index.d.ts b/src/platform/plugins/shared/data/public/search/index.d.ts deleted file mode 100644 index 49572690756af..0000000000000 --- a/src/platform/plugins/shared/data/public/search/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './expressions'; -export type { ISearchSetup, ISearchStart, ISearchStartSearchSource, SearchUsageCollector, } from './types'; -export type { EsQuerySortValue, ISearchSource, SearchError, SearchRequest, SearchSourceDependencies, SearchSourceFields, SerializedSearchSourceFields, } from '../../common/search'; -export { ES_SEARCH_STRATEGY, extractReferences as extractSearchSourceReferences, getSearchParamsFromRequest, injectReferences as injectSearchSourceReferences, parseSearchSourceJSON, SearchSource, SortDirection, } from '../../common/search'; -export type { ISessionService, SearchSessionInfoProvider, ISessionsClient, WaitUntilNextSessionCompletesOptions, } from './session'; -export { SessionService, SearchSessionState, SessionsClient, noSearchSessionStorageCapabilityMessage, SEARCH_SESSIONS_MANAGEMENT_ID, waitUntilNextSessionCompletes$, } from './session'; -export type { SearchInterceptorDeps } from './search_interceptor'; -export { SearchInterceptor } from './search_interceptor'; -export { SearchService } from './search_service'; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/create_request_hash.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/create_request_hash.d.ts deleted file mode 100644 index 50ef1c0159150..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_interceptor/create_request_hash.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Generate the hash for this request. - * - * Ignores the `preference` parameter since it generally won't - * match from one request to another identical request. - * - * (Preference is used to ensure all queries go to the same set of shards and it doesn't need to be hashed - * https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shard-routing.html#shard-and-node-preference) - */ -declare function createRequestHash(keys: Record): string; -/** - * Generates the hash used as a key in the client-side request cache. - */ -export declare const createRequestHashForClientCache: typeof createRequestHash; -/** - * Generates the hash for associating requests with background searches stored on the server. - * - * Ignores sessionId for compatibility with background searches created before https://github.com/elastic/kibana/pull/237191 - */ -export declare const createRequestHashForBackgroundSearches: (keys: Record) => string; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/index.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/index.d.ts deleted file mode 100644 index df8cb7c375f87..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_interceptor/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { ISearchInterceptor, SearchInterceptorDeps } from './search_interceptor'; -export { SearchInterceptor } from './search_interceptor'; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/search_abort_controller.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/search_abort_controller.d.ts deleted file mode 100644 index 1802f10cd466e..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_interceptor/search_abort_controller.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AbortReason } from '@kbn/kibana-utils-plugin/common'; -export declare class SearchAbortController { - private inputAbortSignals; - private abortController; - private timeoutSub?; - private destroyed; - constructor(timeout?: number); - private abortHandler; - cleanup(): void; - addAbortSignal(inputSignal: AbortSignal): void; - getSignal(): AbortSignal; - abort(reason?: AbortReason): void; - isTimeout(): boolean; - isCanceled(): boolean; -} diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.d.ts deleted file mode 100644 index cd40ff5442dd2..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { PublicMethodsOf } from '@kbn/utility-types'; -import type { HttpSetup } from '@kbn/core-http-browser'; -import type { CoreStart, ExecutionContextSetup, IUiSettingsClient, ToastsSetup } from '@kbn/core/public'; -import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/search-types'; -import type { ICPSManager } from '@kbn/cps-utils'; -import type { IAsyncSearchOptions } from '../../../common'; -import type { SearchUsageCollector } from '../collectors'; -import type { ISessionService } from '../session'; -import type { SearchConfigSchema } from '../../../server/config'; -export interface SearchInterceptorDeps { - http: HttpSetup; - executionContext: ExecutionContextSetup; - uiSettings: IUiSettingsClient; - startServices: Promise<[CoreStart, object, unknown]>; - toasts: ToastsSetup; - usageCollector?: SearchUsageCollector; - session: ISessionService; - searchConfig: SearchConfigSchema; - getCPSManager?: () => ICPSManager | undefined; -} -export declare class SearchInterceptor { - private readonly deps; - private uiSettingsSubs; - private searchTimeout; - private readonly responseCache; - private protocolSupportsMultiplexing; - private performanceObserver?; - /** - * Observable that emits when the number of pending requests changes. - * @internal - */ - private pendingCount$; - /** - * @internal - */ - private application; - private docLinks; - private inspector; - private startRenderServices; - constructor(deps: SearchInterceptorDeps); - stop(): void; - private getTimeoutMode; - private createRequestHash$; - private handleSearchError; - private getSerializableOptions; - /** - * @internal - * Creates a new pollSearch that share replays its results - */ - private runSearch$; - /** - * @internal - * @throws `AbortError` | `ErrorLike` - */ - private runSearch; - /** - * @internal - * Creates a new search observable and a corresponding search abort controller - * If requestHash is defined, tries to return them first from cache. - */ - private getSearchResponse$; - /** - * Searches using the given `search` method. Overrides the `AbortSignal` with one that will abort - * either when the request times out, or when the original `AbortSignal` is aborted. Updates - * `pendingCount$` when the request is started/finalized. - * - * @param request - * @options - * @returns `Observable` emitting the search response or an error. - */ - search({ id, ...request }: IKibanaSearchRequest, options?: IAsyncSearchOptions): Observable>; - private showTimeoutErrorToast; - private showTimeoutErrorMemoized; - private showRestoreWarningToast; - private showRestoreWarning; - /** - * Show one error notification per session. - * @internal - */ - private showTimeoutError; - showError(e: Error): void; -} -export type ISearchInterceptor = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/search_response_cache.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/search_response_cache.d.ts deleted file mode 100644 index fd24a465a8b52..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_interceptor/search_response_cache.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { IKibanaSearchResponse } from '@kbn/search-types'; -import type { SearchAbortController } from './search_abort_controller'; -interface ResponseCacheItem { - response$: Observable; - searchAbortController: SearchAbortController; -} -export declare class SearchResponseCache { - private maxItems; - private maxCacheSizeMB; - private responseCache; - private cacheSize; - constructor(maxItems: number, maxCacheSizeMB: number); - private byteToMb; - private deleteItem; - private setItem; - clear(): void; - private shrink; - has(key: string): boolean; - /** - * - * @param key key to cache - * @param response$ - * @returns A ReplaySubject that mimics the behavior of the original observable - * @throws error if key already exists - */ - set(key: string, item: ResponseCacheItem): void; - get(key: string): ResponseCacheItem | undefined; -} -export {}; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/search_session_incomplete_warning.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/search_session_incomplete_warning.d.ts deleted file mode 100644 index ef3d72302e1ad..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_interceptor/search_session_incomplete_warning.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DocLinksStart } from '@kbn/core/public'; -import React from 'react'; -export declare const SearchSessionIncompleteWarning: (docLinks: DocLinksStart) => React.JSX.Element; diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/timeout_error.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/timeout_error.d.ts deleted file mode 100644 index 9f4feb65663ec..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_interceptor/timeout_error.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import type { ApplicationStart } from '@kbn/core/public'; -import { KbnError } from '@kbn/kibana-utils-plugin/common'; -export declare enum TimeoutErrorMode { - CONTACT = 0, - CHANGE = 1 -} -/** - * Request Failure - When an entire multi request fails - * @param {Error} err - the Error that came back - */ -export declare class SearchTimeoutError extends KbnError { - mode: TimeoutErrorMode; - constructor(err: Record, mode: TimeoutErrorMode); - private getMessage; - private getActionText; - private onClick; - getErrorMessage(application: ApplicationStart): React.JSX.Element; -} diff --git a/src/platform/plugins/shared/data/public/search/search_interceptor/to_partial_response.d.ts b/src/platform/plugins/shared/data/public/search/search_interceptor/to_partial_response.d.ts deleted file mode 100644 index ab942866e0215..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_interceptor/to_partial_response.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IEsSearchResponse } from '@kbn/search-types'; -/** - * When we hit the advanced setting `search:timeout`, we cancel in-progress search requests. This method takes the - * active raw response from ES (status: "running") and returns a request in the format expected by our helper utilities - * (status: "partial") that display cluster info, warnings, & errors. - * @param response The raw ES response - */ -export declare function toPartialResponseAfterTimeout(response: IEsSearchResponse): IEsSearchResponse; diff --git a/src/platform/plugins/shared/data/public/search/search_service.d.ts b/src/platform/plugins/shared/data/public/search/search_service.d.ts deleted file mode 100644 index 89fc5121f354b..0000000000000 --- a/src/platform/plugins/shared/data/public/search/search_service.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { CPSPluginStart } from '@kbn/cps/public'; -import type { DataViewsContract } from '@kbn/data-views-plugin/common'; -import type { ExpressionsSetup } from '@kbn/expressions-plugin/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { ManagementSetup } from '@kbn/management-plugin/public'; -import type { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import type { Start as InspectorStartContract } from '@kbn/inspector-plugin/public'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { ConfigSchema } from '../../server/config'; -import type { NowProviderInternalContract } from '../now_provider'; -import type { ISearchSetup, ISearchStart } from './types'; -/** @internal */ -export interface SearchServiceSetupDependencies { - expressions: ExpressionsSetup; - usageCollection?: UsageCollectionSetup; - management: ManagementSetup; - nowProvider: NowProviderInternalContract; -} -/** @internal */ -export interface SearchServiceStartDependencies { - fieldFormats: FieldFormatsStart; - dataViews: DataViewsContract; - inspector: InspectorStartContract; - screenshotMode: ScreenshotModePluginStart; - share: SharePluginStart; - scriptedFieldsEnabled: boolean; - cps?: CPSPluginStart; -} -export declare class SearchService implements Plugin { - private initializerContext; - private readonly aggsService; - private readonly searchSourceService; - private searchInterceptor; - private usageCollector?; - private sessionService; - private sessionsClient; - private backgroundSearchNotifier; - private searchSessionEBTManager; - private cpsManager?; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup, { expressions, usageCollection, nowProvider, management }: SearchServiceSetupDependencies): ISearchSetup; - start(coreStart: CoreStart, { fieldFormats, dataViews, inspector, scriptedFieldsEnabled, share, cps, }: SearchServiceStartDependencies): ISearchStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/data/public/search/session/background_search_notifier.d.ts b/src/platform/plugins/shared/data/public/search/session/background_search_notifier.d.ts deleted file mode 100644 index 3b9951bf3de45..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/background_search_notifier.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { ISessionsClient } from '../..'; -import type { LocatorsStart } from './sessions_mgmt/types'; -export declare class BackgroundSearchNotifier { - private sessionsClient; - private core; - private locators; - private pollingSubscription?; - constructor(sessionsClient: ISessionsClient, core: CoreStart, locators: LocatorsStart); - startPolling(interval: number): void; - stopPolling(): void; - private groupSessions; - private updateSessions; - private buildNotificationInfo; - private getDefaultSessionName; - private showNotifications; -} diff --git a/src/platform/plugins/shared/data/public/search/session/constants.d.ts b/src/platform/plugins/shared/data/public/search/session/constants.d.ts deleted file mode 100644 index 53484e2638666..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/constants.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const SEARCH_SESSIONS_MANAGEMENT_ID = "search_sessions"; -export declare const BACKGROUND_SESSION_POLLING_INTERVAL = 5000; diff --git a/src/platform/plugins/shared/data/public/search/session/ebt_manager/constants.d.ts b/src/platform/plugins/shared/data/public/search/session/ebt_manager/constants.d.ts deleted file mode 100644 index 4376a9f4c88e7..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/ebt_manager/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const BG_SEARCH_START = "bg_search_start"; -export declare const BG_SEARCH_CANCEL = "bg_search_cancel"; -export declare const BG_SEARCH_OPEN = "bg_search_open"; -export declare const BG_SEARCH_LIST_VIEW = "bg_search_list_view"; diff --git a/src/platform/plugins/shared/data/public/search/session/ebt_manager/index.d.ts b/src/platform/plugins/shared/data/public/search/session/ebt_manager/index.d.ts deleted file mode 100644 index 47be97b452333..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/ebt_manager/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { ISearchSessionEBTManager } from './search_session_ebt_manager'; -export { SearchSessionEBTManager } from './search_session_ebt_manager'; -export { registerSearchSessionEBTManagerAnalytics } from './search_session_ebt_manager_registrations'; diff --git a/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager.d.ts b/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager.d.ts deleted file mode 100644 index f711bb3c30c4c..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { CoreSetup } from '@kbn/core/public'; -import type { PublicContract } from '@kbn/utility-types'; -import type { Logger } from '@kbn/logging'; -import type { SearchSessionSavedObject } from '../sessions_client'; -import type { UISession } from '../sessions_mgmt/types'; -export type ISearchSessionEBTManager = PublicContract; -export declare class SearchSessionEBTManager { - private reportEventCore; - private logger; - constructor({ core, logger }: { - core: CoreSetup; - logger: Logger; - }); - private reportEvent; - trackBgsStarted({ entryPoint, session, }: { - entryPoint: string; - session: SearchSessionSavedObject; - }): void; - trackBgsCancelled({ session, cancelSource, }: { - session: SearchSessionSavedObject; - cancelSource: string; - }): void; - trackBgsOpened({ session, resumeSource }: { - session: UISession; - resumeSource: string; - }): void; - trackBgsListView({ entryPoint }: { - entryPoint: string; - }): void; -} diff --git a/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager_registrations.d.ts b/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager_registrations.d.ts deleted file mode 100644 index e51cb99dd6cb4..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/ebt_manager/search_session_ebt_manager_registrations.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { CoreSetup } from '@kbn/core/public'; -export declare const registerSearchSessionEBTManagerAnalytics: (core: CoreSetup) => void; diff --git a/src/platform/plugins/shared/data/public/search/session/get_session_redirect_url.d.ts b/src/platform/plugins/shared/data/public/search/session/get_session_redirect_url.d.ts deleted file mode 100644 index 86c6d068fb1b7..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/get_session_redirect_url.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { LocatorsStart } from './sessions_mgmt/types'; -interface GetRedirectUrlFromStateParams { - locators: LocatorsStart; - locatorId?: string; - state?: SerializableRecord; -} -export declare const getRedirectUrlFromState: ({ locators, locatorId, state, }: GetRedirectUrlFromStateParams) => string | undefined; -interface GetRestoreUrlParams { - locators: LocatorsStart; - locatorId?: string; - restoreState?: SerializableRecord; - sessionName?: string; -} -export declare const getRestoreUrl: ({ locators, locatorId, restoreState, sessionName, }: GetRestoreUrlParams) => string | undefined; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/i18n.d.ts b/src/platform/plugins/shared/data/public/search/session/i18n.d.ts deleted file mode 100644 index bb1e793037555..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/i18n.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Message to display in case storing - * session session is disabled due to turned off capability - */ -export declare const noSearchSessionStorageCapabilityMessage: string; diff --git a/src/platform/plugins/shared/data/public/search/session/in_progress_session.d.ts b/src/platform/plugins/shared/data/public/search/session/in_progress_session.d.ts deleted file mode 100644 index 8e7d3e47995b5..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/in_progress_session.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const IN_PROGRESS_SESSION_PREFIX = "in-progress-background-search"; -export declare function getInProgressSessionIds(): string[]; -export declare function addInProgressSessionId(sessionId: string): void; -export declare function setInProgressSessionIds(sessionIds: string[]): void; diff --git a/src/platform/plugins/shared/data/public/search/session/index.d.ts b/src/platform/plugins/shared/data/public/search/session/index.d.ts deleted file mode 100644 index b14372c49aabd..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type { ISessionService, SearchSessionInfoProvider } from './session_service'; -export { SessionService } from './session_service'; -export { SearchSessionState } from './search_session_state'; -export type { ISessionsClient } from './sessions_client'; -export { SessionsClient } from './sessions_client'; -export { noSearchSessionStorageCapabilityMessage } from './i18n'; -export { SEARCH_SESSIONS_MANAGEMENT_ID } from './constants'; -export type { WaitUntilNextSessionCompletesOptions } from './session_helpers'; -export { waitUntilNextSessionCompletes$ } from './session_helpers'; -export * from './ebt_manager'; diff --git a/src/platform/plugins/shared/data/public/search/session/lib/session_name_formatter.d.ts b/src/platform/plugins/shared/data/public/search/session/lib/session_name_formatter.d.ts deleted file mode 100644 index d2f402af704d4..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/lib/session_name_formatter.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare function formatSessionName(sessionName: string, opts: { - sessionStartTime?: Date; - appendStartTime?: boolean; -}): string; diff --git a/src/platform/plugins/shared/data/public/search/session/search_session_state.d.ts b/src/platform/plugins/shared/data/public/search/session/search_session_state.d.ts deleted file mode 100644 index 1bff2ace5c280..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/search_session_state.d.ts +++ /dev/null @@ -1,167 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { StateContainer } from '@kbn/kibana-utils-plugin/public'; -import type { SearchSessionSavedObject } from './sessions_client'; -/** - * Possible state that current session can be in - * - * @public - */ -export declare enum SearchSessionState { - /** - * Session is not active, e.g. didn't start - */ - None = "none", - /** - * Pending search request has not been sent to the background yet - */ - Loading = "loading", - /** - * No action was taken and the page completed loading without search session creation. - */ - Completed = "completed", - /** - * Search session was sent to the background. - * The page is loading in background. - */ - BackgroundLoading = "backgroundLoading", - /** - * Page load completed with search session created. - */ - BackgroundCompleted = "backgroundCompleted", - /** - * Revisiting the page after background completion - */ - Restored = "restored", - /** - * Current session requests where explicitly canceled by user - * Displaying none or partial results - */ - Canceled = "canceled" -} -/** - * State of the tracked search - */ -export declare enum TrackedSearchState { - InProgress = "inProgress", - Completed = "completed", - Errored = "errored" -} -export interface TrackedSearch { - state: TrackedSearchState; - searchDescriptor: SearchDescriptor; - searchMeta: SearchMeta; -} -/** - * Internal state of SessionService - * {@link SearchSessionState} is inferred from this state - * - * @internal - */ -export interface SessionStateInternal { - /** - * Current session Id - * Empty means there is no current active session. - */ - sessionId?: string; - /** - * App that created this session - */ - appName?: string; - /** - * Is the session in the process of being saved? - */ - isSaving: boolean; - /** - * Has the session already been stored (i.e. "sent to background")? - */ - isStored: boolean; - /** - * Saved object of a current search session - */ - searchSessionSavedObject?: SearchSessionSavedObject; - /** - * Is this session a restored session (have these requests already been made, and we're just - * looking to re-use the previous search IDs)? - */ - isRestore: boolean; - /** - * Set of all searches within a session and any info associated with them - */ - trackedSearches: Array>; - /** - * There was at least a single search in this session - */ - isStarted: boolean; - /** - * If user has explicitly canceled search requests - */ - isCanceled: boolean; - /** - * If session was continued from a different app, - * If session continued from a different app, then it is very likely that `trackedSearches` - * doesn't have all the search that were included into the session. - * Session that was continued can't be saved because we can't guarantee all the searches saved. - * This limitation should be fixed in https://github.com/elastic/kibana/issues/121543 - * - * @deprecated - https://github.com/elastic/kibana/issues/121543 - */ - isContinued: boolean; - /** - * Start time of the current session (from browser perspective) - */ - startTime?: Date; - /** - * Time when all the searches from the current session are completed (from browser perspective) - */ - completedTime?: Date; - /** - * Time when the session was canceled by user, by hitting "stop" - */ - canceledTime?: Date; -} -export interface SessionPureTransitions> { - start: (state: S) => ({ appName }: { - appName: string; - }) => S; - restore: (state: S) => (sessionId: string) => S; - clear: (state: S) => () => S; - save: (state: S) => () => S; - store: (state: S) => (searchSessionSavedObject: SearchSessionSavedObject) => S; - trackSearch: (state: S) => (search: SearchDescriptor, meta?: SearchMeta) => S; - removeSearch: (state: S) => (search: SearchDescriptor) => S; - completeSearch: (state: S) => (search: SearchDescriptor) => S; - errorSearch: (state: S) => (search: SearchDescriptor) => S; - updateSearchMeta: (state: S) => (search: SearchDescriptor, meta: Partial) => S; - cancel: (state: S) => () => S; - setSearchSessionSavedObject: (state: S) => (searchSessionSavedObject: SearchSessionSavedObject) => S; -} -export declare const sessionPureTransitions: SessionPureTransitions; -/** - * Consolidate meta info about current seach session - * Contains both deferred properties and plain properties from state - */ -export interface SessionMeta { - state: SearchSessionState; - name?: string; - startTime?: Date; - canceledTime?: Date; - completedTime?: Date; - /** - * @deprecated - see remarks in {@link SessionStateInternal} - */ - isContinued: boolean; -} -export interface SessionPureSelectors> { - getState: (state: S) => () => SearchSessionState; - getMeta: (state: S) => () => SessionMeta; - getSearch: (state: S) => (search: SearchDescriptor) => TrackedSearch | null; -} -export declare const sessionPureSelectors: SessionPureSelectors; -export type SessionStateContainer = StateContainer, SessionPureTransitions, SessionPureSelectors>; -export declare const createSessionStateContainer: ({ freeze }?: { - freeze: boolean; -}) => { - stateContainer: SessionStateContainer; - sessionState$: Observable; - sessionMeta$: Observable; -}; diff --git a/src/platform/plugins/shared/data/public/search/session/session_helpers.d.ts b/src/platform/plugins/shared/data/public/search/session/session_helpers.d.ts deleted file mode 100644 index 6ee104fc37d76..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/session_helpers.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ISessionService } from './session_service'; -import { SearchSessionState } from './search_session_state'; -/** - * Options for {@link waitUntilNextSessionCompletes$} - */ -export interface WaitUntilNextSessionCompletesOptions { - /** - * For how long to wait between session state transitions before considering that session completed - */ - waitForIdle?: number; -} -/** - * Creates an observable that emits when next search session completes. - * This utility is helpful to use in the application to delay some tasks until next session completes. - * - * @param sessionService - {@link ISessionService} - * @param opts - {@link WaitUntilNextSessionCompletesOptions} - */ -export declare function waitUntilNextSessionCompletes$(sessionService: ISessionService, { waitForIdle }?: WaitUntilNextSessionCompletesOptions): import("rxjs").Observable; diff --git a/src/platform/plugins/shared/data/public/search/session/session_service.d.ts b/src/platform/plugins/shared/data/public/search/session/session_service.d.ts deleted file mode 100644 index df14a7e05aa22..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/session_service.d.ts +++ /dev/null @@ -1,243 +0,0 @@ -import type { PublicContract, SerializableRecord } from '@kbn/utility-types'; -import { type Observable } from 'rxjs'; -import type { PluginInitializerContext, StartServicesAccessor } from '@kbn/core/public'; -import type { IKibanaSearchResponse, ISearchOptions } from '@kbn/search-types'; -import { AbortReason } from '@kbn/kibana-utils-plugin/common'; -import type { ConfigSchema } from '../../../server/config'; -import type { SessionMeta, SessionStateContainer } from './search_session_state'; -import { SearchSessionState } from './search_session_state'; -import type { ISessionsClient } from './sessions_client'; -import type { NowProviderInternalContract } from '../../now_provider'; -import type { ISearchSessionEBTManager } from './ebt_manager'; -export type ISessionService = PublicContract; -interface TrackSearchDescriptor { - /** - * Cancel the search - */ - abort: (reason: AbortReason) => void; - /** - * Used for polling after running in background (to ensure the search makes it into the background search saved - * object) and also to keep the search alive while other search requests in the session are still in progress - * @param abortSignal - signal that can be used to cancel the polling - otherwise the `searchAbortController.getSignal()` is used - */ - poll: (abortSignal?: AbortSignal) => Promise; - /** - * Notify search that session is being saved, could be used to restart the search with different params - * @deprecated - this is used as an escape hatch for TSVB/Timelion to restart a search with different params - */ - onSavingSession?: (options: Required>) => Promise; -} -interface TrackSearchMeta { - /** - * Time that indicates when last time this search was polled - */ - lastPollingTime: Date; - /** - * If the keep_alive of this search was extended up to saved session keep_alive - */ - isStored: boolean; -} -/** - * Api to manage tracked search - */ -interface TrackSearchHandler { - /** - * Transition search into "complete" status - */ - complete(response?: IKibanaSearchResponse): void; - /** - * Transition search into "error" status - */ - error(error?: Error): void; - /** - * Call to notify when search is about to be polled to get current search state to build `searchOptions` from (mainly isSearchStored), - * When poll completes or errors, call `afterPoll` callback and confirm is search was successfully stored - */ - beforePoll(): [ - currentSearchState: { - isSearchStored: boolean; - }, - afterPoll: (newSearchState: { - isSearchStored: boolean; - }) => void - ]; -} -/** - * Represents a search session state in {@link SessionService} in any given moment of time - */ -export type SessionSnapshot = SessionStateContainer; -/** - * Provide info about current search session to be stored in the Search Session saved object - */ -export interface SearchSessionInfoProvider

{ - /** - * User-facing name of the session. - * e.g. will be displayed in saved Search Sessions management list - */ - getName: () => Promise; - /** - * Append session start time to a session name, - * `true` by default - */ - appendSessionStartTimeToName?: boolean; - getLocatorData: () => Promise<{ - id: string; - initialState: P; - restoreState: P; - }>; -} -/** - * Configure a "Background search indicator" UI - */ -interface SearchSessionIndicatorUiConfig { - /** - * App controls if "Search session indicator" UI should be disabled. - * reasonText will appear in a tooltip. - * - * Could be used, for example, to disable "Search session indicator" UI - * in case user doesn't have permissions to store a search session - */ - isDisabled: () => { - disabled: true; - reasonText: string; - } | { - disabled: false; - }; -} -/** - * Responsible for tracking a current search session. Supports a single session at a time. - */ -export declare class SessionService { - private readonly sessionsClient; - private readonly nowProvider; - readonly state$: Observable; - private readonly state; - readonly sessionMeta$: Observable; - private searchSessionInfoProvider?; - private searchSessionIndicatorUiConfig?; - private subscription; - private currentApp?; - private hasAccessToSearchSessions; - private toastService?; - private searchSessionEBTManager?; - private sessionSnapshots; - private logger; - constructor(initializerContext: PluginInitializerContext, getStartServices: StartServicesAccessor, searchSessionEBTManager: ISearchSessionEBTManager, sessionsClient: ISessionsClient, nowProvider: NowProviderInternalContract, { freezeState }?: { - freezeState: boolean; - }); - /** - * If user has access to search sessions - * This resolves to `true` in case at least one app allows user to create search session - * In this case search session management is available - */ - hasAccess(): boolean; - /** - * Used to track searches within current session - * - * @param searchDescriptor - uniq object that will be used to as search identifier - * @returns {@link TrackSearchHandler} - */ - trackSearch(searchDescriptor: TrackSearchDescriptor): TrackSearchHandler; - destroy(): void; - /** - * Get current session id - */ - getSessionId(): string | undefined; - /** - * Get observable for current session id - */ - getSession$(): Observable; - /** - * Is current session in process of saving - */ - isSaving(state?: SessionStateContainer): boolean; - /** - * Is current session already saved as SO (send to background) - */ - isStored(state?: SessionStateContainer): boolean; - /** - * Is restoring the older saved searches - */ - isRestore(state?: SessionStateContainer): boolean; - /** - * Start a new search session - * @returns sessionId - */ - start(): string; - /** - * Restore previously saved search session - * @param sessionId - */ - restore(sessionId: string): Promise; - /** - * Continue previous search session - * Can be used to restore all the information of a previous search session after a new one has been started. It is useful - * to continue a session in different apps or across different discover tabs. - * - * This is different from {@link restore} as it reuses search session state and search results held in client memory instead of restoring search results from elasticsearch - * @param sessionId - * @param keepSearches indicates if restoring the session also restores the tracked searches or starts with an empty tracking list - */ - continue(sessionId: string, keepSearches?: boolean): void; - /** - * Resets the current search session state. - * Can be used to reset to a default state without clearing initialization info, such as when switching between discover tabs. - * - * This is different from {@link clear} as it does not reset initialization info set through {@link enableStorage}. - */ - reset(): void; - private storeSessionSnapshot; - /** - * Cleans up current state - */ - clear(): void; - /** - * Request a cancellation of on-going search requests within current session - */ - cancel({ source }: { - source: string; - }): Promise; - /** - * Save current session as SO to get back to results later - * (Send to background) - */ - save(trackingProps: { - entryPoint: string; - }): Promise; - /** - * Change user-facing name of a current session - * Doesn't throw in case of API error but presents a notification toast instead - * @param newName - new session name - */ - renameCurrentSession(newName: string): Promise; - /** - * Checks if passed sessionId is a current sessionId - * @param sessionId - */ - isCurrentSession(sessionId?: string): boolean; - /** - * Infers search session options for sessionId using current session state - * - * In case user doesn't has access to `search-session` SO returns null, - * meaning that sessionId and other session parameters shouldn't be used when doing searches - * - * @param sessionId - */ - getSearchOptions(sessionId?: string): Required> | null; - /** - * Provide an info about current session which is needed for storing a search session. - * To opt-into "Search session indicator" UI app has to call {@link enableStorage}. - * - * @param searchSessionInfoProvider - info provider for saving a search session - * @param searchSessionIndicatorUiConfig - config for "Search session indicator" UI - */ - enableStorage

(searchSessionInfoProvider: SearchSessionInfoProvider

, searchSessionIndicatorUiConfig?: SearchSessionIndicatorUiConfig): void; - /** - * If the current app explicitly called {@link enableStorage} and provided all configuration needed - * for storing its search sessions - */ - isSessionStorageReady(): boolean; - getSearchSessionIndicatorUiConfig(): SearchSessionIndicatorUiConfig; - private refreshSearchSessionSavedObject; -} -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_client.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_client.d.ts deleted file mode 100644 index 572924d043d63..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_client.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { PublicContract } from '@kbn/utility-types'; -import type { HttpSetup } from '@kbn/core/public'; -import type { SavedObject, SavedObjectsUpdateResponse, SavedObjectsFindOptions } from '@kbn/core/server'; -import type { SearchSessionSavedObjectAttributes, SearchSessionsFindResponse, SearchSessionStatusesResponse } from '../../../common'; -export type SearchSessionSavedObject = SavedObject; -export type ISessionsClient = PublicContract; -export interface SessionsClientDeps { - http: HttpSetup; -} -/** - * CRUD Search Session SO - */ -export declare class SessionsClient { - private readonly http; - constructor(deps: SessionsClientDeps); - get(sessionId: string): Promise; - create({ name, appId, locatorId, initialState, restoreState, sessionId, }: { - name: string; - appId: string; - locatorId: string; - initialState: Record; - restoreState: Record; - sessionId: string; - }): Promise; - find(opts: Omit): Promise; - update(sessionId: string, attributes: unknown): Promise>; - rename(sessionId: string, newName: string): Promise; - extend(sessionId: string, expires: string): Promise; - delete(sessionId: string): Promise; - status(sessionIds: string[]): Promise; -} diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/index.d.ts deleted file mode 100644 index 48888ae261740..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { CoreSetup } from '@kbn/core/public'; -import type { ManagementAppMountParams } from '@kbn/management-plugin/public'; -import type { IManagementSectionsPluginsSetup, IManagementSectionsPluginsStart } from '..'; -import { renderApp } from './render'; -import type { SearchSessionsConfigSchema } from '../../../../../server/config'; -export declare class SearchSessionsMgmtApp { - private coreSetup; - private setupDeps; - private config; - private kibanaVersion; - private params; - constructor(coreSetup: CoreSetup, setupDeps: IManagementSectionsPluginsSetup, config: SearchSessionsConfigSchema, kibanaVersion: string, params: ManagementAppMountParams); - mountManagementSection(): Promise<() => void>; -} -export { renderApp }; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/render.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/render.d.ts deleted file mode 100644 index 89b48d5660e90..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/render.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { AppDependencies } from '..'; -export declare const renderApp: (elem: HTMLElement | null, { uiSettings, ...homeDeps }: AppDependencies) => () => void; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/index.d.ts deleted file mode 100644 index a5218450cbe00..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { EuiTextProps } from '@elastic/eui'; -import React from 'react'; -export type { OnActionComplete } from './table/actions'; -export { PopoverActionsMenu } from './table/actions'; -export declare const TableText: ({ children, ...props }: EuiTextProps) => React.JSX.Element; -export interface StatusDef { - textColor?: EuiTextProps['color']; - icon?: React.ReactElement; - label: React.ReactElement; - toolTipContent: string; -} diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/index.d.ts deleted file mode 100644 index fa41bb68e9eb6..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { InspectFlyout } from './inspect_flyout'; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/inspect_flyout.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/inspect_flyout.d.ts deleted file mode 100644 index 24d8ce94faa69..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/inspect_flyout.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { UISession } from '../../types'; -interface InspectFlyoutProps { - searchSession: UISession; -} -export declare const InspectFlyout: React.FC; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/main.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/main.d.ts deleted file mode 100644 index 9bb4eeec3563b..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/main.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import type { CoreStart, HttpStart } from '@kbn/core/public'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { SearchSessionsMgmtAPI } from '../lib/api'; -import type { SearchSessionsConfigSchema } from '../../../../../server/config'; -import type { SearchUsageCollector } from '../../../collectors'; -import type { ISearchSessionEBTManager } from '../../ebt_manager'; -interface Props { - core: CoreStart; - api: SearchSessionsMgmtAPI; - http: HttpStart; - timezone: string; - config: SearchSessionsConfigSchema; - kibanaVersion: string; - share: SharePluginStart; - searchUsageCollector: SearchUsageCollector; - searchSessionEBTManager: ISearchSessionEBTManager; -} -export declare function SearchSessionsMgmtMain({ share, ...tableProps }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/status.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/status.d.ts deleted file mode 100644 index 5c313076f7c88..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/status.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import type { UISession } from '../types'; -export declare const getStatusText: (statusType: string) => string; -interface StatusIndicatorProps { - now?: string; - session: UISession; - timezone: string; -} -export declare const StatusIndicator: (props: StatusIndicatorProps) => React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/delete_button.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/delete_button.d.ts deleted file mode 100644 index 25e3e106edac4..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/delete_button.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { SearchSessionsMgmtAPI } from '../../../lib/api'; -import type { IClickActionDescriptor } from './types'; -import type { UISession } from '../../../types'; -export declare const createDeleteActionDescriptor: (api: SearchSessionsMgmtAPI, uiSession: UISession, core: CoreStart) => IClickActionDescriptor; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/extend_button.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/extend_button.d.ts deleted file mode 100644 index afa9387a3430c..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/extend_button.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { SearchSessionsMgmtAPI } from '../../../lib/api'; -import type { IClickActionDescriptor } from './types'; -import type { UISession } from '../../../types'; -export declare const createExtendActionDescriptor: (api: SearchSessionsMgmtAPI, uiSession: UISession, core: CoreStart) => IClickActionDescriptor; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/get_action.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/get_action.d.ts deleted file mode 100644 index 3fd6227944a77..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/get_action.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { IClickActionDescriptor } from './types'; -import type { SearchSessionsMgmtAPI } from '../../../lib/api'; -import type { UISession } from '../../../types'; -import { ACTION } from '../../../types'; -export declare const getAction: (api: SearchSessionsMgmtAPI, actionType: ACTION, uiSession: UISession, core: CoreStart, isWithinFlyout?: boolean) => IClickActionDescriptor | null; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/index.d.ts deleted file mode 100644 index 9304ffbbbbcbf..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { PopoverActionsMenu } from './popover_actions'; -export type * from './types'; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/inspect_button.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/inspect_button.d.ts deleted file mode 100644 index 102847c336e67..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/inspect_button.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { UISession } from '../../../types'; -import type { IClickActionDescriptor } from './types'; -import type { SearchSessionsMgmtAPI } from '../../../lib/api'; -export declare const createInspectActionDescriptor: (api: SearchSessionsMgmtAPI, uiSession: UISession, core: CoreStart, isWithinFlyout?: boolean) => IClickActionDescriptor; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/popover_actions.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/popover_actions.d.ts deleted file mode 100644 index 4985271184750..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/popover_actions.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import React from 'react'; -import type { SearchSessionsMgmtAPI } from '../../../lib/api'; -import type { UISession } from '../../../types'; -import type { OnActionComplete } from './types'; -interface PopoverActionItemsProps { - session: UISession; - api: SearchSessionsMgmtAPI; - onActionComplete: OnActionComplete; - core: CoreStart; - allowedActions?: UISession['actions']; - isWithinFlyout?: boolean; -} -export declare const PopoverActionsMenu: ({ api, onActionComplete, session, core, allowedActions, isWithinFlyout, }: PopoverActionItemsProps) => React.JSX.Element | null; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.d.ts deleted file mode 100644 index 7d1c7fc9b1c0c..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { SearchSessionsMgmtAPI } from '../../../lib/api'; -import type { IClickActionDescriptor } from './types'; -import type { UISession } from '../../../types'; -export declare const createRenameActionDescriptor: (api: SearchSessionsMgmtAPI, uiSession: UISession, core: CoreStart) => IClickActionDescriptor; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/types.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/types.d.ts deleted file mode 100644 index cb86b668656cd..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/types.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IconType } from '@elastic/eui'; -export type OnActionComplete = () => void; -export type OnActionDismiss = () => void; -export interface IClickActionDescriptor { - label: React.ReactNode; - iconType: IconType; - onClick: () => Promise | void; -} diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/actions.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/actions.d.ts deleted file mode 100644 index 9599bfc3b9807..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/actions.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { EuiBasicTableColumn } from '@elastic/eui'; -import type { CoreStart } from '@kbn/core/public'; -import type { UISession } from '../../../types'; -import type { OnActionComplete } from '../actions'; -import type { SearchSessionsMgmtAPI } from '../../../lib/api'; -export declare const actionsColumn: ({ api, core, onActionComplete, allowedActions, isWithinFlyout, }: { - core: CoreStart; - api: SearchSessionsMgmtAPI; - onActionComplete: OnActionComplete; - allowedActions?: UISession["actions"]; - isWithinFlyout?: boolean; -}) => EuiBasicTableColumn; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/app_id.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/app_id.d.ts deleted file mode 100644 index b16aea940171a..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/app_id.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { EuiBasicTableColumn } from '@elastic/eui'; -import type { UISession } from '../../../types'; -export declare const appIdColumn: EuiBasicTableColumn; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/get_columns.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/get_columns.d.ts deleted file mode 100644 index 649ce2106bf0b..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/get_columns.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { EuiBasicTableColumn } from '@elastic/eui'; -import type { CoreStart } from '@kbn/core/public'; -import type { OnActionComplete } from '../..'; -import type { SearchSessionsMgmtAPI } from '../../../lib/api'; -import type { UISession } from '../../../types'; -import type { SearchUsageCollector } from '../../../../../collectors'; -import type { SearchSessionsConfigSchema } from '../../../../../../../server/config'; -export declare const getColumns: ({ core, api, config, timezone, onActionComplete, kibanaVersion, searchUsageCollector, }: { - core: CoreStart; - api: SearchSessionsMgmtAPI; - config: SearchSessionsConfigSchema; - timezone: string; - onActionComplete: OnActionComplete; - kibanaVersion: string; - searchUsageCollector: SearchUsageCollector; -}) => Array>; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/index.d.ts deleted file mode 100644 index 9a453606a43a5..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './app_id'; -export * from './name'; -export * from './actions'; -export * from './status'; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/name.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/name.d.ts deleted file mode 100644 index 66cd0a4af850c..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/name.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { EuiBasicTableColumn } from '@elastic/eui'; -import type { CoreStart } from '@kbn/core/public'; -import type { SearchUsageCollector } from '../../../../../collectors'; -import type { BackgroundSearchOpenedHandler, UISession } from '../../../types'; -export declare const nameColumn: ({ core, searchUsageCollector, kibanaVersion, onBackgroundSearchOpened, }: { - core: CoreStart; - searchUsageCollector: SearchUsageCollector; - kibanaVersion: string; - onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; -}) => EuiBasicTableColumn; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/status.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/status.d.ts deleted file mode 100644 index 4b3f89e5ab212..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/status.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { EuiBasicTableColumn } from '@elastic/eui'; -import type { UISession } from '../../../types'; -export declare const statusColumn: (timezone: string) => EuiBasicTableColumn; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/index.d.ts deleted file mode 100644 index 6cb67c17806ba..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * as columns from './columns'; -export { SearchSessionsMgmtTable } from './table'; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/table.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/table.d.ts deleted file mode 100644 index 41ae628a04cf5..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/table.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { EuiBasicTableColumn } from '@elastic/eui'; -import type { CoreStart } from '@kbn/core/public'; -import React from 'react'; -import type { SearchSessionsMgmtAPI } from '../../lib/api'; -import type { BackgroundSearchOpenedHandler, LocatorsStart, UISession } from '../../types'; -import type { OnActionComplete } from './actions'; -import type { SearchUsageCollector } from '../../../../collectors'; -import type { SearchSessionsConfigSchema } from '../../../../../../server/config'; -import type { ISearchSessionEBTManager } from '../../../ebt_manager'; -interface Props { - core: CoreStart; - locators: LocatorsStart; - api: SearchSessionsMgmtAPI; - searchSessionEBTManager: ISearchSessionEBTManager; - timezone: string; - config: SearchSessionsConfigSchema; - kibanaVersion: string; - searchUsageCollector: SearchUsageCollector; - hideRefreshButton?: boolean; - appId?: string; - onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; - getColumns?: (params: { - core: CoreStart; - api: SearchSessionsMgmtAPI; - config: SearchSessionsConfigSchema; - timezone: string; - kibanaVersion: string; - searchUsageCollector: SearchUsageCollector; - onActionComplete: OnActionComplete; - onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; - }) => Array>; - trackingProps: { - openedFrom: string; - renderedIn: string; - }; -} -export type GetColumnsFn = Props['getColumns']; -export declare function SearchSessionsMgmtTable({ core, locators, api, timezone, config, searchSessionEBTManager, kibanaVersion, searchUsageCollector, hideRefreshButton, getColumns, appId, onBackgroundSearchOpened, trackingProps, ...props }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_actions.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_actions.d.ts deleted file mode 100644 index 6fc16a46cb058..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_actions.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { UISearchSessionState } from '../../../types'; -import { ACTION } from '../../../types'; -export declare function getActions(status: UISearchSessionState): ACTION[]; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_app_filter.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_app_filter.d.ts deleted file mode 100644 index 91d1173f16b81..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_app_filter.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SearchFilterConfig } from '@elastic/eui'; -import type { UISession } from '../../../types'; -export declare const getAppFilter: (tableData: UISession[]) => SearchFilterConfig; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_status_filter.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_status_filter.d.ts deleted file mode 100644 index 4f640fce61c56..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_status_filter.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SearchFilterConfig } from '@elastic/eui'; -import type { UISession } from '../../../types'; -export declare const getStatusFilter: (tableData: UISession[]) => SearchFilterConfig; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/map_to_ui_session.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/map_to_ui_session.d.ts deleted file mode 100644 index f1cb04485bc7f..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/map_to_ui_session.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { SearchSessionsFindResponse } from '../../../../../../../common'; -import type { ACTION, LocatorsStart, SearchSessionSavedObject, UISession } from '../../../types'; -export declare const mapToUISession: ({ savedObject, locators, sessionStatuses, actions: filteredActions, }: { - savedObject: SearchSessionSavedObject; - locators: LocatorsStart; - sessionStatuses: SearchSessionsFindResponse["statuses"]; - actions?: ACTION[]; -}) => UISession; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/constants.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/constants.d.ts deleted file mode 100644 index f6506c7b047cc..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const FLYOUT_WIDTH = "33vw"; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/flyout.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/flyout.d.ts deleted file mode 100644 index 42da47d980628..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/flyout.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import type { CoreStart } from '@kbn/core/public'; -import type { SearchSessionsConfigSchema } from '../../../../../server/config'; -import type { SearchSessionsMgmtAPI } from '../lib/api'; -import type { SearchUsageCollector } from '../../../collectors'; -import type { BackgroundSearchOpenedHandler, LocatorsStart } from '../types'; -import type { ISearchSessionEBTManager } from '../../ebt_manager'; -export declare const Flyout: ({ api, coreStart, usageCollector, ebtManager, config, kibanaVersion, locators, appId, trackingProps, onBackgroundSearchOpened, onClose, }: { - api: SearchSessionsMgmtAPI; - coreStart: CoreStart; - usageCollector: SearchUsageCollector; - ebtManager: ISearchSessionEBTManager; - config: SearchSessionsConfigSchema; - kibanaVersion: string; - locators: LocatorsStart; - appId?: string; - trackingProps: { - openedFrom: string; - }; - onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; - onClose: () => void; -}) => React.JSX.Element; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_columns.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_columns.d.ts deleted file mode 100644 index 8e0d58b90e854..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_columns.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { SearchSessionsMgmtTable } from '../components/table'; -type GetColumnsFn = React.ComponentProps['getColumns']; -export declare const getColumns: GetColumnsFn; -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_flyout.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_flyout.d.ts deleted file mode 100644 index c518955f4ff28..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_flyout.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { ISessionsClient } from '../../../..'; -import type { SearchUsageCollector } from '../../../collectors'; -import type { SearchSessionsConfigSchema } from '../../../../../server/config'; -import type { BackgroundSearchOpenedHandler } from '../types'; -import type { ISearchSessionEBTManager } from '../../ebt_manager'; -export declare function openSearchSessionsFlyout({ coreStart, kibanaVersion, usageCollector, ebtManager, config, sessionsClient, share, }: { - coreStart: CoreStart; - kibanaVersion: string; - usageCollector: SearchUsageCollector; - ebtManager: ISearchSessionEBTManager; - config: SearchSessionsConfigSchema; - sessionsClient: ISessionsClient; - share: SharePluginStart; -}): (attrs: { - appId: string; - trackingProps: { - openedFrom: string; - }; - onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; - onClose?: () => void; -}) => { - flyout: import("@kbn/core/public").OverlayRef; -}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/index.d.ts deleted file mode 100644 index 35c76c7b4011f..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { CoreStart, HttpStart, I18nStart, IUiSettingsClient } from '@kbn/core/public'; -import type { CoreSetup } from '@kbn/core/public'; -import type { ManagementSetup } from '@kbn/management-plugin/public'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { ISessionsClient, SearchUsageCollector } from '../../..'; -import type { SearchSessionsMgmtAPI } from './lib/api'; -import type { SearchSessionsConfigSchema } from '../../../../server/config'; -import type { ISearchSessionEBTManager } from '../ebt_manager'; -export { openSearchSessionsFlyout } from './flyout/get_flyout'; -export type { BackgroundSearchOpenedHandler } from './types'; -export interface IManagementSectionsPluginsSetup { - management: ManagementSetup; - searchUsageCollector: SearchUsageCollector; - sessionsClient: ISessionsClient; - searchSessionEBTManager: ISearchSessionEBTManager; -} -export interface IManagementSectionsPluginsStart { - share: SharePluginStart; -} -export interface AppDependencies { - share: SharePluginStart; - uiSettings: IUiSettingsClient; - core: CoreStart; - api: SearchSessionsMgmtAPI; - http: HttpStart; - i18n: I18nStart; - config: SearchSessionsConfigSchema; - kibanaVersion: string; - searchUsageCollector: SearchUsageCollector; - searchSessionEBTManager: ISearchSessionEBTManager; -} -export declare const APP: { - id: string; - getI18nName: () => string; -}; -export declare function registerSearchSessionsMgmt(coreSetup: CoreSetup, deps: IManagementSectionsPluginsSetup, config: SearchSessionsConfigSchema, kibanaVersion: string): import("@kbn/management-plugin/public").ManagementApp; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.d.ts deleted file mode 100644 index b65e25e485563..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { ApplicationStart, FeatureFlagsStart, NotificationsStart } from '@kbn/core/public'; -import moment from 'moment'; -import type { SearchSessionStatusResponse } from '../../../../../common'; -import type { SearchSessionSavedObject } from '../types'; -import type { ISessionsClient } from '../../sessions_client'; -import type { SearchUsageCollector } from '../../../collectors'; -import type { SearchSessionsConfigSchema } from '../../../../../server/config'; -interface SearchSessionManagementDeps { - notifications: NotificationsStart; - application: ApplicationStart; - usageCollector?: SearchUsageCollector; - featureFlags: FeatureFlagsStart; -} -interface FetchReturn { - savedObjects: SearchSessionSavedObject[]; - statuses: Record; -} -export declare class SearchSessionsMgmtAPI { - private sessionsClient; - private config; - private deps; - constructor(sessionsClient: ISessionsClient, config: SearchSessionsConfigSchema, deps: SearchSessionManagementDeps); - fetchTableData({ appId }?: { - appId?: string; - }): Promise; - getExtendByDuration(): moment.Duration; - sendDelete(id: string): Promise; - sendExtend(id: string, expires: string): Promise; - sendRename(id: string, newName: string): Promise; -} -export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/date_string.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/date_string.d.ts deleted file mode 100644 index c47e68d1be065..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/date_string.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const dateString: (inputString: string, tz: string) => string; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/get_expiration_status.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/get_expiration_status.d.ts deleted file mode 100644 index 117eab062de45..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/get_expiration_status.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { SearchSessionsConfigSchema } from '../../../../../server/config'; -export declare const getExpirationStatus: (config: SearchSessionsConfigSchema, expires: string | null) => { - toolTipContent: string; - statusContent: string; -} | undefined; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/types.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/types.d.ts deleted file mode 100644 index de03e663bec8c..0000000000000 --- a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/types.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { SearchSessionSavedObjectAttributes, SearchSessionStatus } from '../../../../common'; -export declare const DATE_STRING_FORMAT = "D MMM, YYYY, HH:mm:ss"; -/** - * Some properties are optional for a non-persisted Search Session. - * This interface makes them mandatory, because management only shows persisted search sessions. - */ -export type PersistedSearchSessionSavedObjectAttributes = SearchSessionSavedObjectAttributes & Required>; -export type UISearchSessionState = SearchSessionStatus; -export declare enum ACTION { - INSPECT = "inspect", - EXTEND = "extend", - DELETE = "delete", - RENAME = "rename" -} -export interface UISession { - id: string; - name: string; - appId: string; - created: string; - expires: string | null; - status: UISearchSessionState; - idMapping: SearchSessionSavedObjectAttributes['idMapping']; - numSearches: number; - actions?: ACTION[]; - reloadUrl: string; - restoreUrl: string; - initialState: Record; - restoreState: Record; - version: string; - errors?: string[]; -} -export type LocatorsStart = SharePluginStart['url']['locators']; -export interface SearchSessionSavedObject { - id: string; - attributes: PersistedSearchSessionSavedObjectAttributes; -} -export type BackgroundSearchOpenedHandler = (attrs: { - session: UISession; - event: React.MouseEvent; -}) => void; diff --git a/src/platform/plugins/shared/data/public/search/types.d.ts b/src/platform/plugins/shared/data/public/search/types.d.ts deleted file mode 100644 index 3053606d182cb..0000000000000 --- a/src/platform/plugins/shared/data/public/search/types.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { PackageInfo } from '@kbn/core/server'; -import type { DataViewsContract } from '@kbn/data-views-plugin/common'; -import type { RequestAdapter } from '@kbn/inspector-plugin/public'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import type { WarningHandlerCallback } from '@kbn/search-response-warnings'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { ISearchStartSearchSource } from '../../common/search'; -import type { AggsSetup, AggsSetupDependencies, AggsStart, AggsStartDependencies } from './aggs'; -import type { SearchUsageCollector } from './collectors'; -import type { ISessionsClient, ISessionService } from './session'; -import type { BackgroundSearchOpenedHandler } from './session/sessions_mgmt'; -export { SEARCH_EVENT_TYPE } from './collectors'; -export type { ISearchStartSearchSource, SearchUsageCollector }; -/** - * The setup contract exposed by the Search plugin exposes the search strategy extension - * point. - */ -export interface ISearchSetup { - aggs: AggsSetup; - usageCollector?: SearchUsageCollector; - /** - * Current session management - * {@link ISessionService} - */ - session: ISessionService; - /** - * Search sessions SO CRUD - * {@link ISessionsClient} - */ - sessionsClient: ISessionsClient; -} -/** - * search service - * @public - */ -export interface ISearchStart { - /** - * agg config sub service - * {@link AggsStart} - * - */ - aggs: AggsStart; - /** - * low level search - * {@link ISearchGeneric} - */ - search: ISearchGeneric; - /** - * Show toast for caught error - * @param e Error - */ - showError: (e: Error) => void; - /** - * Show warnings, or customize how they're shown - * @param inspector IInspectorInfo - an inspector object with requests internally collected - * @param cb WarningHandlerCallback - optional callback to intercept warnings - */ - showWarnings: (adapter: RequestAdapter, cb?: WarningHandlerCallback) => void; - /** - * Shows a flyout with a table to manage search sessions. - */ - showSearchSessionsFlyout: (attrs: { - appId: string; - trackingProps: { - openedFrom: string; - }; - onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; - onClose?: () => void; - }) => void; - /** - * Feature flag value to make it easier to use in different plugins - */ - isBackgroundSearchEnabled: boolean; - /** - * high level search - * {@link ISearchStartSearchSource} - */ - searchSource: ISearchStartSearchSource; - /** - * Current session management - * {@link ISessionService} - */ - session: ISessionService; - /** - * Search sessions SO CRUD - * {@link ISessionsClient} - */ - sessionsClient: ISessionsClient; -} -/** @internal */ -export interface SearchServiceSetupDependencies { - packageInfo: PackageInfo; - registerFunction: AggsSetupDependencies['registerFunction']; - usageCollection?: UsageCollectionSetup; -} -/** @internal */ -export interface SearchServiceStartDependencies { - fieldFormats: AggsStartDependencies['fieldFormats']; - indexPatterns: DataViewsContract; -} diff --git a/src/platform/plugins/shared/data/public/services.d.ts b/src/platform/plugins/shared/data/public/services.d.ts deleted file mode 100644 index 5b0b24166a8c2..0000000000000 --- a/src/platform/plugins/shared/data/public/services.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DataViewsContract } from '@kbn/data-views-plugin/common'; -export declare const getUiSettings: import("@kbn/kibana-utils-plugin/public").Get, setUiSettings: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getOverlays: import("@kbn/kibana-utils-plugin/public").Get, setOverlays: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getIndexPatterns: import("@kbn/kibana-utils-plugin/public").Get, setIndexPatterns: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getHttp: import("@kbn/kibana-utils-plugin/public").Get, setHttp: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getSearchService: import("@kbn/kibana-utils-plugin/public").Get, setSearchService: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getTheme: import("@kbn/kibana-utils-plugin/public").Get, setTheme: import("@kbn/kibana-utils-plugin/public").Set; diff --git a/src/platform/plugins/shared/data/public/types.d.ts b/src/platform/plugins/shared/data/public/types.d.ts deleted file mode 100644 index 817048ec7b32a..0000000000000 --- a/src/platform/plugins/shared/data/public/types.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import type { ExpressionsSetup } from '@kbn/expressions-plugin/public'; -import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import type { FieldFormatsSetup, FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import type { Setup as InspectorSetup, Start as InspectorStartContract } from '@kbn/inspector-plugin/public'; -import type { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { ManagementSetup } from '@kbn/management-plugin/public'; -import type { Filter } from '@kbn/es-query'; -import type { DataViewsContract } from '@kbn/data-views-plugin/public'; -import type { CPSPluginStart } from '@kbn/cps/public'; -import type { DatatableUtilitiesService } from '../common'; -import type { ISearchSetup, ISearchStart } from './search'; -import type { QuerySetup, QueryStart } from './query'; -import type { NowProviderPublicContract } from './now_provider'; -import type { MultiValueClickDataContext, RangeSelectDataContext, ValueClickDataContext } from './actions/filters'; -export interface DataSetupDependencies { - expressions: ExpressionsSetup; - uiActions: UiActionsSetup; - inspector: InspectorSetup; - usageCollection?: UsageCollectionSetup; - fieldFormats: FieldFormatsSetup; - management: ManagementSetup; -} -export interface DataStartDependencies { - uiActions: UiActionsStart; - fieldFormats: FieldFormatsStart; - dataViews: DataViewsPublicPluginStart; - inspector: InspectorStartContract; - screenshotMode: ScreenshotModePluginStart; - share: SharePluginStart; - cps?: CPSPluginStart; -} -/** - * Data plugin public Setup contract - */ -export interface DataPublicPluginSetup { - search: ISearchSetup; - query: QuerySetup; -} -/** - * utilities to generate filters from action context - */ -export interface DataPublicPluginStartActions { - createFiltersFromValueClickAction: (context: ValueClickDataContext) => Promise; - createFiltersFromRangeSelectAction: (event: RangeSelectDataContext) => Promise; - createFiltersFromMultiValueClickAction: (context: MultiValueClickDataContext) => Promise; -} -/** - * Data plugin public Start contract - */ -export interface DataPublicPluginStart { - /** - * filter creation utilities - * {@link DataPublicPluginStartActions} - */ - actions: DataPublicPluginStartActions; - /** - * data views service - * {@link DataViewsContract} - */ - dataViews: DataViewsContract; - /** - * Datatable type utility functions. - */ - datatableUtilities: DatatableUtilitiesService; - /** - * search service - * {@link ISearchStart} - */ - search: ISearchStart; - /** - * @deprecated Use fieldFormats plugin instead - */ - fieldFormats: FieldFormatsStart; - /** - * query service - * {@link QueryStart} - */ - query: QueryStart; - nowProvider: NowProviderPublicContract; -} diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.d.ts deleted file mode 100644 index 5f038a01dbf39..0000000000000 --- a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { Datatable, DatatableColumn, DatatableRow } from '@kbn/expressions-plugin/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { type EuiTablePersistInjectedProps } from '@kbn/shared-ux-table-persist/src'; -interface DataTableFormatProps { - data: Datatable; - uiSettings: IUiSettingsClient; - fieldFormats: FieldFormatsStart; - uiActions: UiActionsStart; - isFilterable: (column: DatatableColumn) => boolean; -} -export declare const DataTableFormat: React.FC, "euiTablePersist">>>; -export {}; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table_selector.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table_selector.d.ts deleted file mode 100644 index f85e861981f9f..0000000000000 --- a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table_selector.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React, { Component } from 'react'; -import type { Datatable } from '@kbn/expressions-plugin/public'; -interface TableSelectorState { - isPopoverOpen: boolean; -} -interface TableSelectorProps { - tables: Datatable[]; - selectedTable: Datatable; - onTableChanged: (table: Datatable) => void; -} -export declare class TableSelector extends Component { - state: { - isPopoverOpen: boolean; - }; - togglePopover: () => void; - closePopover: () => void; - renderTableDropdownItem: (table: Datatable, index: number) => React.JSX.Element; - render(): React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view.d.ts deleted file mode 100644 index 69553805bf4a6..0000000000000 --- a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import React, { Component } from 'react'; -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { InspectorViewProps, Adapters } from '@kbn/inspector-plugin/public'; -import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { TablesAdapter, Datatable, DatatableColumn } from '@kbn/expressions-plugin/public'; -interface DataViewComponentState { - datatable: Datatable; - adapters: Adapters; -} -interface DataViewComponentProps extends InspectorViewProps { - uiSettings: IUiSettingsClient; - uiActions: UiActionsStart; - fieldFormats: FieldFormatsStart; - isFilterable: (column: DatatableColumn) => boolean; - options: { - fileName?: string; - }; -} -declare class DataViewComponent extends Component { - state: DataViewComponentState; - static getDerivedStateFromProps(nextProps: Readonly, state: DataViewComponentState): { - adapters: Adapters; - datatable: any; - } | null; - onUpdateData: (tables: TablesAdapter["tables"]) => void; - selectTable: (datatable: Datatable) => void; - componentDidMount(): void; - componentWillUnmount(): void; - static renderNoData(): React.JSX.Element; - render(): React.JSX.Element; -} -export default DataViewComponent; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view_wrapper.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view_wrapper.d.ts deleted file mode 100644 index 9b3dcac961d57..0000000000000 --- a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view_wrapper.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { DatatableColumn } from '@kbn/expressions-plugin/common/expression_types/specs'; -export declare const getDataViewComponentWrapper: (getStartServices: () => { - uiActions: UiActionsStart; - fieldFormats: FieldFormatsStart; - uiSettings: IUiSettingsClient; - isFilterable: (column: DatatableColumn) => boolean; -}) => (props: any) => React.JSX.Element; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/download_options.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/download_options.d.ts deleted file mode 100644 index 9ea04aab94895..0000000000000 --- a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/download_options.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import React, { Component } from 'react'; -import type { Datatable } from '@kbn/expressions-plugin/common'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { IUiSettingsClient } from '@kbn/core/public'; -interface DataDownloadOptionsState { - isPopoverOpen: boolean; -} -interface DataDownloadOptionsProps { - title: string; - datatables: Datatable[]; - uiSettings: IUiSettingsClient; - isFormatted?: boolean; - fieldFormats: FieldFormatsStart; -} -declare class DataDownloadOptions extends Component { - state: { - isPopoverOpen: boolean; - }; - onTogglePopover: () => void; - closePopover: () => void; - exportCsv: (isFormatted?: boolean) => void; - exportFormattedCsv: () => void; - exportFormattedAsRawCsv: () => void; - renderFormattedDownloads(): React.JSX.Element; - render(): React.JSX.Element; -} -export { DataDownloadOptions }; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/index.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/index.d.ts deleted file mode 100644 index 71e5098a759bf..0000000000000 --- a/src/platform/plugins/shared/data/public/utils/table_inspector_view/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IUiSettingsClient } from '@kbn/core/public'; -import type { InspectorViewDescription } from '@kbn/inspector-plugin/public'; -import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { DatatableColumn } from '@kbn/expressions-plugin/common/expression_types/specs'; -export declare const getTableViewDescription: (getStartServices: () => { - uiActions: UiActionsStart; - fieldFormats: FieldFormatsStart; - isFilterable: (column: DatatableColumn) => boolean; - uiSettings: IUiSettingsClient; -}) => InspectorViewDescription; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/types.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/types.d.ts deleted file mode 100644 index 5ff4c9369eb7d..0000000000000 --- a/src/platform/plugins/shared/data/public/utils/table_inspector_view/types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type React from 'react'; -import type { Datatable, DatatableColumn, DatatableRow } from '@kbn/expressions-plugin/common'; -type DataViewColumnRender = (value: string, _item: DatatableRow) => React.ReactNode | string; -export interface DataViewColumn { - originalColumn: () => DatatableColumn; - name: string; - field: string; - sortable: boolean | ((item: DatatableRow) => string | number); - render: DataViewColumnRender; -} -export type DataViewRow = DatatableRow; -export interface TableInspectorAdapter { - [key: string]: Datatable; -} -export {}; diff --git a/src/platform/plugins/shared/data/server/config.d.ts b/src/platform/plugins/shared/data/server/config.d.ts deleted file mode 100644 index da5e908b90ffb..0000000000000 --- a/src/platform/plugins/shared/data/server/config.d.ts +++ /dev/null @@ -1,211 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -export declare const searchSessionsConfigSchema: import("@kbn/config-schema").ObjectType<{ - /** - * Turns the feature on \ off (incl. removing indicator and management screens) - */ - enabled: import("@kbn/config-schema").Type; - /** - * notTouchedTimeout controls how long user can save a session after all searches completed. - * The client continues to poll searches to keep the alive until this timeout hits - */ - notTouchedTimeout: import("@kbn/config-schema").Type; - /** - * maxUpdateRetries controls how many retries we perform while attempting to save a search session - */ - maxUpdateRetries: import("@kbn/config-schema").Type; - /** - * defaultExpiration controls how long search sessions are valid for, until they are expired. - */ - defaultExpiration: import("@kbn/config-schema").Type; - management: import("@kbn/config-schema").ObjectType<{ - /** - * maxSessions controls how many saved search sessions we load on the management screen. - */ - maxSessions: import("@kbn/config-schema").Type; - /** - * refreshInterval controls how often we refresh the management screen. 0s as duration means that auto-refresh is turned off. - */ - refreshInterval: import("@kbn/config-schema").Type; - /** - * refreshTimeout controls the timeout for loading search sessions on mgmt screen - */ - refreshTimeout: import("@kbn/config-schema").Type; - expiresSoonWarning: import("@kbn/config-schema").Type; - }>; -}>; -export declare const searchConfigSchema: import("@kbn/config-schema").ObjectType<{ - /** - * Config for search strategies that use async search based API underneath - */ - asyncSearch: import("@kbn/config-schema").ObjectType<{ - /** - * Block and wait until the search is completed up to the timeout (see es async_search's `wait_for_completion_timeout`) - */ - waitForCompletion: import("@kbn/config-schema").Type; - /** - * How long the async search needs to be available after each search poll. Ongoing async searches and any saved search results are deleted after this period. - * (see es async_search's `keep_alive`) - * Note: This is applicable to the searches before the search session is saved. - * After search session is saved `keep_alive` is extended using `data.search.sessions.defaultExpiration` config - */ - keepAlive: import("@kbn/config-schema").Type; - /** - * Affects how often partial results become available, which happens whenever shard results are reduced (see es async_search's `batched_reduce_size`) - */ - batchedReduceSize: import("@kbn/config-schema").Type; - /** - * How long to wait before polling the async_search after the previous poll response. - * If not provided, defaults to zero. - */ - pollInterval: import("@kbn/config-schema").Type; - /** - * How long to wait for results before initiating a new poll request. - * Accepts duration format (e.g., "30s", "100ms"). If not provided, - * defaults to protocol-specific behavior (30s for HTTP/2 or HTTP/3). - */ - pollLength: import("@kbn/config-schema").Type; - }>; - aggs: import("@kbn/config-schema").ObjectType<{ - shardDelay: import("@kbn/config-schema").ObjectType<{ - enabled: import("@kbn/config-schema").Type; - }>; - }>; - sessions: import("@kbn/config-schema").ObjectType<{ - /** - * Turns the feature on \ off (incl. removing indicator and management screens) - */ - enabled: import("@kbn/config-schema").Type; - /** - * notTouchedTimeout controls how long user can save a session after all searches completed. - * The client continues to poll searches to keep the alive until this timeout hits - */ - notTouchedTimeout: import("@kbn/config-schema").Type; - /** - * maxUpdateRetries controls how many retries we perform while attempting to save a search session - */ - maxUpdateRetries: import("@kbn/config-schema").Type; - /** - * defaultExpiration controls how long search sessions are valid for, until they are expired. - */ - defaultExpiration: import("@kbn/config-schema").Type; - management: import("@kbn/config-schema").ObjectType<{ - /** - * maxSessions controls how many saved search sessions we load on the management screen. - */ - maxSessions: import("@kbn/config-schema").Type; - /** - * refreshInterval controls how often we refresh the management screen. 0s as duration means that auto-refresh is turned off. - */ - refreshInterval: import("@kbn/config-schema").Type; - /** - * refreshTimeout controls the timeout for loading search sessions on mgmt screen - */ - refreshTimeout: import("@kbn/config-schema").Type; - expiresSoonWarning: import("@kbn/config-schema").Type; - }>; - }>; -}>; -export declare const queryConfigSchema: import("@kbn/config-schema").ObjectType<{ - /** - * Config for timefilter - */ - timefilter: import("@kbn/config-schema").ObjectType<{ - /** - * Lower limit of refresh interval (in milliseconds) - */ - minRefreshInterval: import("@kbn/config-schema").ConditionalType; - }>; -}>; -export declare const configSchema: import("@kbn/config-schema").ObjectType<{ - query: import("@kbn/config-schema").ObjectType<{ - /** - * Config for timefilter - */ - timefilter: import("@kbn/config-schema").ObjectType<{ - /** - * Lower limit of refresh interval (in milliseconds) - */ - minRefreshInterval: import("@kbn/config-schema").ConditionalType; - }>; - }>; - search: import("@kbn/config-schema").ObjectType<{ - /** - * Config for search strategies that use async search based API underneath - */ - asyncSearch: import("@kbn/config-schema").ObjectType<{ - /** - * Block and wait until the search is completed up to the timeout (see es async_search's `wait_for_completion_timeout`) - */ - waitForCompletion: import("@kbn/config-schema").Type; - /** - * How long the async search needs to be available after each search poll. Ongoing async searches and any saved search results are deleted after this period. - * (see es async_search's `keep_alive`) - * Note: This is applicable to the searches before the search session is saved. - * After search session is saved `keep_alive` is extended using `data.search.sessions.defaultExpiration` config - */ - keepAlive: import("@kbn/config-schema").Type; - /** - * Affects how often partial results become available, which happens whenever shard results are reduced (see es async_search's `batched_reduce_size`) - */ - batchedReduceSize: import("@kbn/config-schema").Type; - /** - * How long to wait before polling the async_search after the previous poll response. - * If not provided, defaults to zero. - */ - pollInterval: import("@kbn/config-schema").Type; - /** - * How long to wait for results before initiating a new poll request. - * Accepts duration format (e.g., "30s", "100ms"). If not provided, - * defaults to protocol-specific behavior (30s for HTTP/2 or HTTP/3). - */ - pollLength: import("@kbn/config-schema").Type; - }>; - aggs: import("@kbn/config-schema").ObjectType<{ - shardDelay: import("@kbn/config-schema").ObjectType<{ - enabled: import("@kbn/config-schema").Type; - }>; - }>; - sessions: import("@kbn/config-schema").ObjectType<{ - /** - * Turns the feature on \ off (incl. removing indicator and management screens) - */ - enabled: import("@kbn/config-schema").Type; - /** - * notTouchedTimeout controls how long user can save a session after all searches completed. - * The client continues to poll searches to keep the alive until this timeout hits - */ - notTouchedTimeout: import("@kbn/config-schema").Type; - /** - * maxUpdateRetries controls how many retries we perform while attempting to save a search session - */ - maxUpdateRetries: import("@kbn/config-schema").Type; - /** - * defaultExpiration controls how long search sessions are valid for, until they are expired. - */ - defaultExpiration: import("@kbn/config-schema").Type; - management: import("@kbn/config-schema").ObjectType<{ - /** - * maxSessions controls how many saved search sessions we load on the management screen. - */ - maxSessions: import("@kbn/config-schema").Type; - /** - * refreshInterval controls how often we refresh the management screen. 0s as duration means that auto-refresh is turned off. - */ - refreshInterval: import("@kbn/config-schema").Type; - /** - * refreshTimeout controls the timeout for loading search sessions on mgmt screen - */ - refreshTimeout: import("@kbn/config-schema").Type; - expiresSoonWarning: import("@kbn/config-schema").Type; - }>; - }>; - }>; - /** - * Turns on/off limit validations for the registered uiSettings. - */ - enableUiSettingsValidations: import("@kbn/config-schema").Type; -}>; -export type ConfigSchema = TypeOf; -export type SearchConfigSchema = TypeOf; -export type QueryConfigSchema = TypeOf; -export type SearchSessionsConfigSchema = TypeOf; diff --git a/src/platform/plugins/shared/data_views/common/constants.d.ts b/src/platform/plugins/shared/data_views/common/constants.d.ts deleted file mode 100644 index 5d62821242e48..0000000000000 --- a/src/platform/plugins/shared/data_views/common/constants.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * All runtime field types. - * @public - */ -export declare const RUNTIME_FIELD_COMPOSITE_TYPE: "composite"; -export type RuntimeFieldCompositeType = typeof RUNTIME_FIELD_COMPOSITE_TYPE; -export declare const PRIMITIVE_RUNTIME_FIELD_TYPES: readonly ["keyword", "long", "double", "date", "ip", "boolean", "geo_point"]; -export type PrimitiveRuntimeFieldTypes = typeof PRIMITIVE_RUNTIME_FIELD_TYPES; -export declare const RUNTIME_FIELD_TYPES: readonly ["keyword", "long", "double", "date", "ip", "boolean", "geo_point", "composite"]; -/** - * Used to optimize on-boarding experience to determine if the instance has some user created data views or data indices/streams by filtering data sources - * that are created by default by elastic in ese. - * We should somehow prevent creating initial data for the users without their explicit action - * instead of relying on these hardcoded assets - */ -export declare const DEFAULT_ASSETS_TO_IGNORE: { - DATA_STREAMS_TO_IGNORE: string[]; -}; -/** - * UiSettings key for metaFields list. - * @public - */ -export declare const META_FIELDS = "metaFields"; -/** - * Data view saved object type. - * @public - */ -export declare const DATA_VIEW_SAVED_OBJECT_TYPE = "index-pattern"; -/** - * Data views plugin name. - * @public - */ -export declare const PLUGIN_NAME = "DataViews"; -/** - * Max length for the custom field description - */ -export declare const MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH = 300; -/** - * Fields for wildcard path. - * @public - */ -export declare const FIELDS_FOR_WILDCARD_PATH = "/internal/data_views/_fields_for_wildcard"; -/** - * Fields path. Like fields for wildcard but GET only - * @public - */ -export declare const FIELDS_PATH = "/internal/data_views/fields"; -/** - * Existing indices path - * @public - */ -export declare const EXISTING_INDICES_PATH = "/internal/data_views/_existing_indices"; -export declare const DATA_VIEWS_FIELDS_EXCLUDED_TIERS = "data_views:fields_excluded_data_tiers"; -export declare const DEFAULT_DATA_VIEW_ID = "defaultIndex"; -/** - * Valid `failureReason` attribute values for `has_es_data` API error responses - */ -export declare enum HasEsDataFailureReason { - localDataTimeout = "local_data_timeout", - remoteDataTimeout = "remote_data_timeout", - unknown = "unknown" -} diff --git a/src/platform/plugins/shared/data_views/common/content_management/index.d.ts b/src/platform/plugins/shared/data_views/common/content_management/index.d.ts deleted file mode 100644 index 5b98253d935b4..0000000000000 --- a/src/platform/plugins/shared/data_views/common/content_management/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './v1'; diff --git a/src/platform/plugins/shared/data_views/common/content_management/v1/constants.d.ts b/src/platform/plugins/shared/data_views/common/content_management/v1/constants.d.ts deleted file mode 100644 index dec84ca66ea0e..0000000000000 --- a/src/platform/plugins/shared/data_views/common/content_management/v1/constants.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DATA_VIEW_SAVED_OBJECT_TYPE as DataViewSOType } from '../..'; -export { DataViewSOType }; -/** - * Data view saved object version. - */ -export declare const LATEST_VERSION = 1; -export type DataViewContentType = typeof DataViewSOType; diff --git a/src/platform/plugins/shared/data_views/common/content_management/v1/index.d.ts b/src/platform/plugins/shared/data_views/common/content_management/v1/index.d.ts deleted file mode 100644 index 5acacc3176506..0000000000000 --- a/src/platform/plugins/shared/data_views/common/content_management/v1/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { LATEST_VERSION } from './constants'; -export type { DataViewCrudTypes } from './types'; -export type { DataViewContentType } from './constants'; -export { DataViewSOType } from './constants'; diff --git a/src/platform/plugins/shared/data_views/common/content_management/v1/types.d.ts b/src/platform/plugins/shared/data_views/common/content_management/v1/types.d.ts deleted file mode 100644 index 9856fc54e841a..0000000000000 --- a/src/platform/plugins/shared/data_views/common/content_management/v1/types.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { ContentManagementCrudTypes, SavedObjectCreateOptions, SavedObjectSearchOptions, SavedObjectUpdateOptions } from '@kbn/content-management-utils'; -import type { DataViewAttributes } from '../../types'; -import type { DataViewContentType } from './constants'; -interface DataViewCreateOptions { - id?: SavedObjectCreateOptions['id']; - initialNamespaces?: SavedObjectCreateOptions['initialNamespaces']; - overwrite?: SavedObjectCreateOptions['overwrite']; - managed?: SavedObjectCreateOptions['managed']; -} -interface DataViewUpdateOptions { - version?: SavedObjectUpdateOptions['version']; - refresh?: SavedObjectUpdateOptions['refresh']; - retryOnConflict?: SavedObjectUpdateOptions['retryOnConflict']; -} -interface DataViewSearchOptions { - searchFields?: SavedObjectSearchOptions['searchFields']; - fields?: SavedObjectSearchOptions['fields']; -} -export type DataViewCrudTypes = ContentManagementCrudTypes; -export {}; diff --git a/src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.d.ts b/src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.d.ts deleted file mode 100644 index dc378944b5a96..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.d.ts +++ /dev/null @@ -1,242 +0,0 @@ -import type { FieldFormat, FieldFormatsStartCommon, SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; -import type { DataViewFieldBase } from '@kbn/es-query'; -import type { DataViewSpec, FieldSpec, FieldFormatMap, RuntimeFieldSpec, SourceFilter, TypeMeta, RuntimeField } from '../types'; -import type { DataViewAttributes, FieldAttrs, FieldAttrSet } from '..'; -import type { DataViewField } from '../fields'; -interface SavedObjectBody { - fieldAttrs?: string; - title?: string; - timeFieldName?: string; - fields?: string; - sourceFilters?: string; - fieldFormatMap?: string; - typeMeta?: string; - type?: string; -} -interface AbstractDataViewDeps { - spec?: DataViewSpec; - fieldFormats: FieldFormatsStartCommon; - shortDotsEnable?: boolean; - metaFields?: string[]; -} -type DataViewFieldBaseSpecMap = Record; -export declare abstract class AbstractDataView { - /** - * Saved object id - */ - id?: string; - /** - * Title of data view - * @deprecated use getIndexPattern instead - */ - title: string; - /** - * Map of field formats by field name - */ - fieldFormatMap: FieldFormatMap; - /** - * Only used by rollup indices, used by rollup specific endpoint to load field list. - */ - typeMeta?: TypeMeta; - /** - * Timestamp field name - */ - timeFieldName: string | undefined; - /** - * Type is used to identify rollup index patterns or ES|QL data views. - */ - type: string | undefined; - /** - * List of meta fields by name - */ - metaFields: string[]; - /** - * SavedObject version - */ - version: string | undefined; - /** - * Array of filters - hides fields in discover - */ - sourceFilters?: SourceFilter[]; - /** - * Array of namespace ids - */ - namespaces: string[]; - /** - * Original saved object body. Used to check for saved object changes. - */ - protected originalSavedObjectBody: SavedObjectBody; - /** - * Returns true if short dot notation is enabled - */ - protected shortDotsEnable: boolean; - /** - * FieldFormats service interface - */ - protected fieldFormats: FieldFormatsStartCommon; - /** - * Map of field attributes by field name. Currently count and customLabel. - */ - protected fieldAttrs: FieldAttrs; - /** - * Map of runtime field definitions by field name - */ - protected runtimeFieldMap: Record; - /** - * Prevents errors when index pattern exists before indices - */ - readonly allowNoIndex: boolean; - /** - * Name of the data view. Human readable name used to differentiate data view. - */ - name: string; - matchedIndices: string[]; - /** - * Whether the data view is managed by the application. - */ - managed: boolean; - protected scriptedFieldsMap: DataViewFieldBaseSpecMap; - private allowHidden; - constructor(config: AbstractDataViewDeps); - getAllowHidden: () => boolean; - setAllowHidden: (allowHidden: boolean) => boolean; - /** - * Get name of Data View - */ - getName: () => string; - /** - * Get index pattern - * @returns index pattern string - */ - getIndexPattern: () => string; - /** - * Set index pattern - * @param string index pattern string - */ - setIndexPattern: (indexPattern: string) => void; - /** - * Get last saved saved object fields - */ - getOriginalSavedObjectBody: () => { - fieldAttrs?: string; - title?: string; - timeFieldName?: string; - fields?: string; - sourceFilters?: string; - fieldFormatMap?: string; - typeMeta?: string; - type?: string; - }; - /** - * Reset last saved saved object fields. Used after saving. - */ - resetOriginalSavedObjectBody: () => void; - /** - * Returns true if the data view is persisted, and false if the dataview is adhoc. - */ - isPersisted(): boolean; - /** - * Get the source filtering configuration for that index. - */ - getSourceFiltering(): { - excludes: string[]; - }; - /** - * Get aggregation restrictions. Rollup fields can only perform a subset of aggregations. - */ - getAggregationRestrictions(): Record | undefined; - /** - * Provide a field, get its formatter - * @param field field to get formatter for - */ - getFormatterForField(field: DataViewField | DataViewField['spec']): FieldFormat; - /** - * Get formatter for a given field name. Return undefined if none exists. - * @param fieldname name of field to get formatter for - */ - getFormatterForFieldNoDefault(fieldname: string): FieldFormat | undefined; - /** - * Set field attribute - * @param fieldName name of field to set attribute on - * @param attrName name of attribute to set - * @param value value of attribute - */ - protected setFieldAttrs(fieldName: string, attrName: K, value: FieldAttrSet[K]): void; - /** - * Set field custom label - * @param fieldName name of field to set custom label on - * @param customLabel custom label value. If undefined, custom label is removed - */ - protected setFieldCustomLabelInternal(fieldName: string, customLabel: string | undefined | null): void; - /** - * Set field count - * @param fieldName name of field to set count on - * @param count count value. If undefined, count is removed - */ - protected setFieldCountInternal(fieldName: string, count: number | undefined | null): void; - /** - * Set field custom description - * @param fieldName name of field to set custom description on - * @param customDescription custom description value. If undefined, custom description is removed - */ - protected setFieldCustomDescriptionInternal(fieldName: string, customDescription: string | undefined | null): void; - /** - * Set field formatter - * @param fieldName name of field to set format on - * @param format field format in serialized form - */ - readonly setFieldFormat: (fieldName: string, format: SerializedFieldFormat) => void; - /** - * Remove field format from the field format map. - * @param fieldName field name associated with the format for removal - */ - readonly deleteFieldFormat: (fieldName: string) => void; - /** - * Returns index pattern as saved object body for saving - */ - getAsSavedObjectBody(): DataViewAttributes; - protected toSpecShared(includeFields?: boolean): DataViewSpec; - protected upsertScriptedFieldInternal: (field: FieldSpec) => void; - protected deleteScriptedFieldInternal: (fieldName: string) => void; - replaceAllScriptedFields(newFields: Record): void; - removeScriptedField(name: string): void; - upsertScriptedField(field: FieldSpec): void; - /** - * Only used by search source to process sorting of scripted fields - * @param name field name - * @returns DataViewFieldBase - */ - getScriptedField(name: string): DataViewFieldBase | undefined; - /** - * Checks if runtime field exists - * @param name field name - */ - hasRuntimeField(name: string): boolean; - /** - * Returns runtime field if exists - * @param name Runtime field name - */ - getRuntimeField(name: string): RuntimeField | null; - /** - * Get all runtime field definitions. - * NOTE: this does not strip out runtime fields that match mapped field names - * @returns map of runtime field definitions by field name - */ - getAllRuntimeFields(): Record; - /** - * Replaces all existing runtime fields with new fields. - * @param newFields Map of runtime field definitions by field name - */ - replaceAllRuntimeFields(newFields: Record): void; - removeRuntimeField(name: string): void; - addRuntimeField(name: string, runtimeField: RuntimeField): void; - protected removeRuntimeFieldInteral(name: string): void; - protected addRuntimeFieldInteral(name: string, runtimeField: RuntimeField): void; - getFieldAttrs: () => Map; - /** - * Checks if there are any matched indices. - * @returns True if there are matched indices, false otherwise. - */ - hasMatchedIndices(): boolean; -} -export {}; diff --git a/src/platform/plugins/shared/data_views/common/data_views/data_view.d.ts b/src/platform/plugins/shared/data_views/common/data_views/data_view.d.ts deleted file mode 100644 index b53bb86fe281a..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/data_view.d.ts +++ /dev/null @@ -1,160 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; -import type { DataViewBase } from '@kbn/es-query'; -import type { DataViewField, IIndexPatternFieldList } from '../fields'; -import type { DataViewFieldMap, DataViewSpec, RuntimeField, FieldSpec } from '../types'; -import { AbstractDataView } from './abstract_data_views'; -interface DataViewDeps { - spec?: DataViewSpec; - fieldFormats: FieldFormatsStartCommon; - shortDotsEnable?: boolean; - metaFields?: string[]; -} -/** - * An interface representing a data view that is time based. - */ -export interface TimeBasedDataView extends DataView { - /** - * The timestamp field name. - */ - timeFieldName: NonNullable; - /** - * The timestamp field. - */ - getTimeField: () => DataViewField; -} -/** - * Data view class. Central kibana abstraction around multiple indices. - */ -export declare class DataView extends AbstractDataView implements DataViewBase { - /** - * Field list, in extended array format - */ - fields: IIndexPatternFieldList & { - toSpec: () => DataViewFieldMap; - }; - /** - * @deprecated Use `flattenHit` utility method exported from data plugin instead. - */ - flattenHit: (hit: Record, deep?: boolean) => Record; - private etag; - /** - * constructor - * @param config - config data and dependencies - */ - constructor(config: DataViewDeps); - getScriptedFieldsForQuery(): Record; - getEtag: () => string | undefined; - setEtag: (etag: string | undefined) => string | undefined; - /** - * Returns scripted fields - */ - getComputedFields(): { - scriptFields: Record; - docvalueFields: { - field: string; - format: string; - }[]; - runtimeFields: estypes.MappingRuntimeFields; - }; - /** - * Creates static representation of the data view. - * @param includeFields Whether or not to include the `fields` list as part of this spec. If not included, the list - * will be fetched from Elasticsearch when instantiating a new Data View with this spec. - */ - toSpec(includeFields?: boolean): DataViewSpec; - /** - * Creates a minimal static representation of the data view. Fields and popularity scores will be omitted. - */ - toMinimalSpec(params?: { - keepFieldAttrs?: Array<'customLabel' | 'customDescription'>; - }): Omit; - /** - * Removes scripted field from field list. - * @param fieldName name of scripted field to remove - * @deprecated use runtime field instead - */ - removeScriptedField(fieldName: string): void; - /** - * - * @deprecated Will be removed when scripted fields are removed. - */ - getNonScriptedFields(): DataViewField[]; - /** - * - * @deprecated Use runtime field instead. - */ - getScriptedFields(): DataViewField[]; - /** - * returns true if dataview contains TSDB fields - */ - isTSDBMode(): boolean; - /** - * Does the data view have a timestamp field? - */ - isTimeBased(): this is TimeBasedDataView; - /** - * Does the data view have a timestamp field and is it a date nanos field? - */ - isTimeNanosBased(): this is TimeBasedDataView; - /** - * Get timestamp field as DataViewField or return undefined - */ - getTimeField(): DataViewField | undefined; - /** - * Get field by name. - * @param name field name - */ - getFieldByName(name: string): DataViewField | undefined; - /** - * Add a runtime field - Appended to existing mapped field or a new field is - * created as appropriate. - * @param name Field name - * @param runtimeField Runtime field definition - */ - addRuntimeField(name: string, runtimeField: RuntimeField): DataViewField[]; - /** - * Returns data view fields backed by runtime fields. - * @param name runtime field name - * @returns map of DataViewFields (that are runtime fields) by field name - */ - getFieldsByRuntimeFieldName(name: string): Record | undefined; - /** - * Remove a runtime field - removed from mapped field or removed unmapped - * field as appropriate. Doesn't clear associated field attributes. - * @param name - Field name to remove - */ - removeRuntimeField(name: string): void; - /** - * Return the "runtime_mappings" section of the ES search query. - */ - getRuntimeMappings(): estypes.MappingRuntimeFields; - /** - * Set field custom label - * @param fieldName name of field to set custom label on - * @param customLabel custom label value. If undefined, custom label is removed - */ - setFieldCustomLabel(fieldName: string, customLabel: string | undefined | null): void; - /** - * Set field custom description - * @param fieldName name of field to set custom label on - * @param customDescription custom description value. If undefined, custom description is removed - */ - setFieldCustomDescription(fieldName: string, customDescription: string | undefined | null): void; - /** - * Set field count - * @param fieldName name of field to set count on - * @param count count value. If undefined, count is removed - */ - setFieldCount(fieldName: string, count: number | undefined | null): void; - /** - * Add composite runtime field and all subfields. - * @param name field name - * @param runtimeField runtime field definition - * @returns data view field instance - */ - private addCompositeRuntimeField; - private updateOrAddRuntimeField; - upsertScriptedField: (field: FieldSpec) => void; -} -export {}; diff --git a/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy.d.ts b/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy.d.ts deleted file mode 100644 index 675553e1b4a1d..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; -import { AbstractDataView } from './abstract_data_views'; -import { DataViewField } from '../fields'; -import type { DataViewSpec, RuntimeField, FieldSpec, IDataViewsApiClient } from '../types'; -interface DataViewDeps { - spec?: DataViewSpec; - fieldFormats: FieldFormatsStartCommon; - shortDotsEnable?: boolean; - metaFields?: string[]; - apiClient: IDataViewsApiClient; - scriptedFieldsEnabled: boolean; -} -interface GetFieldsParams { - indexFilter?: QueryDslQueryContainer; - unmapped?: boolean; - fieldName: string[]; - mapped?: boolean; - scripted?: boolean; - runtime?: boolean; - forceRefresh?: boolean; - metaFields?: boolean; - fieldTypes?: string[]; -} -type DataViewFieldMap = Record; -export declare class DataViewLazy extends AbstractDataView { - private apiClient; - private fieldCache; - /** - * Returns true if scripted fields are enabled - */ - protected scriptedFieldsEnabled: boolean; - constructor(config: DataViewDeps); - getFields({ mapped, scripted, runtime, fieldName, forceRefresh, unmapped, indexFilter, metaFields, }: GetFieldsParams): Promise<{ - getFieldMap: () => DataViewFieldMap; - getFieldMapSorted: () => Record; - }>; - getRuntimeFields: ({ fieldName }: Pick) => DataViewFieldMap; - /** - * Add a runtime field - Appended to existing mapped field or a new field is - * created as appropriate. - * @param name Field name - * @param runtimeField Runtime field definition - */ - addRuntimeField(name: string, runtimeField: RuntimeField): Promise; - private addCompositeRuntimeField; - /** - * Remove a runtime field - removed from mapped field or removed unmapped - * field as appropriate. Doesn't clear associated field attributes. - * @param name - Field name to remove - */ - removeRuntimeField(name: string): void; - private getFieldsByRuntimeFieldName; - private updateOrAddRuntimeField; - private getRuntimeFieldSpecMap; - getScriptedFields({ fieldName }: Pick): Record; - private getMappedFields; - getScriptedFieldsForQuery(): Record; - getComputedFields({ fieldName }: { - fieldName: string[]; - }): Promise<{ - scriptFields: Record; - docvalueFields: { - field: string; - format: string; - }[]; - runtimeFields: estypes.MappingRuntimeFields; - }>; - getRuntimeMappings(): estypes.MappingRuntimeFields; - /** - * Creates static representation of the data view. - * @param includeFields Whether or not to include the `fields` list as part of this spec. If not included, the list - * will be fetched from Elasticsearch when instantiating a new Data View with this spec. - */ - toSpec(params?: { - fieldParams?: GetFieldsParams; - }): Promise; - /** - * Creates a minimal static representation of the data view. Fields and popularity scores will be omitted. - */ - toMinimalSpec(params?: { - keepFieldAttrs?: Array<'customLabel' | 'customDescription'>; - }): Omit; - /** - * returns true if dataview contains TSDB fields - */ - isTSDBMode(): Promise; - removeScriptedField(fieldName: string): void; - upsertScriptedField(field: FieldSpec): void; - isTimeBased: () => Promise; - isTimeNanosBased(): Promise; - getTimeField: () => Promise | undefined; - getFieldByName(name: string, forceRefresh?: boolean): Promise; - /** - * Set field custom label - * @param fieldName name of field to set custom label on - * @param customLabel custom label value. If undefined, custom label is removed - */ - setFieldCustomLabel(fieldName: string, customLabel: string | undefined | null): void; - setFieldCount(fieldName: string, count: number | undefined | null): void; - setFieldCustomDescription(fieldName: string, customDescription: string | undefined | null): void; -} -export {}; diff --git a/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy_util.d.ts b/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy_util.d.ts deleted file mode 100644 index 24b91938efa18..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy_util.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const fieldMatchesFieldsRequested: (fieldName: string, fieldsRequested: string[]) => boolean; -export declare const fieldsMatchFieldsRequested: (fieldName: string[], fieldsRequested: string[]) => string[]; diff --git a/src/platform/plugins/shared/data_views/common/data_views/data_views.d.ts b/src/platform/plugins/shared/data_views/common/data_views/data_views.d.ts deleted file mode 100644 index 7182f3fefaf27..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/data_views.d.ts +++ /dev/null @@ -1,511 +0,0 @@ -import type { PublicMethodsOf } from '@kbn/utility-types'; -import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; -import type { PersistenceAPI } from '../types'; -import { DataViewLazy } from './data_view_lazy'; -import type { AbstractDataView } from './abstract_data_views'; -import { DataView } from './data_view'; -import type { OnNotification, OnError, UiSettingsCommon, IDataViewsApiClient, GetFieldsOptions, DataViewSpec, DataViewAttributes, FieldAttrsAsObject, FieldSpec, DataViewFieldMap, TypeMeta } from '../types'; -import type { SavedObject } from '..'; -export type DataViewSavedObjectAttrs = Pick; -/** - * Result from data view search - summary data. - */ -export interface DataViewListItem { - /** - * Saved object id (or generated id if in-memory only) - */ - id: string; - /** - * Namespace ids - */ - namespaces?: string[]; - /** - * Data view title - */ - title: string; - /** - * Data view type - */ - type?: string; - /** - * Data view type meta - */ - typeMeta?: TypeMeta; - /** - * Human-readable name - */ - name?: string; - /** - * Time field name if applicable - */ - timeFieldName?: string; - /** - * Whether the data view is managed by the application. - */ - managed?: boolean; -} -/** - * Data views API service dependencies - */ -export interface DataViewsServiceDeps { - /** - * UiSettings service instance wrapped in a common interface - */ - uiSettings: UiSettingsCommon; - /** - * Saved objects client interface wrapped in a common interface - */ - savedObjectsClient: PersistenceAPI; - /** - * Wrapper around http call functionality so it can be used on client or server - */ - apiClient: IDataViewsApiClient; - /** - * Field formats service - */ - fieldFormats: FieldFormatsStartCommon; - /** - * Handler for service notifications - */ - onNotification: OnNotification; - /** - * Handler for service errors - */ - onError: OnError; - /** - * Redirects when there's no data view. only used on client - */ - onRedirectNoIndexPattern?: () => void; - /** - * Determines whether the user can save data views - */ - getCanSave: () => Promise; - /** - * Determines whether the user can save advancedSettings (used for defaultIndex) - */ - getCanSaveAdvancedSettings: () => Promise; - scriptedFieldsEnabled: boolean; -} -/** - * Data views API service methods - * @public - */ -export interface DataViewsServicePublicMethods { - /** - * Clear the cache of data view saved objects. - */ - clearCache: () => void; - /** - * Clear the cache of data view instances. - */ - clearInstanceCache: (id?: string) => void; - /** - * Clear the cache of lazy data view instances. - */ - clearDataViewLazyCache: (id: string) => void; - /** - * Create data view based on the provided spec. - * @param spec - Data view spec. - * @param skipFetchFields - If true, do not fetch fields. - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - create: (spec: DataViewSpec, skipFetchFields?: boolean, displayErrors?: boolean) => Promise; - /** - * Create and save data view based on provided spec. - * @param spec - Data view spec. - * @param override - If true, save over existing data view - * @param skipFetchFields - If true, do not fetch fields. - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - createAndSave: (spec: DataViewSpec, override?: boolean, skipFetchFields?: boolean, displayErrors?: boolean) => Promise; - /** - * Save data view - * @param dataView - Data view or data view lazy instance to save. - * @param override - If true, save over existing data view - */ - createSavedObject: (indexPattern: AbstractDataView, overwrite?: boolean) => Promise; - /** - * Delete data view - * @param indexPatternId - Id of the data view to delete. - */ - delete: (indexPatternId: string) => Promise; - /** - * Takes field array and field attributes and returns field map by name. - * @param fields - Array of fieldspecs - * @params fieldAttrs - Field attributes, map by name - * @returns Field map by name - */ - fieldArrayToMap: (fields: FieldSpec[], fieldAttrs?: FieldAttrsAsObject) => DataViewFieldMap; - /** - * Search for data views based on title - * @param search - Search string - * @param size - Number of results to return - */ - find: (search: string, size?: number) => Promise; - /** - * Find and load lazy data views by title. - * @param search - Search string - * @param size - Number of results to return - */ - findLazy: (search: string, size?: number) => Promise; - /** - * Get data view by id. - * @param id - Id of the data view to get. - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - get: (id: string, displayErrors?: boolean, refreshFields?: boolean) => Promise; - /** - * Get populated data view saved object cache. - */ - getCache: () => Promise> | null | undefined>; - /** - * If user can save data view, return true. - */ - getCanSave: () => Promise; - /** - * Get default data view as data view instance. - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - getDefault: (displayErrors?: boolean) => Promise; - /** - * Get default data view id. - */ - getDefaultId: () => Promise; - /** - * Get default data view, if it doesn't exist, choose and save new default data view and return it. - * @param {Object} options - * @param {boolean} options.refreshFields - If true, will refresh the fields of the default data view - * @param {boolean} [options.displayErrors=true] - If set false, API consumer is responsible for displaying and handling errors. - */ - getDefaultDataView: (options?: { - refreshFields?: boolean; - displayErrors?: boolean; - }) => Promise; - /** - * Get fields for data view - * @param dataView - Data view instance or spec - * @param options - Options for getting fields - * @returns FieldSpec array - */ - getFieldsForIndexPattern: (indexPattern: DataView | DataViewSpec, options?: Omit) => Promise; - /** - * Get fields for index pattern string - * @param options - options for getting fields - */ - getFieldsForWildcard: (options: GetFieldsOptions) => Promise; - /** - * Get list of data view ids. - * @param refresh - clear cache and fetch from server - */ - getIds: (refresh?: boolean) => Promise; - /** - * Get list of data view ids and title (and more) for each data view. - * @param refresh - clear cache and fetch from server - */ - getIdsWithTitle: (refresh?: boolean) => Promise; - /** - * Get list of data view ids and title (and more) for each data view. - * @param refresh - clear cache and fetch from server - */ - getTitles: (refresh?: boolean) => Promise; - /** - * Returns true if user has access to view a data view. - */ - hasUserDataView: () => Promise; - /** - * Refresh fields for data view instance - * @params dataView - Data view instance - */ - refreshFields: (indexPattern: DataView, displayErrors?: boolean, forceRefresh?: boolean) => Promise; - /** - * Converts data view saved object to spec - * @params savedObject - Data view saved object - */ - savedObjectToSpec: (savedObject: SavedObject) => DataViewSpec; - /** - * Set default data view. - * @param id - Id of the data view to set as default. - * @param force - Overwrite if true - */ - setDefault: (id: string | null, force?: boolean) => Promise; - /** - * Save saved object - * @param indexPattern - data view instance - * @param saveAttempts - number of times to try saving - * @oaram ignoreErrors - if true, do not throw error on failure - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - updateSavedObject: (indexPattern: AbstractDataView, saveAttempts?: number, ignoreErrors?: boolean, displayErrors?: boolean) => Promise; - /** - * Returns whether a default data view exists. - */ - defaultDataViewExists: () => Promise; - getMetaFields: () => Promise; - getShortDotsEnable: () => Promise; - toDataView: (toDataView: DataViewLazy) => Promise; - toDataViewLazy: (dataView: DataView) => Promise; - getAllDataViewLazy: () => Promise; - getDataViewLazy: (id: string) => Promise; - getDataViewLazyFromCache: (id: string) => Promise; - createDataViewLazy: (spec: DataViewSpec) => Promise; - createAndSaveDataViewLazy: (spec: DataViewSpec, override?: boolean) => Promise; - getDefaultDataViewLazy: () => Promise; -} -/** - * Data views service, providing CRUD operations for data views. - * @public - */ -export declare class DataViewsService { - private config; - private savedObjectsClient; - private savedObjectsCache?; - private apiClient; - private fieldFormats; - /** - * Handler for service notifications - * @param toastInputFields notification content in toast format - * @param key used to indicate uniqueness of the notification - */ - private onNotification; - private onError; - private dataViewCache; - private dataViewLazyCache; - /** - * Can the user save advanced settings? - */ - private getCanSaveAdvancedSettings; - /** - * Can the user save data views? - */ - getCanSave: () => Promise; - readonly scriptedFieldsEnabled: boolean; - /** - * DataViewsService constructor - * @param deps Service dependencies - */ - constructor(deps: DataViewsServiceDeps); - /** - * Refresh cache of index pattern ids and titles. - */ - private refreshSavedObjectsCache; - /** - * Gets list of index pattern ids. - * @param refresh Force refresh of index pattern list - */ - getIds: (refresh?: boolean) => Promise; - /** - * Gets list of index pattern titles. - * @param refresh Force refresh of index pattern list - */ - getTitles: (refresh?: boolean) => Promise; - /** - * Find and load index patterns by title. - * @param search Search string - * @param size Number of data views to return - * @returns DataView[] - */ - find: (search: string, size?: number) => Promise; - /** - * Find and load lazy data views by title. - * @param search Search string - * @param size Number of data views to return - * @returns DataViewLazy[] - */ - findLazy: (search: string, size?: number) => Promise; - /** - * Gets list of index pattern ids with titles. - * @param refresh Force refresh of index pattern list - */ - getIdsWithTitle: (refresh?: boolean) => Promise; - getAllDataViewLazy: (refresh?: boolean) => Promise; - /** - * Clear index pattern saved objects cache. - */ - clearCache: () => void; - /** - * Clear index pattern instance cache - */ - clearInstanceCache: (id?: string) => void; - /** - * Clear instance in data view lazy cache - */ - clearDataViewLazyCache: (id: string) => void; - /** - * Get cache, contains data view saved objects. - */ - getCache: () => Promise[] | null | undefined>; - /** - * Get default index pattern - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - getDefault: (displayErrors?: boolean) => Promise; - /** - * Get default index pattern id - */ - getDefaultId: () => Promise; - /** - * Optionally set default index pattern, unless force = true - * @param id data view id - * @param force set default data view even if there's an existing default - */ - setDefault: (id: string | null, force?: boolean) => Promise; - /** - * Checks if current user has a user created index pattern ignoring fleet's server default index patterns. - */ - hasUserDataView(): Promise; - getMetaFields: () => Promise; - getShortDotsEnable: () => Promise; - /** - * Get field list by providing { pattern }. - * @param options options for getting field list - * @returns FieldSpec[] - */ - getFieldsForWildcard: (options: GetFieldsOptions) => Promise; - /** - * Get field list by providing an index pattern (or spec). - * @param options options for getting field list - * @returns FieldSpec[] - */ - getFieldsForIndexPattern: (indexPattern: DataView | DataViewSpec, options?: Omit) => Promise; - private getFieldsAndIndicesForDataView; - private getFieldsAndIndicesForWildcard; - private refreshFieldsFn; - /** - * Refresh field list for a given data view. - * @param dataView - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - refreshFields: (dataView: DataView, displayErrors?: boolean, forceRefresh?: boolean) => Promise; - /** - * Refreshes a field list from a spec before an index pattern instance is created. - * @param fields - * @param id - * @param title - * @param options - * @returns Record - */ - private refreshFieldSpecMap; - /** - * Converts field array to map. - * @param fields: FieldSpec[] - * @param fieldAttrs: FieldAttrs - * @returns Record - */ - fieldArrayToMap: (fields: FieldSpec[], fieldAttrs?: FieldAttrsAsObject) => DataViewFieldMap; - /** - * Converts data view saved object to data view spec. - * @param savedObject - * @returns DataViewSpec - */ - savedObjectToSpec: (savedObject: SavedObject) => DataViewSpec; - private getSavedObjectAndInit; - private initFromSavedObjectLoadFields; - private initFromSavedObject; - private getRuntimeFields; - getDataViewLazy: (id: string) => Promise; - getDataViewLazyFromCache: (id: string) => Promise; - /** - * Get an index pattern by id, cache optimized. - * @param id - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - * @param refreshFields - If set true, will fetch fields from the index pattern - */ - get: (id: string, displayErrors?: boolean, refreshFields?: boolean) => Promise; - /** - * Create a new data view instance. - * @param spec data view spec - * @param skipFetchFields if true, will not fetch fields - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - * @returns DataView - */ - private createFromSpec; - /** - * Create data view instance. - * @param spec data view spec - * @param skipFetchFields if true, will not fetch fields - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - * @returns DataView - */ - create(spec: DataViewSpec, skipFetchFields?: boolean, displayErrors?: boolean): Promise; - /** - * Create a new data view instance. - * @param spec data view spec - * @returns DataViewLazy - */ - private createFromSpecLazy; - /** - * Create data view lazy instance. - * @param spec data view spec - * @returns DataViewLazy - */ - createDataViewLazy(spec: DataViewSpec): Promise; - /** - * Create a new data view lazy and save it right away. - * @param spec data view spec - * @param override Overwrite if existing index pattern exists. - */ - createAndSaveDataViewLazy(spec: DataViewSpec, overwrite?: boolean): Promise; - /** - * Create a new data view and save it right away. - * @param spec data view spec - * @param override Overwrite if existing index pattern exists. - * @param skipFetchFields Whether to skip field refresh step. - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - createAndSave(spec: DataViewSpec, overwrite?: boolean, skipFetchFields?: boolean, displayErrors?: boolean): Promise; - /** - * Save a new data view. - * @param dataView data view instance - * @param override Overwrite if existing index pattern exists - */ - createSavedObject(dataView: AbstractDataView, overwrite?: boolean): Promise; - /** - * Save existing data view. Will attempt to merge differences if there are conflicts. - * @param indexPattern - * @param saveAttempts - * @param ignoreErrors - * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. - */ - updateSavedObject(indexPattern: AbstractDataView, saveAttempts?: number, ignoreErrors?: boolean, displayErrors?: boolean): Promise; - /** - * Deletes an index pattern from .kibana index. - * @param indexPatternId: Id of kibana Index Pattern to delete - */ - delete(indexPatternId: string): Promise; - private getDefaultDataViewId; - /** - * Returns whether a default data view exists. - */ - defaultDataViewExists(): Promise; - /** - * Returns the default data view as a DataViewLazy. - * If no default is found, or it is missing - * another data view is selected as default and returned. - * If no possible data view found to become a default returns null. - * - * @returns default data view lazy - */ - getDefaultDataViewLazy(): Promise; - /** - * Returns the default data view as an object. - * If no default is found, or it is missing - * another data view is selected as default and returned. - * If no possible data view found to become a default returns null. - * - * @param {Object} options - * @param {boolean} options.refreshFields - If true, will refresh the fields of the default data view - * @param {boolean} [options.displayErrors=true] - If set false, API consumer is responsible for displaying and handling errors. - * @returns default data view - */ - getDefaultDataView(options?: { - displayErrors?: boolean; - refreshFields?: boolean; - }): Promise; - toDataView(dataViewLazy: DataViewLazy): Promise; - toDataViewLazy(dataView: DataView): Promise; -} -/** - * Data views service interface - * @public - */ -export type DataViewsContract = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data_views/common/data_views/flatten_hit.d.ts b/src/platform/plugins/shared/data_views/common/data_views/flatten_hit.d.ts deleted file mode 100644 index e696dc21c24d5..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/flatten_hit.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { DataView } from './data_view'; -/** - * This is wrapped by `createFlattenHitWrapper` in order to provide a single cache to be - * shared across all uses of this function. It is only exported here for use in mocks. - * - * @internal - */ -export declare function flattenHitWrapper(dataView: DataView, metaFields?: {}, cache?: WeakMap): (hit: Record, deep?: boolean) => Record; diff --git a/src/platform/plugins/shared/data_views/common/data_views/index.d.ts b/src/platform/plugins/shared/data_views/common/data_views/index.d.ts deleted file mode 100644 index 5965bb04c96a7..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './flatten_hit'; -export * from './data_view'; -export * from './data_views'; -export * from './data_view_lazy'; -export * from './abstract_data_views'; -export { DataViewPersistableStateService } from './persistable_state'; diff --git a/src/platform/plugins/shared/data_views/common/data_views/meta_units_to_formatter.d.ts b/src/platform/plugins/shared/data_views/common/data_views/meta_units_to_formatter.d.ts deleted file mode 100644 index 86f1473ad8bc8..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/meta_units_to_formatter.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; -export declare const metaUnitsToFormatter: Record; diff --git a/src/platform/plugins/shared/data_views/common/data_views/persistable_state.d.ts b/src/platform/plugins/shared/data_views/common/data_views/persistable_state.d.ts deleted file mode 100644 index fdcfa03b7f0ab..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/persistable_state.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PersistableStateService } from '@kbn/kibana-utils-plugin/common'; -import type { DataViewSpec } from '../types'; -export declare const DataViewPersistableStateService: PersistableStateService; diff --git a/src/platform/plugins/shared/data_views/common/data_views/utils.d.ts b/src/platform/plugins/shared/data_views/common/data_views/utils.d.ts deleted file mode 100644 index aa06f01ebdd93..0000000000000 --- a/src/platform/plugins/shared/data_views/common/data_views/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { RuntimeField, RuntimeFieldSpec } from '../types'; -export declare const removeFieldAttrs: (runtimeField: RuntimeField) => RuntimeFieldSpec; -/** - * Helper function to run forkJoin - * with restrictions on how many input observables can be subscribed to concurrently - */ -export declare function rateLimitingForkJoin(observables: Array>, maxConcurrentRequests: number | undefined, failValue: T): Observable; diff --git a/src/platform/plugins/shared/data_views/common/errors/data_view_saved_object_conflict.d.ts b/src/platform/plugins/shared/data_views/common/errors/data_view_saved_object_conflict.d.ts deleted file mode 100644 index d53bba1c95b9e..0000000000000 --- a/src/platform/plugins/shared/data_views/common/errors/data_view_saved_object_conflict.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Error thrown when saved object has been changed when attempting to save. - */ -export declare class DataViewSavedObjectConflictError extends Error { - /** - * constructor - * @param savedObjectId saved object id with conflict - */ - constructor(savedObjectId: string); -} diff --git a/src/platform/plugins/shared/data_views/common/errors/duplicate_index_pattern.d.ts b/src/platform/plugins/shared/data_views/common/errors/duplicate_index_pattern.d.ts deleted file mode 100644 index d8c67ff92db45..0000000000000 --- a/src/platform/plugins/shared/data_views/common/errors/duplicate_index_pattern.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Error thrown when attempting to create duplicate index pattern based on title. - * @public - */ -export declare class DuplicateDataViewError extends Error { - /** - * constructor - * @param message - Error message - */ - constructor(message: string); -} diff --git a/src/platform/plugins/shared/data_views/common/errors/index.d.ts b/src/platform/plugins/shared/data_views/common/errors/index.d.ts deleted file mode 100644 index 5135e73eacc40..0000000000000 --- a/src/platform/plugins/shared/data_views/common/errors/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './duplicate_index_pattern'; -export * from './data_view_saved_object_conflict'; -export * from './insufficient_access'; diff --git a/src/platform/plugins/shared/data_views/common/errors/insufficient_access.d.ts b/src/platform/plugins/shared/data_views/common/errors/insufficient_access.d.ts deleted file mode 100644 index 887c0d9248114..0000000000000 --- a/src/platform/plugins/shared/data_views/common/errors/insufficient_access.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Error thrown when action attempted without sufficient access. - * @constructor - * @param {string} message - Saved object id of data view for display in error message - */ -export declare class DataViewInsufficientAccessError extends Error { - /** - * constructor - * @param {string} message - Saved object id of data view for display in error message - */ - constructor(savedObjectId?: string); -} diff --git a/src/platform/plugins/shared/data_views/common/expressions/index.d.ts b/src/platform/plugins/shared/data_views/common/expressions/index.d.ts deleted file mode 100644 index 47d43af8a29e1..0000000000000 --- a/src/platform/plugins/shared/data_views/common/expressions/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './load_index_pattern'; diff --git a/src/platform/plugins/shared/data_views/common/expressions/load_index_pattern.d.ts b/src/platform/plugins/shared/data_views/common/expressions/load_index_pattern.d.ts deleted file mode 100644 index 62bc1155d47a1..0000000000000 --- a/src/platform/plugins/shared/data_views/common/expressions/load_index_pattern.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; -import type { DataViewsContract } from '../data_views'; -import type { DataViewSpec } from '..'; -declare const name = "indexPatternLoad"; -declare const type = "index_pattern"; -/** - * Index pattern expression interface - * @public - */ -export interface IndexPatternExpressionType { - /** - * Expression type - */ - type: typeof type; - /** - * Value - DataViewSpec - */ - value: DataViewSpec; -} -type Input = null; -type Output = Promise; -interface Arguments { - id: string; - includeFields?: boolean; -} -/** @internal */ -export interface IndexPatternLoadStartDependencies { - indexPatterns: DataViewsContract; -} -export type IndexPatternLoadExpressionFunctionDefinition = ExpressionFunctionDefinition; -export declare const getIndexPatternLoadMeta: () => Omit; -export {}; diff --git a/src/platform/plugins/shared/data_views/common/fields/data_view_field.d.ts b/src/platform/plugins/shared/data_views/common/fields/data_view_field.d.ts deleted file mode 100644 index 4f50641441796..0000000000000 --- a/src/platform/plugins/shared/data_views/common/fields/data_view_field.d.ts +++ /dev/null @@ -1,228 +0,0 @@ -import type { DataViewFieldBase } from '@kbn/es-query'; -import type { RuntimeFieldSpec } from '../types'; -import type { FieldSpec, DataView } from '..'; -/** - * Optional format getter when serializing a field - * @public - */ -export interface ToSpecConfig { - /** - * Field format getter - */ - getFormatterForField?: DataView['getFormatterForField']; -} -/** - * Data view field class - * @public - */ -export declare class DataViewField implements DataViewFieldBase { - readonly spec: FieldSpec; - /** - * Kbn field type, used mainly for formattering. - */ - private readonly kbnFieldType; - /** - * DataView constructor - * @constructor - * @param spec Configuration for the field - */ - constructor(spec: FieldSpec); - /** - * Count is used for field popularity in discover. - */ - get count(): number; - /** - * Set count, which is used for field popularity in discover. - * @param count count number - */ - set count(count: number); - get defaultFormatter(): string | undefined; - /** - * Returns runtime field definition or undefined if field is not runtime field. - */ - get runtimeField(): RuntimeFieldSpec | undefined; - /** - * Sets runtime field definition or unsets if undefined is provided. - * @param runtimeField runtime field definition - */ - set runtimeField(runtimeField: RuntimeFieldSpec | undefined); - /** - * Script field code - */ - get script(): string | undefined; - /** - * Sets scripted field painless code - * @param script Painless code - */ - set script(script: string | undefined); - /** - * Script field language - */ - get lang(): string | undefined; - /** - * Sets scripted field langauge. - * @param lang Scripted field language - */ - set lang(lang: string | undefined); - /** - * Returns custom label if set, otherwise undefined. - */ - get customLabel(): string | undefined; - /** - * Sets custom label for field, or unsets if passed undefined. - * @param customLabel custom label value - */ - set customLabel(customLabel: string | undefined); - /** - * Returns custom description if set, otherwise undefined. - */ - get customDescription(): string | undefined; - /** - * Sets custom description for field, or unsets if passed undefined. - * @param customDescription custom label value - */ - set customDescription(customDescription: string | undefined); - /** - * Description of field type conflicts across different indices in the same index pattern. - */ - get conflictDescriptions(): Record | undefined; - /** - * Sets conflict descriptions for field. - * @param conflictDescriptions conflict descriptions - */ - set conflictDescriptions(conflictDescriptions: Record | undefined); - /** - * Get field name - */ - get name(): string; - /** - * Gets display name, calcualted based on name, custom label and shortDotsEnable. - */ - get displayName(): string; - /** - * Gets field type - */ - get type(): string; - /** - * Gets ES types as string array - */ - get esTypes(): string[] | undefined; - /** - * Returns true if scripted field - */ - get scripted(): boolean; - /** - * Returns true if field is searchable - */ - get searchable(): boolean; - /** - * Returns true if field is aggregatable - */ - get aggregatable(): boolean; - /** - * returns true if field is a TSDB dimension field - */ - get timeSeriesDimension(): boolean; - /** - * returns type of TSDB metric or undefined - */ - get timeSeriesMetric(): import("@elastic/elasticsearch/lib/api/types").MappingTimeSeriesMetricType | undefined; - /** - * returns list of alloeed fixed intervals - */ - get fixedInterval(): string[] | undefined; - /** - * returns true if the field is of rolled up type - */ - get isRolledUpField(): boolean | undefined; - /** - * return list of allowed time zones - */ - get timeZone(): string[] | undefined; - /** - * Returns true if field is available via doc values - */ - get readFromDocValues(): boolean; - /** - * Returns field subtype, multi, nested, or undefined if neither - */ - get subType(): import("@kbn/es-query").IFieldSubType | undefined; - /** - * Is the field part of the index mapping? - */ - get isMapped(): boolean | undefined; - /** - * Returns true if runtime field defined on data view - */ - get isRuntimeField(): boolean; - /** - * Returns true if field is sortable - */ - get sortable(): boolean; - /** - * Returns true if field is filterable - */ - get filterable(): boolean; - /** - * Returns true if field is visualizable - */ - get visualizable(): boolean; - /** - * Returns true if field is Empty - */ - get isNull(): boolean; - /** - * Returns true if the field is not part of the index and is a computed column - */ - get isComputedColumn(): boolean; - /** - * Returns true if field is subtype nested - */ - isSubtypeNested(): boolean; - /** - * Returns true if field is subtype multi - */ - isSubtypeMulti(): boolean; - /** - * Returns subtype nested data if exists - */ - getSubtypeNested(): import("@kbn/es-query").IFieldSubTypeNested | undefined; - /** - * Returns subtype multi data if exists - */ - getSubtypeMulti(): import("@kbn/es-query").IFieldSubTypeMulti | undefined; - /** - * Deletes count value. Popularity as used by discover - */ - deleteCount(): void; - /** - * JSON version of field - */ - toJSON(): { - count: number; - script: string | undefined; - lang: string | undefined; - conflictDescriptions: Record | undefined; - name: string; - type: string; - esTypes: string[] | undefined; - scripted: boolean; - searchable: boolean; - aggregatable: boolean; - readFromDocValues: boolean; - subType: import("@kbn/es-query").IFieldSubType | undefined; - customLabel: string | undefined; - customDescription: string | undefined; - defaultFormatter: string | undefined; - }; - /** - * Get field in serialized form - fieldspec. - * @param config provide a method to get a field formatter - * @returns field in serialized form - field spec - */ - toSpec(config?: ToSpecConfig): FieldSpec; - /** - * Returns true if composite runtime field - */ - isRuntimeCompositeSubField(): boolean; -} diff --git a/src/platform/plugins/shared/data_views/common/fields/field_list.d.ts b/src/platform/plugins/shared/data_views/common/fields/field_list.d.ts deleted file mode 100644 index ab65e9909512a..0000000000000 --- a/src/platform/plugins/shared/data_views/common/fields/field_list.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { DataViewField } from './data_view_field'; -import type { FieldSpec, DataViewFieldMap } from '../types'; -import type { DataView } from '../data_views'; -interface ToSpecOptions { - getFormatterForField?: DataView['getFormatterForField']; -} -/** - * Interface for data view field list which _extends_ the array class. - */ -export interface IIndexPatternFieldList extends Array { - /** - * Creates a DataViewField instance. Does not add it to the data view. - * @param field field spec to create field instance - * @returns a new data view field instance - */ - create(field: FieldSpec): DataViewField; - /** - * Add field to field list. - * @param field field spec to add field to list - * @returns data view field instance which was added to list - */ - add(field: FieldSpec): DataViewField; - /** - * Returns fields as plain array of data view field instances. - */ - getAll(): DataViewField[]; - /** - * Get field by name. Optimized, uses map to find field. - * @param name name of field to find - * @returns data view field instance if found, undefined otherwise - */ - getByName(name: DataViewField['name']): DataViewField | undefined; - /** - * Get fields by field type. Optimized, uses map to find fields. - * @param type type of field to find - * @returns array of data view field instances if found, empty array otherwise - */ - getByType(type: DataViewField['type']): DataViewField[]; - /** - * Remove field from field list - * @param field field for removal - */ - remove(field: DataViewField | FieldSpec): void; - /** - * Remove all fields from field list. - */ - removeAll(): void; - /** - * Replace all fields in field list with new fields. - * @param specs array of field specs to add to list - */ - replaceAll(specs: FieldSpec[]): void; - /** - * Update a field in the list - * @param field field spec to update - */ - update(field: FieldSpec): void; - /** - * Field list as field spec map by name - * @param options optionally provide a function to get field formatter for fields - * @return map of field specs by name - */ - toSpec(options?: ToSpecOptions): DataViewFieldMap; -} -export declare const fieldList: (specs?: FieldSpec[], shortDotsEnable?: boolean) => IIndexPatternFieldList; -export {}; diff --git a/src/platform/plugins/shared/data_views/common/fields/index.d.ts b/src/platform/plugins/shared/data_views/common/fields/index.d.ts deleted file mode 100644 index d8a4d55d2ad4c..0000000000000 --- a/src/platform/plugins/shared/data_views/common/fields/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { isFilterable, isNestedField, isMultiField, getFieldSubtypeMulti, getFieldSubtypeNested, } from './utils'; -export * from './field_list'; -export * from './data_view_field'; diff --git a/src/platform/plugins/shared/data_views/common/fields/utils.d.ts b/src/platform/plugins/shared/data_views/common/fields/utils.d.ts deleted file mode 100644 index 2ccefe1974411..0000000000000 --- a/src/platform/plugins/shared/data_views/common/fields/utils.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { DataViewFieldBase, IFieldSubTypeNested, IFieldSubTypeMulti } from '@kbn/es-query'; -import type { DataViewField } from '.'; -export declare function isFilterable(field: DataViewField): boolean; -export declare const isNestedField: typeof isDataViewFieldSubtypeNested; -export declare const isMultiField: typeof isDataViewFieldSubtypeMulti; -export declare const getFieldSubtypeMulti: typeof getDataViewFieldSubtypeMulti; -export declare const getFieldSubtypeNested: typeof getDataViewFieldSubtypeNested; -/** - * Convert a dot.notated.string into a short - * version (d.n.string) - */ -export declare function shortenDottedString(input: string): string; -type HasSubtype = Pick; -export declare function isDataViewFieldSubtypeNested(field: HasSubtype): boolean; -export declare function getDataViewFieldSubtypeNested(field: HasSubtype): IFieldSubTypeNested | undefined; -export declare function isDataViewFieldSubtypeMulti(field: HasSubtype): boolean; -/** - * Returns subtype data for multi field - * @public - * @param field field to get subtype data from - */ -export declare function getDataViewFieldSubtypeMulti(field: HasSubtype): IFieldSubTypeMulti | undefined; -export {}; diff --git a/src/platform/plugins/shared/data_views/common/index.d.ts b/src/platform/plugins/shared/data_views/common/index.d.ts deleted file mode 100644 index df38fc4a7308c..0000000000000 --- a/src/platform/plugins/shared/data_views/common/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export { RUNTIME_FIELD_TYPES, PRIMITIVE_RUNTIME_FIELD_TYPES, RUNTIME_FIELD_COMPOSITE_TYPE, DEFAULT_ASSETS_TO_IGNORE, META_FIELDS, DATA_VIEW_SAVED_OBJECT_TYPE, MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH, HasEsDataFailureReason, } from './constants'; -export type { PrimitiveRuntimeFieldTypes, RuntimeFieldCompositeType } from './constants'; -export { LATEST_VERSION } from './content_management/v1/constants'; -export type { ToSpecConfig } from './fields'; -export type { IIndexPatternFieldList } from './fields'; -export { isFilterable, fieldList, DataViewField, isNestedField, isMultiField, getFieldSubtypeMulti, getFieldSubtypeNested, } from './fields'; -export type { FieldFormatMap, RuntimeType, RuntimePrimitiveTypes, RuntimeField, RuntimeFieldSpec, RuntimeFieldSubField, RuntimeFieldSubFields, DataViewAttributes, OnNotification, OnError, UiSettingsCommon, PersistenceAPI, GetFieldsOptions, IDataViewsApiClient, SavedObject, AggregationRestrictions, TypeMeta, FieldSpecConflictDescriptions, FieldSpec, DataViewFieldMap, DataViewSpec, SourceFilter, HasDataService, RuntimeFieldBase, FieldConfiguration, SavedObjectsClientCommonFindArgs, FieldAttrs, FieldAttrSet, } from './types'; -export { DataViewType } from './types'; -export type { DataViewsContract, DataViewsServiceDeps, DataViewSavedObjectAttrs, } from './data_views'; -export { DataViewsService, DataViewPersistableStateService } from './data_views'; -export type { DataViewListItem, DataViewsServicePublicMethods, TimeBasedDataView, } from './data_views'; -export { DataView, DataViewLazy, AbstractDataView } from './data_views'; -export { DuplicateDataViewError, DataViewSavedObjectConflictError, DataViewInsufficientAccessError, } from './errors'; -export type { IndexPatternExpressionType, IndexPatternLoadStartDependencies, IndexPatternLoadExpressionFunctionDefinition, } from './expressions'; -export { getIndexPatternLoadMeta } from './expressions'; -export { DataViewMissingIndices } from './lib/errors'; diff --git a/src/platform/plugins/shared/data_views/common/lib/errors.d.ts b/src/platform/plugins/shared/data_views/common/lib/errors.d.ts deleted file mode 100644 index 5271baf6e5646..0000000000000 --- a/src/platform/plugins/shared/data_views/common/lib/errors.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { KbnError } from '@kbn/kibana-utils-plugin/common'; -/** - * Tried to call a method that relies on SearchSource having an indexPattern assigned - */ -export declare class DataViewMissingIndices extends KbnError { - constructor(message: string); -} diff --git a/src/platform/plugins/shared/data_views/common/lib/index.d.ts b/src/platform/plugins/shared/data_views/common/lib/index.d.ts deleted file mode 100644 index 6ae6d06a0378d..0000000000000 --- a/src/platform/plugins/shared/data_views/common/lib/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { DataViewMissingIndices } from './errors'; -export * from '@kbn/data-view-validation'; diff --git a/src/platform/plugins/shared/data_views/common/types.d.ts b/src/platform/plugins/shared/data_views/common/types.d.ts deleted file mode 100644 index 1a42b62162de3..0000000000000 --- a/src/platform/plugins/shared/data_views/common/types.d.ts +++ /dev/null @@ -1,521 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import type { SavedObject } from '@kbn/core/server'; -import type { ErrorToastOptions, ToastInputFields } from '@kbn/core-notifications-browser'; -import type { DataViewFieldBase } from '@kbn/es-query'; -import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; -import type { RUNTIME_FIELD_TYPES } from './constants'; -export type { QueryDslQueryContainer }; -export type { SavedObject }; -export type FieldFormatMap = Record; -/** - * Runtime field types - */ -export type RuntimeType = (typeof RUNTIME_FIELD_TYPES)[number]; -/** - * Runtime field primitive types - excluding composite - */ -export type RuntimePrimitiveTypes = Exclude; -/** - * Runtime field definition - * @public - */ -export type RuntimeFieldBase = { - /** - * Type of runtime field - */ - type: RuntimeType; - /** - * Runtime field script - */ - script?: { - /** - * Script source - */ - source: string; - }; -}; -/** - * The RuntimeField that will be sent in the ES Query "runtime_mappings" object - */ -export type RuntimeFieldSpec = RuntimeFieldBase & { - /** - * Composite subfields - */ - fields?: Record; -}; -/** - * Field attributes that are user configurable - * @public - */ -export interface FieldConfiguration { - /** - * Field format in serialized form - */ - format?: SerializedFieldFormat | null; - /** - * Custom label - */ - customLabel?: string; - /** - * Custom description - */ - customDescription?: string; - /** - * Popularity - used for discover - */ - popularity?: number; -} -/** - * This is the RuntimeField interface enhanced with Data view field - * configuration: field format definition, customLabel or popularity. - * @public - */ -export interface RuntimeField extends RuntimeFieldBase, FieldConfiguration { - /** - * Subfields of composite field - */ - fields?: RuntimeFieldSubFields; -} -export type RuntimeFieldSubFields = Record; -/** - * Runtime field composite subfield - * @public - */ -export interface RuntimeFieldSubField extends FieldConfiguration { - type: RuntimePrimitiveTypes; -} -/** - * Interface for the data view saved object - * @public - */ -export interface DataViewAttributes { - /** - * Fields as a serialized array of field specs - */ - fields?: string; - /** - * Data view title - */ - title: string; - /** - * Data view type, default or rollup - */ - type?: string; - /** - * Type metadata information, serialized. Only used by rollup data views. - */ - typeMeta?: string; - /** - * Time field name - */ - timeFieldName?: string; - /** - * Serialized array of filters. Used by discover to hide fields. - */ - sourceFilters?: string; - /** - * Serialized map of field formats by field name - */ - fieldFormatMap?: string; - /** - * Serialized map of field attributes, currently field count and name - */ - fieldAttrs?: string; - /** - * Serialized map of runtime field definitions, by field name - */ - runtimeFieldMap?: string; - /** - * Prevents errors when index pattern exists before indices - */ - allowNoIndex?: boolean; - /** - * Name of the data view. Human readable name used to differentiate data view. - */ - name?: string; - /** - * Allow hidden and system indices when loading field list - */ - allowHidden?: boolean; -} -/** - * Set of field attributes - * @public - * Storage of field attributes. Necessary since the field list isn't saved. - */ -export type FieldAttrs = Map; -/** - * Field attributes that are stored on the data view - * @public - */ -export type FieldAttrSet = { - /** - * Custom field label - */ - customLabel?: string; - /** - * Custom field description - */ - customDescription?: string; - /** - * Popularity count - used for discover - */ - count?: number; -}; -export type FieldAttrsAsObject = Record; -/** - * Handler for data view notifications - * @public - * @param toastInputFields Toast notif config - * @param key Used to dedupe notifs - */ -export type OnNotification = (toastInputFields: ToastInputFields, key: string) => void; -/** - * Handler for data view errors - * @public - * @param error Error object - * @param toastInputFields Toast notif config - * @param key Used to dedupe notifs - */ -export type OnError = (error: Error, toastInputFields: ErrorToastOptions, key: string) => void; -/** - * Interface for UiSettings common interface {@link UiSettingsClient} - */ -export interface UiSettingsCommon { - /** - * Get a setting value - * @param key name of value - */ - get: (key: string) => Promise; - /** - * Get all settings values - */ - getAll: () => Promise>; - /** - * Set a setting value - * @param key name of value - * @param value value to set - */ - set: (key: string, value: T) => Promise; - /** - * Remove a setting value - * @param key name of value - */ - remove: (key: string) => Promise; -} -/** - * Saved objects common find args - * @public - */ -export interface SavedObjectsClientCommonFindArgs { - /** - * Saved object fields - */ - fields?: string[]; - /** - * Results per page - */ - perPage?: number; - /** - * Query string - */ - search?: string; - /** - * Fields to search - */ - searchFields?: string[]; -} -/** - * Common interface for the saved objects client on server and content management in browser - * @public - */ -export interface PersistenceAPI { - /** - * Search for saved objects - * @param options - options for search - */ - find: (options: SavedObjectsClientCommonFindArgs) => Promise>>; - /** - * Get a single saved object by id - * @param type - type of saved object - * @param id - id of saved object - */ - get: (id: string) => Promise>; - /** - * Update a saved object by id - * @param type - type of saved object - * @param id - id of saved object - * @param attributes - attributes to update - * @param options - client options - */ - update: (id: string, attributes: DataViewAttributes, options: { - version?: string; - }) => Promise; - /** - * Create a saved object - * @param attributes - attributes to set - * @param options - client options - */ - create: (attributes: DataViewAttributes, options: { - id?: string; - initialNamespaces?: string[]; - overwrite?: boolean; - managed?: boolean; - }) => Promise; - /** - * Delete a saved object by id - * @param type - type of saved object - * @param id - id of saved object - */ - delete: (id: string) => Promise; -} -export interface GetFieldsOptions { - pattern: string; - type?: string; - metaFields?: string[]; - rollupIndex?: string; - allowNoIndex?: boolean; - indexFilter?: QueryDslQueryContainer; - includeUnmapped?: boolean; - fields?: string[]; - allowHidden?: boolean; - forceRefresh?: boolean; - fieldTypes?: string[]; - includeEmptyFields?: boolean; - abortSignal?: AbortSignal; - runtimeMappings?: estypes.MappingRuntimeFields; - projectRouting?: string; -} -/** - * FieldsForWildcard response - */ -export interface FieldsForWildcardResponse { - fields: FieldsForWildcardSpec[]; - indices: string[]; - etag?: string; -} -/** - * Existing Indices response - */ -export type ExistingIndicesResponse = string[]; -export interface IDataViewsApiClient { - getFieldsForWildcard: (options: GetFieldsOptions) => Promise; - hasUserDataView: () => Promise; -} -export type AggregationRestrictions = Record; -/** - * Interface for metadata about rollup indices - */ -export type TypeMeta = { - /** - * Aggregation restrictions for rollup fields - */ - aggs?: Record; - /** - * Params for retrieving rollup field data - */ - params?: { - /** - * Rollup index name used for loading field list - */ - rollup_index: string; - }; -}; -/** - * Data View type. Default or rollup - */ -export declare enum DataViewType { - DEFAULT = "default", - ROLLUP = "rollup" -} -export type FieldSpecConflictDescriptions = Record; -type FieldsForWildcardSpec = Omit; -/** - * Serialized version of DataViewField - * @public - */ -export type FieldSpec = DataViewFieldBase & { - /** - * Popularity count is used by discover - */ - count?: number; - /** - * Description of field type conflicts across indices - */ - conflictDescriptions?: Record; - /** - * Field formatting in serialized format - */ - format?: SerializedFieldFormat; - /** - * Elasticsearch field types used by backing indices - */ - esTypes?: string[]; - /** - * True if field is searchable - */ - searchable: boolean; - /** - * True if field is aggregatable - */ - aggregatable: boolean; - /** - * True if field is empty - */ - isNull?: boolean; - /** - * True if field is a computed column, used in ES|QL to distinguish from index fields - */ - isComputedColumn?: boolean; - /** - * True if can be read from doc values - */ - readFromDocValues?: boolean; - /** - * True if field is indexed - */ - indexed?: boolean; - /** - * Custom label for field, used for display in kibana - */ - customLabel?: string; - /** - * Custom description for field, used for display in kibana - */ - customDescription?: string; - /** - * Runtime field definition - */ - runtimeField?: RuntimeFieldSpec; - /** - * list of allowed field intervals for the field - */ - fixedInterval?: string[]; - /** - * List of allowed timezones for the field - */ - timeZone?: string[]; - /** - * set to true if field is a TSDB dimension field - */ - timeSeriesDimension?: boolean; - /** - * set if field is a TSDB metric field - */ - timeSeriesMetric?: estypes.MappingTimeSeriesMetricType; - /** - * Whether short dots are enabled, based on uiSettings. - */ - shortDotsEnable?: boolean; - /** - * Is this field in the mapping? False if a scripted or runtime field defined on the data view. - */ - isMapped?: boolean; - /** - * Name of parent field for composite runtime field subfields. - */ - parentName?: string; - defaultFormatter?: string; - /** - * Indicates whether the field is a metadata field. - */ - metadata_field?: boolean; -}; -export type DataViewFieldMap = Record; -/** - * Static data view format - * Serialized data object, representing data view attributes and state - */ -export type DataViewSpec = { - /** - * Saved object id (or generated id if in-memory only) - */ - id?: string; - /** - * Saved object version string - */ - version?: string; - /** - * Contrary to its name, this property sets the index pattern of the data view. (e.g. `logs-*,metrics-*`) - * - * Use the `name` property instead to set a human readable name for the data view. - */ - title?: string; - /** - * Name of timestamp field - */ - timeFieldName?: string; - /** - * List of filters which discover uses to hide fields - */ - sourceFilters?: SourceFilter[]; - /** - * Map of fields by name - */ - fields?: DataViewFieldMap; - /** - * Metadata about data view, only used by rollup data views - */ - typeMeta?: TypeMeta; - /** - * Default or rollup - */ - type?: string; - /** - * Map of serialized field formats by field name - */ - fieldFormats?: Record; - /** - * Map of runtime fields by field name - */ - runtimeFieldMap?: Record; - /** - * Map of field attributes by field name, currently customName and count - */ - fieldAttrs?: FieldAttrsAsObject; - /** - * Determines whether failure to load field list should be reported as error - */ - allowNoIndex?: boolean; - /** - * Array of namespace ids - */ - namespaces?: string[]; - /** - * Human readable name used to differentiate the data view. - */ - name?: string; - /** - * Allow hidden and system indices when loading field list - */ - allowHidden?: boolean; - /** - * Whether the data view is managed by the application. - */ - managed?: boolean; -}; -export type SourceFilter = { - value: string; - clientId?: string | number; -}; -export interface HasDataService { - hasESData: () => Promise; - hasUserDataView: () => Promise; - hasDataView: () => Promise; -} -export interface ClientConfigType { - scriptedFieldsEnabled?: boolean; - dataTiersExcludedForFields?: string; - fieldListCachingEnabled?: boolean; - hasEsDataTimeout: number; -} diff --git a/src/platform/plugins/shared/data_views/common/utils.d.ts b/src/platform/plugins/shared/data_views/common/utils.d.ts deleted file mode 100644 index 209cc91693835..0000000000000 --- a/src/platform/plugins/shared/data_views/common/utils.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { PersistenceAPI } from './types'; -/** - * Returns an object matching a given name - * - * @param client {SavedObjectsClientCommon} - * @param name {string} - * @returns {SavedObject|undefined} - */ -export declare function findByName(client: PersistenceAPI, name: string): Promise | undefined>; -export declare function unwrapEtag(ifNoneMatch: string): string; diff --git a/src/platform/plugins/shared/data_views/public/content_management_wrapper.d.ts b/src/platform/plugins/shared/data_views/public/content_management_wrapper.d.ts deleted file mode 100644 index e7ae6c1f1cf93..0000000000000 --- a/src/platform/plugins/shared/data_views/public/content_management_wrapper.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ContentClient } from '@kbn/content-management-plugin/public'; -import type { DataViewAttributes, SavedObject, PersistenceAPI, SavedObjectsClientCommonFindArgs } from '../common/types'; -import type { DataViewCrudTypes } from '../common/content_management'; -export declare class ContentMagementWrapper implements PersistenceAPI { - private contentManagementClient; - constructor(contentManagementClient: ContentClient); - find(options: SavedObjectsClientCommonFindArgs): Promise[]>; - get(id: string): Promise>; - update(id: string, attributes: DataViewAttributes, options: DataViewCrudTypes['UpdateOptions']): Promise>; - create(attributes: DataViewAttributes, options: DataViewCrudTypes['CreateOptions']): Promise>; - delete(id: string): Promise; -} diff --git a/src/platform/plugins/shared/data_views/public/data_views/data_views_api_client.d.ts b/src/platform/plugins/shared/data_views/public/data_views/data_views_api_client.d.ts deleted file mode 100644 index a2fa11d960bb2..0000000000000 --- a/src/platform/plugins/shared/data_views/public/data_views/data_views_api_client.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type { HttpSetup } from '@kbn/core/public'; -import type { ProjectRouting } from '@kbn/es-query'; -import type { GetFieldsOptions, IDataViewsApiClient } from '../../common'; -/** - * Helper function to get the request body for the getFieldsForWildcard request - * @param options options for fields request - * @returns string | undefined - */ -export declare function getFieldsForWildcardRequestBody(options: GetFieldsOptions): string | undefined; -/** - * Data Views API Client - client implementation - */ -export declare class DataViewsApiClient implements IDataViewsApiClient { - private http; - private getCurrentUserId; - private getGlobalProjectRouting?; - /** - * constructor - * @param http http dependency - * @param getCurrentUserId function that returns the current user id - * @param getGlobalProjectRouting function that returns the global project routing, used if override is not provided in the options of a request - */ - constructor(http: HttpSetup, getCurrentUserId: () => Promise, getGlobalProjectRouting?: () => ProjectRouting); - private _request; - private _getUrl; - /** - * Get field list for a given index pattern - * @param options options for fields request - */ - getFieldsForWildcard(options: GetFieldsOptions): Promise<{ - indices: string[]; - fields: { - subType?: import("@kbn/es-query").IFieldSubType | undefined; - name: string; - type: string; - script?: string | undefined; - lang?: import("@elastic/elasticsearch/lib/api/types").ScriptLanguage | undefined; - scripted?: boolean | undefined; - esTypes?: string[] | undefined; - conflictDescriptions?: Record | undefined; - searchable: boolean; - aggregatable: boolean; - isNull?: boolean | undefined; - isComputedColumn?: boolean | undefined; - readFromDocValues?: boolean | undefined; - indexed?: boolean | undefined; - fixedInterval?: string[] | undefined; - timeZone?: string[] | undefined; - timeSeriesDimension?: boolean | undefined; - timeSeriesMetric?: import("@elastic/elasticsearch/lib/api/types").MappingTimeSeriesMetricType | undefined; - shortDotsEnable?: boolean | undefined; - isMapped?: boolean | undefined; - parentName?: string | undefined; - defaultFormatter?: string | undefined; - metadata_field?: boolean | undefined; - }[]; - etag: string; - }>; - /** - * Does a user created data view exist? - */ - hasUserDataView(): Promise; -} diff --git a/src/platform/plugins/shared/data_views/public/data_views/index.d.ts b/src/platform/plugins/shared/data_views/public/data_views/index.d.ts deleted file mode 100644 index 461b67bc34960..0000000000000 --- a/src/platform/plugins/shared/data_views/public/data_views/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '../../common/data_views'; -export * from './data_views_api_client'; diff --git a/src/platform/plugins/shared/data_views/public/data_views/sha256.d.ts b/src/platform/plugins/shared/data_views/public/data_views/sha256.d.ts deleted file mode 100644 index d52b21c712424..0000000000000 --- a/src/platform/plugins/shared/data_views/public/data_views/sha256.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const sha256: (str: string) => Promise; diff --git a/src/platform/plugins/shared/data_views/public/data_views_service_public.d.ts b/src/platform/plugins/shared/data_views/public/data_views_service_public.d.ts deleted file mode 100644 index 1de1b1da2bda8..0000000000000 --- a/src/platform/plugins/shared/data_views/public/data_views_service_public.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import type { MatchedItem } from '.'; -import { DataViewsService } from '.'; -import type { DataViewsServiceDeps } from '../common/data_views/data_views'; -import type { HasDataService } from '../common'; -import type { ExistingIndicesResponse } from '../common/types'; -/** - * Data Views public service dependencies - * @public - */ -export interface DataViewsServicePublicDeps extends DataViewsServiceDeps { - /** - * Get can user save data view - sync version - */ - getCanSaveSync: () => boolean; - /** - * Has data service - */ - hasData: HasDataService; - getIndices: (props: { - pattern: string; - showAllIndices?: boolean; - isRollupIndex: (indexName: string) => boolean; - projectRouting?: string; - }) => Promise; - getRollupsEnabled: () => boolean; - scriptedFieldsEnabled: boolean; - http: HttpStart; -} -/** - * Data Views public service - * @public - */ -export declare class DataViewsServicePublic extends DataViewsService { - getCanSaveSync: () => boolean; - getIndices: (props: { - pattern: string; - showAllIndices?: boolean; - isRollupIndex: (indexName: string) => boolean; - projectRouting?: string; - }) => Promise; - hasData: HasDataService; - private rollupsEnabled; - private readonly http; - readonly scriptedFieldsEnabled: boolean; - /** - * Constructor - * @param deps Service dependencies - */ - constructor(deps: DataViewsServicePublicDeps); - getRollupsEnabled(): boolean; - /** - * Get existing index pattern list by providing string array index pattern list. - * @param indices - index pattern list - * @returns index pattern list of index patterns that match indices - */ - getExistingIndices(indices: string[]): Promise; -} diff --git a/src/platform/plugins/shared/data_views/public/debounce_by_key.d.ts b/src/platform/plugins/shared/data_views/public/debounce_by_key.d.ts deleted file mode 100644 index ae989b6d7514b..0000000000000 --- a/src/platform/plugins/shared/data_views/public/debounce_by_key.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Uses a debouncer collector behind a debouncing factory to work on a set of functions - * - * @template F - function type - * @param {F} fn - function to debounce - * @param {number} waitInMs - * @returns {(key: string) => Function} - */ -export declare const debounceByKey: unknown>(fn: F, waitInMs: number) => ((key: string) => Function); diff --git a/src/platform/plugins/shared/data_views/public/expressions/index.d.ts b/src/platform/plugins/shared/data_views/public/expressions/index.d.ts deleted file mode 100644 index 47d43af8a29e1..0000000000000 --- a/src/platform/plugins/shared/data_views/public/expressions/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './load_index_pattern'; diff --git a/src/platform/plugins/shared/data_views/public/expressions/load_index_pattern.d.ts b/src/platform/plugins/shared/data_views/public/expressions/load_index_pattern.d.ts deleted file mode 100644 index 8e8ce9900130f..0000000000000 --- a/src/platform/plugins/shared/data_views/public/expressions/load_index_pattern.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/public'; -import type { IndexPatternLoadExpressionFunctionDefinition, IndexPatternLoadStartDependencies } from '../../common/expressions'; -import type { DataViewsPublicPluginStart, DataViewsPublicStartDependencies } from '../types'; -/** - * Returns the expression function definition. Any stateful dependencies are accessed - * at runtime via the `getStartDependencies` param, which provides the specific services - * needed for this function to run. - * - * This function is an implementation detail of this module, and is exported separately - * only for testing purposes. - * - * @param getStartDependencies - async function that resolves with IndexPatternLoadStartDependencies - * - * @internal - */ -export declare function getFunctionDefinition({ getStartDependencies, }: { - getStartDependencies: () => Promise; -}): () => IndexPatternLoadExpressionFunctionDefinition; -/** - * This is some glue code that takes in `core.getStartServices`, extracts the dependencies - * needed for this function, and wraps them behind a `getStartDependencies` function that - * is then called at runtime. - * - * We do this so that we can be explicit about exactly which dependencies the function - * requires, without cluttering up the top-level `plugin.ts` with this logic. It also - * makes testing the expression function a bit easier since `getStartDependencies` is - * the only thing you should need to mock. - * - * @param getStartServices - core's StartServicesAccessor for this plugin - * - * @internal - */ -export declare function getIndexPatternLoad({ getStartServices, }: { - getStartServices: StartServicesAccessor; -}): () => IndexPatternLoadExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data_views/public/index.d.ts b/src/platform/plugins/shared/data_views/public/index.d.ts deleted file mode 100644 index d2556f86986dc..0000000000000 --- a/src/platform/plugins/shared/data_views/public/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -export { ILLEGAL_CHARACTERS_KEY, CONTAINS_SPACES_KEY, ILLEGAL_CHARACTERS_VISIBLE, ILLEGAL_CHARACTERS, validateDataView, } from '@kbn/data-view-validation'; -export type { IIndexPatternFieldList, TypeMeta, RuntimeType } from '../common'; -export type { DataViewSpec, FieldSpec, DataViewAttributes, PersistenceAPI, RuntimeField, } from '../common'; -export { DataViewField, DataViewType, DataViewSavedObjectConflictError, META_FIELDS, DATA_VIEW_SAVED_OBJECT_TYPE, getFieldSubtypeMulti, getFieldSubtypeNested, } from '../common'; -export type { DataViewsPublicSetupDependencies, DataViewsPublicStartDependencies, MatchedItem, Tag, } from './types'; -export { INDEX_PATTERN_TYPE } from './types'; -export type { IndexKind } from './types'; -export type { DataViewsServicePublic, DataViewsServicePublicDeps, } from './data_views_service_public'; -export { DataViewsApiClient, DataViewsService, DataView, DataViewLazy } from './data_views'; -export type { DataViewListItem } from './data_views'; -export { UiSettingsPublicToCommon } from './ui_settings_wrapper'; -import { DataViewsPublicPlugin } from './plugin'; -export declare function plugin(initializerContext: PluginInitializerContext): DataViewsPublicPlugin; -export type { DataViewsPublicPluginSetup, DataViewsPublicPluginStart, DataViewsContract, HasDataViewsResponse, IndicesViaSearchResponse, } from './types'; -export type { DataViewsPublicPlugin as DataViewsPlugin }; diff --git a/src/platform/plugins/shared/data_views/public/plugin.d.ts b/src/platform/plugins/shared/data_views/public/plugin.d.ts deleted file mode 100644 index 3a0c11a29dfe7..0000000000000 --- a/src/platform/plugins/shared/data_views/public/plugin.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { DataViewsPublicPluginSetup, DataViewsPublicPluginStart, DataViewsPublicSetupDependencies, DataViewsPublicStartDependencies } from './types'; -export declare class DataViewsPublicPlugin implements Plugin { - private readonly initializerContext; - private readonly hasData; - private rollupsEnabled; - private readonly callResolveCluster; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup, { expressions, contentManagement }: DataViewsPublicSetupDependencies): DataViewsPublicPluginSetup; - start(core: CoreStart, { fieldFormats, contentManagement, cps }: DataViewsPublicStartDependencies): DataViewsPublicPluginStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/data_views/public/services/get_indices.d.ts b/src/platform/plugins/shared/data_views/public/services/get_indices.d.ts deleted file mode 100644 index 0e23330f0e05a..0000000000000 --- a/src/platform/plugins/shared/data_views/public/services/get_indices.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import type { Tag, MatchedItem, ResolveIndexResponse } from '../types'; -export declare const getIndicesViaResolve: ({ http, pattern, showAllIndices, isRollupIndex, projectRouting, }: { - http: HttpStart; - pattern: string; - showAllIndices: boolean; - isRollupIndex: (indexName: string) => boolean; - projectRouting?: string; -}) => Promise; -export declare function getIndices({ http, pattern: rawPattern, showAllIndices, isRollupIndex, projectRouting, }: { - http: HttpStart; - pattern: string; - showAllIndices?: boolean; - isRollupIndex: (indexName: string) => boolean; - projectRouting?: string; -}): Promise; -export declare const responseToItemArray: (response: ResolveIndexResponse, getTags: (indexName: string) => Tag[]) => MatchedItem[]; diff --git a/src/platform/plugins/shared/data_views/public/services/has_data.d.ts b/src/platform/plugins/shared/data_views/public/services/has_data.d.ts deleted file mode 100644 index cafad081f2b19..0000000000000 --- a/src/platform/plugins/shared/data_views/public/services/has_data.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { ResponseErrorBody } from '@kbn/core-http-browser'; -import type { ICPSManager } from '@kbn/cps-utils'; -export interface HasEsDataParams { - /** - * Callback to handle the case where checking for remote data times out. - * If not provided, the default behavior is to show a toast notification. - * @param body The error response body - */ - onRemoteDataTimeout?: (body: ResponseErrorBody) => void; -} -export declare class HasData { - private removeAliases; - private isUserDataSource; - start(core: CoreStart, callResolveCluster: boolean, cpsManager?: ICPSManager): { - /** - * Check to see if ES data exists - */ - hasESData: ({ onRemoteDataTimeout, }?: HasEsDataParams) => Promise; - /** - * Check to see if a data view exists - */ - hasDataView: () => Promise; - /** - * Check to see if user created data views exist - */ - hasUserDataView: () => Promise; - }; - private isResponseError; - private responseToItemArray; - private getIndicesViaSearch; - private getIndices; - private checkLocalESData; - private checkRemoteESData; - private getHasDataViews; - private hasDataViews; - private hasUserDataViews; -} -export type HasDataStart = ReturnType; diff --git a/src/platform/plugins/shared/data_views/public/services/index.d.ts b/src/platform/plugins/shared/data_views/public/services/index.d.ts deleted file mode 100644 index 7b386486d21f7..0000000000000 --- a/src/platform/plugins/shared/data_views/public/services/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import type { MatchedItem } from '../types'; -export * from './has_data'; -export declare function getIndices(props: { - http: HttpStart; - pattern: string; - showAllIndices?: boolean; - isRollupIndex: (indexName: string) => boolean; - projectRouting?: string; -}): Promise; diff --git a/src/platform/plugins/shared/data_views/public/types.d.ts b/src/platform/plugins/shared/data_views/public/types.d.ts deleted file mode 100644 index b99e5bc0f9f28..0000000000000 --- a/src/platform/plugins/shared/data_views/public/types.d.ts +++ /dev/null @@ -1,175 +0,0 @@ -import type { ExpressionsSetup } from '@kbn/expressions-plugin/public'; -import type { FieldFormatsSetup, FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { ContentManagementPublicSetup, ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; -import type { CPSPluginStart } from '@kbn/cps/public'; -import type { DataViewsServicePublicMethods } from './data_views'; -import type { HasDataService } from '../common'; -export declare enum INDEX_PATTERN_TYPE { - ROLLUP = "rollup", - DEFAULT = "default" -} -/** - * Discriminator for the entries returned by `dataViews.getIndices()` (backed - * by the Elasticsearch `_resolve/index` endpoint). Written to each - * `MatchedItem.tags[].key`. Exported as a type-only union so consumers can - * narrow against it without forcing a runtime dependency on `dataViews`. - */ -export type IndexKind = 'index' | 'alias' | 'data_stream' | 'frozen' | 'rollup'; -export declare enum IndicesResponseItemIndexAttrs { - OPEN = "open", - CLOSED = "closed", - HIDDEN = "hidden", - FROZEN = "frozen" -} -export interface IndicesResponseModified { - name: string; - item: { - name: string; - backing_indices?: string[]; - timestamp_field?: string; - indices?: string[]; - aliases?: string[]; - attributes?: IndicesResponseItemIndexAttrs[]; - data_stream?: string; - }; -} -export interface IndicesResponseItem { - name: string; -} -export interface IndicesResponseItemAlias extends IndicesResponseItem { - indices: string[]; -} -export interface IndicesResponseItemDataStream extends IndicesResponseItem { - backing_indices: string[]; - timestamp_field: string; -} -export interface IndicesResponseItemIndex extends IndicesResponseItem { - aliases?: string[]; - attributes?: IndicesResponseItemIndexAttrs[]; - data_stream?: string; -} -export interface IndicesResponse { - indices?: IndicesResponseItemIndex[]; - aliases?: IndicesResponseItemAlias[]; - data_streams?: IndicesResponseItemDataStream[]; -} -export interface IndicesViaSearchResponse { - total: number; -} -export interface HasDataViewsResponse { - hasDataView: boolean; - hasUserDataView: boolean; -} -/** - * Data views public setup dependencies - */ -export interface DataViewsPublicSetupDependencies { - /** - * Expressions - */ - expressions: ExpressionsSetup; - /** - * Field formats - */ - fieldFormats: FieldFormatsSetup; - /** - * Content management - */ - contentManagement: ContentManagementPublicSetup; -} -/** - * Data views public start dependencies - */ -export interface DataViewsPublicStartDependencies { - /** - * Field formats - */ - fieldFormats: FieldFormatsStart; - /** - * Content management - */ - contentManagement: ContentManagementPublicStart; - /** - * CPS plugin (optional) - */ - cps?: CPSPluginStart; -} -/** - * Data plugin public Setup contract - */ -export interface DataViewsPublicPluginSetup { - enableRollups: () => void; -} -export interface DataViewsServicePublic extends DataViewsServicePublicMethods { - getCanSaveSync: () => boolean; - hasData: HasDataService; - getIndices: (props: { - pattern: string; - showAllIndices?: boolean; - isRollupIndex: (indexName: string) => boolean; - projectRouting?: string; - }) => Promise; - getRollupsEnabled: () => boolean; - scriptedFieldsEnabled: boolean; - /** - * Get existing index pattern list by providing string array index pattern list. - * @param indices - index pattern list - * @returns index pattern list of index patterns that match indices - */ - getExistingIndices: (indices: string[]) => Promise; -} -export type DataViewsContract = DataViewsServicePublic; -/** - * Data views plugin public Start contract - */ -export type DataViewsPublicPluginStart = DataViewsServicePublic; -export interface MatchedItem { - name: string; - tags: Tag[]; - item: { - name: string; - backing_indices?: string[]; - timestamp_field?: string; - indices?: string[]; - aliases?: string[]; - attributes?: ResolveIndexResponseItemIndexAttrs[]; - data_stream?: string; - mode?: string; - }; -} -export interface ResolveIndexResponse { - indices?: ResolveIndexResponseItemIndex[]; - aliases?: ResolveIndexResponseItemAlias[]; - data_streams?: ResolveIndexResponseItemDataStream[]; -} -export interface ResolveIndexResponseItem { - name: string; -} -export interface ResolveIndexResponseItemDataStream extends ResolveIndexResponseItem { - backing_indices: string[]; - timestamp_field: string; -} -export interface ResolveIndexResponseItemAlias extends ResolveIndexResponseItem { - indices: string[]; -} -export interface ResolveIndexResponseItemIndex extends ResolveIndexResponseItem { - aliases?: string[]; - attributes?: ResolveIndexResponseItemIndexAttrs[]; - data_stream?: string; -} -/** - * UI tag attached to each entry returned by `dataViews.getIndices()`. - * - * @see IndexKind for the discriminator written to `key`. - */ -export interface Tag { - name: string; - key: IndexKind; - color: string; -} -export declare enum ResolveIndexResponseItemIndexAttrs { - OPEN = "open", - CLOSED = "closed", - HIDDEN = "hidden", - FROZEN = "frozen" -} diff --git a/src/platform/plugins/shared/data_views/public/ui_settings_wrapper.d.ts b/src/platform/plugins/shared/data_views/public/ui_settings_wrapper.d.ts deleted file mode 100644 index ee43678481f60..0000000000000 --- a/src/platform/plugins/shared/data_views/public/ui_settings_wrapper.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IUiSettingsClient, PublicUiSettingsParams, UserProvidedValues } from '@kbn/core/public'; -import type { UiSettingsCommon } from '../common'; -export declare class UiSettingsPublicToCommon implements UiSettingsCommon { - private uiSettings; - constructor(uiSettings: IUiSettingsClient); - get(key: string): Promise; - getAll(): Promise) | undefined>>; - set(key: string, value: unknown): Promise; - remove(key: string): Promise; -} diff --git a/src/platform/plugins/shared/expressions/common/ast/build_expression.d.ts b/src/platform/plugins/shared/expressions/common/ast/build_expression.d.ts deleted file mode 100644 index 35fa8d40d5dce..0000000000000 --- a/src/platform/plugins/shared/expressions/common/ast/build_expression.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import type { AnyExpressionFunctionDefinition } from '../expression_functions/types'; -import type { ExpressionAstExpression } from './types'; -import type { ExpressionAstFunctionBuilder, InferFunctionDefinition } from './build_function'; -/** - * Type guard that checks whether a given value is an - * `ExpressionAstExpressionBuilder`. This is useful when working - * with subexpressions, where you might be retrieving a function - * argument, and need to know whether it is an expression builder - * instance which you can perform operations on. - * - * @example - * const arg = myFunction.getArgument('foo'); - * if (isExpressionAstBuilder(foo)) { - * foo.toAst(); - * } - * - * @param val Value you want to check. - * @return boolean - */ -export declare function isExpressionAstBuilder(val: unknown): val is ExpressionAstExpressionBuilder; -/** @internal */ -export declare function isExpressionAst(val: unknown): val is ExpressionAstExpression; -export interface ExpressionAstExpressionBuilder { - /** - * Used to identify expression builder objects. - */ - type: 'expression_builder'; - /** - * Array of each of the `buildExpressionFunction()` instances - * in this expression. Use this to remove or reorder functions - * in the expression. - */ - functions: ExpressionAstFunctionBuilder[]; - /** - * Recursively searches expression for all ocurrences of the - * function, including in subexpressions. - * - * Useful when performing migrations on a specific function, - * as you can iterate over the array of references and update - * all functions at once. - * - * @param fnName Name of the function to search for. - * @return `ExpressionAstFunctionBuilder[]` - */ - findFunction: (fnName: InferFunctionDefinition['name']) => Array> | []; - /** - * Converts expression to an AST. - * - * @return `ExpressionAstExpression` - */ - toAst: () => ExpressionAstExpression; - /** - * Converts expression to an expression string. - * - * @return `string` - */ - toString: () => string; -} -/** - * Makes it easy to progressively build, update, and traverse an - * expression AST. You can either start with an empty AST, or - * provide an expression string, AST, or array of expression - * function builders to use as initial state. - * - * @param initialState Optional. An expression string, AST, or array of `ExpressionAstFunctionBuilder[]`. - * @return `this` - */ -export declare function buildExpression(initialState?: ExpressionAstFunctionBuilder[] | ExpressionAstExpression | string): ExpressionAstExpressionBuilder; diff --git a/src/platform/plugins/shared/expressions/common/ast/build_function.d.ts b/src/platform/plugins/shared/expressions/common/ast/build_function.d.ts deleted file mode 100644 index 73775c1faccc0..0000000000000 --- a/src/platform/plugins/shared/expressions/common/ast/build_function.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -import type { ExpressionAstExpression, ExpressionAstFunction } from './types'; -import type { AnyExpressionFunctionDefinition, ExpressionFunctionDefinition } from '../expression_functions/types'; -import type { ExpressionAstExpressionBuilder } from './build_expression'; -export type InferFunctionDefinition = FnDef extends ExpressionFunctionDefinition ? { - name: Name; - input: Input; - arguments: Arguments; - output: Output; - context: Context; -} : never; -type FunctionArgs = InferFunctionDefinition['arguments']; -type FunctionArgName = { - [A in keyof FunctionArgs]: A extends string ? A : never; -}[keyof FunctionArgs]; -type OptionalKeys = { - [K in keyof T]-?: {} extends Pick ? (K extends string ? K : never) : never; -}[keyof T]; -interface FunctionBuilderArguments { - [key: string]: Array[string] | ExpressionAstExpressionBuilder>; -} -export interface ExpressionAstFunctionBuilder { - /** - * Used to identify expression function builder objects. - */ - type: 'expression_function_builder'; - /** - * Name of this expression function. - */ - name: InferFunctionDefinition['name']; - /** - * Object of all args currently added to the function. This is - * structured similarly to `ExpressionAstFunction['arguments']`, - * however any subexpressions are returned as expression builder - * instances instead of expression ASTs. - */ - arguments: FunctionBuilderArguments; - /** - * Adds an additional argument to the function. For multi-args, - * this should be called once for each new arg. Note that TS - * will not enforce whether multi-args are available, so only - * use this to update an existing arg if you are certain it - * is a multi-arg. - * - * @param name The name of the argument to add. - * @param value The value of the argument to add. - * @return `this` - */ - addArgument: >(name: A, value: FunctionArgs[A] | ExpressionAstExpressionBuilder) => this; - /** - * Retrieves an existing argument by name. - * Useful when you want to retrieve the current array of args and add - * something to it before calling `replaceArgument`. Any subexpression - * arguments will be returned as expression builder instances. - * - * @param name The name of the argument to retrieve. - * @return `ExpressionAstFunctionBuilderArgument[] | undefined` - */ - getArgument: >(name: A) => Array[A] | ExpressionAstExpressionBuilder> | undefined; - /** - * Overwrites an existing argument with a new value. - * In order to support multi-args, the value given must always be - * an array. - * - * @param name The name of the argument to replace. - * @param value The value of the argument. Must always be an array. - * @return `this` - */ - replaceArgument: >(name: A, value: Array[A] | ExpressionAstExpressionBuilder>) => this; - /** - * Removes an (optional) argument from the function. - * - * TypeScript will enforce that you only remove optional - * arguments. For manipulating required args, use `replaceArgument`. - * - * @param name The name of the argument to remove. - * @return `this` - */ - removeArgument: >>(name: A) => this; - /** - * Converts function to an AST. - * - * @return `ExpressionAstFunction` - */ - toAst: () => ExpressionAstFunction; - /** - * Converts function to an expression string. - * - * @return `string` - */ - toString: () => string; -} -/** - * Manages an AST for a single expression function. The return value - * can be provided to `buildExpression` to add this function to an - * expression. - * - * Note that to preserve type safety and ensure no args are missing, - * all required arguments for the specified function must be provided - * up front. If desired, they can be changed or removed later. - * - * @param fnName String representing the name of this expression function. - * @param initialArgs Object containing the arguments to this function. - * @return `this` - */ -export declare function buildExpressionFunction(fnName: InferFunctionDefinition['name'], -/** - * To support subexpressions, we override all args to also accept an - * ExpressionBuilder. This isn't perfectly typesafe since we don't - * know with certainty that the builder's output matches the required - * argument input, so we trust that folks using subexpressions in the - * builder know what they're doing. - */ -initialArgs: { - [K in keyof FunctionArgs]: FunctionArgs[K] | ExpressionAstExpressionBuilder | ExpressionAstExpressionBuilder[] | ExpressionAstExpression | ExpressionAstExpression[]; -}): ExpressionAstFunctionBuilder; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/ast/format.d.ts b/src/platform/plugins/shared/expressions/common/ast/format.d.ts deleted file mode 100644 index d296d3b91807d..0000000000000 --- a/src/platform/plugins/shared/expressions/common/ast/format.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ExpressionAstExpression, ExpressionAstArgument } from './types'; -export declare function format(ast: T, type: T extends ExpressionAstExpression ? 'expression' : 'argument'): string; diff --git a/src/platform/plugins/shared/expressions/common/ast/format_expression.d.ts b/src/platform/plugins/shared/expressions/common/ast/format_expression.d.ts deleted file mode 100644 index d6c0f2ce79c09..0000000000000 --- a/src/platform/plugins/shared/expressions/common/ast/format_expression.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ExpressionAstExpression } from './types'; -/** - * Given expression pipeline AST, returns formatted string. - * - * @param ast Expression pipeline AST. - */ -export declare function formatExpression(ast: ExpressionAstExpression): string; diff --git a/src/platform/plugins/shared/expressions/common/ast/index.d.ts b/src/platform/plugins/shared/expressions/common/ast/index.d.ts deleted file mode 100644 index 3427512887cd9..0000000000000 --- a/src/platform/plugins/shared/expressions/common/ast/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './build_expression'; -export * from './build_function'; -export * from './format_expression'; -export * from './format'; -export * from './parse_expression'; -export * from './parse'; -export type * from './types'; diff --git a/src/platform/plugins/shared/expressions/common/ast/parse.d.ts b/src/platform/plugins/shared/expressions/common/ast/parse.d.ts deleted file mode 100644 index 636aa35c24cc5..0000000000000 --- a/src/platform/plugins/shared/expressions/common/ast/parse.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ExpressionAstExpression, ExpressionAstArgument } from './types'; -export declare function parse(expression: E, startRule: S): S extends 'expression' ? ExpressionAstExpression : ExpressionAstArgument; diff --git a/src/platform/plugins/shared/expressions/common/ast/parse_expression.d.ts b/src/platform/plugins/shared/expressions/common/ast/parse_expression.d.ts deleted file mode 100644 index 82f93ea667879..0000000000000 --- a/src/platform/plugins/shared/expressions/common/ast/parse_expression.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ExpressionAstExpression } from './types'; -/** - * Given expression pipeline string, returns parsed AST. - * - * @param expression Expression pipeline string. - */ -export declare function parseExpression(expression: string): ExpressionAstExpression; diff --git a/src/platform/plugins/shared/expressions/common/ast/types.d.ts b/src/platform/plugins/shared/expressions/common/ast/types.d.ts deleted file mode 100644 index 79cc2e579c5e3..0000000000000 --- a/src/platform/plugins/shared/expressions/common/ast/types.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { Ast, AstFunction } from '@kbn/interpreter'; -import type { ExpressionValue, ExpressionValueError } from '../expression_types'; -export type ExpressionAstNode = ExpressionAstExpression | ExpressionAstFunction | ExpressionAstArgument; -export type ExpressionAstExpression = Omit & { - chain: ExpressionAstFunction[]; -}; -export type ExpressionAstFunction = Omit & { - arguments: Record; - /** - * Debug information added to each function when expression is executed in *debug mode*. - */ - debug?: ExpressionAstFunctionDebug; -}; -export type ExpressionAstFunctionDebug = { - /** - * True if function successfully returned output, false if function threw. - */ - success: boolean; - /** - * Id of expression function. - */ - fn: string; - /** - * Input that expression function received as its first argument. - */ - input: ExpressionValue; - /** - * Map of resolved arguments expression function received as its second argument. - */ - args: Record; - /** - * Result returned by the expression function. Including an error result - * if it was returned by the function (not thrown). - */ - output?: ExpressionValue; - /** - * Error that function threw normalized to `ExpressionValueError`. - */ - error?: ExpressionValueError; - /** - * Raw error that was thrown by the function, if any. - */ - rawError?: any | Error; - /** - * Time in milliseconds it took to execute the function. Duration can be - * `undefined` if error happened during argument resolution, because function - * timing starts after the arguments have been resolved. - */ - duration: number | undefined; -}; -export type ExpressionAstArgument = string | boolean | number | ExpressionAstExpression; diff --git a/src/platform/plugins/shared/expressions/common/execution/container.d.ts b/src/platform/plugins/shared/expressions/common/execution/container.d.ts deleted file mode 100644 index 60d911605f3f6..0000000000000 --- a/src/platform/plugins/shared/expressions/common/execution/container.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { StateContainer } from '@kbn/kibana-utils-plugin/common/state_containers'; -import type { ExecutorState } from '../executor'; -import type { ExpressionAstExpression } from '../ast'; -import type { ExpressionValue } from '../expression_types'; -export interface ExecutionState extends ExecutorState { - ast: ExpressionAstExpression; - /** - * Tracks state of execution. - * - * - `not-started` - before .start() method was called. - * - `pending` - immediately after .start() method is called. - * - `result` - when expression execution completed. - * - `error` - when execution failed with error. - */ - state: 'not-started' | 'pending' | 'result' | 'error'; - /** - * Result of the expression execution. - */ - result?: Output; - /** - * Error happened during the execution. - */ - error?: Error; -} -export interface ExecutionPureTransitions { - start: (state: ExecutionState) => () => ExecutionState; - setResult: (state: ExecutionState) => (result: Output) => ExecutionState; - setError: (state: ExecutionState) => (error: Error) => ExecutionState; -} -export declare const executionPureTransitions: ExecutionPureTransitions; -export type ExecutionContainer = StateContainer, ExecutionPureTransitions>; -export declare const createExecutionContainer: (state?: ExecutionState) => ExecutionContainer; diff --git a/src/platform/plugins/shared/expressions/common/execution/execution.d.ts b/src/platform/plugins/shared/expressions/common/execution/execution.d.ts deleted file mode 100644 index 0413a0efffb6c..0000000000000 --- a/src/platform/plugins/shared/expressions/common/execution/execution.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -import type { Logger } from '@kbn/logging'; -import type { ObservableLike, UnwrapObservable } from '@kbn/utility-types'; -import { Observable } from 'rxjs'; -import { AbortReason } from '@kbn/kibana-utils-plugin/common'; -import type { Adapters } from '@kbn/inspector-plugin/common'; -import type { Executor } from '../executor'; -import type { ExecutionContainer } from './container'; -import type { ExpressionValueError } from '../expression_types/specs/error'; -import type { ExpressionAstArgument, ExpressionAstExpression, ExpressionAstFunction, ExpressionAstNode } from '../ast'; -import type { DefaultInspectorAdapters, ExecutionContext } from './types'; -import type { ExpressionFunction, ExpressionFunctionParameter } from '../expression_functions'; -import { ExecutionContract } from './execution_contract'; -import type { ExpressionExecutionParams } from '../service'; -type UnwrapReturnType unknown> = ReturnType extends ObservableLike ? UnwrapObservable> : Awaited>; -export interface FunctionCacheItem { - value: unknown; - time: number; - sideEffectFn?: () => void; -} -/** - * The result returned after an expression function execution. - */ -export interface ExecutionResult { - /** - * Partial result flag. - */ - partial: boolean; - /** - * The expression function result. - */ - result: Output; -} -export interface ExecutionParams { - executor: Executor; - ast?: ExpressionAstExpression; - expression?: string; - params: ExpressionExecutionParams; -} -export declare class Execution { - #private; - readonly execution: ExecutionParams; - private readonly logger?; - private readonly functionCache; - /** - * Dynamic state of the execution. - */ - readonly state: ExecutionContainer>; - /** - * Initial input of the execution. - * - * N.B. It is initialized to `null` rather than `undefined` for legacy reasons, - * because in legacy interpreter it was set to `null` by default. - */ - input: Input; - /** - * Input of the started execution. - */ - private input$; - /** - * Execution context - object that allows to do side-effects. Context is passed - * to every function. - */ - readonly context: ExecutionContext; - /** - * AbortController to cancel this Execution. - */ - private readonly abortController; - /** - * Whether .start() method has been called. - */ - private hasStarted; - /** - * Future that tracks result or error of this execution. - */ - readonly result: Observable>; - /** - * Keeping track of any child executions - * Needed to cancel child executions in case parent execution is canceled - * @internal - */ - private readonly childExecutions; - private cacheTimeout; - /** - * Contract is a public representation of `Execution` instances. Contract we - * can return to other plugins for their consumption. - */ - readonly contract: ExecutionContract; - readonly expression: string; - get inspectorAdapters(): InspectorAdapters; - constructor(execution: ExecutionParams, logger?: Logger | undefined, functionCache?: Map); - /** - * Stop execution of expression. - */ - cancel(reason?: AbortReason): void; - /** - * Call this method to start execution. - * - * N.B. `input` is initialized to `null` rather than `undefined` for legacy reasons, - * because in legacy interpreter it was set to `null` by default. - */ - start(input?: Input, isSubExpression?: boolean): Observable>; - invokeChain([head, ...tail]: ExpressionAstFunction[], input: unknown): Observable; - invokeFunction(fn: Fn, input: unknown, args: Record): Observable>; - cast(value: unknown, toTypeNames?: string[]): Type; - validate(value: Type, argDef: ExpressionFunctionParameter): void; - resolveArgs(fnDef: Fn, input: unknown, argAsts: Record): Observable | ExpressionValueError>; - interpret(ast: ExpressionAstNode, input: T): Observable>; -} -export {}; diff --git a/src/platform/plugins/shared/expressions/common/execution/execution_contract.d.ts b/src/platform/plugins/shared/expressions/common/execution/execution_contract.d.ts deleted file mode 100644 index 70ae2a733dd63..0000000000000 --- a/src/platform/plugins/shared/expressions/common/execution/execution_contract.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Adapters } from '@kbn/inspector-plugin/common/adapters'; -import type { AbortReason } from '@kbn/kibana-utils-plugin/common'; -import type { Execution, ExecutionResult } from './execution'; -import type { ExpressionValueError } from '../expression_types/specs'; -import type { ExpressionAstExpression } from '../ast'; -/** - * `ExecutionContract` is a wrapper around `Execution` class. It provides the - * same functionality but does not expose Expressions plugin internals. - */ -export declare class ExecutionContract { - get isPending(): boolean; - protected readonly execution: Execution; - constructor(execution: Execution); - /** - * Cancel the execution of the expression. This will set abort signal - * (available in execution context) to aborted state, letting expression - * functions to stop their execution. - */ - cancel: (reason?: AbortReason) => void; - /** - * Returns the final output of expression, if any error happens still - * wraps that error into `ExpressionValueError` type and returns that. - * This function never throws. - */ - getData: () => Observable>; - /** - * Get string representation of the expression. Returns the original string - * if execution was started from a string. If execution was started from an - * AST this method returns a string generated from AST. - */ - getExpression: () => string; - /** - * Get AST used to execute the expression. - */ - getAst: () => ExpressionAstExpression; - /** - * Get Inspector adapters provided to all functions of expression through - * execution context. - */ - inspect: () => Adapters; -} diff --git a/src/platform/plugins/shared/expressions/common/execution/index.d.ts b/src/platform/plugins/shared/expressions/common/execution/index.d.ts deleted file mode 100644 index d18f67e4bcccd..0000000000000 --- a/src/platform/plugins/shared/expressions/common/execution/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type * from './types'; -export * from './container'; -export * from './execution'; -export * from './execution_contract'; diff --git a/src/platform/plugins/shared/expressions/common/execution/types.d.ts b/src/platform/plugins/shared/expressions/common/execution/types.d.ts deleted file mode 100644 index ebd33c459f06f..0000000000000 --- a/src/platform/plugins/shared/expressions/common/execution/types.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -import type { KibanaExecutionContext } from '@kbn/core/public'; -import type { Adapters, RequestAdapter } from '@kbn/inspector-plugin/common'; -import type { ExecutionContextSearch } from '@kbn/es-query'; -import type { Datatable, ExpressionType } from '../expression_types'; -import type { TablesAdapter } from '../util/tables_adapter'; -import type { ExpressionsInspectorAdapter } from '../util'; -/** - * `ExecutionContext` is an object available to all functions during a single execution; - * it provides various methods to perform side-effects. - */ -export interface ExecutionContext { - /** - * Get search context of the expression. - */ - getSearchContext: () => ExecutionContextSearch; - /** - * Context variables that can be consumed using `var` and `var_set` functions. - */ - variables: Record; - /** - * A map of available expression types. - */ - types: Record; - /** - * Allow caching in the current execution. - */ - allowCache?: boolean; - /** - * Adds ability to abort current execution. - */ - abortSignal: AbortSignal; - /** - * Adapters for `inspector` plugin. - */ - inspectorAdapters: InspectorAdapters; - /** - * Search context in which expression should operate. - */ - getSearchSessionId: () => string | undefined; - /** - * Getter to retrieve the `KibanaRequest` object inside an expression function. - * Useful for functions which are running on the server and need to perform - * operations that are scoped to a specific user. - */ - getKibanaRequest?: () => KibanaRequest; - /** - * Returns the state (true|false) of the sync colors across panels switch. - */ - isSyncColorsEnabled?: () => boolean; - /** - * Returns the state (true|false) of the sync cursor across panels switch. - */ - isSyncCursorEnabled?: () => boolean; - /** - * Returns the state (true|false) of the sync tooltips across panels switch. - */ - isSyncTooltipsEnabled?: () => boolean; - /** - * Contains the meta-data about the source of the expression. - */ - getExecutionContext: () => KibanaExecutionContext | undefined; - /** - * Logs datatable. - */ - logDatatable?(name: string, datatable: Datatable): void; -} -/** - * Default inspector adapters created if inspector adapters are not set explicitly. - */ -export interface DefaultInspectorAdapters { - requests: RequestAdapter; - tables: TablesAdapter; - expression: ExpressionsInspectorAdapter; -} diff --git a/src/platform/plugins/shared/expressions/common/executor/container.d.ts b/src/platform/plugins/shared/expressions/common/executor/container.d.ts deleted file mode 100644 index dcecc7cf05a0b..0000000000000 --- a/src/platform/plugins/shared/expressions/common/executor/container.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { StateContainer } from '@kbn/kibana-utils-plugin/common/state_containers'; -import type { ExpressionFunction } from '../expression_functions'; -import type { ExpressionType } from '../expression_types'; -export interface ExecutorState = Record> { - functions: Record; - types: Record; - context: Context; -} -export declare const defaultState: ExecutorState; -export interface ExecutorPureTransitions { - addFunction: (state: ExecutorState) => (fn: ExpressionFunction) => ExecutorState; - addType: (state: ExecutorState) => (type: ExpressionType) => ExecutorState; -} -export declare const pureTransitions: ExecutorPureTransitions; -export interface ExecutorPureSelectors { - getFunction: (state: ExecutorState) => (id: string) => ExpressionFunction | null; - getType: (state: ExecutorState) => (id: string) => ExpressionType | null; - getContext: (state: ExecutorState) => () => ExecutorState['context']; -} -export declare const pureSelectors: ExecutorPureSelectors; -export type ExecutorContainer = Record> = StateContainer, ExecutorPureTransitions, ExecutorPureSelectors>; -export declare const createExecutorContainer: = Record>(state?: ExecutorState) => ExecutorContainer; diff --git a/src/platform/plugins/shared/expressions/common/executor/executor.d.ts b/src/platform/plugins/shared/expressions/common/executor/executor.d.ts deleted file mode 100644 index f16765a1ae3c4..0000000000000 --- a/src/platform/plugins/shared/expressions/common/executor/executor.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/logging'; -import type { SavedObjectReference } from '@kbn/core/types'; -import type { MigrateFunctionsObject, PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common'; -import type { ExecutorState, ExecutorContainer } from './container'; -import type { AnyExpressionFunctionDefinition } from '../expression_functions'; -import { ExpressionFunction } from '../expression_functions'; -import type { ExecutionResult, FunctionCacheItem } from '../execution/execution'; -import { Execution } from '../execution/execution'; -import type { IRegistry } from '../types'; -import { ExpressionType } from '../expression_types/expression_type'; -import type { AnyExpressionTypeDefinition } from '../expression_types/types'; -import type { ExpressionAstExpression } from '../ast'; -import type { ExpressionValueError } from '../expression_types/specs'; -import type { ExpressionExecutionParams } from '../service'; -export interface ExpressionExecOptions { - /** - * Whether to execute expression in *debug mode*. In *debug mode* inputs and - * outputs as well as all resolved arguments and time it took to execute each - * function are saved and are available for introspection. - */ - debug?: boolean; -} -export declare class TypesRegistry implements IRegistry { - private readonly executor; - constructor(executor: Executor); - register(typeDefinition: AnyExpressionTypeDefinition | (() => AnyExpressionTypeDefinition)): void; - get(id: string): ExpressionType | null; - toJS(): Record; - toArray(): ExpressionType[]; -} -export declare class FunctionsRegistry implements IRegistry { - private readonly executor; - constructor(executor: Executor); - register(functionDefinition: AnyExpressionFunctionDefinition | (() => AnyExpressionFunctionDefinition)): void; - get(id: string): ExpressionFunction | null; - toJS(): Record; - toArray(): ExpressionFunction[]; -} -export declare class Executor = Record> implements PersistableStateService { - private readonly logger?; - static createWithDefaults = Record>(logger?: Logger, state?: ExecutorState): Executor; - readonly container: ExecutorContainer; - /** - * @deprecated - */ - readonly functions: FunctionsRegistry; - /** - * @deprecated - */ - readonly types: TypesRegistry; - private functionCache; - constructor(logger?: Logger | undefined, state?: ExecutorState, functionCache?: Map); - get state(): ExecutorState; - registerFunction(functionDefinition: AnyExpressionFunctionDefinition | (() => AnyExpressionFunctionDefinition)): void; - getFunction(name: string, namespace?: string): ExpressionFunction | undefined; - getFunctions(namespace?: string): Record; - registerType(typeDefinition: AnyExpressionTypeDefinition | (() => AnyExpressionTypeDefinition)): void; - getType(name: string): ExpressionType | undefined; - getTypes(): Record; - get context(): Record; - /** - * Execute expression and return result. - * - * @param ast Expression AST or a string representing expression. - * @param input Initial input to the first expression function. - * @param context Extra global context object that will be merged into the - * expression global context object that is provided to each function to allow side-effects. - */ - run(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): Observable>; - createExecution(ast: string | ExpressionAstExpression, params?: ExpressionExecutionParams): Execution; - private walkAst; - private walkAstAndTransform; - inject(ast: ExpressionAstExpression, references: SavedObjectReference[]): ExpressionAstExpression; - extract(ast: ExpressionAstExpression): { - state: ExpressionAstExpression; - references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; - }; - telemetry(ast: ExpressionAstExpression, telemetryData: Record): Record; - getAllMigrations(): MigrateFunctionsObject; - migrateToLatest(state: VersionedState): ExpressionAstExpression; - private migrate; -} diff --git a/src/platform/plugins/shared/expressions/common/executor/index.d.ts b/src/platform/plugins/shared/expressions/common/executor/index.d.ts deleted file mode 100644 index 65aeae07d9f24..0000000000000 --- a/src/platform/plugins/shared/expressions/common/executor/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './container'; -export * from './executor'; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/arguments.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/arguments.d.ts deleted file mode 100644 index f3391ed85a3bb..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/arguments.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -import type { KnownTypeToString, TypeString, UnmappedTypeStrings } from '../types/common'; -/** - * This type represents all of the possible combinations of properties of an - * Argument in an Expression Function. The presence or absence of certain fields - * influence the shape and presence of others within each `arg` in the specification. - */ -export type ArgumentType = SingleArgumentType | MultipleArgumentType | UnresolvedSingleArgumentType | UnresolvedMultipleArgumentType; -/** - * Map the type within the the generic array to a string-based - * representation of the type. - */ -type ArrayTypeToArgumentString = T extends Array ? TypeString : T extends null ? 'null' : never; -/** - * Map the return type of the function within the generic to a - * string-based representation of the return type. - */ -type UnresolvedTypeToArgumentString = T extends (...args: any[]) => infer ElementType ? TypeString : T extends null ? 'null' : never; -/** - * Map the array-based return type of the function within the generic to a - * string-based representation of the return type. - */ -type UnresolvedArrayTypeToArgumentString = T extends Array<(...args: any[]) => infer ElementType> ? TypeString : T extends (...args: any[]) => infer ElementType ? ArrayTypeToArgumentString : T extends null ? 'null' : never; -/** A type containing properties common to all Function Arguments. */ -interface BaseArgumentType { - /** Alternate names for the Function valid for use in the Expression Editor */ - aliases?: string[]; - /** - * The flag to mark the function parameter as deprecated. - */ - deprecated?: boolean; - /** Help text for the Argument to be displayed in the Expression Editor */ - help: string; - /** Default options for the Argument */ - options?: T[]; - /** - * Is this Argument required? - * @default false - */ - required?: boolean; - /** - * If false, the Argument is supplied as a function to be invoked in the - * implementation, rather than a value. - * @default true - */ - resolve?: boolean; - /** - * Turns on strict options checking. - * @default false - * @deprecated This option is added for backward compatibility and will be removed - * as soon as all the functions list all the available options. - */ - strict?: boolean; - /** Names of types that are valid values of the Argument. */ - types?: string[]; - /** The optional default value of the Argument. */ - default?: T | string; - /** - * If true, multiple values may be supplied to the Argument. - * @default false - */ - multi?: boolean; -} -/** - * The `types` array in a `FunctionSpec` should contain string - * representations of the `ArgumentsSpec` types: - * - * `someArgument: boolean | string` results in `types: ['boolean', 'string']` - */ -type SingleArgumentType = BaseArgumentType & { - multi?: false; - resolve?: true; - types?: Array | UnmappedTypeStrings>; -}; -/** - * If the `multi` property on the argument is true, the `types` array should - * contain string representations of the `ArgumentsSpec` array types: - * - * `someArgument: boolean[] | string[]` results in: `types: ['boolean', 'string']` - */ -type MultipleArgumentType = BaseArgumentType & { - multi: true; - resolve?: true; - types?: Array | UnmappedTypeStrings>; -}; -/** - * If the `resolve` property on the arugument is false, the `types` array, if - * present, should contain string representations of the result of the argument - * function: - * - * `someArgument: () => string` results in `types: ['string']` - */ -type UnresolvedSingleArgumentType = BaseArgumentType & { - multi?: false; - resolve: false; - types?: Array | UnmappedTypeStrings>; -}; -/** - * If the `resolve` property on the arugument is false, the `types` array, if - * present, should contain string representations of the result of the argument - * function: - * - * `someArgument: () => string[]` results in `types: ['string']` - */ -type UnresolvedMultipleArgumentType = BaseArgumentType & { - multi: true; - resolve: false; - types?: Array | UnmappedTypeStrings>; -}; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/expression_function.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/expression_function.d.ts deleted file mode 100644 index ba704d7945ade..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/expression_function.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { SavedObjectReference } from '@kbn/core/types'; -import type { MigrateFunctionsObject, GetMigrationFunctionObjectFn, PersistableState } from '@kbn/kibana-utils-plugin/common'; -import type { AnyExpressionFunctionDefinition } from './types'; -import { ExpressionFunctionParameter } from './expression_function_parameter'; -import type { ExpressionValue } from '../expression_types/types'; -import type { ExpressionAstFunction } from '../ast'; -export declare class ExpressionFunction implements PersistableState { - /** - * Name of function - */ - name: string; - namespace?: string; - /** - * Aliases that can be used instead of `name`. - */ - aliases: string[]; - /** - * Return type of function. This SHOULD be supplied. We use it for UI - * and autocomplete hinting. We may also use it for optimizations in - * the future. - */ - type: string; - /** - * Opt-in to caching this function. By default function outputs are cached and given the same inputs cached result is returned. - */ - allowCache: boolean | { - withSideEffects: (params: Record, handlers: object) => () => void; - }; - /** - * Function to run function (context, args) - */ - fn: (input: ExpressionValue, params: Record, handlers: object) => ExpressionValue; - /** - * A short help text. - */ - help: string; - /** - * Specification of expression function parameters. - */ - args: Record; - /** - * Type of inputs that this function supports. - */ - inputTypes: string[] | undefined; - disabled: boolean; - /** - * Deprecation flag. - */ - deprecated: boolean; - telemetry: (state: ExpressionAstFunction['arguments'], telemetryData: Record) => Record; - extract: (state: ExpressionAstFunction['arguments']) => { - state: ExpressionAstFunction['arguments']; - references: SavedObjectReference[]; - }; - inject: (state: ExpressionAstFunction['arguments'], references: SavedObjectReference[]) => ExpressionAstFunction['arguments']; - migrations: MigrateFunctionsObject | GetMigrationFunctionObjectFn; - constructor(functionDefinition: AnyExpressionFunctionDefinition); - accepts: (type: string) => boolean; -} diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/expression_function_parameter.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/expression_function_parameter.d.ts deleted file mode 100644 index b7d91c62a3e97..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/expression_function_parameter.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ArgumentType } from './arguments'; -export declare class ExpressionFunctionParameter { - name: string; - required: boolean; - help: string; - types: ArgumentType['types']; - default?: ArgumentType['default']; - aliases: string[]; - deprecated: boolean; - multi: boolean; - resolve: boolean; - /** - * @deprecated - */ - strict?: boolean; - options: T[]; - constructor(name: string, arg: ArgumentType); - accepts(type: string): boolean; -} diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/index.d.ts deleted file mode 100644 index f81e44dba45d2..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type * from './types'; -export type * from './arguments'; -export * from './expression_function_parameter'; -export * from './expression_function'; -export * from './specs'; -export * from './series_calculation_helpers'; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/series_calculation_helpers.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/series_calculation_helpers.d.ts deleted file mode 100644 index 74cc1209b599c..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/series_calculation_helpers.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Datatable, DatatableRow } from '../expression_types'; -/** - * Returns a string identifying the group of a row by a list of columns to group by - */ -export declare function getBucketIdentifier(row: DatatableRow, groupColumns?: string[]): string; -/** - * Checks whether input and output columns are defined properly - * and builds column array of the output table if that's the case. - * - * * Throws an error if the output column exists already. - * * Returns undefined if the input column doesn't exist. - * @param input Input datatable - * @param outputColumnId Id of the output column - * @param inputColumnId Id of the input column - * @param outputColumnName Optional name of the output column - * @param options Optional options, set `allowColumnOverwrite` to true to not raise an exception if the output column exists already - */ -export declare function buildResultColumns(input: Datatable, outputColumnId: string, inputColumnId: string, outputColumnName: string | undefined, options?: { - allowColumnOverwrite: boolean; -}): import("../expression_types").DatatableColumn[] | undefined; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/clog.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/clog.d.ts deleted file mode 100644 index aca138282f45b..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/clog.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -export type ExpressionFunctionClog = ExpressionFunctionDefinition<'clog', unknown, {}, unknown>; -export declare const clog: ExpressionFunctionClog; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/create_table.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/create_table.d.ts deleted file mode 100644 index 6bf741028ac6b..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/create_table.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -import type { Datatable } from '../../expression_types'; -export interface CreateTableArguments { - ids?: string[]; - names?: string[] | null; - rowCount?: number; -} -export declare const createTable: ExpressionFunctionDefinition<'createTable', null, CreateTableArguments, Datatable>; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum.d.ts deleted file mode 100644 index 49a7f53fc1b71..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -import type { Datatable } from '../../expression_types'; -export interface CumulativeSumArgs { - by?: string[]; - inputColumnId: string; - outputColumnId: string; - outputColumnName?: string; -} -export type ExpressionFunctionCumulativeSum = ExpressionFunctionDefinition<'cumulative_sum', Datatable, CumulativeSumArgs, Promise>; -/** - * Calculates the cumulative sum of a specified column in the data table. - * - * Also supports multiple series in a single data table - use the `by` argument - * to specify the columns to split the calculation by. - * For each unique combination of all `by` columns a separate cumulative sum will be calculated. - * The order of rows won't be changed - this function is not modifying any existing columns, it's only - * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. - * - * Behavior: - * * Will write the cumulative sum of `inputColumnId` into `outputColumnId` - * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` - * * Cumulative sums always start with 0, a cell will contain its own value plus the values of - * all cells of the same series further up in the table. - * - * Edge cases: - * * Will return the input table if `inputColumnId` does not exist - * * Will throw an error if `outputColumnId` exists already in provided data table - * * If the row value contains `null` or `undefined`, it will be ignored and overwritten with the cumulative sum of - * all cells of the same series further up in the table. - * * For all values besides `null` and `undefined`, the value will be cast to a number before it's added to the - * cumulative sum of the current series - if this results in `NaN` (like in case of objects), all cells of the - * current series will be set to `NaN`. - * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings - * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. - * Missing values (`null` and `undefined`) will be treated as empty strings. - */ -export declare const cumulativeSum: ExpressionFunctionCumulativeSum; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum_fn.d.ts deleted file mode 100644 index cd5df51a982a6..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum_fn.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Datatable } from '../../expression_types'; -import type { CumulativeSumArgs } from './cumulative_sum'; -export declare const cumulativeSumFn: (input: Datatable, { by, inputColumnId, outputColumnId, outputColumnName }: CumulativeSumArgs) => Datatable; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative.d.ts deleted file mode 100644 index 4b56eab96721f..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -import type { Datatable } from '../../expression_types'; -export interface DerivativeArgs { - by?: string[]; - inputColumnId: string; - outputColumnId: string; - outputColumnName?: string; -} -export type ExpressionFunctionDerivative = ExpressionFunctionDefinition<'derivative', Datatable, DerivativeArgs, Promise>; -/** - * Calculates the derivative of a specified column in the data table. - * - * Also supports multiple series in a single data table - use the `by` argument - * to specify the columns to split the calculation by. - * For each unique combination of all `by` columns a separate derivative will be calculated. - * The order of rows won't be changed - this function is not modifying any existing columns, it's only - * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. - * - * Behavior: - * * Will write the derivative of `inputColumnId` into `outputColumnId` - * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` - * * Derivative always start with an undefined value for the first row of a series, a cell will contain its own value minus the - * value of the previous cell of the same series. - * - * Edge cases: - * * Will return the input table if `inputColumnId` does not exist - * * Will throw an error if `outputColumnId` exists already in provided data table - * * If there is no previous row of the current series with a non `null` or `undefined` value, the output cell of the current row - * will be set to `undefined`. - * * If the row value contains `null` or `undefined`, it will be ignored and the output cell will be set to `undefined` - * * If the value of the previous row of the same series contains `null` or `undefined`, the output cell of the current row will be set to `undefined` as well - * * For all values besides `null` and `undefined`, the value will be cast to a number before it's used in the - * calculation of the current series even if this results in `NaN` (like in case of objects). - * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings - * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. - * Missing values (`null` and `undefined`) will be treated as empty strings. - */ -export declare const derivative: ExpressionFunctionDerivative; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative_fn.d.ts deleted file mode 100644 index ef1f332776f67..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative_fn.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { Datatable } from '../../expression_types'; -import type { DerivativeArgs } from './derivative'; -/** - * Calculates the derivative of a specified column in the data table. - * - * Also supports multiple series in a single data table - use the `by` argument - * to specify the columns to split the calculation by. - * For each unique combination of all `by` columns a separate derivative will be calculated. - * The order of rows won't be changed - this function is not modifying any existing columns, it's only - * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. - * - * Behavior: - * * Will write the derivative of `inputColumnId` into `outputColumnId` - * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` - * * Derivative always start with an undefined value for the first row of a series, a cell will contain its own value minus the - * value of the previous cell of the same series. - * - * Edge cases: - * * Will return the input table if `inputColumnId` does not exist - * * Will throw an error if `outputColumnId` exists already in provided data table - * * If there is no previous row of the current series with a non `null` or `undefined` value, the output cell of the current row - * will be set to `undefined`. - * * If the row value contains `null` or `undefined`, it will be ignored and the output cell will be set to `undefined` - * * If the value of the previous row of the same series contains `null` or `undefined`, the output cell of the current row will be set to `undefined` as well - * * For all values besides `null` and `undefined`, the value will be cast to a number before it's used in the - * calculation of the current series even if this results in `NaN` (like in case of objects). - * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings - * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. - * Missing values (`null` and `undefined`) will be treated as empty strings. - */ -export declare const derivativeFn: (input: Datatable, { by, inputColumnId, outputColumnId, outputColumnName }: DerivativeArgs) => Datatable; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/font.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/font.d.ts deleted file mode 100644 index 5f18104a3de21..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/font.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -import type { FontLabel as FontFamily } from '../../fonts'; -import type { Style } from '../../types'; -import { FontWeight, TextAlignment } from '../../types'; -export interface FontArguments { - align?: TextAlignment; - color?: string; - family?: FontFamily; - italic?: boolean; - lHeight?: number | null; - size?: number; - underline?: boolean; - weight?: FontWeight; - sizeUnit?: string; -} -export type ExpressionFunctionFont = ExpressionFunctionDefinition<'font', null, FontArguments, Style>; -export declare const font: ExpressionFunctionFont; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/index.d.ts deleted file mode 100644 index a49f009a33d3d..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './clog'; -export * from './create_table'; -export * from './font'; -export * from './var_set'; -export * from './var'; -export * from './theme'; -export * from './cumulative_sum'; -export * from './overall_metric'; -export * from './derivative'; -export * from './moving_average'; -export * from './ui_setting'; -export * from './math_column'; -export type { MapColumnArguments } from './map_column'; -export { mapColumn } from './map_column'; -export type { MathArguments, MathInput } from './math'; -export { math } from './math'; -export type { MathColumnArguments } from './math_column'; -export { mathColumn } from './math_column'; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/map_column.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/map_column.d.ts deleted file mode 100644 index c2c836e925501..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/map_column.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { ExpressionFunctionDefinition } from '../types'; -import type { Datatable } from '../../expression_types'; -export interface MapColumnArguments { - id?: string | null; - name: string; - expression(datatable: Datatable): Observable; - copyMetaFrom?: string | null; -} -export declare const mapColumn: ExpressionFunctionDefinition<'mapColumn', Datatable, MapColumnArguments, Observable>; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math.d.ts deleted file mode 100644 index fb63dfa78f294..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -import type { Datatable } from '../../expression_types'; -export type MathArguments = { - expression: string; - onError?: 'null' | 'zero' | 'false' | 'throw'; -}; -export type MathInput = number | Datatable; -export declare const math: ExpressionFunctionDefinition<'math', MathInput, MathArguments, Promise>; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_column.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_column.d.ts deleted file mode 100644 index 61b9d6693da00..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_column.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -import type { MathArguments } from './math'; -import type { Datatable } from '../../expression_types'; -export type MathColumnArguments = MathArguments & { - id: string; - name?: string; - castColumns?: string[]; - copyMetaFrom?: string | null; -}; -export type ExpressionFunctionMathColumn = ExpressionFunctionDefinition<'mathColumn', Datatable, MathColumnArguments, Promise>; -export declare const mathColumn: ExpressionFunctionMathColumn; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_fn.d.ts deleted file mode 100644 index cb997a7d47ff3..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_fn.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { MathArguments, MathInput } from './math'; -export declare const errors: { - emptyExpression: () => Error; - tooManyResults: () => Error; - executionFailed: () => Error; - emptyDatatable: () => Error; -}; -export declare const mathFn: (input: MathInput, args: MathArguments) => boolean | number | null; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average.d.ts deleted file mode 100644 index 1e4446a7bd67e..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -import type { Datatable } from '../../expression_types'; -export interface MovingAverageArgs { - by?: string[]; - inputColumnId: string; - outputColumnId: string; - outputColumnName?: string; - window: number; -} -export type ExpressionFunctionMovingAverage = ExpressionFunctionDefinition<'moving_average', Datatable, MovingAverageArgs, Promise>; -/** - * Calculates the moving average of a specified column in the data table. - * - * Also supports multiple series in a single data table - use the `by` argument - * to specify the columns to split the calculation by. - * For each unique combination of all `by` columns a separate moving average will be calculated. - * The order of rows won't be changed - this function is not modifying any existing columns, it's only - * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. - * - * Behavior: - * * Will write the moving average of `inputColumnId` into `outputColumnId` - * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` - * * Moving average always starts with an undefined value for the first row of a series. Each next cell will contain sum of the last - * * [window] of values divided by [window] excluding the current bucket. - * If either of window edges moves outside the borders of data series, the window shrinks to include available values only. - * - * Edge cases: - * * Will return the input table if `inputColumnId` does not exist - * * Will throw an error if `outputColumnId` exists already in provided data table - * * If null or undefined value is encountered, skip the current row and do not change the window - * * For all values besides `null` and `undefined`, the value will be cast to a number before it's used in the - * calculation of the current series even if this results in `NaN` (like in case of objects). - * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings - * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. - */ -export declare const movingAverage: ExpressionFunctionMovingAverage; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average_fn.d.ts deleted file mode 100644 index 2de0bd6131809..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average_fn.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Datatable } from '../../expression_types'; -import type { MovingAverageArgs } from './moving_average'; -/** - * Calculates the moving average of a specified column in the data table. - * - * Also supports multiple series in a single data table - use the `by` argument - * to specify the columns to split the calculation by. - * For each unique combination of all `by` columns a separate moving average will be calculated. - * The order of rows won't be changed - this function is not modifying any existing columns, it's only - * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. - * - * Behavior: - * * Will write the moving average of `inputColumnId` into `outputColumnId` - * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` - * * Moving average always starts with an undefined value for the first row of a series. Each next cell will contain sum of the last - * * [window] of values divided by [window] excluding the current bucket. - * If either of window edges moves outside the borders of data series, the window shrinks to include available values only. - * - * Edge cases: - * * Will return the input table if `inputColumnId` does not exist - * * Will throw an error if `outputColumnId` exists already in provided data table - * * If null or undefined value is encountered, skip the current row and do not change the window - * * For all values besides `null` and `undefined`, the value will be cast to a number before it's used in the - * calculation of the current series even if this results in `NaN` (like in case of objects). - * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings - * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. - */ -export declare const movingAverageFn: (input: Datatable, { by, inputColumnId, outputColumnId, outputColumnName, window }: MovingAverageArgs) => Datatable; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric.d.ts deleted file mode 100644 index bbba36f5fbb32..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -import type { Datatable } from '../../expression_types'; -export interface OverallMetricArgs { - by?: string[]; - inputColumnId: string; - outputColumnId: string; - outputColumnName?: string; - metric: 'sum' | 'min' | 'max' | 'average'; -} -export type ExpressionFunctionOverallMetric = ExpressionFunctionDefinition<'overall_metric', Datatable, OverallMetricArgs, Promise>; -/** - * Calculates the overall metric of a specified column in the data table. - * - * Also supports multiple series in a single data table - use the `by` argument - * to specify the columns to split the calculation by. - * For each unique combination of all `by` columns a separate overall metric will be calculated. - * The order of rows won't be changed - this function is not modifying any existing columns, it's only - * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. - * - * Behavior: - * * Will write the overall metric of `inputColumnId` into `outputColumnId` - * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` - * * Each cell will contain the calculated metric based on the values of all cells belonging to the current series. - * - * Edge cases: - * * Will return the input table if `inputColumnId` does not exist - * * Will throw an error if `outputColumnId` exists already in provided data table - * * If the row value contains `null` or `undefined`, it will be ignored and overwritten with the overall metric of - * all cells of the same series. - * * For all values besides `null` and `undefined`, the value will be cast to a number before it's added to the - * overall metric of the current series - if this results in `NaN` (like in case of objects), all cells of the - * current series will be set to `NaN`. - * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings - * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. - * Missing values (`null` and `undefined`) will be treated as empty strings. - */ -export declare const overallMetric: ExpressionFunctionOverallMetric; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric_fn.d.ts deleted file mode 100644 index a6e5c8b7ccc7c..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric_fn.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Datatable } from '../../expression_types'; -import type { OverallMetricArgs } from './overall_metric'; -/** - * Calculates the overall metric of a specified column in the data table. - * - * Also supports multiple series in a single data table - use the `by` argument - * to specify the columns to split the calculation by. - * For each unique combination of all `by` columns a separate overall metric will be calculated. - * The order of rows won't be changed - this function is not modifying any existing columns, it's only - * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. - * - * Behavior: - * * Will write the overall metric of `inputColumnId` into `outputColumnId` - * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` - * * Each cell will contain the calculated metric based on the values of all cells belonging to the current series. - * - * Edge cases: - * * Will return the input table if `inputColumnId` does not exist - * * Will throw an error if `outputColumnId` exists already in provided data table - * * If the row value contains `null` or `undefined`, it will be ignored and overwritten with the overall metric of - * all cells of the same series. - * * For all values besides `null` and `undefined`, the value will be cast to a number before it's added to the - * overall metric of the current series - if this results in `NaN` (like in case of objects), all cells of the - * current series will be set to `NaN`. - * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings - * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. - * Missing values (`null` and `undefined`) will be treated as empty strings. - */ -export declare const overallMetricFn: (input: Datatable, { by, inputColumnId, outputColumnId, outputColumnName, metric }: OverallMetricArgs) => Datatable; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/theme.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/theme.d.ts deleted file mode 100644 index 01151e2654a7d..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/theme.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -interface Arguments { - variable: string; - default?: string | number | boolean; -} -type Output = unknown; -export type ExpressionFunctionTheme = ExpressionFunctionDefinition<'theme', null, Arguments, Output>; -export declare const theme: ExpressionFunctionTheme; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/ui_setting.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/ui_setting.d.ts deleted file mode 100644 index 9ba3085d4c412..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/ui_setting.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -import type { ExpressionFunctionDefinition } from '../..'; -import type { UiSetting } from '../../expression_types/specs/ui_setting'; -/** - * Note: The UiSettings client interface is different between the browser and server. - * For that reason we can't expose a common getUiSettingFn for both environments. - * To maintain the consistency with the current file structure, we expose 2 separate functions - * from this file inside the "common" folder. - */ -interface UiSettingsClientBrowser { - get(key: string, defaultValue?: T): T | Promise; -} -interface UiSettingStartDependenciesBrowser { - uiSettings: UiSettingsClientBrowser; -} -interface UiSettingFnArgumentsBrowser { - getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; -} -interface UiSettingsClientServer { - get(key: string): T | Promise; -} -interface UiSettingStartDependenciesServer { - uiSettings: UiSettingsClientServer; -} -interface UiSettingFnArgumentsServer { - getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; -} -export interface UiSettingArguments { - default?: unknown; - parameter: string; -} -export type ExpressionFunctionUiSetting = ExpressionFunctionDefinition<'uiSetting', unknown, UiSettingArguments, Promise>; -export declare function getUiSettingFnBrowser({ getStartDependencies, }: UiSettingFnArgumentsBrowser): ExpressionFunctionUiSetting; -export declare function getUiSettingFnServer({ getStartDependencies, }: UiSettingFnArgumentsServer): ExpressionFunctionUiSetting; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/var.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/var.d.ts deleted file mode 100644 index 4877c7f314f57..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/var.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ExpressionFunctionDefinition } from '../types'; -interface Arguments { - name: string; -} -export type ExpressionFunctionVar = ExpressionFunctionDefinition<'var', unknown, Arguments, unknown>; -export declare const variable: ExpressionFunctionVar; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/var_set.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/var_set.d.ts deleted file mode 100644 index 68aa040854c0c..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/specs/var_set.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Serializable } from '@kbn/utility-types'; -import type { ExpressionFunctionDefinition } from '../types'; -interface Arguments { - name: string[]; - value?: Serializable[]; -} -export type ExpressionFunctionVarSet = ExpressionFunctionDefinition<'var_set', unknown, Arguments, unknown>; -export declare const variableSet: ExpressionFunctionVarSet; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/types.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/types.d.ts deleted file mode 100644 index 7856ec0342f55..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_functions/types.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -import type { PersistableStateDefinition } from '@kbn/kibana-utils-plugin/common'; -import type { ArgumentType } from './arguments'; -import type { TypeToString, TypeString, UnmappedTypeStrings } from '../types/common'; -import type { ExecutionContext } from '../execution/types'; -import type { ExpressionFunctionClog, ExpressionFunctionFont, ExpressionFunctionVarSet, ExpressionFunctionVar, ExpressionFunctionTheme, ExpressionFunctionCumulativeSum, ExpressionFunctionDerivative, ExpressionFunctionMovingAverage, ExpressionFunctionOverallMetric, ExpressionFunctionMathColumn } from './specs'; -import type { ExpressionAstFunction } from '../ast'; -/** - * `ExpressionFunctionDefinition` is the interface plugins have to implement to - * register a function in `expressions` plugin. - */ -export interface ExpressionFunctionDefinition, Output, Context extends ExecutionContext = ExecutionContext> extends PersistableStateDefinition { - /** - * The name of the function, as will be used in expression. - */ - name: Name; - /** - * The flag to mark the function as deprecated. - */ - deprecated?: boolean; - /** - * if set to true function will be disabled (but its migrate function will still be available) - */ - disabled?: boolean; - namespace?: string; - /** - * Name of type of value this function outputs. - */ - type?: TypeString | UnmappedTypeStrings; - /** - * Opt-in to caching this function. By default function outputs are cached and given the same inputs cached result is returned. - * - * It is possible to collect side effects produced by the function - * (e.g. logging, sending events to the server, etc.) and return a - * handler to reproduce such side effects when the function cache is used - * instead of the original function implementation. - * @param args Parameters set for this function in expression. - * @param context Object with functions to perform side effects. This object - * is created for the duration of the execution of expression and is the - * same for all functions in expression chain. - * @returns A handler to be called to reproduce side effects when the function cache is used. - * - */ - allowCache?: boolean | { - withSideEffects(args: Arguments, context: Context): () => void; - }; - /** - * List of allowed type names for input value of this function. If this - * property is set the input of function will be cast to the first possible - * type in this list. If this property is missing the input will be provided - * to the function as-is. - */ - inputTypes?: Array>; - /** - * Specification of arguments that function supports. This list will also be - * used for autocomplete functionality when your function is being edited. - */ - args: { - [key in keyof Arguments]: ArgumentType; - }; - /** - * @todo What is this? - */ - aliases?: string[]; - /** - * Help text displayed in the Expression editor. This text should be - * internationalized. - */ - help: string; - /** - * The actual implementation of the function. - * - * @param input Output of the previous function, or initial input. - * @param args Parameters set for this function in expression. - * @param context Object with functions to perform side effects. This object - * is created for the duration of the execution of expression and is the - * same for all functions in expression chain. - */ - fn(input: Input, args: Arguments, context: Context): Output; - /** - * @deprecated Use `inputTypes` instead. - */ - context?: { - /** - * @deprecated This is alias for `inputTypes`, use `inputTypes` instead. - */ - types: AnyExpressionFunctionDefinition['inputTypes']; - }; -} -/** - * Type to capture every possible expression function definition. - */ -export type AnyExpressionFunctionDefinition = ExpressionFunctionDefinition, any>; -/** - * A mapping of `ExpressionFunctionDefinition`s for functions which the - * Expressions services provides out-of-the-box. Any new functions registered - * by the Expressions plugin should have their types added here. - * - * @public - */ -export interface ExpressionFunctionDefinitions { - clog: ExpressionFunctionClog; - font: ExpressionFunctionFont; - var_set: ExpressionFunctionVarSet; - var: ExpressionFunctionVar; - theme: ExpressionFunctionTheme; - cumulative_sum: ExpressionFunctionCumulativeSum; - overall_metric: ExpressionFunctionOverallMetric; - derivative: ExpressionFunctionDerivative; - moving_average: ExpressionFunctionMovingAverage; - math_column: ExpressionFunctionMathColumn; -} diff --git a/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer.d.ts b/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer.d.ts deleted file mode 100644 index 4b4a3b0990556..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ExpressionRenderDefinition } from './types'; -export declare class ExpressionRenderer { - readonly name: string; - readonly namespace?: string; - readonly displayName: string; - readonly help: string; - readonly validate: () => void | Error; - readonly reuseDomNode: boolean; - readonly render: ExpressionRenderDefinition['render']; - constructor(config: ExpressionRenderDefinition); -} diff --git a/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer_registry.d.ts b/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer_registry.d.ts deleted file mode 100644 index bfa562f4c9985..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer_registry.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IRegistry } from '../types'; -import { ExpressionRenderer } from './expression_renderer'; -import type { AnyExpressionRenderDefinition } from './types'; -export declare class ExpressionRendererRegistry implements IRegistry { - private readonly renderers; - register(definition: AnyExpressionRenderDefinition | (() => AnyExpressionRenderDefinition)): void; - get(id: string): ExpressionRenderer | null; - toJS(): Record; - toArray(): ExpressionRenderer[]; -} diff --git a/src/platform/plugins/shared/expressions/common/expression_renderers/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_renderers/index.d.ts deleted file mode 100644 index ee7055431edc6..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_renderers/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type * from './types'; -export * from './expression_renderer'; -export * from './expression_renderer_registry'; diff --git a/src/platform/plugins/shared/expressions/common/expression_renderers/types.d.ts b/src/platform/plugins/shared/expressions/common/expression_renderers/types.d.ts deleted file mode 100644 index 15c2666830fc3..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_renderers/types.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; -import type { ExpressionAstExpression } from '../ast'; -export interface ExpressionRenderDefinition { - /** - * Technical name of the renderer, used as ID to identify renderer in - * expression renderer registry. This must match the name of the expression - * function that is used to create the `type: render` object. - */ - name: string; - namespace?: string; - /** - * A user friendly name of the renderer as will be displayed to user in UI. - */ - displayName?: string; - /** - * Help text as will be displayed to user. A sentence or few about what this - * element does. - */ - help?: string; - /** - * Used to validate the data before calling the render function. - */ - validate?: () => undefined | Error; - /** - * Tell the renderer if the dom node should be reused, it's recreated each - * time by default. - */ - reuseDomNode: boolean; - /** - * The function called to render the output data of an expression. - */ - render: (domNode: HTMLElement, config: Config, handlers: IInterpreterRenderHandlers) => void | Promise; -} -export type AnyExpressionRenderDefinition = ExpressionRenderDefinition; -/** - * Mode of the expression render environment. - * This value can be set from a consumer embedding an expression renderer and is accessible - * from within the active render function as part of the handlers. - * The following modes are supported: - * * view (default): The chart is rendered in a container with the main purpose of viewing the chart (e.g. in a container like dashboard or canvas) - * * preview: The chart is rendered in very restricted space (below 100px width and height) and should only show a rough outline - * * edit: The chart is rendered within an editor and configuration elements within the chart should be displayed - */ -export type RenderMode = 'edit' | 'preview' | 'view'; -export interface IInterpreterRenderUpdateParams { - newExpression?: string | ExpressionAstExpression; - newParams: Params; -} -export interface IInterpreterRenderEvent { - name: string; - data?: Context; -} -export interface IInterpreterRenderHandlers { - /** - * Done increments the number of rendering successes - */ - done(): void; - onDestroy(fn: () => void): void; - reload(): void; - update(params: IInterpreterRenderUpdateParams): void; - event(event: IInterpreterRenderEvent): void; - hasCompatibleActions?(event: IInterpreterRenderEvent): Promise; - getCompatibleCellValueActions?(data: object[]): Promise; - getRenderMode(): RenderMode; - /** - * The chart is rendered in a non-interactive environment and should not provide any affordances for interaction like brushing. - */ - isInteractive(): boolean; - isSyncColorsEnabled(): boolean; - isSyncCursorEnabled(): boolean; - isSyncTooltipsEnabled(): boolean; - /** - * This uiState interface is actually `PersistedState` from the visualizations plugin, - * but expressions cannot know about vis or it creates a mess of circular dependencies. - * Downstream consumers of the uiState handler will need to cast for now. - */ - uiState?: unknown; - getExecutionContext(): KibanaExecutionContext | undefined; -} diff --git a/src/platform/plugins/shared/expressions/common/expression_types/expression_type.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/expression_type.d.ts deleted file mode 100644 index f15326a3215c3..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/expression_type.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Serializable } from '@kbn/utility-types'; -import type { AnyExpressionTypeDefinition, ExpressionValue, ExpressionValueConverter } from './types'; -export declare class ExpressionType { - name: string; - namespace?: string; - /** - * A short help text. - */ - help: string; - /** - * Type validation, useful for checking function output. - */ - validate: (type: unknown) => void | Error; - create: unknown; - /** - * Optional serialization (used when passing context around client/server). - */ - serialize?: (value: Serializable) => unknown; - deserialize?: (serialized: unknown[]) => Serializable; - private readonly definition; - constructor(definition: AnyExpressionTypeDefinition); - getToFn: (typeName: string) => undefined | ExpressionValueConverter; - getFromFn: (typeName: string) => undefined | ExpressionValueConverter; - castsTo: (value: ExpressionValue) => boolean; - castsFrom: (value: ExpressionValue) => boolean; - to: (value: ExpressionValue, toTypeName: string, types: Record) => any; - from: (value: ExpressionValue, types: Record) => any; -} diff --git a/src/platform/plugins/shared/expressions/common/expression_types/get_type.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/get_type.d.ts deleted file mode 100644 index a0320d31f63c9..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/get_type.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getType(node: unknown): string; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/index.d.ts deleted file mode 100644 index 74010559242e4..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type * from './types'; -export * from './get_type'; -export * from './serialize_provider'; -export * from './expression_type'; -export * from './specs'; -export * from './unbox_expression_value'; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/serialize_provider.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/serialize_provider.d.ts deleted file mode 100644 index 4c2790d67fb77..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/serialize_provider.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ExpressionType } from './expression_type'; -import type { ExpressionValue } from './types'; -export declare const serializeProvider: (types: Record) => { - serialize: (value: ExpressionValue) => unknown; - deserialize: (value: ExpressionValue) => any; -}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/boolean.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/boolean.d.ts deleted file mode 100644 index 42da96cca52cd..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/boolean.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ExpressionTypeDefinition } from '../types'; -export declare const boolean: ExpressionTypeDefinition<'boolean', boolean>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.d.ts deleted file mode 100644 index ad917a0914e4c..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; -import type { ExpressionTypeDefinition } from '../types'; -export declare enum DimensionType { - Y_AXIS = "y", - X_AXIS = "x", - REFERENCE_LINE = "reference", - BREAKDOWN = "breakdown", - MARK_SIZE = "markSize", - SPLIT_COLUMN = "splitCol", - SPLIT_ROW = "splitRow" -} -declare const name = "datatable"; -/** - * A Utility function that Typescript can use to determine if an object is a Datatable. - * @param datatable - */ -export declare const isDatatable: (datatable: unknown) => datatable is Datatable; -/** - * This type represents the `type` of any `DatatableColumn` in a `Datatable`. - * its duplicated from KBN_FIELD_TYPES - */ -export type DatatableColumnType = '_source' | 'attachment' | 'boolean' | 'date' | 'geo_point' | 'geo_shape' | 'ip' | 'murmur3' | 'number' | 'string' | 'unknown' | 'conflict' | 'object' | 'nested' | 'histogram' | 'flattened' | 'null'; -/** - * This type represents a row in a `Datatable`. - */ -export type DatatableRow = Record; -/** - * Datatable column meta information - */ -export interface DatatableColumnMeta { - /** - * The Kibana normalized type of the column - */ - type: DatatableColumnType; - /** - * The original type of the column from ES - */ - esType?: string; - /** - * field this column is based on - */ - field?: string; - /** - * index/table this column is based on - */ - index?: string; - /** - * i18nized names the domain this column represents - */ - dimensionName?: string; - /** - * types of dimension this column represents - */ - dimensionType?: string; - /** - * serialized field format - */ - params?: SerializedFieldFormat; - /** - * source function that produced this column - */ - source?: string; - /** - * any extra parameters for the source that produced this column - */ - sourceParams?: SerializableRecord; -} -interface SourceParamsESQL extends Record { - indexPattern: string; - sourceField: string; - operationType: string; - interval?: number; -} -export declare function isSourceParamsESQL(obj: Record): obj is SourceParamsESQL; -/** - * This type represents the shape of a column in a `Datatable`. - */ -export interface DatatableColumn { - id: string; - name: string; - meta: DatatableColumnMeta; - isNull?: boolean; - isComputedColumn?: boolean; - variable?: string; -} -/** - * Metadata with statistics about the `Datatable` source. - */ -export interface DatatableMetaStatistics { - /** - * Total hits number returned for the request generated the `Datatable`. - */ - totalCount?: number; -} -/** - * The `Datatable` meta information. - */ -export interface DatatableMeta { - /** - * Statistics about the `Datatable` source. - */ - statistics?: DatatableMetaStatistics; - /** - * The `Datatable` type (e.g. `essql`, `eql`, `esdsl`, etc.). - */ - type?: string; - /** - * The `Datatable` data source. - */ - source?: string; - [key: string]: unknown; -} -/** - * A `Datatable` in Canvas is a unique structure that represents tabulated data. - */ -export interface Datatable { - type: typeof name; - columns: DatatableColumn[]; - meta?: DatatableMeta; - rows: DatatableRow[]; - warning?: string; -} -export interface SerializedDatatable extends Datatable { - rows: string[][]; -} -export declare const datatable: ExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/error.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/error.d.ts deleted file mode 100644 index 157d11752a27a..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/error.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; -import type { ErrorLike } from '../../util'; -export type ExpressionValueError = ExpressionValueBoxed<'error', { - error: ErrorLike; - info?: SerializableRecord; -}>; -export declare const isExpressionValueError: (value: unknown) => value is ExpressionValueError; -/** - * @deprecated - * - * Exported for backwards compatibility. - */ -export type InterpreterErrorType = ExpressionValueError; -export declare const error: ExpressionTypeDefinition<'error', ExpressionValueError>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/filter.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/filter.d.ts deleted file mode 100644 index 239698931e181..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/filter.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; -/** - * Represents an object that is a Filter. - */ -export type ExpressionValueFilter = ExpressionValueBoxed<'filter', { - filterType?: string; - filterGroup?: string; - value?: string; - column?: string; - and: ExpressionValueFilter[]; - to?: string; - from?: string; - query?: string | null; -}>; -export declare const filter: ExpressionTypeDefinition<'filter', ExpressionValueFilter>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/image.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/image.d.ts deleted file mode 100644 index d1033f94c9b47..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/image.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ExpressionTypeDefinition } from '../types'; -declare const name = "image"; -export interface ExpressionImage { - type: 'image'; - mode: string; - dataurl: string; -} -export declare const image: ExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/index.d.ts deleted file mode 100644 index 2c7ddfad31b11..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { AnyExpressionTypeDefinition } from '../types'; -export declare const typeSpecs: AnyExpressionTypeDefinition[]; -export * from './boolean'; -export * from './datatable'; -export * from './error'; -export * from './filter'; -export * from './image'; -export * from './null'; -export * from './num'; -export * from './number'; -export * from './pointseries'; -export * from './range'; -export * from './render'; -export * from './shape'; -export * from './string'; -export * from './style'; -export * from './ui_setting'; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/null.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/null.d.ts deleted file mode 100644 index 1554c2a27ffbe..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/null.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ExpressionTypeDefinition } from '../types'; -declare const name = "null"; -export declare const nullType: ExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/num.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/num.d.ts deleted file mode 100644 index d0120a5f7c6d2..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/num.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; -export type ExpressionValueNum = ExpressionValueBoxed<'num', { - value: number; -}>; -export declare const num: ExpressionTypeDefinition<'num', ExpressionValueNum>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/number.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/number.d.ts deleted file mode 100644 index b77f71993a375..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/number.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ExpressionTypeDefinition } from '../types'; -declare const name = "number"; -export declare const number: ExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/pointseries.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/pointseries.d.ts deleted file mode 100644 index d9a7c465bb7d6..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/pointseries.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { $Values } from '@kbn/utility-types'; -import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; -import type { DatatableRow } from './datatable'; -export declare const PointSeriesColumnNames: { - readonly X: "x"; - readonly Y: "y"; - readonly COLOR: "color"; - readonly SIZE: "size"; - readonly TEXT: "text"; -}; -/** - * Allowed column names in a PointSeries - */ -export type PointSeriesColumnName = $Values; -/** - * Column in a PointSeries - */ -export interface PointSeriesColumn { - type: 'number' | 'string'; - role: 'measure' | 'dimension'; - expression: string; -} -/** - * Represents a collection of valid Columns in a PointSeries - */ -export type PointSeriesColumns = Record | {}; -export type PointSeriesRow = DatatableRow; -/** - * A `PointSeries` is a unique structure that represents dots on a chart. - */ -export type PointSeries = ExpressionValueBoxed<'pointseries', { - columns: PointSeriesColumns; - rows: PointSeriesRow[]; -}>; -export declare const pointseries: ExpressionTypeDefinition<'pointseries', PointSeries>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/range.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/range.d.ts deleted file mode 100644 index 7e83a68d53686..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/range.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionTypeDefinition } from '../types'; -declare const name = "range"; -export interface Range { - type: typeof name; - from: number; - to: number; - label?: string; -} -export declare const range: ExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/render.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/render.d.ts deleted file mode 100644 index a3a39035fcf27..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/render.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; -declare const name = "render"; -/** - * Represents an object that is intended to be rendered. - */ -export type ExpressionValueRender = ExpressionValueBoxed; -/** - * @deprecated - * - * Use `ExpressionValueRender` instead. - */ -export type Render = ExpressionValueRender; -export declare const render: ExpressionTypeDefinition>; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/shape.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/shape.d.ts deleted file mode 100644 index 0b5b8d7cfea93..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/shape.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ExpressionTypeDefinition } from '../types'; -import type { ExpressionValueRender } from './render'; -declare const name = "shape"; -export declare const shape: ExpressionTypeDefinition>; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/string.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/string.d.ts deleted file mode 100644 index bb92451c5c377..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/string.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ExpressionTypeDefinition } from '../types'; -declare const name = "string"; -export declare const string: ExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/style.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/style.d.ts deleted file mode 100644 index 5c2b2670fb9f7..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/style.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ExpressionTypeDefinition } from '../types'; -import type { ExpressionTypeStyle } from '../../types/style'; -declare const name = "style"; -export declare const style: ExpressionTypeDefinition; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/ui_setting.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/ui_setting.d.ts deleted file mode 100644 index 6030201085fad..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/specs/ui_setting.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; -export type UiSetting = ExpressionValueBoxed<'ui_setting', { - key: string; - value: unknown; -}>; -export declare const uiSetting: ExpressionTypeDefinition<'ui_setting', UiSetting>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/types.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/types.d.ts deleted file mode 100644 index 89b41876d8c89..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/types.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { ExpressionType } from './expression_type'; -export type ExpressionValueUnboxed = any; -export type ExpressionValueBoxed = { - type: Type; -} & Value; -export type ExpressionValue = ExpressionValueUnboxed | ExpressionValueBoxed; -export type ExpressionValueConverter = (input: I, availableTypes: Record) => O; -/** - * A generic type which represents a custom Expression Type Definition that's - * registered to the Interpreter. - */ -export interface ExpressionTypeDefinition { - name: Name; - namespace?: string; - validate?(type: unknown): void | Error; - serialize?(type: Value): SerializedType; - deserialize?(type: SerializedType): Value; - from?: { - [type: string]: ExpressionValueConverter; - }; - to?: { - [type: string]: ExpressionValueConverter; - }; - help?: string; -} -export type AnyExpressionTypeDefinition = ExpressionTypeDefinition; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/unbox_expression_value.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/unbox_expression_value.d.ts deleted file mode 100644 index c3141103c6d3d..0000000000000 --- a/src/platform/plugins/shared/expressions/common/expression_types/unbox_expression_value.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ExpressionValueBoxed } from './types'; -export declare function unboxExpressionValue({ type, ...value }: ExpressionValueBoxed): T; diff --git a/src/platform/plugins/shared/expressions/common/fonts.d.ts b/src/platform/plugins/shared/expressions/common/fonts.d.ts deleted file mode 100644 index 4dd19d760a91c..0000000000000 --- a/src/platform/plugins/shared/expressions/common/fonts.d.ts +++ /dev/null @@ -1,141 +0,0 @@ -/** - * This type contains a unions of all supported font labels, or the the name of - * the font the user would see in a UI. - */ -export type FontLabel = (typeof fonts)[number]['label']; -/** - * This type contains a union of all supported font values, equivalent to the CSS - * `font-value` property. - */ -export type FontValue = (typeof fonts)[number]['value']; -/** - * An interface representing a font in Canvas, with a textual label and the CSS - * `font-value`. - */ -export interface Font { - label: FontLabel; - value: FontValue; -} -export declare const americanTypewriter: { - label: "American Typewriter"; - value: "'American Typewriter', 'Courier New', Courier, Monaco, mono"; -}; -export declare const arial: { - label: "Arial"; - value: "Arial, sans-serif"; -}; -export declare const baskerville: { - label: "Baskerville"; - value: "Baskerville, Georgia, Garamond, 'Times New Roman', Times, serif"; -}; -export declare const bookAntiqua: { - label: "Book Antiqua"; - value: "'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif"; -}; -export declare const brushScript: { - label: "Brush Script"; - value: "'Brush Script MT', 'Comic Sans', sans-serif"; -}; -export declare const chalkboard: { - label: "Chalkboard"; - value: "Chalkboard, 'Comic Sans', sans-serif"; -}; -export declare const didot: { - label: "Didot"; - value: "Didot, Georgia, Garamond, 'Times New Roman', Times, serif"; -}; -export declare const futura: { - label: "Futura"; - value: "Futura, Impact, Helvetica, Arial, sans-serif"; -}; -export declare const gillSans: { - label: "Gill Sans"; - value: "'Gill Sans', 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif"; -}; -export declare const helveticaNeue: { - label: "Helvetica Neue"; - value: "'Helvetica Neue', Helvetica, Arial, sans-serif"; -}; -export declare const hoeflerText: { - label: "Hoefler Text"; - value: "'Hoefler Text', Garamond, Georgia, 'Times New Roman', Times, serif"; -}; -export declare const inter: { - label: "Inter"; - value: "'Inter', 'Inter UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"; -}; -export declare const lucidaGrande: { - label: "Lucida Grande"; - value: "'Lucida Grande', 'Lucida Sans Unicode', Lucida, Verdana, Helvetica, Arial, sans-serif"; -}; -export declare const myriad: { - label: "Myriad"; - value: "Myriad, Helvetica, Arial, sans-serif"; -}; -export declare const openSans: { - label: "Open Sans"; - value: "'Open Sans', Helvetica, Arial, sans-serif"; -}; -export declare const optima: { - label: "Optima"; - value: "Optima, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif"; -}; -export declare const palatino: { - label: "Palatino"; - value: "Palatino, 'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif"; -}; -/** - * A collection of supported fonts. - */ -export declare const fonts: ({ - label: "American Typewriter"; - value: "'American Typewriter', 'Courier New', Courier, Monaco, mono"; -} | { - label: "Arial"; - value: "Arial, sans-serif"; -} | { - label: "Baskerville"; - value: "Baskerville, Georgia, Garamond, 'Times New Roman', Times, serif"; -} | { - label: "Book Antiqua"; - value: "'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif"; -} | { - label: "Brush Script"; - value: "'Brush Script MT', 'Comic Sans', sans-serif"; -} | { - label: "Chalkboard"; - value: "Chalkboard, 'Comic Sans', sans-serif"; -} | { - label: "Didot"; - value: "Didot, Georgia, Garamond, 'Times New Roman', Times, serif"; -} | { - label: "Futura"; - value: "Futura, Impact, Helvetica, Arial, sans-serif"; -} | { - label: "Gill Sans"; - value: "'Gill Sans', 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif"; -} | { - label: "Helvetica Neue"; - value: "'Helvetica Neue', Helvetica, Arial, sans-serif"; -} | { - label: "Hoefler Text"; - value: "'Hoefler Text', Garamond, Georgia, 'Times New Roman', Times, serif"; -} | { - label: "Inter"; - value: "'Inter', 'Inter UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"; -} | { - label: "Lucida Grande"; - value: "'Lucida Grande', 'Lucida Sans Unicode', Lucida, Verdana, Helvetica, Arial, sans-serif"; -} | { - label: "Myriad"; - value: "Myriad, Helvetica, Arial, sans-serif"; -} | { - label: "Open Sans"; - value: "'Open Sans', Helvetica, Arial, sans-serif"; -} | { - label: "Optima"; - value: "Optima, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif"; -} | { - label: "Palatino"; - value: "Palatino, 'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif"; -})[]; diff --git a/src/platform/plugins/shared/expressions/common/index.d.ts b/src/platform/plugins/shared/expressions/common/index.d.ts deleted file mode 100644 index 964c17f72853f..0000000000000 --- a/src/platform/plugins/shared/expressions/common/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export { BackgroundRepeat, BackgroundSize, Overflow, FontStyle, FontWeight, FontSizeUnit, TextDecoration, TextAlignment, } from './types'; -export type { ExpressionTypeStyle, CSSStyle, Style, TypeString, TypeToString, UnmappedTypeStrings, KnownTypeToString, IRegistry, ContainerStyle, } from './types'; -export { buildExpression, buildExpressionFunction, formatExpression, isExpressionAstBuilder, parseExpression, parse, isExpressionAst, format, } from './ast'; -export type { ExpressionAstExpression, ExpressionAstExpressionBuilder, ExpressionAstFunction, ExpressionAstFunctionBuilder, ExpressionAstNode, ExpressionAstArgument, ExpressionAstFunctionDebug, InferFunctionDefinition, } from './ast'; -export { americanTypewriter, inter, arial, fonts, bookAntiqua, brushScript, didot, futura, chalkboard, gillSans, openSans, helveticaNeue, hoeflerText, lucidaGrande, myriad, optima, palatino, baskerville, } from './fonts'; -export type { Font, FontLabel, FontValue } from './fonts'; -export { num, filter, error, image, render, number, datatable, nullType, range, pointseries, serializeProvider, typeSpecs, string, shape, style, uiSetting, boolean, isExpressionValueError, getType, unboxExpressionValue, isDatatable, ExpressionType, PointSeriesColumnNames, DimensionType, } from './expression_types'; -export type { AnyExpressionTypeDefinition, ExpressionValueError, ExpressionValueNum, ExpressionValueRender, ExpressionValueUnboxed, ExpressionValueFilter, ExpressionTypeDefinition, ExpressionValueConverter, ExpressionValueBoxed, ExpressionValue, Render, ExpressionImage, DatatableColumnType, DatatableRow, Datatable, DatatableColumn, DatatableColumnMeta, InterpreterErrorType, SerializedDatatable, PointSeries, PointSeriesColumn, PointSeriesColumnName, PointSeriesColumns, PointSeriesRow, Range, UiSetting, } from './expression_types'; -export { derivative, movingAverage, mapColumn, math, mathColumn, clog, createTable, font, variableSet, variable, theme, cumulativeSum, overallMetric, getUiSettingFnBrowser, getUiSettingFnServer, buildResultColumns, getBucketIdentifier, ExpressionFunction, } from './expression_functions'; -export type { AnyExpressionFunctionDefinition, ExpressionFunctionDefinition, ExpressionFunctionDefinitions, ExpressionFunctionParameter, ExpressionFunctionDerivative, ExpressionFunctionClog, CreateTableArguments, CumulativeSumArgs, ExpressionFunctionFont, ExpressionFunctionTheme, ExpressionFunctionUiSetting, ExpressionFunctionVar, ExpressionFunctionVarSet, DerivativeArgs, ExpressionFunctionCumulativeSum, ExpressionFunctionMovingAverage, ExpressionFunctionOverallMetric, FontArguments, MapColumnArguments, MathColumnArguments, MathArguments, MovingAverageArgs, OverallMetricArgs, ArgumentType, MathInput, UiSettingArguments, } from './expression_functions'; -export { ExpressionRenderer } from './expression_renderers'; -export type { AnyExpressionRenderDefinition, ExpressionRendererRegistry, ExpressionRenderDefinition, IInterpreterRenderEvent, IInterpreterRenderHandlers, IInterpreterRenderUpdateParams, RenderMode, } from './expression_renderers'; -export { createExecutorContainer, pureSelectors, pureTransitions, defaultState } from './executor'; -export type { Executor, ExecutorContainer, ExecutorState, ExecutorPureSelectors, ExecutorPureTransitions, ExpressionExecOptions, FunctionsRegistry, TypesRegistry, } from './executor'; -export { createExecutionContainer, executionPureTransitions } from './execution'; -export type { Execution, ExecutionContract, ExecutionContainer, ExecutionContext, ExecutionParams, ExecutionState, ExecutionPureTransitions, ExecutionResult, DefaultInspectorAdapters, } from './execution'; -export { ExpressionsService } from './service'; -export type { ExpressionsServiceSetup, ExpressionsServiceStart, ExpressionExecutionParams, ExpressionServiceParams, } from './service'; -export { createDefaultInspectorAdapters, createMockContext, createError, getByAlias, ExpressionsInspectorAdapter, TablesAdapter, } from './util'; -export type { SerializedError, ErrorLike } from './util'; diff --git a/src/platform/plugins/shared/expressions/common/service/expressions_fork.d.ts b/src/platform/plugins/shared/expressions/common/service/expressions_fork.d.ts deleted file mode 100644 index 18b0daf6c62cd..0000000000000 --- a/src/platform/plugins/shared/expressions/common/service/expressions_fork.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { ExpressionExecutionParams, ExpressionsService, ExpressionsServiceSetup, ExpressionsServiceStart } from '.'; -import type { ExpressionAstExpression } from '../ast'; -import type { AnyExpressionFunctionDefinition } from '../expression_functions'; -import type { AnyExpressionTypeDefinition } from '../expression_types'; -import type { AnyExpressionRenderDefinition } from '../expression_renderers'; -export interface ExpressionServiceFork { - setup(): ExpressionsServiceSetup; - start(): ExpressionsServiceStart; -} -/** - * `ExpressionsService` class is used for multiple purposes: - * - * 1. It implements the same Expressions service that can be used on both: - * (1) server-side and (2) browser-side. - * 2. It implements the same Expressions service that users can fork/clone, - * thus have their own instance of the Expressions plugin. - * 3. `ExpressionsService` defines the public contracts of *setup* and *start* - * Kibana Platform life-cycles for ease-of-use on server-side and browser-side. - * 4. `ExpressionsService` creates a bound version of all exported contract functions. - * 5. Functions are bound the way there are: - * - * ```ts - * registerFunction = (...args: Parameters - * ): ReturnType => this.executor.registerFunction(...args); - * ``` - * - * so that JSDoc appears in developers IDE when they use those `plugins.expressions.registerFunction(`. - */ -export declare class ExpressionsServiceFork implements ExpressionServiceFork { - private namespace; - private expressionsService; - /** - * @note Workaround since the expressions service is frozen. - */ - constructor(namespace: string, expressionsService: ExpressionsService); - protected registerFunction(definition: AnyExpressionFunctionDefinition | (() => AnyExpressionFunctionDefinition)): void; - protected registerRenderer(definition: AnyExpressionRenderDefinition | (() => AnyExpressionRenderDefinition)): void; - protected registerType(definition: AnyExpressionTypeDefinition | (() => AnyExpressionTypeDefinition)): void; - protected run(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): import("rxjs").Observable>; - protected execute(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): import("..").ExecutionContract; - protected getFunction(name: string): import("../expression_functions").ExpressionFunction | undefined; - protected getFunctions(): Record; - /** - * Returns Kibana Platform *setup* life-cycle contract. Useful to return the - * same contract on server-side and browser-side. - */ - setup(): ExpressionsServiceSetup; - /** - * Returns Kibana Platform *start* life-cycle contract. Useful to return the - * same contract on server-side and browser-side. - */ - start(): ExpressionsServiceStart; -} diff --git a/src/platform/plugins/shared/expressions/common/service/expressions_services.d.ts b/src/platform/plugins/shared/expressions/common/service/expressions_services.d.ts deleted file mode 100644 index 8057ef2d1d7aa..0000000000000 --- a/src/platform/plugins/shared/expressions/common/service/expressions_services.d.ts +++ /dev/null @@ -1,292 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/logging'; -import type { KibanaRequest } from '@kbn/core/server'; -import type { KibanaExecutionContext } from '@kbn/core/public'; -import type { SavedObjectReference } from '@kbn/core/types'; -import type { MigrateFunctionsObject, PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common'; -import type { Adapters } from '@kbn/inspector-plugin/common/adapters'; -import type { ExecutionContextSearch } from '@kbn/es-query'; -import { Executor } from '../executor'; -import type { AnyExpressionRenderDefinition } from '../expression_renderers'; -import { ExpressionRendererRegistry } from '../expression_renderers'; -import type { ExpressionAstExpression } from '../ast'; -import type { ExecutionContract, ExecutionResult } from '../execution'; -import type { AnyExpressionTypeDefinition, ExpressionValueError } from '../expression_types'; -import type { AnyExpressionFunctionDefinition } from '../expression_functions'; -import { ExpressionsServiceFork } from './expressions_fork'; -/** - * The public contract that `ExpressionsService` provides to other plugins - * in Kibana Platform in *setup* life-cycle. - */ -export interface ExpressionsServiceSetup { - /** - * Get a registered `ExpressionFunction` by its name, which was registered - * using the `registerFunction` method. The returned `ExpressionFunction` - * instance is an internal representation of the function in Expressions - * service - do not mutate that object. - * @deprecated Use start contract instead. - */ - getFunction(name: string, namespace?: string): ReturnType; - /** - * Returns POJO map of all registered expression functions, where keys are - * names of the functions and values are `ExpressionFunction` instances. - * @deprecated Use start contract instead. - */ - getFunctions(namespace?: string): ReturnType; - /** - * Returns POJO map of all registered expression types, where keys are - * names of the types and values are `ExpressionType` instances. - * @deprecated Use start contract instead. - */ - getTypes(): ReturnType; - /** - * Create a new instance of `ExpressionsService`. The new instance inherits - * all state of the original `ExpressionsService`, including all expression - * types, expression functions and context. Also, all new types and functions - * registered in the original services AFTER the forking event will be - * available in the forked instance. However, all new types and functions - * registered in the forked instances will NOT be available to the original - * service. - * @param name A fork name that can be used to get fork instance later. - */ - fork(namespace: string): ExpressionsServiceFork; - /** - * Register an expression function, which will be possible to execute as - * part of the expression pipeline. - * - * Below we register a function which simply sleeps for given number of - * milliseconds to delay the execution and outputs its input as-is. - * - * ```ts - * expressions.registerFunction({ - * name: 'sleep', - * args: { - * time: { - * aliases: ['_'], - * help: 'Time in milliseconds for how long to sleep', - * types: ['number'], - * }, - * }, - * help: '', - * fn: async (input, args, context) => { - * await new Promise(r => setTimeout(r, args.time)); - * return input; - * }, - * } - * ``` - * - * The actual function is defined in the `fn` key. The function can be *async*. - * It receives three arguments: (1) `input` is the output of the previous function - * or the initial input of the expression if the function is first in chain; - * (2) `args` are function arguments as defined in expression string, that can - * be edited by user (e.g in case of Canvas); (3) `context` is a shared object - * passed to all functions that can be used for side-effects. - */ - registerFunction(functionDefinition: AnyExpressionFunctionDefinition | (() => AnyExpressionFunctionDefinition)): void; - registerType(typeDefinition: AnyExpressionTypeDefinition | (() => AnyExpressionTypeDefinition)): void; - registerRenderer(definition: AnyExpressionRenderDefinition | (() => AnyExpressionRenderDefinition)): void; - getAllMigrations(): MigrateFunctionsObject; -} -export interface ExpressionExecutionParams { - searchContext?: ExecutionContextSearch; - variables?: Record; - /** - * Whether to execute expression in *debug mode*. In *debug mode* inputs and - * outputs as well as all resolved arguments and time it took to execute each - * function are saved and are available for introspection. - */ - debug?: boolean; - /** - * Makes a `KibanaRequest` object available to expression functions. Useful for - * functions which are running on the server and need to perform operations that - * are scoped to a specific user. - */ - kibanaRequest?: KibanaRequest; - searchSessionId?: string; - syncColors?: boolean; - syncCursor?: boolean; - syncTooltips?: boolean; - inspectorAdapters?: Adapters; - executionContext?: KibanaExecutionContext; - namespace?: string; - /** - * Toggles the partial results support. - * @default false - */ - partial?: boolean; - /** - * Throttling of partial results in milliseconds. 0 is disabling the throttling. - * @deafult 0 - */ - throttle?: number; - allowCache?: boolean; -} -/** - * The public contract that `ExpressionsService` provides to other plugins - * in Kibana Platform in *start* life-cycle. - */ -export interface ExpressionsServiceStart { - /** - * Get a registered `ExpressionFunction` by its name, which was registered - * using the `registerFunction` method. The returned `ExpressionFunction` - * instance is an internal representation of the function in Expressions - * service - do not mutate that object. - */ - getFunction(name: string, namespace?: string): ReturnType; - /** - * Returns POJO map of all registered expression functions, where keys are - * names of the functions and values are `ExpressionFunction` instances. - */ - getFunctions(namespace?: string): ReturnType; - /** - * Get a registered `ExpressionRenderer` by its name, which was registered - * using the `registerRenderer` method. The returned `ExpressionRenderer` - * instance is an internal representation of the renderer in Expressions - * service - do not mutate that object. - */ - getRenderer(name: string): ReturnType; - /** - * Returns POJO map of all registered expression renderers, where keys are - * names of the renderers and values are `ExpressionRenderer` instances. - */ - getRenderers(): ReturnType; - /** - * Get a registered `ExpressionType` by its name, which was registered - * using the `registerType` method. The returned `ExpressionType` - * instance is an internal representation of the type in Expressions - * service - do not mutate that object. - */ - getType(name: string): ReturnType; - /** - * Returns POJO map of all registered expression types, where keys are - * names of the types and values are `ExpressionType` instances. - */ - getTypes(): ReturnType; - /** - * Executes expression string or a parsed expression AST and immediately - * returns the result. - * - * Below example will execute `sleep 100 | clog` expression with `123` initial - * input to the first function. - * - * ```ts - * expressions.run('sleep 100 | clog', 123); - * ``` - * - * - `sleep 100` will delay execution by 100 milliseconds and pass the `123` input as - * its output. - * - `clog` will print to console `123` and pass it as its output. - * - The final result of the execution will be `123`. - * - * Optionally, you can pass an object as the third argument which will be used - * to extend the `ExecutionContext`—an object passed to each function - * as the third argument, that allows functions to perform side-effects. - * - * ```ts - * expressions.run('...', null, { elasticsearchClient }); - * ``` - */ - run(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): Observable>; - /** - * Starts expression execution and immediately returns `ExecutionContract` - * instance that tracks the progress of the execution and can be used to - * interact with the execution. - */ - execute(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): ExecutionContract; - extract(state: ExpressionAstExpression): { - state: ExpressionAstExpression; - references: SavedObjectReference[]; - }; - inject(state: ExpressionAstExpression, references: SavedObjectReference[]): ExpressionAstExpression; - telemetry(state: ExpressionAstExpression, telemetryData: Record): Record; - getAllMigrations(): MigrateFunctionsObject; -} -export interface ExpressionServiceParams { - executor?: Executor; - logger?: Logger; - renderers?: ExpressionRendererRegistry; -} -/** - * `ExpressionsService` class is used for multiple purposes: - * - * 1. It implements the same Expressions service that can be used on both: - * (1) server-side and (2) browser-side. - * 2. It implements the same Expressions service that users can fork/clone, - * thus have their own instance of the Expressions plugin. - * 3. `ExpressionsService` defines the public contracts of *setup* and *start* - * Kibana Platform life-cycles for ease-of-use on server-side and browser-side. - * 4. `ExpressionsService` creates a bound version of all exported contract functions. - * 5. Functions are bound the way there are: - * - * ```ts - * registerFunction = (...args: Parameters - * ): ReturnType => this.executor.registerFunction(...args); - * ``` - * - * so that JSDoc appears in developers IDE when they use those `plugins.expressions.registerFunction(`. - */ -export declare class ExpressionsService implements PersistableStateService, ExpressionsServiceSetup, ExpressionsServiceStart { - /** - * @note Workaround since the expressions service is frozen. - */ - private static started; - readonly executor: Executor; - readonly renderers: ExpressionRendererRegistry; - constructor({ logger, executor, renderers, }?: ExpressionServiceParams); - private isStarted; - private assertSetup; - private assertStart; - readonly getFunction: ExpressionsServiceStart['getFunction']; - readonly getFunctions: ExpressionsServiceStart['getFunctions']; - readonly getRenderer: ExpressionsServiceStart['getRenderer']; - readonly getRenderers: ExpressionsServiceStart['getRenderers']; - readonly getType: ExpressionsServiceStart['getType']; - readonly getTypes: ExpressionsServiceStart['getTypes']; - readonly registerFunction: ExpressionsServiceSetup['registerFunction']; - readonly registerType: ExpressionsServiceSetup['registerType']; - readonly registerRenderer: ExpressionsServiceSetup['registerRenderer']; - readonly fork: ExpressionsServiceSetup['fork']; - readonly execute: ExpressionsServiceStart['execute']; - readonly run: ExpressionsServiceStart['run']; - /** - * Extracts telemetry from expression AST - * @param state expression AST to extract references from - */ - readonly telemetry: (state: ExpressionAstExpression, telemetryData?: Record) => Record; - /** - * Extracts saved object references from expression AST - * @param state expression AST to extract references from - * @returns new expression AST with references removed and array of references - */ - readonly extract: (state: ExpressionAstExpression) => { - state: ExpressionAstExpression; - references: import("@kbn/core/server").SavedObjectReference[]; - }; - /** - * Injects saved object references into expression AST - * @param state expression AST to update - * @param references array of saved object references - * @returns new expression AST with references injected - */ - readonly inject: (state: ExpressionAstExpression, references: SavedObjectReference[]) => ExpressionAstExpression; - /** - * gets an object with semver mapped to a migration function - */ - getAllMigrations: () => MigrateFunctionsObject; - /** - * migrates an old expression to latest version - * @param state - */ - migrateToLatest: (state: VersionedState) => ExpressionAstExpression; - /** - * Returns Kibana Platform *setup* life-cycle contract. Useful to return the - * same contract on server-side and browser-side. - */ - setup(...args: unknown[]): ExpressionsServiceSetup; - /** - * Returns Kibana Platform *start* life-cycle contract. Useful to return the - * same contract on server-side and browser-side. - */ - start(...args: unknown[]): ExpressionsServiceStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/expressions/common/service/index.d.ts b/src/platform/plugins/shared/expressions/common/service/index.d.ts deleted file mode 100644 index 5b55853bc3424..0000000000000 --- a/src/platform/plugins/shared/expressions/common/service/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './expressions_services'; diff --git a/src/platform/plugins/shared/expressions/common/types/common.d.ts b/src/platform/plugins/shared/expressions/common/types/common.d.ts deleted file mode 100644 index 62be31fe9ac6c..0000000000000 --- a/src/platform/plugins/shared/expressions/common/types/common.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { ObservableLike, UnwrapObservable } from '@kbn/utility-types'; -/** - * This can convert a type into a known Expression string representation of - * that type. For example, `TypeToString` will resolve to `'datatable'`. - * This allows Expression Functions to continue to specify their type in a - * simple string format. - */ -export type TypeToString = KnownTypeToString | UnmappedTypeStrings; -/** - * Map the type of the generic to a string-based representation of the type. - * - * If the provided generic is its own type interface, we use the value of - * the `type` key as a string literal type for it. - */ -export type KnownTypeToString = T extends string ? 'string' : T extends boolean ? 'boolean' : T extends number ? 'number' : T extends null ? 'null' : T extends { - type: string; -} ? T['type'] : never; -/** - * If the type extends a Promise, we still need to return the string representation: - * - * `someArgument: Promise` results in `types: ['boolean', 'string']` - */ -export type TypeString = KnownTypeToString ? UnwrapObservable : Awaited>; -/** - * Types used in Expressions that don't map to a primitive cleanly: - * - * `date` is typed as a number or string, and represents a date - */ -export type UnmappedTypeStrings = 'date' | 'filter'; diff --git a/src/platform/plugins/shared/expressions/common/types/index.d.ts b/src/platform/plugins/shared/expressions/common/types/index.d.ts deleted file mode 100644 index 0072761cd7819..0000000000000 --- a/src/platform/plugins/shared/expressions/common/types/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { TypeToString, KnownTypeToString, TypeString, UnmappedTypeStrings } from './common'; -export * from './style'; -export type * from './registry'; diff --git a/src/platform/plugins/shared/expressions/common/types/registry.d.ts b/src/platform/plugins/shared/expressions/common/types/registry.d.ts deleted file mode 100644 index b869581ac25db..0000000000000 --- a/src/platform/plugins/shared/expressions/common/types/registry.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IRegistry { - get(id: string): T | null; - toJS(): Record; - toArray(): T[]; -} diff --git a/src/platform/plugins/shared/expressions/common/types/style.d.ts b/src/platform/plugins/shared/expressions/common/types/style.d.ts deleted file mode 100644 index 8bf818428a67b..0000000000000 --- a/src/platform/plugins/shared/expressions/common/types/style.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -import type { FontLabel } from '../fonts'; -/** - * Enum of supported CSS `background-repeat` properties. - */ -export declare enum BackgroundRepeat { - REPEAT = "repeat", - REPEAT_NO = "no-repeat", - REPEAT_X = "repeat-x", - REPEAT_Y = "repeat-y", - ROUND = "round", - SPACE = "space" -} -/** - * Enum of supported CSS `background-size` properties. - */ -export declare enum BackgroundSize { - AUTO = "auto", - CONTAIN = "contain", - COVER = "cover" -} -/** - * Enum of supported CSS `font-style` properties. - */ -export declare enum FontStyle { - ITALIC = "italic", - NORMAL = "normal" -} -/** - * Enum of supported CSS `font-weight` properties. - */ -export declare enum FontWeight { - NORMAL = "normal", - BOLD = "bold", - BOLDER = "bolder", - LIGHTER = "lighter", - ONE = "100", - TWO = "200", - THREE = "300", - FOUR = "400", - FIVE = "500", - SIX = "600", - SEVEN = "700", - EIGHT = "800", - NINE = "900" -} -/** - * Enum of supported CSS `overflow` properties. - */ -export declare enum Overflow { - AUTO = "auto", - HIDDEN = "hidden", - SCROLL = "scroll", - VISIBLE = "visible" -} -/** - * Enum of supported CSS `text-align` properties. - */ -export declare enum TextAlignment { - CENTER = "center", - JUSTIFY = "justify", - LEFT = "left", - RIGHT = "right" -} -/** - * Enum of supported CSS `text-decoration` properties. - */ -export declare enum TextDecoration { - NONE = "none", - UNDERLINE = "underline" -} -export declare enum FontSizeUnit { - PX = "px", - PT = "pt" -} -/** - * Represents the various style properties that can be applied to an element. - */ -export interface CSSStyle { - color?: string; - fill?: string; - fontFamily?: FontLabel; - fontSize?: string; - fontStyle?: FontStyle; - fontWeight?: FontWeight; - lineHeight?: number | string; - textAlign?: TextAlignment; - textDecoration?: TextDecoration; -} -/** - * Represents an object containing style information for a Container. - */ -export interface ContainerStyle { - border: string | null; - borderRadius: string | null; - padding: string | null; - backgroundColor: string | null; - backgroundImage: string | null; - backgroundSize: BackgroundSize; - backgroundRepeat: BackgroundRepeat; - opacity: number | null; - overflow: Overflow; -} -/** - * An object that represents style information, typically CSS. - */ -export interface ExpressionTypeStyle { - type: 'style'; - spec: CSSStyle; - css: string; -} -export type Style = ExpressionTypeStyle; diff --git a/src/platform/plugins/shared/expressions/common/util/create_default_inspector_adapters.d.ts b/src/platform/plugins/shared/expressions/common/util/create_default_inspector_adapters.d.ts deleted file mode 100644 index 146ad7aaf7545..0000000000000 --- a/src/platform/plugins/shared/expressions/common/util/create_default_inspector_adapters.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { DefaultInspectorAdapters } from '../execution'; -export declare const createDefaultInspectorAdapters: () => DefaultInspectorAdapters; diff --git a/src/platform/plugins/shared/expressions/common/util/create_error.d.ts b/src/platform/plugins/shared/expressions/common/util/create_error.d.ts deleted file mode 100644 index 9fffa87787d4b..0000000000000 --- a/src/platform/plugins/shared/expressions/common/util/create_error.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ExpressionValueError } from '..'; -export type SerializedError = { - name: string; - message: string; - stack?: string; -}; -export type ErrorLike = SerializedError & { - original?: SerializedError; -}; -export declare const createError: (err: string | ErrorLike) => ExpressionValueError; diff --git a/src/platform/plugins/shared/expressions/common/util/expressions_inspector_adapter.d.ts b/src/platform/plugins/shared/expressions/common/util/expressions_inspector_adapter.d.ts deleted file mode 100644 index f77e76dd13685..0000000000000 --- a/src/platform/plugins/shared/expressions/common/util/expressions_inspector_adapter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { EventEmitter } from 'events'; -import type { ExpressionAstNode } from '..'; -export declare class ExpressionsInspectorAdapter extends EventEmitter { - private _ast; - logAST(ast: ExpressionAstNode): void; - get ast(): ExpressionAstNode; -} diff --git a/src/platform/plugins/shared/expressions/common/util/get_by_alias.d.ts b/src/platform/plugins/shared/expressions/common/util/get_by_alias.d.ts deleted file mode 100644 index c4a1e20925ae3..0000000000000 --- a/src/platform/plugins/shared/expressions/common/util/get_by_alias.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This is used for looking up function/argument definitions. It looks through - * the given object/array for a case-insensitive match, which could be either the - * `name` itself, or something under the `aliases` property. - */ -export declare const ALL_NAMESPACES = "*"; -interface Node { - name?: string; - aliases?: string[]; - namespace?: string; -} -export declare function getByAlias(node: T[] | Record, nodeName: string, nodeNamespace?: string): T | undefined; -export {}; diff --git a/src/platform/plugins/shared/expressions/common/util/index.d.ts b/src/platform/plugins/shared/expressions/common/util/index.d.ts deleted file mode 100644 index a8a67588443cf..0000000000000 --- a/src/platform/plugins/shared/expressions/common/util/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './create_error'; -export * from './get_by_alias'; -export * from './tables_adapter'; -export * from './expressions_inspector_adapter'; -export * from './test_utils'; -export * from './create_default_inspector_adapters'; diff --git a/src/platform/plugins/shared/expressions/common/util/tables_adapter.d.ts b/src/platform/plugins/shared/expressions/common/util/tables_adapter.d.ts deleted file mode 100644 index 766e8a07bb279..0000000000000 --- a/src/platform/plugins/shared/expressions/common/util/tables_adapter.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { EventEmitter } from 'events'; -import type { Datatable } from '../expression_types/specs'; -export declare class TablesAdapter extends EventEmitter { - #private; - allowCsvExport: boolean; - /** Key of table to set as initial selection */ - initialSelectedTable?: string; - logDatatable(key: string, datatable: Datatable): void; - reset(): void; - get tables(): { - [key: string]: Datatable; - }; -} diff --git a/src/platform/plugins/shared/expressions/common/util/test_utils.d.ts b/src/platform/plugins/shared/expressions/common/util/test_utils.d.ts deleted file mode 100644 index 189bfaf1c30f2..0000000000000 --- a/src/platform/plugins/shared/expressions/common/util/test_utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ExecutionContext } from '../execution'; -export declare const createMockContext: () => ExecutionContext; diff --git a/src/platform/plugins/shared/expressions/public/expression_functions/index.d.ts b/src/platform/plugins/shared/expressions/public/expression_functions/index.d.ts deleted file mode 100644 index 3907793105295..0000000000000 --- a/src/platform/plugins/shared/expressions/public/expression_functions/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ui_setting'; diff --git a/src/platform/plugins/shared/expressions/public/expression_functions/ui_setting.d.ts b/src/platform/plugins/shared/expressions/public/expression_functions/ui_setting.d.ts deleted file mode 100644 index 0e69cd53798de..0000000000000 --- a/src/platform/plugins/shared/expressions/public/expression_functions/ui_setting.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { CoreSetup } from '@kbn/core/public'; -export declare function getUiSettingFn({ getStartServices }: Pick): import("../../common").ExpressionFunctionUiSetting; diff --git a/src/platform/plugins/shared/expressions/public/index.d.ts b/src/platform/plugins/shared/expressions/public/index.d.ts deleted file mode 100644 index 5673b52e2ba2b..0000000000000 --- a/src/platform/plugins/shared/expressions/public/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import { ExpressionsPublicPlugin } from './plugin'; -export { ExpressionsPublicPlugin as Plugin }; -export type { ExpressionsSetup, ExpressionsStart } from './plugin'; -export declare function plugin(initializerContext: PluginInitializerContext): ExpressionsPublicPlugin; -export type { ExpressionExecutor, IExpressionLoaderParams, ExpressionRenderError, ExpressionRendererEvent, } from './types'; -export type { ExpressionLoader } from './loader'; -export type { ExpressionRenderHandler } from './render'; -export type { ExpressionRendererComponent, ExpressionRendererParams, ReactExpressionRendererProps, ReactExpressionRendererType, } from './react_expression_renderer'; -export { useExpressionRenderer } from './react_expression_renderer'; -export type { AnyExpressionFunctionDefinition, AnyExpressionTypeDefinition, ArgumentType, Datatable, DatatableColumn, DatatableColumnType, DatatableRow, Execution, ExecutionContract, ExecutionContainer, ExecutionContext, ExecutionParams, ExecutionState, Executor, ExecutorContainer, ExecutorState, ExpressionAstArgument, ExpressionAstExpression, ExpressionAstExpressionBuilder, ExpressionAstFunction, ExpressionAstFunctionBuilder, ExpressionAstNode, ExpressionFunction, ExpressionFunctionDefinition, ExpressionFunctionDefinitions, ExpressionFunctionParameter, ExpressionImage, ExpressionRenderDefinition, ExpressionRenderer, ExpressionRendererRegistry, ExpressionType, ExpressionTypeDefinition, ExpressionTypeStyle, ExpressionValue, ExpressionValueBoxed, ExpressionValueConverter, ExpressionValueError, ExpressionValueNum, ExpressionValueRender, ExpressionValueUnboxed, ExpressionValueFilter, Font, FontLabel, FontStyle, FontValue, FontWeight, FunctionsRegistry, IInterpreterRenderHandlers, InterpreterErrorType, IRegistry, KnownTypeToString, Overflow, PointSeries, PointSeriesColumn, PointSeriesColumnName, PointSeriesColumns, PointSeriesRow, Range, SerializedDatatable, Style, TextAlignment, TextDecoration, TypesRegistry, TypeString, TypeToString, UnmappedTypeStrings, ExpressionValueRender as Render, ExpressionsService, ExpressionsServiceSetup, ExpressionsServiceStart, TablesAdapter, } from '../common'; -export { buildExpression, buildExpressionFunction, formatExpression, isExpressionAstBuilder, parseExpression, createDefaultInspectorAdapters, } from '../common'; -export { isSourceParamsESQL } from '../common/expression_types'; diff --git a/src/platform/plugins/shared/expressions/public/loader.d.ts b/src/platform/plugins/shared/expressions/public/loader.d.ts deleted file mode 100644 index a1ff429d85d4c..0000000000000 --- a/src/platform/plugins/shared/expressions/public/loader.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Adapters } from '@kbn/inspector-plugin/public'; -import { AbortReason } from '@kbn/kibana-utils-plugin/common'; -import type { IExpressionLoaderParams } from './types'; -import type { ExpressionAstExpression } from '../common'; -import type { ExecutionContract } from '../common/execution/execution_contract'; -import { ExpressionRenderHandler } from './render'; -export declare class ExpressionLoader { - data$: ReturnType; - update$: ExpressionRenderHandler['update$']; - render$: ExpressionRenderHandler['render$']; - events$: ExpressionRenderHandler['events$']; - loading$: Observable; - private execution; - private renderHandler; - private dataSubject; - private loadingSubject; - private data; - private params; - private subscription?; - constructor(element: HTMLElement, expression?: string | ExpressionAstExpression, params?: IExpressionLoaderParams); - destroy(): void; - cancel(reason?: AbortReason): void; - getExpression(): string | undefined; - getAst(): ExpressionAstExpression | undefined; - getElement(): HTMLElement; - inspect(): Adapters | undefined; - update(expression?: string | ExpressionAstExpression, params?: IExpressionLoaderParams): void; - private loadData; - private render; - private setParams; -} -export type IExpressionLoader = (element: HTMLElement, expression?: string | ExpressionAstExpression, params?: IExpressionLoaderParams) => Promise; -export declare const loader: IExpressionLoader; diff --git a/src/platform/plugins/shared/expressions/public/plugin.d.ts b/src/platform/plugins/shared/expressions/public/plugin.d.ts deleted file mode 100644 index 99db9de6b675e..0000000000000 --- a/src/platform/plugins/shared/expressions/public/plugin.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import type { ExpressionsServiceSetup, ExpressionsServiceStart } from '../common'; -import { ReactExpressionRenderer } from './react_expression_renderer_wrapper'; -import type { IExpressionLoader } from './loader'; -import type { IExpressionRenderer } from './render'; -/** - * Expressions public setup contract, extends {@link ExpressionsServiceSetup} - */ -export type ExpressionsSetup = ExpressionsServiceSetup; -/** - * Expressions public start contrect, extends {@link ExpressionServiceStart} - */ -export interface ExpressionsStart extends ExpressionsServiceStart { - loader: IExpressionLoader; - render: IExpressionRenderer; - ReactExpressionRenderer: typeof ReactExpressionRenderer; -} -export declare class ExpressionsPublicPlugin implements Plugin { - private static logger; - private readonly expressions; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup): ExpressionsSetup; - start(core: CoreStart): ExpressionsStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/index.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/index.d.ts deleted file mode 100644 index d08e15c741dc4..0000000000000 --- a/src/platform/plugins/shared/expressions/public/react_expression_renderer/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './react_expression_renderer'; -export * from './use_expression_renderer'; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/react_expression_renderer.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/react_expression_renderer.d.ts deleted file mode 100644 index 0aeb049076027..0000000000000 --- a/src/platform/plugins/shared/expressions/public/react_expression_renderer/react_expression_renderer.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import type { ExpressionRenderError } from '../types'; -import type { ExpressionRendererParams } from './use_expression_renderer'; -export interface ReactExpressionRendererProps extends Omit { - className?: string; - dataAttrs?: string[]; - renderError?: (message?: string | null, error?: ExpressionRenderError | null) => React.ReactElement | React.ReactElement[]; - padding?: 'xs' | 's' | 'm' | 'l' | 'xl'; - paddingTop?: boolean; -} -export type ReactExpressionRendererType = React.ComponentType; -export type ExpressionRendererComponent = React.FC; -export declare function ReactExpressionRenderer({ className, dataAttrs, padding, paddingTop, renderError, abortController, ...expressionRendererOptions }: ReactExpressionRendererProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_debounced_value.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_debounced_value.d.ts deleted file mode 100644 index 465c0ff0ab643..0000000000000 --- a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_debounced_value.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function useDebouncedValue(value: T, timeout?: number): [T, boolean]; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.d.ts deleted file mode 100644 index d5c7872b69ca2..0000000000000 --- a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { RefObject } from 'react'; -import type { Observable } from 'rxjs'; -import type { ExpressionAstExpression } from '../../common'; -import type { IExpressionLoaderParams, ExpressionRenderError, ExpressionRendererEvent } from '../types'; -export interface ExpressionRendererParams extends IExpressionLoaderParams { - debounce?: number; - expression: string | ExpressionAstExpression; - hasCustomErrorRenderer?: boolean; - onData$?(data: TData, adapters?: TInspectorAdapters, partial?: boolean): void; - onEvent?(event: ExpressionRendererEvent): void; - onRender$?(item: number): void; - /** - * An observable which can be used to re-run the expression without destroying the component - */ - reload$?: Observable; - abortController?: AbortController; -} -interface ExpressionRendererState { - isEmpty: boolean; - isLoading: boolean; - error: null | ExpressionRenderError; -} -export declare function useExpressionRenderer(nodeRef: RefObject, { debounce, expression, hasCustomErrorRenderer, onData$, onEvent, onRender$, reload$, abortController, ...loaderParams }: ExpressionRendererParams): ExpressionRendererState; -export {}; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_shallow_memo.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_shallow_memo.d.ts deleted file mode 100644 index 7a615fcdf6801..0000000000000 --- a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_shallow_memo.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function useShallowMemo(value: T): T; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer_wrapper.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer_wrapper.d.ts deleted file mode 100644 index e6df347276d68..0000000000000 --- a/src/platform/plugins/shared/expressions/public/react_expression_renderer_wrapper.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from 'react'; -import type { ReactExpressionRendererProps } from './react_expression_renderer'; -export declare const ReactExpressionRenderer: (props: ReactExpressionRendererProps) => React.JSX.Element; diff --git a/src/platform/plugins/shared/expressions/public/render.d.ts b/src/platform/plugins/shared/expressions/public/render.d.ts deleted file mode 100644 index f7810a2c54bbe..0000000000000 --- a/src/platform/plugins/shared/expressions/public/render.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { SerializableRecord } from '@kbn/utility-types'; -import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; -import type { ExpressionRenderError, RenderErrorHandlerFnType, IExpressionLoaderParams, ExpressionRendererEvent } from './types'; -import type { IInterpreterRenderUpdateParams, RenderMode } from '../common'; -export type IExpressionRendererExtraHandlers = Record; -export interface ExpressionRenderHandlerParams { - onRenderError?: RenderErrorHandlerFnType; - renderMode?: RenderMode; - syncColors?: boolean; - syncCursor?: boolean; - syncTooltips?: boolean; - interactive?: boolean; - hasCompatibleActions?: (event: ExpressionRendererEvent) => Promise; - getCompatibleCellValueActions?: (data: object[]) => Promise; - executionContext?: KibanaExecutionContext; -} -type UpdateValue = IInterpreterRenderUpdateParams; -export declare class ExpressionRenderHandler { - render$: Observable; - update$: Observable; - events$: Observable; - private element; - private destroyFn?; - private renderCount; - private renderSubject; - private eventsSubject; - private updateSubject; - private handlers; - private onRenderError; - constructor(element: HTMLElement, { onRenderError, renderMode, syncColors, syncTooltips, syncCursor, interactive, hasCompatibleActions, getCompatibleCellValueActions, executionContext, }?: ExpressionRenderHandlerParams); - render: (value: SerializableRecord, uiState?: unknown) => Promise; - destroy: () => void; - getElement: () => HTMLElement; - handleRenderError: (error: ExpressionRenderError) => void; -} -export type IExpressionRenderer = (element: HTMLElement, data: unknown, options?: ExpressionRenderHandlerParams) => Promise; -export declare const render: IExpressionRenderer; -export {}; diff --git a/src/platform/plugins/shared/expressions/public/render_error_handler.d.ts b/src/platform/plugins/shared/expressions/public/render_error_handler.d.ts deleted file mode 100644 index 35b7328f030f8..0000000000000 --- a/src/platform/plugins/shared/expressions/public/render_error_handler.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { RenderErrorHandlerFnType } from './types'; -export declare const renderErrorHandler: RenderErrorHandlerFnType; diff --git a/src/platform/plugins/shared/expressions/public/services/expressions_services.d.ts b/src/platform/plugins/shared/expressions/public/services/expressions_services.d.ts deleted file mode 100644 index 7e3c63004d7a3..0000000000000 --- a/src/platform/plugins/shared/expressions/public/services/expressions_services.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CoreSetup } from '@kbn/core/public'; -import { ExpressionsService as CommonExpressionsService } from '../../common'; -export declare class ExpressionsService extends CommonExpressionsService { - setup({ getStartServices }: Pick): import("../../common").ExpressionsServiceSetup; -} diff --git a/src/platform/plugins/shared/expressions/public/services/index.d.ts b/src/platform/plugins/shared/expressions/public/services/index.d.ts deleted file mode 100644 index 3f158fe1af28a..0000000000000 --- a/src/platform/plugins/shared/expressions/public/services/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { NotificationsStart } from '@kbn/core/public'; -import type { ExpressionsService, ExpressionRendererRegistry } from '../../common'; -export declare const getNotifications: import("@kbn/kibana-utils-plugin/public").Get, setNotifications: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getRenderersRegistry: import("@kbn/kibana-utils-plugin/public").Get, setRenderersRegistry: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getExpressionsService: import("@kbn/kibana-utils-plugin/public").Get, setExpressionsService: import("@kbn/kibana-utils-plugin/public").Set; -export * from './expressions_services'; diff --git a/src/platform/plugins/shared/expressions/public/types/index.d.ts b/src/platform/plugins/shared/expressions/public/types/index.d.ts deleted file mode 100644 index 44015114fc0c9..0000000000000 --- a/src/platform/plugins/shared/expressions/public/types/index.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { KibanaExecutionContext } from '@kbn/core/public'; -import type { Adapters } from '@kbn/inspector-plugin/public'; -import type { ExecutionContextSearch } from '@kbn/es-query'; -import type { IInterpreterRenderHandlers, ExpressionValue, ExpressionsService, RenderMode, IInterpreterRenderEvent } from '../../common'; -import type { ExpressionRenderHandlerParams } from '../render'; -/** - * @deprecated - * - * This type if remainder from legacy platform, will be deleted going further. - */ -export interface ExpressionExecutor { - interpreter: ExpressionInterpreter; -} -/** - * @deprecated - */ -export interface ExpressionInterpreter { - interpretAst: ExpressionsService['run']; -} -export interface IExpressionLoaderParams { - searchContext?: ExecutionContextSearch; - context?: ExpressionValue; - variables?: Record; - debug?: boolean; - customFunctions?: []; - customRenderers?: []; - uiState?: unknown; - inspectorAdapters?: Adapters; - interactive?: boolean; - onRenderError?: RenderErrorHandlerFnType; - searchSessionId?: string; - renderMode?: RenderMode; - syncColors?: boolean; - syncCursor?: boolean; - syncTooltips?: boolean; - hasCompatibleActions?: ExpressionRenderHandlerParams['hasCompatibleActions']; - getCompatibleCellValueActions?: ExpressionRenderHandlerParams['getCompatibleCellValueActions']; - executionContext?: KibanaExecutionContext; - abortController?: AbortController; - /** - * The flag to toggle on emitting partial results. - * By default, the partial results are disabled. - */ - partial?: boolean; - /** - * Throttling of partial results in milliseconds. 0 is disabling the throttling. - * By default, it equals 1000. - */ - throttle?: number; - allowCache?: boolean; -} -export interface ExpressionRenderError extends Error { - type?: string; - original?: Error; -} -export type RenderErrorHandlerFnType = (domNode: HTMLElement, error: ExpressionRenderError, handlers: IInterpreterRenderHandlers) => void; -export type ExpressionRendererEvent = IInterpreterRenderEvent; diff --git a/src/platform/plugins/shared/home/common/constants.d.ts b/src/platform/plugins/shared/home/common/constants.d.ts deleted file mode 100644 index 4ddd44994f1c5..0000000000000 --- a/src/platform/plugins/shared/home/common/constants.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare const PLUGIN_ID = "home"; -export declare const HOME_APP_BASE_PATH = "/app/home"; -export declare enum TutorialsCategory { - LOGGING = "logging", - SECURITY_SOLUTION = "security", - METRICS = "metrics", - OTHER = "other" -} diff --git a/src/platform/plugins/shared/home/common/instruction_variant.d.ts b/src/platform/plugins/shared/home/common/instruction_variant.d.ts deleted file mode 100644 index 17e7054743cbe..0000000000000 --- a/src/platform/plugins/shared/home/common/instruction_variant.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export declare const INSTRUCTION_VARIANT: { - ESC: string; - OSX: string; - DEB: string; - RPM: string; - DOCKER: string; - WINDOWS: string; - NODE: string; - DJANGO: string; - FLASK: string; - RAILS: string; - RACK: string; - JS: string; - GO: string; - JAVA: string; - DOTNET: string; - LINUX: string; - PHP: string; - FLEET: string; - OPEN_TELEMETRY: string; - OTHER_LINUX: string; -}; -/** - * Convert instruction variant id into display text. - * - * @params {String} id - instruction variant id as defined from INSTRUCTION_VARIANT - * @return {String} display name - */ -export declare function getDisplayText(id: keyof typeof INSTRUCTION_VARIANT): string; diff --git a/src/platform/plugins/shared/home/public/application/application.d.ts b/src/platform/plugins/shared/home/public/application/application.d.ts deleted file mode 100644 index 99a2f05cae41c..0000000000000 --- a/src/platform/plugins/shared/home/public/application/application.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ScopedHistory, CoreStart } from '@kbn/core/public'; -export declare const renderApp: (element: HTMLElement, coreStart: CoreStart, history: ScopedHistory) => Promise<() => void>; diff --git a/src/platform/plugins/shared/home/public/application/components/add_data/add_data.d.ts b/src/platform/plugins/shared/home/public/application/components/add_data/add_data.d.ts deleted file mode 100644 index a231ba5786470..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/add_data/add_data.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { FC } from 'react'; -import type { ApplicationStart } from '@kbn/core/public'; -interface Props { - addBasePath: (path: string) => string; - application: ApplicationStart; - isDarkMode: boolean; - isCloudEnabled: boolean; -} -export declare const AddData: FC; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/add_data/index.d.ts b/src/platform/plugins/shared/home/public/application/components/add_data/index.d.ts deleted file mode 100644 index e191c405f8aea..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/add_data/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './add_data'; diff --git a/src/platform/plugins/shared/home/public/application/components/app_navigation_handler.d.ts b/src/platform/plugins/shared/home/public/application/components/app_navigation_handler.d.ts deleted file mode 100644 index 161a67bc8ea56..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/app_navigation_handler.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { MouseEvent } from 'react'; -export declare const createAppNavigationHandler: (targetUrl: string) => (event: MouseEvent) => void; diff --git a/src/platform/plugins/shared/home/public/application/components/home.d.ts b/src/platform/plugins/shared/home/public/application/components/home.d.ts deleted file mode 100644 index e06e5ae2f7b25..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/home.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import React, { Component } from 'react'; -import type { FeatureCatalogueEntry, FeatureCatalogueSolution } from '../../services'; -export declare const KEY_ENABLE_WELCOME = "home:welcome:show"; -export interface HomeProps { - addBasePath: (url: string) => string; - directories: FeatureCatalogueEntry[]; - solutions: FeatureCatalogueSolution[]; - localStorage: Storage; - urlBasePath: string; - hasUserDataView: () => Promise; - isCloudEnabled: boolean; -} -interface State { - isLoading: boolean; - isNewKibanaInstance: boolean; - isWelcomeEnabled: boolean; -} -export declare class Home extends Component { - private _isMounted; - constructor(props: HomeProps); - componentWillUnmount(): void; - componentDidMount(): void; - private fetchIsNewKibanaInstance; - private endLoading; - skipWelcome(): void; - private findDirectoryById; - private getFeaturesByCategory; - private renderNormal; - private renderLoading; - private renderWelcome; - render(): string | React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/home_app.d.ts b/src/platform/plugins/shared/home/public/application/components/home_app.d.ts deleted file mode 100644 index bf1db3c6d68ea..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/home_app.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { FeatureCatalogueEntry, FeatureCatalogueSolution } from '../../services'; -export interface HomeAppProps { - directories: FeatureCatalogueEntry[]; - solutions: FeatureCatalogueSolution[]; -} -export declare function HomeApp({ directories, solutions }: HomeAppProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/home/public/application/components/manage_data/index.d.ts b/src/platform/plugins/shared/home/public/application/components/manage_data/index.d.ts deleted file mode 100644 index 4cb51f7acffaa..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/manage_data/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './manage_data'; diff --git a/src/platform/plugins/shared/home/public/application/components/manage_data/manage_data.d.ts b/src/platform/plugins/shared/home/public/application/components/manage_data/manage_data.d.ts deleted file mode 100644 index d5cb0fde33725..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/manage_data/manage_data.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { FC } from 'react'; -import type { ApplicationStart } from '@kbn/core/public'; -import type { FeatureCatalogueEntry } from '../../../services'; -interface Props { - addBasePath: (path: string) => string; - application: ApplicationStart; - features: FeatureCatalogueEntry[]; -} -export declare const ManageData: FC; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/move_data/index.d.ts b/src/platform/plugins/shared/home/public/application/components/move_data/index.d.ts deleted file mode 100644 index c9c63d147a30f..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/move_data/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './move_data'; diff --git a/src/platform/plugins/shared/home/public/application/components/move_data/move_data.d.ts b/src/platform/plugins/shared/home/public/application/components/move_data/move_data.d.ts deleted file mode 100644 index 9bfa476ea29c2..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/move_data/move_data.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FC } from 'react'; -interface Props { - addBasePath: (path: string) => string; -} -export declare const MoveData: FC; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/sample_data/index.d.ts b/src/platform/plugins/shared/home/public/application/components/sample_data/index.d.ts deleted file mode 100644 index fcaff2c368c2f..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/sample_data/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -interface Props { - urlBasePath: string; - onDecline: () => void; - onConfirm: () => void; -} -export declare function SampleDataCard({ urlBasePath, onDecline, onConfirm }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/callout_skeleton.d.ts b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/callout_skeleton.d.ts deleted file mode 100644 index f6e7cacab4735..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/callout_skeleton.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { FC } from 'react'; -export declare const CalloutSkeleton: FC; diff --git a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/index.d.ts b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/index.d.ts deleted file mode 100644 index 6ea8a1c94c18a..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './setup_cloud_connect'; -export * from './callout_skeleton'; diff --git a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/setup_cloud_connect.d.ts b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/setup_cloud_connect.d.ts deleted file mode 100644 index 261d674fa3f2f..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/setup_cloud_connect.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FC } from 'react'; -import type { ApplicationStart } from '@kbn/core/public'; -interface Props { - addBasePath: (path: string) => string; - application: ApplicationStart; -} -export declare const SetupCloudConnect: FC; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/solutions_section/index.d.ts b/src/platform/plugins/shared/home/public/application/components/solutions_section/index.d.ts deleted file mode 100644 index 5a4f338c2425d..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/solutions_section/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './solutions_section'; diff --git a/src/platform/plugins/shared/home/public/application/components/solutions_section/solution_panel.d.ts b/src/platform/plugins/shared/home/public/application/components/solutions_section/solution_panel.d.ts deleted file mode 100644 index 9884ccb92a6ae..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/solutions_section/solution_panel.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FC } from 'react'; -import type { FeatureCatalogueSolution } from '../../..'; -interface Props { - addBasePath: (path: string) => string; - solution: FeatureCatalogueSolution; -} -export declare const SolutionPanel: FC; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/solutions_section/solutions_section.d.ts b/src/platform/plugins/shared/home/public/application/components/solutions_section/solutions_section.d.ts deleted file mode 100644 index c94c71bfc3ca4..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/solutions_section/solutions_section.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FC } from 'react'; -import type { FeatureCatalogueSolution } from '../../..'; -interface Props { - addBasePath: (path: string) => string; - solutions: FeatureCatalogueSolution[]; -} -export declare const SolutionsSection: FC; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/synopsis.d.ts b/src/platform/plugins/shared/home/public/application/components/synopsis.d.ts deleted file mode 100644 index ed030f1758b42..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/synopsis.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import type { EuiCardProps, IconType } from '@elastic/eui'; -export interface SynopsisProps { - id: string; - title: string; - description: string; - iconUrl?: string; - iconType?: IconType; - url?: string; - isBeta?: boolean; - onClick?: EuiCardProps['onClick']; -} -export declare function Synopsis({ id, description, iconUrl, iconType, title, url, onClick, isBeta, }: SynopsisProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/content.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/content.d.ts deleted file mode 100644 index 320f5902b66db..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial/content.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from 'react'; -interface ContentProps { - text: string; -} -export declare function Content({ text }: ContentProps): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/footer.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/footer.d.ts deleted file mode 100644 index 7657f17527264..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial/footer.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -interface FooterProps { - url: string; - label: string; -} -export declare function Footer({ url, label }: FooterProps): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/instruction.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/instruction.d.ts deleted file mode 100644 index f6012a2eace82..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial/instruction.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import type { InstructionType } from '../../../services/tutorials/types'; -export interface InstructionProps extends InstructionType { - variantId: string; - isCloudEnabled: boolean; - replaceTemplateStrings: (text: string) => string; -} -export declare function Instruction({ commands, textPost, textPre, replaceTemplateStrings, customComponentName, variantId, isCloudEnabled, }: InstructionProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/instruction_set.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/instruction_set.d.ts deleted file mode 100644 index b0d0a344bd642..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial/instruction_set.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import type { InjectedIntl } from '@kbn/i18n-react'; -import * as StatusCheckStates from './status_check_states'; -import type { InstructionSetType } from '../../../services/tutorials/types'; -interface InstructionSetProps extends InstructionSetType { - instructionVariants: InstructionSetType['instructionVariants']; - statusCheckConfig: InstructionSetType['statusCheck']; - statusCheckState: keyof typeof StatusCheckStates; - onStatusCheck: () => void; - offset: number; - replaceTemplateStrings: (text: string) => string; - isCloudEnabled: boolean; - intl: InjectedIntl; -} -export declare const InstructionSet: React.FC> & { - WrappedComponent: React.ComponentType; -}; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/introduction.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/introduction.d.ts deleted file mode 100644 index 95c1f5913f2d7..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial/introduction.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import type { IBasePath } from '@kbn/core-http-browser'; -import type { InjectedIntl } from '@kbn/i18n-react'; -import { TutorialsCategory } from '../../../../common/constants'; -export interface IntroductionProps { - description: string; - title: string; - intl: InjectedIntl; - basePath: IBasePath; - previewUrl?: string; - exportedFieldUrl?: string; - iconType?: string; - isBeta?: boolean; - notices?: React.ReactNode; - exportedFieldsUrl?: string; - category?: TutorialsCategory; -} -export declare const Introduction: React.FC> & { - WrappedComponent: React.ComponentType; -}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.d.ts deleted file mode 100644 index b05050e828bcc..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function replaceTemplateStrings(text: string): string; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/status_check_states.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/status_check_states.d.ts deleted file mode 100644 index a5a0c6e22b4ea..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial/status_check_states.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const HAS_DATA = "HAS_DATA"; -export declare const FETCHING = "FETCHING"; -export declare const NO_DATA = "NO_DATA"; -export declare const NOT_CHECKED = "NOT_CHECKED"; -export declare const ERROR = "ERROR"; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/tutorial.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/tutorial.d.ts deleted file mode 100644 index cc269ee10bd70..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial/tutorial.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import type { InjectedIntl } from '@kbn/i18n-react'; -import type { TutorialType } from '../../../services/tutorials/types'; -import type { HomeKibanaServices } from '../../kibana_services'; -interface TutorialProps { - addBasePath: HomeKibanaServices['addBasePath']; - isCloudEnabled: boolean; - getTutorial: (id: string) => Promise; - replaceTemplateStrings: (text: string) => string; - tutorialId: string; - intl: InjectedIntl; -} -export declare const Tutorial: React.FC> & { - WrappedComponent: React.ComponentType; -}; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial_directory.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial_directory.d.ts deleted file mode 100644 index 053148ffd53d7..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/tutorial_directory.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import type { InjectedIntl } from '@kbn/i18n-react'; -import type { HomeKibanaServices } from '../kibana_services'; -interface TutorialDirectoryUiProps { - addBasePath: HomeKibanaServices['addBasePath']; - openTab: string; - isCloudEnabled: boolean; - intl: InjectedIntl; -} -export declare const TutorialDirectory: React.FC> & { - WrappedComponent: React.ComponentType; -}; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/welcome.d.ts b/src/platform/plugins/shared/home/public/application/components/welcome.d.ts deleted file mode 100644 index 5c99a830a7db9..0000000000000 --- a/src/platform/plugins/shared/home/public/application/components/welcome.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -interface WelcomeProps { - urlBasePath: string; - onSkip: () => void; -} -/** - * Shows a full-screen welcome page that gives helpful quick links to beginners. - */ -export declare const Welcome: React.FC; -export {}; diff --git a/src/platform/plugins/shared/home/public/application/index.d.ts b/src/platform/plugins/shared/home/public/application/index.d.ts deleted file mode 100644 index 14ee74b26446f..0000000000000 --- a/src/platform/plugins/shared/home/public/application/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { renderApp } from './application'; diff --git a/src/platform/plugins/shared/home/public/application/kibana_services.d.ts b/src/platform/plugins/shared/home/public/application/kibana_services.d.ts deleted file mode 100644 index 146305b2d8f84..0000000000000 --- a/src/platform/plugins/shared/home/public/application/kibana_services.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { ChromeStart, DocLinksStart, HttpStart, NotificationsSetup, NotificationsStart, OverlayStart, IUiSettingsClient, ApplicationStart, ThemeServiceStart, I18nStart, AppMountParameters } from '@kbn/core/public'; -import type { UiCounterMetricType } from '@kbn/analytics'; -import type { UrlForwardingStart } from '@kbn/url-forwarding-plugin/public'; -import type { DataViewsContract } from '@kbn/data-views-plugin/public'; -import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; -import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; -import type { TutorialService } from '../services/tutorials'; -import type { AddDataService } from '../services/add_data'; -import type { FeatureCatalogueRegistry } from '../services/feature_catalogue'; -import type { EnvironmentService } from '../services/environment'; -import type { ConfigSchema } from '../../server/config'; -import type { WelcomeService } from '../services/welcome'; -export interface HomeKibanaServices { - dataViewsService: DataViewsContract; - kibanaVersion: string; - share: SharePluginSetup; - shareStart: SharePluginStart; - chrome: ChromeStart; - application: ApplicationStart; - uiSettings: IUiSettingsClient; - urlForwarding: UrlForwardingStart; - homeConfig: ConfigSchema; - featureCatalogue: FeatureCatalogueRegistry; - http: HttpStart; - notifications: NotificationsStart; - toastNotifications: NotificationsSetup['toasts']; - banners: OverlayStart['banners']; - trackUiMetric: (type: UiCounterMetricType, eventNames: string | string[], count?: number) => void; - getBasePath: () => string; - docLinks: DocLinksStart; - addBasePath: (url: string) => string; - environmentService: EnvironmentService; - tutorialService: TutorialService; - addDataService: AddDataService; - welcomeService: WelcomeService; - cloud: CloudSetup; - cloudStart: CloudStart; - overlays: OverlayStart; - theme: ThemeServiceStart; - i18nStart: I18nStart; - history: AppMountParameters['history']; -} -export declare function setServices(newServices: HomeKibanaServices): void; -export declare function getServices(): HomeKibanaServices; diff --git a/src/platform/plugins/shared/home/public/application/load_tutorials.d.ts b/src/platform/plugins/shared/home/public/application/load_tutorials.d.ts deleted file mode 100644 index 3208a0b422884..0000000000000 --- a/src/platform/plugins/shared/home/public/application/load_tutorials.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TutorialType } from '../services/tutorials/types'; -export declare function getTutorials(): Promise; -export declare function getTutorial(id: string): Promise; diff --git a/src/platform/plugins/shared/home/public/index.d.ts b/src/platform/plugins/shared/home/public/index.d.ts deleted file mode 100644 index cb9025762312c..0000000000000 --- a/src/platform/plugins/shared/home/public/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -export type { FeatureCatalogueSetup, EnvironmentSetup, TutorialSetup, HomePublicPluginSetup, HomePublicPluginStart, } from './plugin'; -export type { AddDataTab, FeatureCatalogueCategory, FeatureCatalogueEntry, FeatureCatalogueRegistry, FeatureCatalogueSolution, Environment, TutorialVariables, TutorialDirectoryHeaderLinkComponent, TutorialModuleNoticeComponent, WelcomeRenderTelemetryNotice, WelcomeServiceSetup, } from './services'; -export type { CustomComponentProps } from './services/tutorials/tutorial_service'; -export { INSTRUCTION_VARIANT, getDisplayText } from '../common/instruction_variant'; -import { HomePublicPlugin } from './plugin'; -export declare const plugin: (initializerContext: PluginInitializerContext) => HomePublicPlugin; diff --git a/src/platform/plugins/shared/home/public/plugin.d.ts b/src/platform/plugins/shared/home/public/plugin.d.ts deleted file mode 100644 index 59c3801b250f8..0000000000000 --- a/src/platform/plugins/shared/home/public/plugin.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import type { AppMountParameters, CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import type { UrlForwardingSetup, UrlForwardingStart } from '@kbn/url-forwarding-plugin/public'; -import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; -import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; -import type { ConfigSchema } from '../server/config'; -import type { EnvironmentServiceSetup, FeatureCatalogueRegistrySetup, TutorialServiceSetup, AddDataServiceSetup, WelcomeServiceSetup } from './services'; -import { FeatureCatalogueRegistry } from './services'; -export interface HomePluginStartDependencies { - dataViews: DataViewsPublicPluginStart; - urlForwarding: UrlForwardingStart; - cloud: CloudStart; - share: SharePluginStart; - history: AppMountParameters['history']; -} -export interface HomePluginSetupDependencies { - cloud: CloudSetup; - share: SharePluginSetup; - usageCollection?: UsageCollectionSetup; - urlForwarding: UrlForwardingSetup; -} -export declare class HomePublicPlugin implements Plugin { - private readonly initializerContext; - private readonly featuresCatalogueRegistry; - private readonly environmentService; - private readonly tutorialService; - private readonly addDataService; - private readonly welcomeService; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup, { cloud, share, urlForwarding, usageCollection }: HomePluginSetupDependencies): HomePublicPluginSetup; - start({ application: { capabilities } }: CoreStart): { - featureCatalogue: FeatureCatalogueRegistry; - }; -} -/** @public */ -export type FeatureCatalogueSetup = FeatureCatalogueRegistrySetup; -/** @public */ -export type EnvironmentSetup = EnvironmentServiceSetup; -/** @public */ -export type TutorialSetup = TutorialServiceSetup; -/** @public */ -export type AddDataSetup = AddDataServiceSetup; -/** @public */ -export interface HomePublicPluginSetup { - tutorials: TutorialServiceSetup; - addData: AddDataServiceSetup; - featureCatalogue: FeatureCatalogueSetup; - welcomeScreen: WelcomeServiceSetup; - /** - * The environment service is only available for a transition period and will - * be replaced by display specific extension points. - * @deprecated - * @removeBy 8.8.0 - */ - environment: EnvironmentSetup; -} -export interface HomePublicPluginStart { - featureCatalogue: FeatureCatalogueRegistry; -} diff --git a/src/platform/plugins/shared/home/public/services/add_data/add_data_service.d.ts b/src/platform/plugins/shared/home/public/services/add_data/add_data_service.d.ts deleted file mode 100644 index 99bd53abd379c..0000000000000 --- a/src/platform/plugins/shared/home/public/services/add_data/add_data_service.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** @public */ -export interface AddDataTab { - id: string; - name: string; - getComponent: () => JSX.Element; -} -/** @public */ -export interface CloudConnectStatusResult { - isCloudConnected: boolean; - isLoading: boolean; -} -/** @public */ -export type CloudConnectStatusHook = () => CloudConnectStatusResult; -export declare class AddDataService { - private addDataTabs; - private cloudConnectStatusHook; - setup(): { - /** - * Registers a component that will be rendered as a new tab in the Add data page - */ - registerAddDataTab: (tab: AddDataTab) => void; - /** - * Registers a hook that returns the cloud connect status. - * Used by the cloud_connect plugin to provide connection status to the home page. - */ - registerCloudConnectStatusHook: (hook: CloudConnectStatusHook) => void; - }; - getAddDataTabs(): AddDataTab[]; - getCloudConnectStatusHook(): CloudConnectStatusHook; -} -export type AddDataServiceSetup = ReturnType; diff --git a/src/platform/plugins/shared/home/public/services/add_data/index.d.ts b/src/platform/plugins/shared/home/public/services/add_data/index.d.ts deleted file mode 100644 index 3d578c82dd3da..0000000000000 --- a/src/platform/plugins/shared/home/public/services/add_data/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { AddDataService } from './add_data_service'; -export type { AddDataServiceSetup, AddDataTab } from './add_data_service'; diff --git a/src/platform/plugins/shared/home/public/services/environment/environment.d.ts b/src/platform/plugins/shared/home/public/services/environment/environment.d.ts deleted file mode 100644 index 08f0ef41a2f52..0000000000000 --- a/src/platform/plugins/shared/home/public/services/environment/environment.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** @public */ -export interface Environment { - /** - * Flag whether the home app should advertise cloud features - */ - readonly cloud: boolean; - /** - * Flag whether the home app should advertise apm features - */ - readonly apmUi: boolean; - /** - * Flag whether the home app should advertise ml features - */ - readonly ml: boolean; -} -export declare class EnvironmentService { - private environment; - setup(): { - /** - * Update the environment to influence how the home app is presenting available features. - * This API should not be extended for new features and will be removed in future versions - * in favor of display specific extension apis. - * @deprecated - * @removeBy 8.8.0 - * @param update - */ - update: (update: Partial) => void; - }; - getEnvironment(): { - cloud: boolean; - apmUi: boolean; - ml: boolean; - }; -} -export type EnvironmentServiceSetup = ReturnType; diff --git a/src/platform/plugins/shared/home/public/services/environment/index.d.ts b/src/platform/plugins/shared/home/public/services/environment/index.d.ts deleted file mode 100644 index a364e8fd3fa0e..0000000000000 --- a/src/platform/plugins/shared/home/public/services/environment/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { EnvironmentService } from './environment'; -export type { Environment, EnvironmentServiceSetup } from './environment'; diff --git a/src/platform/plugins/shared/home/public/services/feature_catalogue/feature_catalogue_registry.d.ts b/src/platform/plugins/shared/home/public/services/feature_catalogue/feature_catalogue_registry.d.ts deleted file mode 100644 index 6e3fb9dde1c04..0000000000000 --- a/src/platform/plugins/shared/home/public/services/feature_catalogue/feature_catalogue_registry.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import type { Capabilities } from '@kbn/core/public'; -import type { IconType } from '@elastic/eui'; -import type { Observable } from 'rxjs'; -/** @public */ -export type FeatureCatalogueCategory = 'admin' | 'data' | 'other'; -/** @public */ -export interface FeatureCatalogueEntry { - /** Unique string identifier for this feature. */ - readonly id: string; - /** Title of feature displayed to the user. */ - readonly title: string; - /** {@link FeatureCatalogueCategory} to display this feature in. */ - readonly category: FeatureCatalogueCategory; - /** A tagline of feature displayed to the user. */ - readonly subtitle?: string; - /** One-line description of feature displayed to the user. */ - readonly description: string; - /** EUI `IconType` for icon to be displayed to the user. EUI supports any known EUI icon, SVG URL, or ReactElement. */ - readonly icon: IconType; - /** URL path to link to this future. Should not include the basePath. */ - readonly path: string; - /** Whether or not this link should be shown on the front page of Kibana. */ - readonly showOnHomePage: boolean; - /** An ordinal used to sort features relative to one another for display on the home page */ - readonly order?: number; - /** Optional function to control visibility of this feature. */ - readonly visible?: () => boolean; - /** Unique string identifier of the solution this feature belongs to */ - readonly solutionId?: string; -} -/** @public */ -export interface FeatureCatalogueSolution { - /** Unique string identifier for this solution. */ - readonly id: string; - /** Title of solution displayed to the user. */ - readonly title: string; - /** One-line description of the solution displayed to the user. */ - readonly description: string; - /** EUI `IconType` for icon to be displayed to the user. EUI supports any known EUI icon, SVG URL, or ReactElement. */ - readonly icon: IconType; - /** URL path to link to this future. Should not include the basePath. */ - readonly path: string; - /** An ordinal used to sort solutions relative to one another for display on the home page */ - readonly order: number; - /** Optional function to control visibility of this solution. */ - readonly isVisible?: (capabilities: Capabilities) => boolean; -} -export declare class FeatureCatalogueRegistry { - private capabilities; - private solutions; - private featuresSubject; - setup(): { - register: (feature: FeatureCatalogueEntry) => void; - registerSolution: (solution: FeatureCatalogueSolution) => void; - }; - start({ capabilities }: { - capabilities: Capabilities; - }): void; - /** - * @deprecated - * Use getFeatures$() instead - */ - get(features?: Map): FeatureCatalogueEntry[]; - getFeatures$(): Observable; - getSolutions(): FeatureCatalogueSolution[]; - removeFeature(appId: string): void; -} -export type FeatureCatalogueRegistrySetup = ReturnType; diff --git a/src/platform/plugins/shared/home/public/services/feature_catalogue/index.d.ts b/src/platform/plugins/shared/home/public/services/feature_catalogue/index.d.ts deleted file mode 100644 index 75e10f7c1ab3b..0000000000000 --- a/src/platform/plugins/shared/home/public/services/feature_catalogue/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { FeatureCatalogueRegistry } from './feature_catalogue_registry'; -export type { FeatureCatalogueCategory, FeatureCatalogueEntry, FeatureCatalogueSolution, FeatureCatalogueRegistrySetup, } from './feature_catalogue_registry'; diff --git a/src/platform/plugins/shared/home/public/services/index.d.ts b/src/platform/plugins/shared/home/public/services/index.d.ts deleted file mode 100644 index 6187ae5b57a70..0000000000000 --- a/src/platform/plugins/shared/home/public/services/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export { FeatureCatalogueRegistry } from './feature_catalogue'; -export type { FeatureCatalogueCategory, FeatureCatalogueEntry, FeatureCatalogueSolution, FeatureCatalogueRegistrySetup, } from './feature_catalogue'; -export { EnvironmentService } from './environment'; -export type { Environment, EnvironmentServiceSetup } from './environment'; -export { TutorialService } from './tutorials'; -export type { TutorialVariables, TutorialServiceSetup, TutorialDirectoryHeaderLinkComponent, TutorialModuleNoticeComponent, } from './tutorials'; -export { AddDataService } from './add_data'; -export type { AddDataServiceSetup, AddDataTab } from './add_data'; -export { WelcomeService } from './welcome'; -export type { WelcomeServiceSetup, WelcomeRenderTelemetryNotice } from './welcome'; diff --git a/src/platform/plugins/shared/home/public/services/tutorials/index.d.ts b/src/platform/plugins/shared/home/public/services/tutorials/index.d.ts deleted file mode 100644 index 5c6ae459a24a5..0000000000000 --- a/src/platform/plugins/shared/home/public/services/tutorials/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { TutorialService } from './tutorial_service'; -export type { TutorialVariables, TutorialServiceSetup, TutorialDirectoryHeaderLinkComponent, TutorialModuleNoticeComponent, } from './tutorial_service'; diff --git a/src/platform/plugins/shared/home/public/services/tutorials/tutorial_service.d.ts b/src/platform/plugins/shared/home/public/services/tutorials/tutorial_service.d.ts deleted file mode 100644 index de9a095d0c427..0000000000000 --- a/src/platform/plugins/shared/home/public/services/tutorials/tutorial_service.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type React from 'react'; -import type { HomeKibanaServices } from '../../application/kibana_services'; -/** @public */ -export type TutorialVariables = Partial>; -/** @public */ -export type TutorialDirectoryHeaderLinkComponent = React.FC; -/** @public */ -export type TutorialModuleNoticeComponent = React.FC<{ - moduleName: string; -}>; -export type CustomStatusCheckCallback = () => Promise; -export interface CustomComponentProps { - http: HomeKibanaServices['http']; - basePath: string; - isDarkTheme: boolean; - kibanaVersion: string; - variantId: string; - isCloudEnabled: boolean; -} -type CustomComponent = () => Promise>; -export declare class TutorialService { - private tutorialVariables; - private tutorialDirectoryHeaderLinks; - private tutorialModuleNotices; - private customStatusCheck; - private customComponent; - setup(): { - /** - * Set a variable usable in tutorial templates. Access with `{config.}`. - */ - setVariable: (key: string, value: unknown) => void; - /** - * Registers a component that will be rendered next to tutorial directory title/header area. - */ - registerDirectoryHeaderLink: (id: string, component: TutorialDirectoryHeaderLinkComponent) => void; - /** - * Registers a component that will be rendered in the description of a tutorial that is associated with a module. - */ - registerModuleNotice: (id: string, component: TutorialModuleNoticeComponent) => void; - registerCustomStatusCheck: (name: string, fnCallback: CustomStatusCheckCallback) => void; - registerCustomComponent: (name: string, component: CustomComponent) => void; - }; - getVariables(): Partial>; - getDirectoryHeaderLinks(): TutorialDirectoryHeaderLinkComponent[]; - getModuleNotices(): TutorialModuleNoticeComponent[]; - getCustomStatusCheck(customStatusCheckName: string): CustomStatusCheckCallback; - getCustomComponent(customComponentName: string): CustomComponent; -} -export type TutorialServiceSetup = ReturnType; -export {}; diff --git a/src/platform/plugins/shared/home/public/services/tutorials/types.d.ts b/src/platform/plugins/shared/home/public/services/tutorials/types.d.ts deleted file mode 100644 index 3c17fb0f277dd..0000000000000 --- a/src/platform/plugins/shared/home/public/services/tutorials/types.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { TutorialSchema, InstructionSetSchema, StatusCheckSchema, InstructionVariant, Instruction, InstructionsSchema } from '../../../server'; -export type TutorialType = TutorialSchema; -export type InstructionSetType = InstructionSetSchema; -export type InstructionsType = InstructionsSchema; -export type StatusCheckType = StatusCheckSchema; -export type InstructionVariantType = InstructionVariant; -export type InstructionType = Instruction; diff --git a/src/platform/plugins/shared/home/public/services/welcome/index.d.ts b/src/platform/plugins/shared/home/public/services/welcome/index.d.ts deleted file mode 100644 index 225fe2b7c97cb..0000000000000 --- a/src/platform/plugins/shared/home/public/services/welcome/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { WelcomeServiceSetup, WelcomeRenderTelemetryNotice } from './welcome_service'; -export { WelcomeService } from './welcome_service'; diff --git a/src/platform/plugins/shared/home/public/services/welcome/welcome_service.d.ts b/src/platform/plugins/shared/home/public/services/welcome/welcome_service.d.ts deleted file mode 100644 index 6ad9c96f89be5..0000000000000 --- a/src/platform/plugins/shared/home/public/services/welcome/welcome_service.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export type WelcomeRenderTelemetryNotice = () => null | JSX.Element; -export interface WelcomeServiceSetup { - /** - * Register listeners to be called when the Welcome component is mounted. - * It can be called multiple times to register multiple listeners. - */ - registerOnRendered: (onRendered: () => void) => void; - /** - * Register a renderer of the telemetry notice to be shown below the Welcome page. - */ - registerTelemetryNoticeRenderer: (renderTelemetryNotice: WelcomeRenderTelemetryNotice) => void; -} -export declare class WelcomeService { - private readonly onRenderedHandlers; - private renderTelemetryNoticeHandler?; - setup: () => WelcomeServiceSetup; - onRendered: () => void; - renderTelemetryNotice: () => JSX.Element | null; -} diff --git a/src/platform/plugins/shared/home/server/capabilities_provider.d.ts b/src/platform/plugins/shared/home/server/capabilities_provider.d.ts deleted file mode 100644 index ea467c4dbe19f..0000000000000 --- a/src/platform/plugins/shared/home/server/capabilities_provider.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare const capabilitiesProvider: () => { - catalogue: { - discover: boolean; - dashboard: boolean; - visualize: boolean; - console: boolean; - advanced_settings: boolean; - indexPatterns: boolean; - }; -}; diff --git a/src/platform/plugins/shared/home/server/config.d.ts b/src/platform/plugins/shared/home/server/config.d.ts deleted file mode 100644 index fcf0bdc9c94fb..0000000000000 --- a/src/platform/plugins/shared/home/server/config.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -export declare const configSchema: import("@kbn/config-schema").ObjectType<{ - disableWelcomeScreen: import("@kbn/config-schema").Type; -}>; -export type ConfigSchema = TypeOf; diff --git a/src/platform/plugins/shared/home/server/index.d.ts b/src/platform/plugins/shared/home/server/index.d.ts deleted file mode 100644 index a8b654502bee6..0000000000000 --- a/src/platform/plugins/shared/home/server/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type { HomeServerPluginSetup, HomeServerPluginStart } from './plugin'; -export { TutorialsCategory } from './services'; -export type { AppLinkData, ArtifactsSchema, TutorialProvider, TutorialSchema, StatusCheckSchema, Instruction, InstructionVariant, InstructionSetSchema, InstructionsSchema, TutorialContext, SampleDatasetProvider, SampleDataRegistrySetup, SampleDatasetDashboardPanel, SampleObject, ScopedTutorialContextFactory, } from './services'; -import type { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server'; -import type { ConfigSchema } from './config'; -export declare const config: PluginConfigDescriptor; -export declare const plugin: (initContext: PluginInitializerContext) => Promise; -export { INSTRUCTION_VARIANT } from '../common/instruction_variant'; diff --git a/src/platform/plugins/shared/home/server/plugin.d.ts b/src/platform/plugins/shared/home/server/plugin.d.ts deleted file mode 100644 index 452ecb4de4fb9..0000000000000 --- a/src/platform/plugins/shared/home/server/plugin.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; -import type { TutorialsRegistrySetup, TutorialsRegistryStart, SampleDataRegistrySetup, SampleDataRegistryStart } from './services'; -export interface HomeServerPluginSetupDependencies { - usageCollection?: UsageCollectionSetup; - customIntegrations?: CustomIntegrationsPluginSetup; -} -export declare class HomeServerPlugin implements Plugin { - private readonly initContext; - private readonly tutorialsRegistry; - private readonly sampleDataRegistry; - private customIntegrations?; - private readonly isDevMode; - constructor(initContext: PluginInitializerContext); - setup(core: CoreSetup, plugins: HomeServerPluginSetupDependencies): HomeServerPluginSetup; - start(core: CoreStart): HomeServerPluginStart; -} -/** @public */ -export interface HomeServerPluginSetup { - tutorials: TutorialsRegistrySetup; - sampleData: SampleDataRegistrySetup; -} -/** @public */ -export interface HomeServerPluginStart { - tutorials: TutorialsRegistryStart; - sampleData: SampleDataRegistryStart; -} diff --git a/src/platform/plugins/shared/home/server/routes/fetch_es_hits_status.d.ts b/src/platform/plugins/shared/home/server/routes/fetch_es_hits_status.d.ts deleted file mode 100644 index 1fe7b56f213a4..0000000000000 --- a/src/platform/plugins/shared/home/server/routes/fetch_es_hits_status.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { IRouter } from '@kbn/core/server'; -export declare const registerHitsStatusRoute: (router: IRouter) => void; diff --git a/src/platform/plugins/shared/home/server/routes/index.d.ts b/src/platform/plugins/shared/home/server/routes/index.d.ts deleted file mode 100644 index 595b0535c36a6..0000000000000 --- a/src/platform/plugins/shared/home/server/routes/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { IRouter } from '@kbn/core/server'; -export declare const registerRoutes: (router: IRouter) => void; diff --git a/src/platform/plugins/shared/home/server/saved_objects/index.d.ts b/src/platform/plugins/shared/home/server/saved_objects/index.d.ts deleted file mode 100644 index 7b3073b37b2a8..0000000000000 --- a/src/platform/plugins/shared/home/server/saved_objects/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { sampleDataTelemetry } from './sample_data_telemetry'; diff --git a/src/platform/plugins/shared/home/server/saved_objects/sample_data_telemetry.d.ts b/src/platform/plugins/shared/home/server/saved_objects/sample_data_telemetry.d.ts deleted file mode 100644 index 49ffeae8052cd..0000000000000 --- a/src/platform/plugins/shared/home/server/saved_objects/sample_data_telemetry.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObjectsType } from '@kbn/core/server'; -export declare const sampleDataTelemetry: SavedObjectsType; diff --git a/src/platform/plugins/shared/home/server/services/index.d.ts b/src/platform/plugins/shared/home/server/services/index.d.ts deleted file mode 100644 index 3be00e7b4b2c9..0000000000000 --- a/src/platform/plugins/shared/home/server/services/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { TutorialsRegistry, TutorialsCategory } from './tutorials'; -export type { TutorialsRegistrySetup, TutorialsRegistryStart } from './tutorials'; -export type { InstructionSetSchema, InstructionsSchema, DashboardSchema, ArtifactsSchema, StatusCheckSchema, InstructionVariant, Instruction, TutorialSchema, TutorialProvider, TutorialContext, TutorialContextFactory, ScopedTutorialContextFactory, } from './tutorials'; -export { SampleDataRegistry } from './sample_data'; -export type { AppLinkData, SampleDataRegistrySetup, SampleDataRegistryStart, SampleDatasetDashboardPanel, SampleDatasetProvider, SampleDatasetSchema, SampleObject, } from './sample_data'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/field_mappings.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/field_mappings.d.ts deleted file mode 100644 index 9746be9627ade..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/field_mappings.d.ts +++ /dev/null @@ -1,202 +0,0 @@ -export declare const fieldMappings: { - category: { - type: string; - fields: { - keyword: { - type: string; - }; - }; - }; - currency: { - type: string; - }; - customer_birth_date: { - type: string; - }; - customer_first_name: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - customer_full_name: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - customer_gender: { - type: string; - }; - customer_id: { - type: string; - }; - customer_last_name: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - customer_phone: { - type: string; - }; - day_of_week: { - type: string; - }; - day_of_week_i: { - type: string; - }; - email: { - type: string; - }; - manufacturer: { - type: string; - fields: { - keyword: { - type: string; - }; - }; - }; - order_date: { - type: string; - }; - order_id: { - type: string; - }; - products: { - properties: { - base_price: { - type: string; - }; - discount_percentage: { - type: string; - }; - quantity: { - type: string; - }; - manufacturer: { - type: string; - fields: { - keyword: { - type: string; - }; - }; - }; - tax_amount: { - type: string; - }; - product_id: { - type: string; - }; - category: { - type: string; - fields: { - keyword: { - type: string; - }; - }; - }; - sku: { - type: string; - }; - taxless_price: { - type: string; - }; - unit_discount_amount: { - type: string; - }; - min_price: { - type: string; - }; - _id: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - discount_amount: { - type: string; - }; - created_on: { - type: string; - }; - product_name: { - type: string; - analyzer: string; - fields: { - keyword: { - type: string; - }; - }; - }; - price: { - type: string; - }; - taxful_price: { - type: string; - }; - base_unit_price: { - type: string; - }; - }; - }; - sku: { - type: string; - }; - taxful_total_price: { - type: string; - }; - taxless_total_price: { - type: string; - }; - total_quantity: { - type: string; - }; - total_unique_products: { - type: string; - }; - type: { - type: string; - }; - user: { - type: string; - }; - geoip: { - properties: { - country_iso_code: { - type: string; - }; - location: { - type: string; - }; - region_name: { - type: string; - }; - continent_name: { - type: string; - }; - city_name: { - type: string; - }; - }; - }; - event: { - properties: { - dataset: { - type: string; - }; - }; - }; -}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/index.d.ts deleted file mode 100644 index ac80e91fc4fa6..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SampleDatasetProvider } from '../../lib/sample_dataset_registry_types'; -export declare const ecommerceSpecProvider: SampleDatasetProvider; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/saved_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/saved_objects.d.ts deleted file mode 100644 index ae8dff6cc46e7..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/saved_objects.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObject } from '@kbn/core/server'; -export declare const getSavedObjects: () => SavedObject[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/field_mappings.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/field_mappings.d.ts deleted file mode 100644 index a48137c4787c6..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/field_mappings.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -export declare const fieldMappings: { - timestamp: { - type: string; - }; - dayOfWeek: { - type: string; - }; - Carrier: { - type: string; - }; - FlightNum: { - type: string; - }; - Origin: { - type: string; - }; - OriginAirportID: { - type: string; - }; - OriginCityName: { - type: string; - }; - OriginRegion: { - type: string; - }; - OriginCountry: { - type: string; - }; - OriginLocation: { - type: string; - }; - Dest: { - type: string; - }; - DestAirportID: { - type: string; - }; - DestCityName: { - type: string; - }; - DestRegion: { - type: string; - }; - DestCountry: { - type: string; - }; - DestLocation: { - type: string; - }; - AvgTicketPrice: { - type: string; - }; - OriginWeather: { - type: string; - }; - DestWeather: { - type: string; - }; - Cancelled: { - type: string; - }; - DistanceMiles: { - type: string; - }; - DistanceKilometers: { - type: string; - }; - FlightDelayMin: { - type: string; - }; - FlightDelay: { - type: string; - }; - FlightDelayType: { - type: string; - }; - FlightTimeMin: { - type: string; - }; - FlightTimeHour: { - type: string; - }; -}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/index.d.ts deleted file mode 100644 index 1135d354e71f3..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SampleDatasetProvider } from '../../lib/sample_dataset_registry_types'; -export declare const flightsSpecProvider: SampleDatasetProvider; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/saved_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/saved_objects.d.ts deleted file mode 100644 index ae8dff6cc46e7..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/saved_objects.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObject } from '@kbn/core/server'; -export declare const getSavedObjects: () => SavedObject[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/index.d.ts deleted file mode 100644 index f65170eb95de4..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { flightsSpecProvider } from './flights'; -export { logsSpecProvider } from './logs'; -export { ecommerceSpecProvider } from './ecommerce'; -export { logsTSDBSpecProvider } from './logs_tsdb'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/field_mappings.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/field_mappings.d.ts deleted file mode 100644 index 3497d39b08843..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/field_mappings.d.ts +++ /dev/null @@ -1,155 +0,0 @@ -export declare const fieldMappings: { - request: { - type: string; - fields: { - keyword: { - type: string; - time_series_dimension: boolean; - }; - }; - }; - geo: { - properties: { - srcdest: { - type: string; - }; - src: { - type: string; - }; - dest: { - type: string; - }; - coordinates: { - type: string; - }; - }; - }; - utc_time: { - type: string; - }; - url: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - message: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - host: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - clientip: { - type: string; - }; - response: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - machine: { - properties: { - ram: { - type: string; - }; - os: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - }; - }; - agent: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - bytes: { - type: string; - }; - tags: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - referer: { - type: string; - }; - ip: { - type: string; - }; - ip_range: { - type: string; - }; - '@timestamp': { - type: string; - }; - timestamp: { - type: string; - path: string; - }; - timestamp_range: { - type: string; - }; - phpmemory: { - type: string; - }; - bytes_counter: { - type: string; - time_series_metric: string; - }; - bytes_gauge: { - type: string; - time_series_metric: string; - }; - memory: { - type: string; - }; - extension: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - event: { - properties: { - dataset: { - type: string; - }; - }; - }; -}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/index.d.ts deleted file mode 100644 index 46b3ff12dbe6b..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SampleDatasetProvider } from '../../lib/sample_dataset_registry_types'; -export declare const logsSpecProvider: SampleDatasetProvider; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/saved_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/saved_objects.d.ts deleted file mode 100644 index ae8dff6cc46e7..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/saved_objects.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObject } from '@kbn/core/server'; -export declare const getSavedObjects: () => SavedObject[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/field_mappings.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/field_mappings.d.ts deleted file mode 100644 index 66faa398b22ca..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/field_mappings.d.ts +++ /dev/null @@ -1,141 +0,0 @@ -export declare const fieldMappings: { - request: { - type: string; - }; - geo: { - properties: { - srcdest: { - type: string; - }; - src: { - type: string; - }; - dest: { - type: string; - }; - coordinates: { - type: string; - }; - }; - }; - utc_time: { - type: string; - }; - url: { - type: string; - }; - message: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - host: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - clientip: { - type: string; - }; - response: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - machine: { - properties: { - ram: { - type: string; - }; - os: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - }; - }; - agent: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - bytes: { - type: string; - }; - tags: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - referer: { - type: string; - }; - ip: { - type: string; - }; - '@timestamp': { - type: string; - }; - timestamp: { - type: string; - path: string; - }; - phpmemory: { - type: string; - }; - bytes_counter: { - type: string; - time_series_metric: string; - }; - bytes_normal_counter: { - type: string; - }; - bytes_gauge: { - type: string; - time_series_metric: string; - }; - memory: { - type: string; - }; - extension: { - type: string; - fields: { - keyword: { - type: string; - ignore_above: number; - }; - }; - }; - event: { - properties: { - dataset: { - type: string; - time_series_dimension: boolean; - }; - }; - }; -}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/index.d.ts deleted file mode 100644 index 8a78418ac5e92..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SampleDatasetProvider } from '../../lib/sample_dataset_registry_types'; -export declare const GLOBE_ICON_PATH = "/platform/plugins/shared/home/assets/sample_data_resources/logs/icon.svg"; -export declare const logsTSDBSpecProvider: SampleDatasetProvider; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/saved_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/saved_objects.d.ts deleted file mode 100644 index ae8dff6cc46e7..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/saved_objects.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObject } from '@kbn/core/server'; -export declare const getSavedObjects: () => SavedObject[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/errors.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/errors.d.ts deleted file mode 100644 index bcc7db21bd8a3..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/errors.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare class SampleDataInstallError extends Error { - readonly httpCode: number; - constructor(message: string, httpCode: number); -} diff --git a/src/platform/plugins/shared/home/server/services/sample_data/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/index.d.ts deleted file mode 100644 index bd5c330bdc595..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { SampleDataRegistry } from './sample_data_registry'; -export type { SampleDataRegistrySetup, SampleDataRegistryStart } from './sample_data_registry'; -export type { AppLinkData, SampleDatasetDashboardPanel, SampleDatasetProvider, SampleDatasetSchema, SampleObject, } from './lib/sample_dataset_registry_types'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/create_index_name.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/create_index_name.d.ts deleted file mode 100644 index ba7c611fa8fc7..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/create_index_name.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const createIndexName: (sampleDataSetId: string, dataIndexId: string) => string; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/find_sample_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/find_sample_objects.d.ts deleted file mode 100644 index e49fe3fcd06e4..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/find_sample_objects.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; -export interface FindSampleObjectsParams { - client: SavedObjectsClientContract; - logger: Logger; - objects: SampleObject[]; -} -export interface SampleObject { - type: string; - id: string; -} -export interface FindSampleObjectsResponseObject { - type: string; - id: string; - /** Contains a string if this sample data object was found, or undefined if it was not. */ - foundObjectId: string | undefined; -} -/** - * Given an array of objects in a sample dataset, this function attempts to find if those objects exist in the current space. - * It attempts to find objects with an origin of the sample data (e.g., matching `id` or `originId`). - */ -export declare function findSampleObjects({ client, logger, objects }: FindSampleObjectsParams): Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/insert_data_into_index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/insert_data_into_index.d.ts deleted file mode 100644 index 8a51e7732283a..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/insert_data_into_index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { IScopedClusterClient, Logger } from '@kbn/core/server'; -import type { DataIndexSchema } from './sample_dataset_registry_types'; -export declare const insertDataIntoIndex: ({ dataIndexConfig, logger, esClient, index, nowReference, }: { - dataIndexConfig: DataIndexSchema; - index: string; - nowReference: string; - esClient: IScopedClusterClient; - logger: Logger; -}) => Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/load_data.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/load_data.d.ts deleted file mode 100644 index 74e187b76ea1d..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/load_data.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function loadData(path: string, bulkInsert: (docs: unknown[]) => Promise): Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/register_with_integrations.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/register_with_integrations.d.ts deleted file mode 100644 index cd1376c816e62..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/register_with_integrations.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CoreSetup } from '@kbn/core/server'; -import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; -export declare function registerSampleDatasetWithIntegration(customIntegrations: CustomIntegrationsPluginSetup, core: CoreSetup): void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types.d.ts deleted file mode 100644 index 808a8ab981eae..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { IStaticAssets } from '@kbn/core/server'; -import type { SampleDatasetSchema } from './sample_dataset_schema'; -export type { SampleDatasetSchema, DataIndexSchema } from './sample_dataset_schema'; -export declare enum DatasetStatusTypes { - NOT_INSTALLED = "not_installed", - INSTALLED = "installed", - UNKNOWN = "unknown" -} -export interface SampleDatasetDashboardPanel { - sampleDataId: string; - dashboardId: string; - oldEmbeddableId: string; - embeddableId: string; - embeddableType: string; - embeddableConfig: object; -} -export interface SampleDatasetProviderContext { - staticAssets: IStaticAssets; -} -export type SampleDatasetProvider = (context: SampleDatasetProviderContext) => SampleDatasetSchema; -/** This type is used to identify an object in a sample dataset. */ -export interface SampleObject { - /** The type of the sample object. */ - type: string; - /** The ID of the sample object. */ - id: string; -} -/** - * This type is used by consumers to register a new app link for a sample dataset. - */ -export interface AppLinkData { - /** - * The sample object that is used for this app link's path; if the path does not use an object ID, set this to null. - */ - sampleObject: SampleObject | null; - /** - * Function that returns the path for this app link. Note that the `objectId` can be different than the given `sampleObject.id`, depending - * on how the sample data was installed. If the `sampleObject` is null, the `objectId` argument will be an empty string. - */ - getPath: (objectId: string) => string; - /** - * The label for this app link. - */ - label: string; - /** - * The icon for this app link. - */ - icon: string; - /** - * Index of the links (ascending order, smallest will be displayed first). - * Used for ordering in the dropdown. - * - * @remark links without order defined will be displayed last - */ - order?: number; -} diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_schema.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_schema.d.ts deleted file mode 100644 index 78e55585b1565..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_schema.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { Writable } from '@kbn/utility-types'; -import type { TypeOf } from '@kbn/config-schema'; -declare const dataIndexSchema: import("@kbn/config-schema").ObjectType<{ - id: import("@kbn/config-schema").Type; - dataPath: import("@kbn/config-schema").Type; - fields: import("@kbn/config-schema").Type>; - timeFields: import("@kbn/config-schema").Type; - isDataStream: import("@kbn/config-schema").Type; - indexSettings: import("@kbn/config-schema").Type | undefined>; - currentTimeMarker: import("@kbn/config-schema").Type; - preserveDayOfWeekTimeOfDay: import("@kbn/config-schema").Type; -}>; -export type DataIndexSchema = TypeOf; -export declare const sampleDataSchema: import("@kbn/config-schema").ObjectType<{ - id: import("@kbn/config-schema").Type; - name: import("@kbn/config-schema").Type; - description: import("@kbn/config-schema").Type; - previewImagePath: import("@kbn/config-schema").Type; - darkPreviewImagePath: import("@kbn/config-schema").Type; - iconPath: import("@kbn/config-schema").Type; - overviewDashboard: import("@kbn/config-schema").Type; - defaultIndex: import("@kbn/config-schema").Type; - savedObjects: import("@kbn/config-schema").Type[]>; - dataIndices: import("@kbn/config-schema").Type | undefined; - isDataStream?: boolean | undefined; - } & { - fields: Record; - id: string; - dataPath: string; - timeFields: string[]; - currentTimeMarker: string; - preserveDayOfWeekTimeOfDay: boolean; - }>[]>; - status: import("@kbn/config-schema").Type; - statusMsg: import("@kbn/config-schema").Type; -}>; -export type SampleDatasetSchema = Writable>; -export {}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/translate_timestamp.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/translate_timestamp.d.ts deleted file mode 100644 index 75079ce55ba25..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/translate_timestamp.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function dateToIso8601IgnoringTime(date: Date): string; -export declare function translateTimeRelativeToDifference(source: string, sourceReference: any, targetReference: any): string; -export declare function translateTimeRelativeToWeek(source: string, sourceReference: any, targetReference: any): string; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/utils.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/utils.d.ts deleted file mode 100644 index f2ea9e410c414..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/lib/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SampleObject } from './sample_dataset_registry_types'; -export declare function getUniqueObjectTypes(objects: SampleObject[]): string[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/index.d.ts deleted file mode 100644 index 4a7585928a6e9..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/routes/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { createListRoute } from './list'; -export { createInstallRoute } from './install'; -export { createUninstallRoute } from './uninstall'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/install.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/install.d.ts deleted file mode 100644 index 7bf530c62d6cf..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/routes/install.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { IRouter, Logger } from '@kbn/core/server'; -import type { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; -import type { SampleDatasetSchema } from '../lib/sample_dataset_registry_types'; -import type { SampleDataUsageTracker } from '../usage/usage'; -export declare function createInstallRoute(router: IRouter, sampleDatasets: SampleDatasetSchema[], logger: Logger, usageTracker: SampleDataUsageTracker, analytics: AnalyticsServiceSetup): void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/list.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/list.d.ts deleted file mode 100644 index 58df59f9eed8c..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/routes/list.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IRouter, Logger } from '@kbn/core/server'; -import type { AppLinkData, SampleDatasetSchema } from '../lib/sample_dataset_registry_types'; -export declare const createListRoute: (router: IRouter, sampleDatasets: SampleDatasetSchema[], appLinksMap: Map, logger: Logger) => void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/uninstall.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/uninstall.d.ts deleted file mode 100644 index 3e76a0b02e385..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/routes/uninstall.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { IRouter, Logger } from '@kbn/core/server'; -import type { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; -import type { SampleDatasetSchema } from '../lib/sample_dataset_registry_types'; -import type { SampleDataUsageTracker } from '../usage/usage'; -export declare function createUninstallRoute(router: IRouter, sampleDatasets: SampleDatasetSchema[], logger: Logger, usageTracker: SampleDataUsageTracker, analytics: AnalyticsServiceSetup): void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/utils.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/utils.d.ts deleted file mode 100644 index 0799e5fbe6910..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/routes/utils.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { RequestHandlerContext, Logger } from '@kbn/core/server'; -import type { SampleDatasetSchema } from '../lib/sample_dataset_registry_types'; -import { SampleDataInstaller } from '../sample_data_installer'; -export declare const SAMPLE_DATA_INSTALLED_EVENT = "sample_data_installed"; -export declare const SAMPLE_DATA_UNINSTALLED_EVENT = "sample_data_uninstalled"; -export declare const getSampleDataInstaller: ({ datasetId, context, sampleDatasets, logger, }: { - datasetId: string; - context: RequestHandlerContext; - sampleDatasets: SampleDatasetSchema[]; - logger: Logger; -}) => Promise; -export declare const getSavedObjectsClient: (context: RequestHandlerContext, objectTypes: string[]) => Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/sample_data_installer.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/sample_data_installer.d.ts deleted file mode 100644 index 4cb1b0a69cecc..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/sample_data_installer.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { IScopedClusterClient, ISavedObjectsImporter, Logger, SavedObjectsClientContract } from '@kbn/core/server'; -import type { SampleDatasetSchema } from './lib/sample_dataset_registry_types'; -export interface SampleDataInstallerOptions { - esClient: IScopedClusterClient; - soClient: SavedObjectsClientContract; - soImporter: ISavedObjectsImporter; - sampleDatasets: SampleDatasetSchema[]; - logger: Logger; -} -export interface SampleDataInstallResult { - createdDocsPerIndex: Record; - createdSavedObjects: number; -} -/** - * Utility class in charge of installing and uninstalling sample datasets - */ -export declare class SampleDataInstaller { - private readonly esClient; - private readonly soClient; - private readonly soImporter; - private readonly sampleDatasets; - private readonly logger; - constructor({ esClient, soImporter, soClient, sampleDatasets, logger, }: SampleDataInstallerOptions); - install(datasetId: string, installDate?: Date): Promise; - uninstall(datasetId: string): Promise<{ - deletedSavedObjects: number; - }>; - private uninstallDataIndex; - private installDataIndex; - private importSavedObjects; - private deleteSavedObjects; -} diff --git a/src/platform/plugins/shared/home/server/services/sample_data/sample_data_registry.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/sample_data_registry.d.ts deleted file mode 100644 index e8bf6675b95a7..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/sample_data_registry.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { CoreSetup, PluginInitializerContext } from '@kbn/core/server'; -import type { SavedObject } from '@kbn/core/public'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; -import type { SampleDatasetDashboardPanel, AppLinkData } from './lib/sample_dataset_registry_types'; -export declare class SampleDataRegistry { - private readonly initContext; - constructor(initContext: PluginInitializerContext); - private readonly sampleDatasets; - private readonly appLinksMap; - private sampleDataProviderContext?; - private registerSampleDataSet; - setup(core: CoreSetup, usageCollections: UsageCollectionSetup | undefined, customIntegrations?: CustomIntegrationsPluginSetup, isDevMode?: boolean): { - getSampleDatasets: () => import("@kbn/utility-types").Writable[]; - dataIndices: Readonly<{ - indexSettings?: Record | undefined; - isDataStream?: boolean | undefined; - } & { - fields: Record; - id: string; - dataPath: string; - timeFields: string[]; - currentTimeMarker: string; - preserveDayOfWeekTimeOfDay: boolean; - }>[]; - }>>[]; - addSavedObjectsToSampleDataset: (id: string, savedObjects: SavedObject[]) => void; - addAppLinksToSampleDataset: (id: string, appLinks: AppLinkData[]) => void; - replacePanelInSampleDatasetDashboard: ({ sampleDataId, dashboardId, oldEmbeddableId, embeddableId, embeddableType, embeddableConfig, }: SampleDatasetDashboardPanel) => void; - }; - start(): {}; -} -/** @public */ -export type SampleDataRegistrySetup = ReturnType; -/** @public */ -export type SampleDataRegistryStart = ReturnType; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/usage/collector.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/usage/collector.d.ts deleted file mode 100644 index 7732988b07618..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/usage/collector.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -export declare function makeSampleDataUsageCollector(usageCollection: UsageCollectionSetup, getIndexForType: (type: string) => Promise): void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/usage/collector_fetch.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/usage/collector_fetch.d.ts deleted file mode 100644 index 141b0ea989e44..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/usage/collector_fetch.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import moment from 'moment'; -import type { CollectorFetchContext } from '@kbn/usage-collection-plugin/server'; -export interface TelemetryResponse { - installed: string[]; - uninstalled: string[]; - last_install_date: moment.Moment | null; - last_install_set: string | null; - last_uninstall_date: moment.Moment | null; - last_uninstall_set: string | null; -} -export declare function fetchProvider(getIndexForType: (type: string) => Promise): ({ esClient }: CollectorFetchContext) => Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/usage/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/usage/index.d.ts deleted file mode 100644 index bbd37c5dc805c..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/usage/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { makeSampleDataUsageCollector } from './collector'; -export { usage } from './usage'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/usage/usage.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/usage/usage.d.ts deleted file mode 100644 index 534cfc77dd7cc..0000000000000 --- a/src/platform/plugins/shared/home/server/services/sample_data/usage/usage.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Logger, SavedObjectsServiceStart } from '@kbn/core/server'; -export interface SampleDataUsageTracker { - addInstall(dataSet: string): void; - addUninstall(dataSet: string): void; -} -export declare function usage(savedObjects: Promise, logger: Logger): SampleDataUsageTracker; diff --git a/src/platform/plugins/shared/home/server/services/tutorials/index.d.ts b/src/platform/plugins/shared/home/server/services/tutorials/index.d.ts deleted file mode 100644 index 2ce75130bc6ad..0000000000000 --- a/src/platform/plugins/shared/home/server/services/tutorials/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { TutorialsRegistry } from './tutorials_registry'; -export type { TutorialsRegistrySetup, TutorialsRegistryStart } from './tutorials_registry'; -export { TutorialsCategory } from './lib/tutorials_registry_types'; -export type { InstructionSetSchema, StatusCheckSchema, InstructionsSchema, InstructionVariant, Instruction, DashboardSchema, ArtifactsSchema, TutorialSchema, TutorialProvider, TutorialContext, TutorialContextFactory, ScopedTutorialContextFactory, } from './lib/tutorials_registry_types'; diff --git a/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.d.ts b/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.d.ts deleted file mode 100644 index 730697f06509b..0000000000000 --- a/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.d.ts +++ /dev/null @@ -1,268 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -declare const dashboardSchema: import("@kbn/config-schema").ObjectType<{ - id: import("@kbn/config-schema").Type; - isOverview: import("@kbn/config-schema").Type; - linkLabel: import("@kbn/config-schema").ConditionalType; -}>; -export type DashboardSchema = TypeOf; -declare const artifactsSchema: import("@kbn/config-schema").ObjectType<{ - exportedFields: import("@kbn/config-schema").Type | undefined>; - dashboards: import("@kbn/config-schema").Type[]>; - application: import("@kbn/config-schema").Type | undefined>; -}>; -export type ArtifactsSchema = TypeOf; -declare const statusCheckSchema: import("@kbn/config-schema").ObjectType<{ - title: import("@kbn/config-schema").Type; - text: import("@kbn/config-schema").Type; - btnLabel: import("@kbn/config-schema").Type; - success: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - esHitsCheck: import("@kbn/config-schema").ObjectType<{ - index: import("@kbn/config-schema").Type; - query: import("@kbn/config-schema").Type>; - }>; -}>; -export type StatusCheckSchema = TypeOf; -declare const instructionSchema: import("@kbn/config-schema").ObjectType<{ - title: import("@kbn/config-schema").Type; - textPre: import("@kbn/config-schema").Type; - commands: import("@kbn/config-schema").Type; - textPost: import("@kbn/config-schema").Type; - customComponentName: import("@kbn/config-schema").Type; -}>; -export type Instruction = TypeOf; -declare const instructionVariantSchema: import("@kbn/config-schema").ObjectType<{ - id: import("@kbn/config-schema").Type; - instructions: import("@kbn/config-schema").Type[]>; - initialSelected: import("@kbn/config-schema").Type; -}>; -export type InstructionVariant = TypeOf; -declare const instructionSetSchema: import("@kbn/config-schema").ObjectType<{ - title: import("@kbn/config-schema").Type; - callOut: import("@kbn/config-schema").Type | undefined>; - instructionVariants: import("@kbn/config-schema").Type[]; - }>[]>; - statusCheck: import("@kbn/config-schema").Type; - index: string | string[]; - }>; - }> | undefined>; -}>; -export type InstructionSetSchema = TypeOf; -declare const instructionsSchema: import("@kbn/config-schema").ObjectType<{ - instructionSets: import("@kbn/config-schema").Type | undefined; - statusCheck?: Readonly<{ - text?: string | undefined; - error?: string | undefined; - title?: string | undefined; - success?: string | undefined; - btnLabel?: string | undefined; - } & { - esHitsCheck: Readonly<{} & { - query: Record; - index: string | string[]; - }>; - }> | undefined; - } & { - instructionVariants: Readonly<{ - initialSelected?: boolean | undefined; - } & { - id: string; - instructions: Readonly<{ - commands?: string[] | undefined; - title?: string | undefined; - textPre?: string | undefined; - textPost?: string | undefined; - customComponentName?: string | undefined; - } & {}>[]; - }>[]; - }>[]>; -}>; -export type InstructionsSchema = TypeOf; -export declare const tutorialSchema: import("@kbn/config-schema").ObjectType<{ - id: import("@kbn/config-schema").Type; - category: import("@kbn/config-schema").Type<"security" | "logging" | "metrics" | "other">; - name: import("@kbn/config-schema").Type; - moduleName: import("@kbn/config-schema").Type; - isBeta: import("@kbn/config-schema").Type; - shortDescription: import("@kbn/config-schema").Type; - euiIconType: import("@kbn/config-schema").Type; - longDescription: import("@kbn/config-schema").Type; - completionTimeMinutes: import("@kbn/config-schema").Type; - previewImagePath: import("@kbn/config-schema").Type; - onPrem: import("@kbn/config-schema").ObjectType<{ - instructionSets: import("@kbn/config-schema").Type | undefined; - statusCheck?: Readonly<{ - text?: string | undefined; - error?: string | undefined; - title?: string | undefined; - success?: string | undefined; - btnLabel?: string | undefined; - } & { - esHitsCheck: Readonly<{} & { - query: Record; - index: string | string[]; - }>; - }> | undefined; - } & { - instructionVariants: Readonly<{ - initialSelected?: boolean | undefined; - } & { - id: string; - instructions: Readonly<{ - commands?: string[] | undefined; - title?: string | undefined; - textPre?: string | undefined; - textPost?: string | undefined; - customComponentName?: string | undefined; - } & {}>[]; - }>[]; - }>[]>; - }>; - elasticCloud: import("@kbn/config-schema").Type | undefined; - statusCheck?: Readonly<{ - text?: string | undefined; - error?: string | undefined; - title?: string | undefined; - success?: string | undefined; - btnLabel?: string | undefined; - } & { - esHitsCheck: Readonly<{} & { - query: Record; - index: string | string[]; - }>; - }> | undefined; - } & { - instructionVariants: Readonly<{ - initialSelected?: boolean | undefined; - } & { - id: string; - instructions: Readonly<{ - commands?: string[] | undefined; - title?: string | undefined; - textPre?: string | undefined; - textPost?: string | undefined; - customComponentName?: string | undefined; - } & {}>[]; - }>[]; - }>[]; - }> | undefined>; - onPremElasticCloud: import("@kbn/config-schema").Type | undefined; - statusCheck?: Readonly<{ - text?: string | undefined; - error?: string | undefined; - title?: string | undefined; - success?: string | undefined; - btnLabel?: string | undefined; - } & { - esHitsCheck: Readonly<{} & { - query: Record; - index: string | string[]; - }>; - }> | undefined; - } & { - instructionVariants: Readonly<{ - initialSelected?: boolean | undefined; - } & { - id: string; - instructions: Readonly<{ - commands?: string[] | undefined; - title?: string | undefined; - textPre?: string | undefined; - textPost?: string | undefined; - customComponentName?: string | undefined; - } & {}>[]; - }>[]; - }>[]; - }> | undefined>; - artifacts: import("@kbn/config-schema").Type | undefined; - exportedFields?: Readonly<{} & { - documentationUrl: string; - }> | undefined; - } & { - dashboards: Readonly<{ - linkLabel?: string | undefined; - } & { - id: string; - isOverview: boolean; - }>[]; - }> | undefined>; - omitServerless: import("@kbn/config-schema").Type; - customStatusCheckName: import("@kbn/config-schema").Type; - integrationBrowserCategories: import("@kbn/config-schema").Type; - eprPackageOverlap: import("@kbn/config-schema").Type; -}>; -export type TutorialSchema = TypeOf; -export {}; diff --git a/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorials_registry_types.d.ts b/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorials_registry_types.d.ts deleted file mode 100644 index ea3207638eea6..0000000000000 --- a/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorials_registry_types.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { KibanaRequest, IStaticAssets } from '@kbn/core/server'; -import type { TutorialSchema } from './tutorial_schema'; -export { TutorialsCategory } from '../../../../common/constants'; -export type { TutorialSchema, ArtifactsSchema, DashboardSchema, InstructionsSchema, StatusCheckSchema, InstructionSetSchema, InstructionVariant, Instruction, } from './tutorial_schema'; -export type Platform = 'WINDOWS' | 'OSX' | 'DEB' | 'RPM'; -export interface TutorialContext { - kibanaBranch: string; - staticAssets: IStaticAssets; - isServerless?: boolean; - [key: string]: unknown; -} -export type TutorialProvider = (context: TutorialContext) => TutorialSchema; -export type TutorialContextFactory = (req: KibanaRequest) => { - [key: string]: unknown; -}; -export type ScopedTutorialContextFactory = (...args: any[]) => any; diff --git a/src/platform/plugins/shared/home/server/services/tutorials/tutorials_registry.d.ts b/src/platform/plugins/shared/home/server/services/tutorials/tutorials_registry.d.ts deleted file mode 100644 index be85dbc55ef59..0000000000000 --- a/src/platform/plugins/shared/home/server/services/tutorials/tutorials_registry.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { CoreSetup, CoreStart, PluginInitializerContext } from '@kbn/core/server'; -import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; -import type { TutorialProvider, ScopedTutorialContextFactory } from './lib/tutorials_registry_types'; -export declare class TutorialsRegistry { - private readonly initContext; - private tutorialProviders; - private readonly scopedTutorialContextFactories; - private staticAssets; - private readonly isServerless; - constructor(initContext: PluginInitializerContext); - setup(core: CoreSetup, customIntegrations?: CustomIntegrationsPluginSetup): { - registerTutorial: (specProvider: TutorialProvider) => void; - unregisterTutorial: (specProvider: TutorialProvider) => void; - addScopedTutorialContextFactory: (scopedTutorialContextFactory: ScopedTutorialContextFactory) => void; - }; - start(core: CoreStart, customIntegrations?: CustomIntegrationsPluginSetup): {}; - private get baseTutorialContext(); -} -/** @public */ -export type TutorialsRegistrySetup = ReturnType; -/** @public */ -export type TutorialsRegistryStart = ReturnType; diff --git a/src/platform/plugins/shared/home/server/tutorials/activemq_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/activemq_logs/index.d.ts deleted file mode 100644 index 8e2b69cd91cff..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/activemq_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function activemqLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/activemq_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/activemq_metrics/index.d.ts deleted file mode 100644 index ffb3d05c37069..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/activemq_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function activemqMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/aerospike_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/aerospike_metrics/index.d.ts deleted file mode 100644 index dce2e0b1aab0b..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/aerospike_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function aerospikeMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/apache_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/apache_logs/index.d.ts deleted file mode 100644 index b60dbe914fdc6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/apache_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function apacheLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/apache_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/apache_metrics/index.d.ts deleted file mode 100644 index d653b4e4076f6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/apache_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function apacheMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/auditbeat/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/auditbeat/index.d.ts deleted file mode 100644 index c8b9bc42ca7e9..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/auditbeat/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function auditbeatSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/auditd_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/auditd_logs/index.d.ts deleted file mode 100644 index 3a88d473fcd21..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/auditd_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function auditdLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/aws_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/aws_logs/index.d.ts deleted file mode 100644 index f291fa9722f0a..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/aws_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function awsLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/aws_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/aws_metrics/index.d.ts deleted file mode 100644 index f2dd900b3b023..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/aws_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function awsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/azure_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/azure_logs/index.d.ts deleted file mode 100644 index d66ec6ac20830..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/azure_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function azureLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/azure_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/azure_metrics/index.d.ts deleted file mode 100644 index 434307a7fb7a7..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/azure_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function azureMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/barracuda_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/barracuda_logs/index.d.ts deleted file mode 100644 index 26d6c6d80b10c..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/barracuda_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function barracudaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/bluecoat_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/bluecoat_logs/index.d.ts deleted file mode 100644 index a028cdc9bdf6d..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/bluecoat_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function bluecoatLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/cef_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/cef_logs/index.d.ts deleted file mode 100644 index b6c2b1973dcdf..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/cef_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function cefLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/ceph_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/ceph_metrics/index.d.ts deleted file mode 100644 index 81eb671d58259..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/ceph_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function cephMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/checkpoint_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/checkpoint_logs/index.d.ts deleted file mode 100644 index b5b56256f538e..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/checkpoint_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function checkpointLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/cisco_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/cisco_logs/index.d.ts deleted file mode 100644 index b172875778ff3..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/cisco_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function ciscoLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/cockroachdb_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/cockroachdb_metrics/index.d.ts deleted file mode 100644 index 3e62d26993dc0..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/cockroachdb_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function cockroachdbMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/consul_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/consul_metrics/index.d.ts deleted file mode 100644 index 106b818ca0b90..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/consul_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function consulMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/coredns_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/coredns_logs/index.d.ts deleted file mode 100644 index 1c593970cd8d5..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/coredns_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function corednsLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/coredns_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/coredns_metrics/index.d.ts deleted file mode 100644 index b673952085ab5..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/coredns_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function corednsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/couchbase_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/couchbase_metrics/index.d.ts deleted file mode 100644 index 56911d4e624a6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/couchbase_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function couchbaseMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/couchdb_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/couchdb_metrics/index.d.ts deleted file mode 100644 index a5b34df7749fc..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/couchdb_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function couchdbMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/crowdstrike_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/crowdstrike_logs/index.d.ts deleted file mode 100644 index 425a978f59b19..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/crowdstrike_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function crowdstrikeLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/cylance_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/cylance_logs/index.d.ts deleted file mode 100644 index 380d5c88d733a..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/cylance_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function cylanceLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/docker_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/docker_metrics/index.d.ts deleted file mode 100644 index ff25bf6c077a9..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/docker_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function dockerMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/dropwizard_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/dropwizard_metrics/index.d.ts deleted file mode 100644 index a4ffc1f71e3f6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/dropwizard_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function dropwizardMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/elasticsearch_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/elasticsearch_logs/index.d.ts deleted file mode 100644 index dabfa142bcae6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/elasticsearch_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function elasticsearchLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/elasticsearch_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/elasticsearch_metrics/index.d.ts deleted file mode 100644 index a78a97e2c7489..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/elasticsearch_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function elasticsearchMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/envoyproxy_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/envoyproxy_logs/index.d.ts deleted file mode 100644 index 77b3f5d12df5f..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/envoyproxy_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function envoyproxyLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/envoyproxy_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/envoyproxy_metrics/index.d.ts deleted file mode 100644 index 16272ca64d6c6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/envoyproxy_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function envoyproxyMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/etcd_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/etcd_metrics/index.d.ts deleted file mode 100644 index d0ff3b81e4081..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/etcd_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function etcdMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/f5_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/f5_logs/index.d.ts deleted file mode 100644 index c177bda276022..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/f5_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function f5LogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/fortinet_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/fortinet_logs/index.d.ts deleted file mode 100644 index 128abd848b9f6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/fortinet_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function fortinetLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/gcp_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/gcp_logs/index.d.ts deleted file mode 100644 index f5f67299047f6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/gcp_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function gcpLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/gcp_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/gcp_metrics/index.d.ts deleted file mode 100644 index 11f752d4c203d..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/gcp_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function gcpMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/golang_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/golang_metrics/index.d.ts deleted file mode 100644 index 7c921db173f09..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/golang_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function golangMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/gsuite_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/gsuite_logs/index.d.ts deleted file mode 100644 index fdd5b6acf259b..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/gsuite_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function gsuiteLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/haproxy_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/haproxy_logs/index.d.ts deleted file mode 100644 index d927b910b4d96..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/haproxy_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function haproxyLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/haproxy_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/haproxy_metrics/index.d.ts deleted file mode 100644 index 3b1face1f41b9..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/haproxy_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function haproxyMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/ibmmq_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/ibmmq_logs/index.d.ts deleted file mode 100644 index 2bcb85ffa891e..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/ibmmq_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function ibmmqLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/ibmmq_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/ibmmq_metrics/index.d.ts deleted file mode 100644 index 073069bd6120e..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/ibmmq_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function ibmmqMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/icinga_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/icinga_logs/index.d.ts deleted file mode 100644 index 347115de50919..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/icinga_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function icingaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/iis_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/iis_logs/index.d.ts deleted file mode 100644 index 071362401c45b..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/iis_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function iisLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/iis_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/iis_metrics/index.d.ts deleted file mode 100644 index 0656a3fe71057..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/iis_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function iisMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/imperva_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/imperva_logs/index.d.ts deleted file mode 100644 index d8474c55d945a..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/imperva_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function impervaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/infoblox_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/infoblox_logs/index.d.ts deleted file mode 100644 index 607a222231bc1..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/infoblox_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function infobloxLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/auditbeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/auditbeat_instructions.d.ts deleted file mode 100644 index fdbab1424fbfb..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/instructions/auditbeat_instructions.d.ts +++ /dev/null @@ -1,246 +0,0 @@ -import type { Platform, TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare const createAuditbeatInstructions: (context: TutorialContext) => { - INSTALL: { - OSX: { - title: string; - textPre: string; - commands: string[]; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; - START: { - OSX: { - title: string; - textPre: string; - commands: string[]; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - }; - }; - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare const createAuditbeatCloudInstructions: () => { - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare const createAuditbeatCloudInstructionsServerless: () => { - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare function auditbeatStatusCheck(): { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'agent.type': string; - }; - }; - }; - }; - }; -}; -export declare function onPremInstructions(platforms: readonly Platform[], context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - commands: string[]; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'agent.type': string; - }; - }; - }; - }; - }; - }; - }[]; -}; -export declare function onPremCloudInstructions(platforms: readonly Platform[], context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'agent.type': string; - }; - }; - }; - }; - }; - }; - }[]; -}; -export declare function cloudInstructions(platforms: readonly Platform[], context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - commands: string[]; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'agent.type': string; - }; - }; - }; - }; - }; - }; - }[]; -}; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/cloud_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/cloud_instructions.d.ts deleted file mode 100644 index 0bcd214cc4174..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/instructions/cloud_instructions.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const cloudPasswordAndResetLink: () => string; -export declare const cloudServerlessApiKeyNote: () => string; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/filebeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/filebeat_instructions.d.ts deleted file mode 100644 index c68007a3e28f6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/instructions/filebeat_instructions.d.ts +++ /dev/null @@ -1,282 +0,0 @@ -import type { Platform, TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare const createFilebeatInstructions: (context: TutorialContext) => { - INSTALL: { - OSX: { - title: string; - textPre: string; - commands: string[]; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; - START: { - OSX: { - title: string; - textPre: string; - commands: string[]; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - }; - }; - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare const createFilebeatCloudInstructions: () => { - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare const createFilebeatCloudInstructionsServerless: () => { - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare function filebeatEnableInstructions(moduleName: string): { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; -}; -export declare function filebeatStatusCheck(moduleName: string): { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'event.module': string; - }; - }; - }; - }; - }; -}; -export declare function onPremInstructions(moduleName: string, platforms: readonly Platform[] | undefined, context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: ({ - title: string; - commands: string[]; - textPost: string; - } | { - title: string; - textPre: string; - commands: string[]; - })[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'event.module': string; - }; - }; - }; - }; - }; - }; - }[]; -}; -export declare function onPremCloudInstructions(moduleName: string, platforms: readonly Platform[] | undefined, context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: ({ - title: string; - textPre: string; - } | { - title: string; - commands: string[]; - textPost: string; - })[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'event.module': string; - }; - }; - }; - }; - }; - }; - }[]; -}; -export declare function cloudInstructions(moduleName: string, platforms: readonly Platform[] | undefined, context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: ({ - title: string; - commands: string[]; - textPost: string; - } | { - title: string; - textPre: string; - commands: string[]; - })[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'event.module': string; - }; - }; - }; - }; - }; - }; - }[]; -}; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/get_space_id_for_beats_tutorial.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/get_space_id_for_beats_tutorial.d.ts deleted file mode 100644 index 222f262512f42..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/instructions/get_space_id_for_beats_tutorial.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; -/** - * Returns valid configuration for a beat.yml file for adding the space id - * if there is an active space and that space is not the default one. - * - * @param {object} context - Context object generated from tutorial factory (see #22760) - */ -export declare function getSpaceIdForBeatsTutorial(context?: TutorialContext): string; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/heartbeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/heartbeat_instructions.d.ts deleted file mode 100644 index 971e13aecf455..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/instructions/heartbeat_instructions.d.ts +++ /dev/null @@ -1,273 +0,0 @@ -import type { Platform, TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare const createHeartbeatInstructions: (context: TutorialContext) => { - INSTALL: { - OSX: { - title: string; - textPre: string; - commands: string[]; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - }; - }; - START: { - OSX: { - title: string; - textPre: string; - commands: string[]; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - }; - }; - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare const createHeartbeatCloudInstructions: () => { - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare const createHeartbeatCloudInstructionsServerless: () => { - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare function heartbeatEnableInstructionsOnPrem(): { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; -}; -export declare function heartbeatEnableInstructionsCloud(): { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; -}; -export declare function heartbeatStatusCheck(): { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - match_all: {}; - }; - }; -}; -export declare function onPremInstructions(platforms: Platform[], context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - commands: string[]; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - match_all: {}; - }; - }; - }; - }[]; -}; -export declare function onPremCloudInstructions(context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - match_all: {}; - }; - }; - }; - }[]; -}; -export declare function cloudInstructions(context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - commands: string[]; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - match_all: {}; - }; - }; - }; - }[]; -}; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/metricbeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/metricbeat_instructions.d.ts deleted file mode 100644 index 700f1d250c2d4..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/instructions/metricbeat_instructions.d.ts +++ /dev/null @@ -1,282 +0,0 @@ -import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare const createMetricbeatInstructions: ((context: TutorialContext) => { - INSTALL: { - OSX: { - title: string; - textPre: string; - commands: string[]; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; - START: { - OSX: { - title: string; - textPre: string; - commands: string[]; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - }; - }; - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}) & import("lodash").MemoizedFunction; -export declare const createMetricbeatCloudInstructions: (() => { - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}) & import("lodash").MemoizedFunction; -export declare const createMetricbeatCloudInstructionsServerless: () => { - CONFIG: { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare function metricbeatEnableInstructions(moduleName: string): { - OSX: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - DEB: { - title: string; - commands: string[]; - textPost: string; - }; - RPM: { - title: string; - commands: string[]; - textPost: string; - }; - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; -}; -export declare function metricbeatStatusCheck(moduleName: string): { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'event.module': string; - }; - }; - }; - }; - }; -}; -export declare function onPremInstructions(moduleName: string, context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: ({ - title: string; - textPre: string; - commands: string[]; - } | { - title: string; - commands: string[]; - textPost: string; - })[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'event.module': string; - }; - }; - }; - }; - }; - }; - }[]; -}; -export declare function onPremCloudInstructions(moduleName: string, context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: ({ - title: string; - textPre: string; - } | { - title: string; - commands: string[]; - textPost: string; - })[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'event.module': string; - }; - }; - }; - }; - }; - }; - }[]; -}; -export declare function cloudInstructions(moduleName: string, context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: ({ - title: string; - textPre: string; - commands: string[]; - } | { - title: string; - commands: string[]; - textPost: string; - })[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'event.module': string; - }; - }; - }; - }; - }; - }; - }[]; -}; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/onprem_cloud_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/onprem_cloud_instructions.d.ts deleted file mode 100644 index ae3f5bd1ef6d2..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/instructions/onprem_cloud_instructions.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare const createTrycloudOption1: (() => { - title: string; - textPre: string; -}) & import("lodash").MemoizedFunction; -export declare const createTrycloudOption2: (() => { - title: string; - textPre: string; -}) & import("lodash").MemoizedFunction; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/winlogbeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/winlogbeat_instructions.d.ts deleted file mode 100644 index a81100cc51605..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/instructions/winlogbeat_instructions.d.ts +++ /dev/null @@ -1,160 +0,0 @@ -import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare const createWinlogbeatInstructions: (context: TutorialContext) => { - INSTALL: { - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; - START: { - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - }; - }; - CONFIG: { - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare const createWinlogbeatCloudInstructions: () => { - CONFIG: { - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare const createWinlogbeatCloudInstructionsServerless: () => { - CONFIG: { - WINDOWS: { - title: string; - textPre: string; - commands: string[]; - textPost: string; - }; - }; -}; -export declare function winlogbeatStatusCheck(): { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'agent.type': string; - }; - }; - }; - }; - }; -}; -export declare function onPremInstructions(context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - commands: string[]; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'agent.type': string; - }; - }; - }; - }; - }; - }; - }[]; -}; -export declare function onPremCloudInstructions(context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'agent.type': string; - }; - }; - }; - }; - }; - }; - }[]; -}; -export declare function cloudInstructions(context: TutorialContext): { - instructionSets: { - title: string; - instructionVariants: { - id: string; - instructions: { - title: string; - textPre: string; - commands: string[]; - }[]; - }[]; - statusCheck: { - title: string; - text: string; - btnLabel: string; - success: string; - error: string; - esHitsCheck: { - index: string; - query: { - bool: { - filter: { - term: { - 'agent.type': string; - }; - }; - }; - }; - }; - }; - }[]; -}; diff --git a/src/platform/plugins/shared/home/server/tutorials/iptables_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/iptables_logs/index.d.ts deleted file mode 100644 index 26ea6b5a75f1f..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/iptables_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function iptablesLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/juniper_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/juniper_logs/index.d.ts deleted file mode 100644 index bb466be014d76..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/juniper_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function juniperLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kafka_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kafka_logs/index.d.ts deleted file mode 100644 index 4b9b792070808..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/kafka_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function kafkaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kafka_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kafka_metrics/index.d.ts deleted file mode 100644 index 14613b10c2a55..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/kafka_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function kafkaMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kibana_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kibana_logs/index.d.ts deleted file mode 100644 index a94ae30ae90a9..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/kibana_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function kibanaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kibana_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kibana_metrics/index.d.ts deleted file mode 100644 index 9ef4440bd34b3..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/kibana_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function kibanaMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kubernetes_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kubernetes_metrics/index.d.ts deleted file mode 100644 index 2f6735c7c95db..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/kubernetes_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function kubernetesMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/logstash_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/logstash_logs/index.d.ts deleted file mode 100644 index 99a12848ea766..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/logstash_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function logstashLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/logstash_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/logstash_metrics/index.d.ts deleted file mode 100644 index 70e4dd65eeb6e..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/logstash_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function logstashMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/memcached_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/memcached_metrics/index.d.ts deleted file mode 100644 index 324f8babd3ad4..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/memcached_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function memcachedMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/microsoft_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/microsoft_logs/index.d.ts deleted file mode 100644 index 4d60b1b5964bd..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/microsoft_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function microsoftLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/misp_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/misp_logs/index.d.ts deleted file mode 100644 index eec1cb3dd33fc..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/misp_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function mispLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mongodb_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mongodb_logs/index.d.ts deleted file mode 100644 index 73a74b7c9b3be..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/mongodb_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function mongodbLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mongodb_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mongodb_metrics/index.d.ts deleted file mode 100644 index f95e5d21fe0f2..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/mongodb_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function mongodbMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mssql_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mssql_logs/index.d.ts deleted file mode 100644 index c33a9ee23ab0d..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/mssql_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function mssqlLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mssql_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mssql_metrics/index.d.ts deleted file mode 100644 index bfb2e98785911..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/mssql_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function mssqlMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/munin_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/munin_metrics/index.d.ts deleted file mode 100644 index 7e0ba9380b5cb..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/munin_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function muninMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mysql_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mysql_logs/index.d.ts deleted file mode 100644 index de8b017f67e2e..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/mysql_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function mysqlLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mysql_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mysql_metrics/index.d.ts deleted file mode 100644 index bee74bc7ba92c..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/mysql_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function mysqlMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/nats_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/nats_logs/index.d.ts deleted file mode 100644 index 84b6fc96a1236..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/nats_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function natsLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/nats_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/nats_metrics/index.d.ts deleted file mode 100644 index 475bc568354b2..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/nats_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function natsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/netflow_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/netflow_logs/index.d.ts deleted file mode 100644 index 4f96cdcd9bd8a..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/netflow_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function netflowLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/netscout_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/netscout_logs/index.d.ts deleted file mode 100644 index 664cc5ea3bcd1..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/netscout_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function netscoutLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/nginx_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/nginx_logs/index.d.ts deleted file mode 100644 index 95bddedda0c97..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/nginx_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function nginxLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/nginx_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/nginx_metrics/index.d.ts deleted file mode 100644 index 52c378f14760a..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/nginx_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function nginxMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/o365_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/o365_logs/index.d.ts deleted file mode 100644 index 22487e18440e2..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/o365_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function o365LogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/okta_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/okta_logs/index.d.ts deleted file mode 100644 index 4ce1125d0a070..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/okta_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function oktaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/openmetrics_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/openmetrics_metrics/index.d.ts deleted file mode 100644 index ffb2886fbdc27..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/openmetrics_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function openmetricsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/oracle_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/oracle_metrics/index.d.ts deleted file mode 100644 index 82af102eed83f..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/oracle_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function oracleMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/osquery_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/osquery_logs/index.d.ts deleted file mode 100644 index a95d06c1c744d..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/osquery_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function osqueryLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/panw_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/panw_logs/index.d.ts deleted file mode 100644 index f206acb4a0986..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/panw_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function panwLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/php_fpm_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/php_fpm_metrics/index.d.ts deleted file mode 100644 index 1bdee2e2c8f80..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/php_fpm_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function phpfpmMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/postgresql_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/postgresql_logs/index.d.ts deleted file mode 100644 index dc0ca5df44604..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/postgresql_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function postgresqlLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/postgresql_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/postgresql_metrics/index.d.ts deleted file mode 100644 index 644057f691dbd..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/postgresql_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function postgresqlMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/prometheus_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/prometheus_metrics/index.d.ts deleted file mode 100644 index 97d0884bf65c5..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/prometheus_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function prometheusMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/rabbitmq_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/rabbitmq_logs/index.d.ts deleted file mode 100644 index 0b5b8fc8b4a06..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/rabbitmq_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function rabbitmqLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/rabbitmq_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/rabbitmq_metrics/index.d.ts deleted file mode 100644 index 98cd538a05f1f..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/rabbitmq_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function rabbitmqMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/radware_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/radware_logs/index.d.ts deleted file mode 100644 index 6f16c96fde36a..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/radware_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function radwareLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/redis_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/redis_logs/index.d.ts deleted file mode 100644 index ac05f6fdf8720..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/redis_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function redisLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/redis_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/redis_metrics/index.d.ts deleted file mode 100644 index af0e7eb9013f1..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/redis_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function redisMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/redisenterprise_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/redisenterprise_metrics/index.d.ts deleted file mode 100644 index 14aad4cc84662..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/redisenterprise_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function redisenterpriseMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/register.d.ts b/src/platform/plugins/shared/home/server/tutorials/register.d.ts deleted file mode 100644 index 64afaffb4d99d..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/register.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { systemLogsSpecProvider } from './system_logs'; -export declare const builtInTutorials: (typeof systemLogsSpecProvider)[]; diff --git a/src/platform/plugins/shared/home/server/tutorials/santa_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/santa_logs/index.d.ts deleted file mode 100644 index ed3e94b8237c4..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/santa_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function santaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/sonicwall_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/sonicwall_logs/index.d.ts deleted file mode 100644 index 3b2150703b419..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/sonicwall_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function sonicwallLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/sophos_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/sophos_logs/index.d.ts deleted file mode 100644 index 95e3d149ef568..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/sophos_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function sophosLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/stan_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/stan_metrics/index.d.ts deleted file mode 100644 index 1912baa258d25..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/stan_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function stanMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/statsd_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/statsd_metrics/index.d.ts deleted file mode 100644 index 20b3963bc0ac6..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/statsd_metrics/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TutorialSchema } from '../../services/tutorials'; -import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function statsdMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/suricata_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/suricata_logs/index.d.ts deleted file mode 100644 index b874a7fc4c265..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/suricata_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function suricataLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/system_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/system_logs/index.d.ts deleted file mode 100644 index 7ded169860802..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/system_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function systemLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/system_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/system_metrics/index.d.ts deleted file mode 100644 index 0e3edb0d980a9..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/system_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function systemMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/tomcat_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/tomcat_logs/index.d.ts deleted file mode 100644 index 9d841e73cad93..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/tomcat_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function tomcatLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/traefik_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/traefik_logs/index.d.ts deleted file mode 100644 index 5065d67f99b33..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/traefik_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function traefikLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/traefik_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/traefik_metrics/index.d.ts deleted file mode 100644 index 95bfab8584868..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/traefik_metrics/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TutorialSchema } from '../../services/tutorials'; -import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function traefikMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/uptime_monitors/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/uptime_monitors/index.d.ts deleted file mode 100644 index d768ceefd8693..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/uptime_monitors/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function uptimeMonitorsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/uwsgi_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/uwsgi_metrics/index.d.ts deleted file mode 100644 index 77869eb7481a1..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/uwsgi_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function uwsgiMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/vsphere_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/vsphere_metrics/index.d.ts deleted file mode 100644 index 90f47d0e01728..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/vsphere_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function vSphereMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/windows_event_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/windows_event_logs/index.d.ts deleted file mode 100644 index 6607a07e1038a..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/windows_event_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function windowsEventLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/windows_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/windows_metrics/index.d.ts deleted file mode 100644 index 14b17bb3d8d74..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/windows_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function windowsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/zeek_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/zeek_logs/index.d.ts deleted file mode 100644 index 10e897982964f..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/zeek_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function zeekLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/zookeeper_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/zookeeper_metrics/index.d.ts deleted file mode 100644 index 248533640d33d..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/zookeeper_metrics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function zookeeperMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/zscaler_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/zscaler_logs/index.d.ts deleted file mode 100644 index 331dbdd2bb3b7..0000000000000 --- a/src/platform/plugins/shared/home/server/tutorials/zscaler_logs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; -export declare function zscalerLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/inspector/common/adapters/index.d.ts b/src/platform/plugins/shared/inspector/common/adapters/index.d.ts deleted file mode 100644 index ec4cf008591e0..0000000000000 --- a/src/platform/plugins/shared/inspector/common/adapters/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './request'; -export type * from './types'; diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/index.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/index.d.ts deleted file mode 100644 index e7d38e48ec8bc..0000000000000 --- a/src/platform/plugins/shared/inspector/common/adapters/request/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { Request, RequestStatistic, RequestStatistics } from './types'; -export { RequestStatus } from './types'; -export { RequestAdapter } from './request_adapter'; -export { RequestResponder } from './request_responder'; diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/move_request_params_to_top_level.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/move_request_params_to_top_level.d.ts deleted file mode 100644 index a957f2271413c..0000000000000 --- a/src/platform/plugins/shared/inspector/common/adapters/request/move_request_params_to_top_level.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Response } from './types'; -export declare function moveRequestParamsToTopLevel(response: Response): Response; diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/request_adapter.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/request_adapter.d.ts deleted file mode 100644 index 974ef7fdb16e6..0000000000000 --- a/src/platform/plugins/shared/inspector/common/adapters/request/request_adapter.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { EventEmitter } from 'events'; -import { RequestResponder } from './request_responder'; -import type { Request, RequestParams } from './types'; -/** - * An generic inspector adapter to log requests. - * These can be presented in the inspector using the requests view. - * The adapter is not coupled to a specific implementation or even Elasticsearch - * instead it offers a generic API to log requests of any kind. - * @extends EventEmitter - */ -export declare class RequestAdapter extends EventEmitter { - private requests; - private responses; - constructor(); - /** - * Start logging a new request into this request adapter. The new request will - * by default be in a processing state unless you explicitly finish it via - * {@link RequestResponder#finish}, {@link RequestResponder#ok} or - * {@link RequestResponder#error}. - * - * @param {string} name The name of this request as it should be shown in the UI. - * @param {RequestParams} params Additional arguments for the request. - * @param {number} [startTime] Set an optional start time for the request - * @return {RequestResponder} An instance to add information to the request and finish it. - */ - start(name: string, params?: RequestParams, startTime?: number): RequestResponder; - loadFromEntries(requests: Map, responses: WeakMap): void; - reset(): void; - resetRequest(id: string): void; - getRequests(): Request[]; - getRequestsSince(time: number): Request[]; - getRequestEntries(): Array<[Request, RequestResponder]>; - private _onChange; -} diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/request_responder.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/request_responder.d.ts deleted file mode 100644 index 7712a26974ef0..0000000000000 --- a/src/platform/plugins/shared/inspector/common/adapters/request/request_responder.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Request, RequestStatistics, Response } from './types'; -import { RequestStatus } from './types'; -/** - * An API to specify information about a specific request that will be logged. - * Create a new instance to log a request using {@link RequestAdapter#start}. - */ -export declare class RequestResponder { - private readonly request; - private readonly onChange; - constructor(request: Request, onChange: () => void); - json(reqJson: object): RequestResponder; - stats(stats: RequestStatistics): RequestResponder; - finish(status: RequestStatus, response: Response): void; - ok(response: Response): void; - error(response: Response): void; -} diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/types.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/types.d.ts deleted file mode 100644 index e95fd3037b392..0000000000000 --- a/src/platform/plugins/shared/inspector/common/adapters/request/types.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { ConnectionRequestParams } from '@elastic/transport'; -/** - * The status a request can have. - */ -export declare enum RequestStatus { - /** - * The request hasn't finished yet. - */ - PENDING = 0, - /** - * The request has successfully finished. - */ - OK = 1, - /** - * The request failed. - */ - ERROR = 2 -} -export interface Request extends RequestParams { - id: string; - name: string; - json?: object; - response?: Response; - startTime: number; - stats?: RequestStatistics; - status: RequestStatus; - time?: number; -} -export interface RequestParams { - id?: string; - description?: string; - searchSessionId?: string; -} -export interface RequestStatistics { - [key: string]: RequestStatistic; -} -export interface RequestStatistic { - label: string; - description?: string; - value: any; -} -export interface Response { - json?: object; - requestParams?: ConnectionRequestParams; - time?: number; -} diff --git a/src/platform/plugins/shared/inspector/common/adapters/types.d.ts b/src/platform/plugins/shared/inspector/common/adapters/types.d.ts deleted file mode 100644 index 873c02c3cffd2..0000000000000 --- a/src/platform/plugins/shared/inspector/common/adapters/types.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { RequestAdapter } from './request'; -/** - * The interface that the adapters used to open an inspector have to fullfill. - */ -export interface Adapters { - requests?: RequestAdapter; - [key: string]: any; -} diff --git a/src/platform/plugins/shared/inspector/common/index.d.ts b/src/platform/plugins/shared/inspector/common/index.d.ts deleted file mode 100644 index 0e73b1994c6c7..0000000000000 --- a/src/platform/plugins/shared/inspector/common/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { Adapters, Request, RequestStatistic, RequestStatistics } from './adapters'; -export { RequestAdapter, RequestStatus, RequestResponder } from './adapters'; diff --git a/src/platform/plugins/shared/inspector/public/adapters/has_inspector_adapters.d.ts b/src/platform/plugins/shared/inspector/public/adapters/has_inspector_adapters.d.ts deleted file mode 100644 index 598d08f0f2430..0000000000000 --- a/src/platform/plugins/shared/inspector/public/adapters/has_inspector_adapters.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Adapters } from '../../common'; -export interface HasInspectorAdapters { - getInspectorAdapters: () => Adapters | undefined; -} -export declare const apiHasInspectorAdapters: (api: unknown | null) => api is HasInspectorAdapters; diff --git a/src/platform/plugins/shared/inspector/public/async_services.d.ts b/src/platform/plugins/shared/inspector/public/async_services.d.ts deleted file mode 100644 index 33bfa8e9705b0..0000000000000 --- a/src/platform/plugins/shared/inspector/public/async_services.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { RequestsViewComponent } from './views/requests/components/requests_view'; -export { InspectorPanel } from './ui/inspector_panel'; diff --git a/src/platform/plugins/shared/inspector/public/index.d.ts b/src/platform/plugins/shared/inspector/public/index.d.ts deleted file mode 100644 index 8559984628b25..0000000000000 --- a/src/platform/plugins/shared/inspector/public/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import { InspectorPublicPlugin } from './plugin'; -export declare function plugin(initializerContext: PluginInitializerContext): InspectorPublicPlugin; -export { type Adapters, type Request, type RequestStatistic, type RequestStatistics, RequestAdapter, RequestStatus, RequestResponder, } from '../common'; -export { apiHasInspectorAdapters, type HasInspectorAdapters, } from './adapters/has_inspector_adapters'; -export { InspectorPublicPlugin as Plugin } from './plugin'; -export type { Setup, Start } from './plugin'; -export type { InspectorViewProps, InspectorViewDescription, InspectorOptions, InspectorSession, } from './types'; diff --git a/src/platform/plugins/shared/inspector/public/plugin.d.ts b/src/platform/plugins/shared/inspector/public/plugin.d.ts deleted file mode 100644 index 34f9ccc26fe57..0000000000000 --- a/src/platform/plugins/shared/inspector/public/plugin.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import { InspectorViewRegistry } from './view_registry'; -import type { InspectorOptions, InspectorSession } from './types'; -import type { Adapters } from '../common'; -export interface InspectorPluginStartDeps { - share: SharePluginStart; -} -export interface Setup { - registerView: InspectorViewRegistry['register']; -} -export interface Start { - /** - * Checks if a inspector panel could be shown based on the passed adapters. - * - * @param {object} adapters - An object of adapters. This should be the same - * you would pass into `open`. - * @returns {boolean} True, if a call to `open` with the same adapters - * would have shown the inspector panel, false otherwise. - */ - isAvailable: (adapters?: Adapters) => boolean; - /** - * Opens the inspector panel for the given adapters and close any previously opened - * inspector panel. The previously panel will be closed also if no new panel will be - * opened (e.g. because of the passed adapters no view is available). You can use - * {@link InspectorSession#close} on the return value to close that opened panel again. - * - * @param {object} adapters - An object of adapters for which you want to show - * the inspector panel. - * @param {InspectorOptions} options - Options that configure the inspector. See InspectorOptions type. - * @param {unknown} parentApi - Optional parent api for trackingOverlays. - * @return {InspectorSession} The session instance for the opened inspector. - * @throws {Error} - */ - open: (adapters: Adapters, options?: InspectorOptions, parentApi?: unknown) => InspectorSession; -} -export declare class InspectorPublicPlugin implements Plugin { - views: InspectorViewRegistry | undefined; - constructor(_initializerContext: PluginInitializerContext); - setup(_core: CoreSetup): { - registerView: (view: import("./types").InspectorViewDescription) => void; - }; - start(core: CoreStart, startDeps: InspectorPluginStartDeps): { - isAvailable: (adapters?: Adapters) => boolean; - open: (adapters: Adapters, options?: InspectorOptions, parentApi?: unknown) => InspectorSession; - }; - stop(): void; -} diff --git a/src/platform/plugins/shared/inspector/public/types.d.ts b/src/platform/plugins/shared/inspector/public/types.d.ts deleted file mode 100644 index 566c3daa7b65f..0000000000000 --- a/src/platform/plugins/shared/inspector/public/types.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { OverlayFlyoutOpenOptions, OverlayRef } from '@kbn/core/public'; -import type { Adapters } from '../common'; -/** - * The props interface that a custom inspector view component, that will be passed - * to {@link InspectorViewDescription#component}, must use. - */ -export interface InspectorViewProps { - /** - * Adapters used to open the inspector. - */ - adapters: TAdapters; - /** - * The title that the inspector is currently using e.g. a visualization name. - */ - title: string; - /** - * A set of specific options for each view. - */ - options?: unknown; -} -/** - * An object describing an inspector view. - * @typedef {object} InspectorViewDescription - * @property {string} title - The title that will be used to present that view. - * @property {string} icon - An icon name to present this view. Must match an EUI icon. - * @property {React.ComponentType} component - The actual React component to render that view. - * @property {number} [order=9000] - An order for this view. Views are ordered from lower - * order values to higher order values in the UI. - * @property {string} [help=''] - An help text for this view, that gives a brief description - * of this view. - * @property {viewShouldShowFunc} [shouldShow] - A function, that determines whether - * this view should be visible for a given collection of adapters. If not specified - * the view will always be visible. - */ -export interface InspectorViewDescription { - component: React.ComponentType; - help?: string; - order?: number; - shouldShow?: (adapters: Adapters) => boolean; - title: string; -} -/** - * Options that can be specified when opening the inspector. - * @property {string} title - An optional title, that will be shown in the header - * of the inspector. Can be used to give more context about what is being inspected. - * @property {unknown} options - A set of specific payload to be passed to inspector views - * @property {object} flyoutProps - Optional props passed to `openLazyFlyout` (e.g. size, className, etc). - */ -export interface InspectorOptions { - title?: string; - options?: unknown; - flyoutProps?: Partial & { - triggerId?: string; - focusedPanelId?: string; - }; -} -export type InspectorSession = OverlayRef; diff --git a/src/platform/plugins/shared/inspector/public/ui/inspector_panel.d.ts b/src/platform/plugins/shared/inspector/public/ui/inspector_panel.d.ts deleted file mode 100644 index 4e577b0aeeb22..0000000000000 --- a/src/platform/plugins/shared/inspector/public/ui/inspector_panel.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import React, { Component } from 'react'; -import type { ApplicationStart, HttpStart, IUiSettingsClient, ThemeServiceStart } from '@kbn/core/public'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { SettingsStart } from '@kbn/core-ui-settings-browser'; -import type { InspectorViewDescription } from '../types'; -import type { Adapters } from '../../common'; -interface InspectorPanelProps { - adapters: Adapters; - title?: string; - options?: unknown; - views: InspectorViewDescription[]; - dependencies: { - application: ApplicationStart; - http: HttpStart; - uiSettings: IUiSettingsClient; - share: SharePluginStart; - settings: SettingsStart; - theme: ThemeServiceStart; - }; -} -interface InspectorPanelState { - selectedView: InspectorViewDescription; - views: InspectorViewDescription[]; - adapters: Adapters; -} -export declare class InspectorPanel extends Component { - static defaultProps: { - title: string; - }; - state: InspectorPanelState; - static getDerivedStateFromProps(nextProps: InspectorPanelProps, prevState: InspectorPanelState): { - views: InspectorViewDescription[]; - selectedView: InspectorViewDescription; - }; - onViewSelected: (view: InspectorViewDescription) => void; - renderSelectedPanel(): React.JSX.Element; - render(): React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/inspector/public/ui/inspector_view_chooser.d.ts b/src/platform/plugins/shared/inspector/public/ui/inspector_view_chooser.d.ts deleted file mode 100644 index a6565d4132e57..0000000000000 --- a/src/platform/plugins/shared/inspector/public/ui/inspector_view_chooser.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React, { Component } from 'react'; -import type { InspectorViewDescription } from '../types'; -interface Props { - views: InspectorViewDescription[]; - onViewSelected: (view: InspectorViewDescription) => void; - selectedView: InspectorViewDescription; -} -interface State { - isSelectorOpen: boolean; -} -export declare class InspectorViewChooser extends Component { - state: State; - toggleSelector: () => void; - closeSelector: () => void; - renderView: (view: InspectorViewDescription, index: number) => React.JSX.Element; - renderViewButton(): React.JSX.Element; - renderSingleView(): React.JSX.Element; - render(): React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/inspector/public/view_registry.d.ts b/src/platform/plugins/shared/inspector/public/view_registry.d.ts deleted file mode 100644 index 27148efcbbc60..0000000000000 --- a/src/platform/plugins/shared/inspector/public/view_registry.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { EventEmitter } from 'events'; -import type { InspectorViewDescription } from './types'; -import type { Adapters } from '../common'; -/** - * @callback viewShouldShowFunc - * @param {object} adapters - A list of adapters to check whether or not this view - * should be shown for. - * @returns {boolean} true - if this view should be shown for the given adapters. - */ -/** - * A registry that will hold inspector views. - */ -export declare class InspectorViewRegistry extends EventEmitter { - private views; - /** - * Register a new inspector view to the registry. Check the README.md in the - * inspector directory for more information of the object format to register - * here. This will also emit a 'change' event on the registry itself. - * - * @param {InspectorViewDescription} view - The view description to add to the registry. - */ - register(view: InspectorViewDescription): void; - /** - * Retrieve all views currently registered with the registry. - * @returns {InspectorViewDescription[]} A by `order` sorted list of all registered - * inspector views. - */ - getAll(): InspectorViewDescription[]; - /** - * Retrieve all registered views, that want to be visible for the specified adapters. - * @param {object} adapters - an adapter configuration - * @returns {InspectorViewDescription[]} All inespector view descriptions visible - * for the specific adapters. - */ - getVisible(adapters?: Adapters): InspectorViewDescription[]; -} diff --git a/src/platform/plugins/shared/inspector/public/views/index.d.ts b/src/platform/plugins/shared/inspector/public/views/index.d.ts deleted file mode 100644 index 35efc2c2050b3..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { getRequestsViewDescription } from './requests'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/cluster_health.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/cluster_health.d.ts deleted file mode 100644 index d9a11d5161cf3..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/cluster_health.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import type { EuiTextProps } from '@elastic/eui'; -interface Props { - count?: number; - status: string; - textProps?: EuiTextProps; -} -export declare function ClusterHealth({ count, status, textProps }: Props): React.JSX.Element | null; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/clusters_health.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/clusters_health.d.ts deleted file mode 100644 index 6e4779706a5fb..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/clusters_health.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -interface Props { - clusters: Record; -} -export declare function ClustersHealth({ clusters }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/gradient.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/gradient.d.ts deleted file mode 100644 index a22e2ea83e773..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/gradient.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare function useHealthHexCodes(): { - successful: string; - partial: string; - skipped: string; - failed: string; -}; -export declare function useHeathBarLinearGradient(successful: number, partial: number, skipped: number, failed: number): string; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/index.d.ts deleted file mode 100644 index 8d7c07e8f737d..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ClustersHealth } from './clusters_health'; -export { ClusterHealth } from './cluster_health'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/cluster_view.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/cluster_view.d.ts deleted file mode 100644 index e1d77dd8a197e..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/cluster_view.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -interface Props { - clusterDetails: estypes.ClusterDetails; -} -export declare function ClusterView({ clusterDetails }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.d.ts deleted file mode 100644 index 892b8787a2232..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -interface Props { - clusters: Record; -} -export declare function ClustersTable({ clusters }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/index.d.ts deleted file mode 100644 index 3225257e5e314..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { ClustersTable } from './clusters_table'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/index.d.ts deleted file mode 100644 index 9eec3220a7c85..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ShardsView } from './shards_view'; -export { OpenShardFailureFlyoutButton } from './open_shard_failure_flyout_button'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/open_shard_failure_flyout_button.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/open_shard_failure_flyout_button.d.ts deleted file mode 100644 index dbe9c598504f4..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/open_shard_failure_flyout_button.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -interface Props { - failures: estypes.ShardFailure[]; -} -export declare function OpenShardFailureFlyoutButton({ failures }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_details.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_details.d.ts deleted file mode 100644 index f5c3b294ba943..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_details.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -/** - * Provides pretty formatting of a given key string - * e.g. formats "this_key.is_nice" to "This key is nice" - * @param key - */ -export declare function formatKey(key: string): string; -/** - * Adds a EuiCodeBlock to values of `script` and `script_stack` key - * Values of other keys are handled a strings - * @param value - * @param key - */ -export declare function formatValueByKey(value: unknown, key: string): JSX.Element; -interface Props { - failure: estypes.ShardFailure; -} -export declare function ShardFailureDetails({ failure }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_flyout.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_flyout.d.ts deleted file mode 100644 index 9f0dbdf2e9d47..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_flyout.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -interface Props { - failures: estypes.ShardFailure[]; - onClose: () => void; -} -export declare function ShardFailureFlyout({ failures, onClose }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.d.ts deleted file mode 100644 index ae1df3c16f5d0..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -interface Props { - failures: estypes.ShardFailure[]; -} -export declare function ShardFailureTable({ failures }: Props): React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shards_view.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shards_view.d.ts deleted file mode 100644 index 6be76b6b569a9..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shards_view.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -interface Props { - failures: estypes.ShardFailure[]; - shardStats?: estypes.ShardStatistics; -} -export declare function ShardsView({ failures, shardStats }: Props): React.JSX.Element | null; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_view.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_view.d.ts deleted file mode 100644 index db3596cf96b00..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_view.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import React, { Component } from 'react'; -import type { estypes } from '@elastic/elasticsearch'; -import { type EuiSearchBarOnChangeArgs } from '@elastic/eui'; -import type { Request } from '../../../../../../common/adapters/request/types'; -import type { DetailViewProps } from '../types'; -interface State { - clusters: Record; - showSearchAndStatusBar: boolean; -} -export declare class ClustersView extends Component { - static shouldShow: (request: Request) => boolean; - constructor(props: DetailViewProps); - _onSearchChange: ({ query, error }: EuiSearchBarOnChangeArgs) => void; - render(): React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/find_clusters.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/find_clusters.d.ts deleted file mode 100644 index 9d7c240cab89a..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/find_clusters.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import { type Query } from '@elastic/eui'; -import type { Request } from '../../../../../../common/adapters/request/types'; -export declare function findClusters(request: Request, query?: Query): Record; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/index.d.ts deleted file mode 100644 index 70763c70f103c..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { ClustersView } from './clusters_view'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/local_cluster.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/local_cluster.d.ts deleted file mode 100644 index c751e1bbde8a5..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/local_cluster.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -export declare const LOCAL_CLUSTER_KEY = "(local)"; -export declare function getLocalClusterDetails(rawResponse: estypes.SearchResponse): { - status: estypes.ClusterSearchStatus; - indices: string; - took: number; - timed_out: boolean; - _shards: { - failed: estypes.uint; - successful: estypes.uint; - total: estypes.uint; - failures?: estypes.ShardFailure[]; - skipped?: estypes.uint; - }; - failures: estypes.ShardFailure[] | undefined; -}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/index.d.ts deleted file mode 100644 index 642b40b5bc397..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type { DetailViewProps } from './types'; -export { RequestDetailsRequest } from './req_details_request'; -export { RequestDetailsResponse } from './req_details_response'; -export { RequestDetailsStats } from './req_details_stats'; -export { ClustersView } from './clusters_view'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_code_viewer.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_code_viewer.d.ts deleted file mode 100644 index 8fe532d1e68db..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_code_viewer.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { ReactNode } from 'react'; -import React from 'react'; -interface RequestCodeViewerProps { - value: string; - actions?: Array<{ - name: string; - action: ReactNode; - }>; -} -/** - * @internal - */ -export declare const RequestCodeViewer: ({ value, actions }: RequestCodeViewerProps) => React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request.d.ts deleted file mode 100644 index 37e38b80299db..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React, { Component } from 'react'; -import type { Request } from '../../../../../common/adapters/request/types'; -import type { DetailViewProps } from './types'; -export declare class RequestDetailsRequest extends Component { - static shouldShow: (request: Request) => boolean; - render(): React.JSX.Element | null; -} diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request_content.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request_content.d.ts deleted file mode 100644 index 7b8d222851b29..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request_content.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import type { ConnectionRequestParams } from '@elastic/transport'; -interface RequestDetailsRequestContentProps { - indexPattern?: string; - requestParams?: ConnectionRequestParams; - json: string; -} -export declare const RequestDetailsRequestContent: React.FC; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_response.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_response.d.ts deleted file mode 100644 index aad9b7b93fc56..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_response.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React, { Component } from 'react'; -import type { Request } from '../../../../../common/adapters/request/types'; -import type { DetailViewProps } from './types'; -export declare class RequestDetailsResponse extends Component { - static shouldShow: (request: Request) => boolean; - static getResponseJson: (request: Request) => object | null | undefined; - render(): React.JSX.Element | null; -} diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_stats.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_stats.d.ts deleted file mode 100644 index 0b02f4c89d3dc..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_stats.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import type { DetailViewProps } from './types'; -import type { Request } from '../../../../../common/adapters/request/types'; -export declare const RequestDetailsStats: { - ({ request }: DetailViewProps): React.JSX.Element | null; - shouldShow(request: Request): boolean; -}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/types.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/types.d.ts deleted file mode 100644 index d7474c4921ea2..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/details/types.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Request } from '../../../../../common/adapters/request/types'; -export interface DetailViewProps { - request: Request; -} diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/disambiguate_request_names.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/disambiguate_request_names.d.ts deleted file mode 100644 index 3f2a5e2623bba..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/disambiguate_request_names.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Request } from '../../../../common/adapters/request/types'; -export declare function disambiguateRequestNames(requests: Request[]): Request[]; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/get_next_tab.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/get_next_tab.d.ts deleted file mode 100644 index 880e9e2f56b49..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/get_next_tab.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { DetailViewData } from './types'; -export declare function getNextTab(currentTab: DetailViewData | null, tabs: DetailViewData[], preferredTabs?: string[]): DetailViewData | null; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/request_details.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/request_details.d.ts deleted file mode 100644 index 7f2d3eda65183..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/request_details.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import type { Request } from '../../../../common/adapters/request/types'; -interface Props { - initialTabs?: string[]; - request: Request; -} -export declare function RequestDetails(props: Props): React.JSX.Element | null; -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/request_selector.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/request_selector.d.ts deleted file mode 100644 index 20166c20d4bd4..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/request_selector.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import React, { Component } from 'react'; -import type { EuiComboBoxOptionOption } from '@elastic/eui'; -import type { Request } from '../../../../common/adapters/request/types'; -interface RequestSelectorProps { - requests: Request[]; - selectedRequest: Request; - onRequestChanged: (request: Request) => void; -} -export declare class RequestSelector extends Component { - handleSelected: (selectedOptions: Array>) => void; - renderRequestCombobox(): React.JSX.Element; - render(): React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/requests_view.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/requests_view.d.ts deleted file mode 100644 index ad55650ca5f26..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/requests_view.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import React, { Component } from 'react'; -import type { Request } from '../../../../common/adapters/request/types'; -import type { InspectorViewProps } from '../../../types'; -interface RequestSelectorState { - requests: Request[]; - request: Request | null; -} -export declare class RequestsViewComponent extends Component { - constructor(props: InspectorViewProps); - getRequests(): Request[]; - _onRequestsChange: () => void; - selectRequest: (request: Request) => void; - componentWillUnmount(): void; - static renderEmptyRequests(): React.JSX.Element; - render(): React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/types.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/types.d.ts deleted file mode 100644 index b7fccb5cdb34c..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/components/types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SharePluginStart } from '@kbn/share-plugin/public'; -import type { CoreStart } from '@kbn/core-lifecycle-browser'; -export interface DetailViewData { - name: string; - label: string; - component: any; -} -export interface InspectorKibanaServices { - share: SharePluginStart; - application: CoreStart['application']; - http: CoreStart['http']; - uiSettings: CoreStart['uiSettings']; - settings: CoreStart['settings']; - theme: CoreStart['theme']; -} diff --git a/src/platform/plugins/shared/inspector/public/views/requests/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/index.d.ts deleted file mode 100644 index 52b66957a44c5..0000000000000 --- a/src/platform/plugins/shared/inspector/public/views/requests/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { InspectorViewDescription } from '../../types'; -export declare const getRequestsViewDescription: () => InspectorViewDescription; diff --git a/src/platform/plugins/shared/kibana_react/public/context/context.d.ts b/src/platform/plugins/shared/kibana_react/public/context/context.d.ts deleted file mode 100644 index 904c7b9b29ca5..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/context/context.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import React from 'react'; -import type { KibanaReactContext, KibanaReactContextValue, KibanaServices } from './types'; -export declare const context: React.Context>>; -export declare const useKibana: () => KibanaReactContextValue; -export declare const withKibana: ; -}>(type: React.ComponentType) => FC>; -export declare const createKibanaReactContext: (services: Services) => KibanaReactContext; -export declare const KibanaContextProvider: FC>; diff --git a/src/platform/plugins/shared/kibana_react/public/context/index.d.ts b/src/platform/plugins/shared/kibana_react/public/context/index.d.ts deleted file mode 100644 index db4e8e86689cb..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/context/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { context, createKibanaReactContext, KibanaContextProvider, useKibana, withKibana, } from './context'; -export type { KibanaReactContext, KibanaReactContextValue, KibanaServices } from './types'; diff --git a/src/platform/plugins/shared/kibana_react/public/context/types.d.ts b/src/platform/plugins/shared/kibana_react/public/context/types.d.ts deleted file mode 100644 index 0129daf09e8bb..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/context/types.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import type React from 'react'; -import type { CoreStart } from '@kbn/core/public'; -import type { KibanaReactOverlays } from '../overlays'; -export type KibanaServices = Partial; -export interface KibanaReactContextValue { - readonly services: Services; - readonly overlays: KibanaReactOverlays; -} -export interface KibanaReactContext { - value: KibanaReactContextValue; - Provider: FC>; - Consumer: React.Consumer>; -} diff --git a/src/platform/plugins/shared/kibana_react/public/dark_mode/use_dark_mode.d.ts b/src/platform/plugins/shared/kibana_react/public/dark_mode/use_dark_mode.d.ts deleted file mode 100644 index 023f1a2e87869..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/dark_mode/use_dark_mode.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * This should only be used to pass the darkMode to a theme provider which is outside - * of the global theme provider scope. For example when used with `EuiThemeProvider`. - * - * @deprecated - */ -export declare const useDarkMode: (defaultValue?: boolean) => boolean; diff --git a/src/platform/plugins/shared/kibana_react/public/index.d.ts b/src/platform/plugins/shared/kibana_react/public/index.d.ts deleted file mode 100644 index ca8b9dc4ee96f..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export type { UrlTemplateEditorVariable, UrlTemplateEditorProps } from './url_template_editor'; -export { UrlTemplateEditor } from './url_template_editor'; -export type { KibanaReactContext, KibanaReactContextValue, KibanaServices } from './context'; -export { context, createKibanaReactContext, KibanaContextProvider, useKibana, withKibana, } from './context'; -export { overviewPageActions, OverviewPageFooter } from './overview_page'; -export type { KibanaReactOverlays } from './overlays'; -export { createReactOverlays } from './overlays'; -export { useUiSetting, useGlobalUiSetting, useUiSetting$, useGlobalUiSetting$, } from './ui_settings'; -export { useDarkMode } from './dark_mode/use_dark_mode'; -export { useExecutionContext } from './use_execution_context'; -export { reactRouterNavigate, reactRouterOnClickHandler } from './react_router_navigate'; -export type { NoDataPageActions, NoDataPageActionsProps, NoDataPageProps, ElasticAgentCardProps, } from './page_template'; -export { KibanaPageTemplateSolutionNavAvatar, NO_DATA_RECOMMENDED, NoDataPage, ElasticAgentCard, NoDataCard, } from './page_template'; -export type { Value } from './validated_range'; -export { ValidatedDualRange } from './validated_range'; -/** @deprecated use `Markdown` from `@kbn/shared-ux-markdown` */ -export { Markdown, MarkdownSimple } from './markdown'; -export { toMountPoint } from './util'; -export type { ToMountPointOptions } from './util'; -/** @deprecated Use `KibanaThemeProvider`, `wrapWithTheme` from `@kbn/react-kibana-context-theme` */ -export { KibanaThemeProvider, wrapWithTheme, type KibanaThemeProviderProps } from './theme'; -/** dummy plugin, we just want kibanaReact to have its own bundle */ -export declare function plugin(): { - setup(): void; - start(): void; -}; diff --git a/src/platform/plugins/shared/kibana_react/public/markdown/index.d.ts b/src/platform/plugins/shared/kibana_react/public/markdown/index.d.ts deleted file mode 100644 index 92be1f3f8f889..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/markdown/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -import type { MarkdownSimpleProps } from './markdown_simple'; -import type { MarkdownProps } from './markdown'; -export declare const MarkdownSimple: (props: MarkdownSimpleProps) => React.JSX.Element; -export declare const Markdown: (props: MarkdownProps) => React.JSX.Element; diff --git a/src/platform/plugins/shared/kibana_react/public/markdown/markdown.d.ts b/src/platform/plugins/shared/kibana_react/public/markdown/markdown.d.ts deleted file mode 100644 index 72b9cf8703407..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/markdown/markdown.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -/** - * Return a memoized markdown rendering function that use the specified - * whiteListedRules and openLinksInNewTab configurations. - * @param {Array of Strings} whiteListedRules - white list of markdown rules - * list of rules can be found at https://github.com/markdown-it/markdown-it/issues/361 - * @param {Boolean} openLinksInNewTab - * @return {Function} Returns an Object to use with dangerouslySetInnerHTML - * with the rendered markdown HTML - */ -export declare const markdownFactory: ((whiteListedRules?: string[], openLinksInNewTab?: boolean) => (markdown: string) => string) & import("lodash").MemoizedFunction; -export interface MarkdownProps extends React.HTMLAttributes { - className?: string; - markdown?: string; - openLinksInNewTab?: boolean; - whiteListedRules?: string[]; - onRender?: () => void; - isReversed?: boolean; -} -export declare const Markdown: (props: MarkdownProps) => React.JSX.Element; -export default Markdown; diff --git a/src/platform/plugins/shared/kibana_react/public/markdown/markdownStyles.d.ts b/src/platform/plugins/shared/kibana_react/public/markdown/markdownStyles.d.ts deleted file mode 100644 index d1e2b8cc751c9..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/markdown/markdownStyles.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { UseEuiTheme } from '@elastic/eui'; -export declare const markdownStyles: (euiTheme: UseEuiTheme["euiTheme"], isReversed: boolean) => import("@emotion/react").SerializedStyles; diff --git a/src/platform/plugins/shared/kibana_react/public/markdown/markdown_simple.d.ts b/src/platform/plugins/shared/kibana_react/public/markdown/markdown_simple.d.ts deleted file mode 100644 index c80af1bea76ca..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/markdown/markdown_simple.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from 'react'; -export interface MarkdownSimpleProps { - children: string; -} -export declare const MarkdownSimple: ({ children }: MarkdownSimpleProps) => React.JSX.Element; -export default MarkdownSimple; diff --git a/src/platform/plugins/shared/kibana_react/public/overlays/create_react_overlays.d.ts b/src/platform/plugins/shared/kibana_react/public/overlays/create_react_overlays.d.ts deleted file mode 100644 index aed801d8dc524..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/overlays/create_react_overlays.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { KibanaServices } from '../context/types'; -import type { KibanaReactOverlays } from './types'; -export declare const createReactOverlays: (services: KibanaServices) => KibanaReactOverlays; diff --git a/src/platform/plugins/shared/kibana_react/public/overlays/index.d.ts b/src/platform/plugins/shared/kibana_react/public/overlays/index.d.ts deleted file mode 100644 index 570273146e9ea..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/overlays/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * from './types'; -export * from './create_react_overlays'; diff --git a/src/platform/plugins/shared/kibana_react/public/overlays/types.d.ts b/src/platform/plugins/shared/kibana_react/public/overlays/types.d.ts deleted file mode 100644 index b3a1e08adbf6a..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/overlays/types.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type * as React from 'react'; -import type { CoreStart } from '@kbn/core/public'; -export interface KibanaReactOverlays { - openFlyout: (node: React.ReactNode, options?: Parameters['1']) => ReturnType; - openModal: (node: React.ReactNode, options?: Parameters['1']) => ReturnType; -} diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/index.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/index.d.ts deleted file mode 100644 index 8ba768b07e2bd..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/overview_page/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './overview_page_actions'; -export * from './overview_page_footer'; diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/index.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/index.d.ts deleted file mode 100644 index 4a812f1962ddf..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './overview_page_actions'; diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.d.ts deleted file mode 100644 index 51f439c3cfbf5..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import type { ApplicationStart } from '@kbn/core/public'; -interface Props { - addDataHref: string; - application: ApplicationStart; - devToolsHref?: string; - hidden?: boolean; - managementHref?: string; - showDevToolsLink?: boolean; - showManagementLink?: boolean; -} -export declare const overviewPageActions: ({ addDataHref, application, devToolsHref, hidden, managementHref, showDevToolsLink, showManagementLink, }: Props) => (React.JSX.Element | null)[]; -export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/index.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/index.d.ts deleted file mode 100644 index 644bc785481cc..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './overview_page_footer'; diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.d.ts deleted file mode 100644 index 17db4a5ad3272..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FC, MouseEvent } from 'react'; -interface Props { - addBasePath: (path: string) => string; - /** The path to set as the new default route in advanced settings */ - path: string; - /** Callback function to invoke when the user wants to set their default route to the current page */ - onSetDefaultRoute?: (event: MouseEvent) => void; - /** Callback function to invoke when the user wants to change their default route button is changed */ - onChangeDefaultRoute?: (event: MouseEvent) => void; -} -export declare const OverviewPageFooter: FC; -export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/index.d.ts deleted file mode 100644 index 92a3d981c8a7b..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { KibanaPageTemplateSolutionNavAvatar } from './solution_nav'; -export * from './no_data_page'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/action_cards.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/action_cards.d.ts deleted file mode 100644 index 297a5f72cfb59..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/action_cards.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ReactElement } from 'react'; -import React from 'react'; -import type { ElasticAgentCard, NoDataCard } from '../no_data_card'; -interface ActionCardsProps { - actionCards: Array | ReactElement>; -} -export declare const ActionCards: ({ actionCards }: ActionCardsProps) => React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/index.d.ts deleted file mode 100644 index e2f86e9e39ace..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { ActionCards } from './action_cards'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/index.d.ts deleted file mode 100644 index a77d9e1ae4dd3..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './no_data_page'; -export * from './no_data_card'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.d.ts deleted file mode 100644 index 9ca262d11a5aa..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { FunctionComponent } from 'react'; -import type { NoDataPageActions } from '../no_data_page'; -export type ElasticAgentCardProps = NoDataPageActions & { - solution: string; -}; -/** - * Applies extra styling to a typical EuiAvatar - */ -export declare const ElasticAgentCard: FunctionComponent; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/index.d.ts deleted file mode 100644 index e27571ab6e985..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './elastic_agent_card'; -/** @deprecated Use `NoDataCard` from `src/plugins/shared_ux/page_template`. */ -export * from './no_data_card'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/no_data_card.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/no_data_card.d.ts deleted file mode 100644 index 54360d2d6e0f7..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/no_data_card.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FunctionComponent } from 'react'; -import type { NoDataPageActions } from '../no_data_page'; -export declare const NoDataCard: FunctionComponent; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page.d.ts deleted file mode 100644 index fda41852c3a66..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { ReactNode, FunctionComponent, MouseEventHandler } from 'react'; -import type { EuiCardProps, CommonProps } from '@elastic/eui'; -export declare const NO_DATA_RECOMMENDED: string; -export type NoDataPageActions = Partial & { - /** - * Applies the `Recommended` beta badge and makes the button `fill` - */ - recommended?: boolean; - /** - * Provide just a string for the button's label, or a whole component - */ - button?: string | ReactNode; - /** - * Remapping `onClick` to any element - */ - onClick?: MouseEventHandler; - /** - * Category to auto-select within Fleet - */ - category?: string; -}; -export type NoDataPageActionsProps = Record; -export interface NoDataPageProps extends CommonProps { - /** - * Single name for the current solution, used to auto-generate the title, logo, description, and button label - */ - solution: string; - /** - * Optionally replace the auto-generated logo - */ - logo?: string; - /** - * Required to set the docs link for the whole solution - */ - docsLink: string; - /** - * Optionally replace the auto-generated page title (h1) - */ - pageTitle?: string; - /** - * An object of `NoDataPageActions` configurations with unique primary keys. - * Use `elasticAgent` or `beats` as the primary key for pre-configured cards of this type. - * Otherwise use a custom key that contains `EuiCard` props. - */ - actions: NoDataPageActionsProps; -} -export declare const NoDataPage: FunctionComponent; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page_body/no_data_page_body.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page_body/no_data_page_body.d.ts deleted file mode 100644 index 649a1776c0efb..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page_body/no_data_page_body.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ReactElement } from 'react'; -import React from 'react'; -import type { NoDataPageProps } from '../no_data_page'; -import type { ElasticAgentCard, NoDataCard } from '../no_data_card'; -type NoDataPageBodyProps = { - actionCards: Array | ReactElement>; -} & Omit; -export declare const NoDataPageBody: (props: NoDataPageBodyProps) => React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/index.d.ts deleted file mode 100644 index 05caaf584029e..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { KibanaPageTemplateSolutionNavAvatarProps } from './solution_nav_avatar'; -export { KibanaPageTemplateSolutionNavAvatar } from './solution_nav_avatar'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/solution_nav_avatar.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/solution_nav_avatar.d.ts deleted file mode 100644 index 785580a2d4879..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/solution_nav_avatar.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FunctionComponent } from 'react'; -import type { DistributiveOmit, EuiAvatarProps } from '@elastic/eui'; -export type KibanaPageTemplateSolutionNavAvatarProps = DistributiveOmit & { - /** - * Any EuiAvatar size available, of `xxl` for custom large, brand-focused version - */ - size?: EuiAvatarProps['size'] | 'xxl'; -}; -/** - * Applies extra styling to a typical EuiAvatar - */ -export declare const KibanaPageTemplateSolutionNavAvatar: FunctionComponent; diff --git a/src/platform/plugins/shared/kibana_react/public/react_router_navigate/index.d.ts b/src/platform/plugins/shared/kibana_react/public/react_router_navigate/index.d.ts deleted file mode 100644 index ef1eeb4f3a726..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/react_router_navigate/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { reactRouterNavigate, reactRouterOnClickHandler } from './react_router_navigate'; diff --git a/src/platform/plugins/shared/kibana_react/public/react_router_navigate/react_router_navigate.d.ts b/src/platform/plugins/shared/kibana_react/public/react_router_navigate/react_router_navigate.d.ts deleted file mode 100644 index 555f52bf2de6d..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/react_router_navigate/react_router_navigate.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ScopedHistory } from '@kbn/core/public'; -import type { MouseEvent } from 'react'; -import type { History } from 'history'; -interface LocationObject { - pathname?: string; - search?: string; - hash?: string; -} -export declare const toLocationObject: (to: string | LocationObject) => LocationObject; -export declare const reactRouterNavigate: (history: ScopedHistory | History, to: string | LocationObject, onClickCallback?: Function) => { - href: string; - onClick: (event: MouseEvent) => void; -}; -export declare const reactRouterOnClickHandler: (history: ScopedHistory | History, to: string | LocationObject, onClickCallback?: Function) => (event: MouseEvent) => void; -export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/theme.d.ts b/src/platform/plugins/shared/kibana_react/public/theme.d.ts deleted file mode 100644 index 59e79b52de84f..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/theme.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import type { KibanaThemeProviderProps as KbnThemeProviderProps } from '@kbn/react-kibana-context-theme'; -import type { UserProfileService } from '@kbn/core-user-profile-browser'; -/** @deprecated Use `KibanaThemeProviderProps` from `@kbn/react-kibana-context-theme` */ -export type KibanaThemeProviderProps = Pick & KbnThemeProviderProps['theme']; -/** @deprecated Use `KibanaThemeProvider` from `@kbn/react-kibana-context-theme` */ -export declare const KibanaThemeProvider: ({ children, theme$, userProfile, modify, }: KibanaThemeProviderProps) => React.JSX.Element; -type Theme = KbnThemeProviderProps['theme']['theme$']; -/** @deprecated Use `wrapWithTheme` from `@kbn/react-kibana-context-theme` */ -export declare const wrapWithTheme: (node: React.ReactNode, theme$: Theme, userProfile?: UserProfileService) => React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/ui_settings/index.d.ts b/src/platform/plugins/shared/kibana_react/public/ui_settings/index.d.ts deleted file mode 100644 index 86cca6acb95e7..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/ui_settings/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './use_ui_setting'; diff --git a/src/platform/plugins/shared/kibana_react/public/ui_settings/use_ui_setting.d.ts b/src/platform/plugins/shared/kibana_react/public/ui_settings/use_ui_setting.d.ts deleted file mode 100644 index 63121b0d439e3..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/ui_settings/use_ui_setting.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Returns the current UI-settings value. - * - * Usage: - * - * ```js - * const darkMode = useUiSetting('theme:darkMode'); - * ``` - */ -export declare const useUiSetting: (key: string, defaultValue?: T) => T; -/** - * Returns the current global UI-settings value. - * - * Usage: - * - * ```js - * const customBranding = useGlobalUiSetting('customBranding:pageTitle'); - * ``` - */ -export declare const useGlobalUiSetting: (key: string, defaultValue?: T) => T; -type Setter = (newValue: T) => Promise; -/** - * Returns a 2-tuple, where first entry is the setting value and second is a - * function to update the setting value. - * - * Synchronously returns the most current value of the setting and subscribes - * to all subsequent updates, which will re-render your component on new values. - * - * Usage: - * - * ```js - * const [darkMode, setDarkMode] = useUiSetting$('theme:darkMode'); - * ``` - */ -export declare const useUiSetting$: (key: string, defaultValue?: T) => [T, Setter]; -/** - * Returns a 2-tuple, where first entry is the setting value and second is a - * function to update the setting value. - * - * Synchronously returns the most current value of the setting and subscribes - * to all subsequent updates, which will re-render your component on new values. - * - * Usage: - * - * ```js - * const [customBranding, setCustomBranding] = useGlobalUiSetting$('customBranding:pageTitle'); - * ``` - */ -export declare const useGlobalUiSetting$: (key: string, defaultValue?: T) => [T, Setter]; -export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/url_template_editor/index.d.ts b/src/platform/plugins/shared/kibana_react/public/url_template_editor/index.d.ts deleted file mode 100644 index a53049d12f39d..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/url_template_editor/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './url_template_editor'; diff --git a/src/platform/plugins/shared/kibana_react/public/url_template_editor/url_template_editor.d.ts b/src/platform/plugins/shared/kibana_react/public/url_template_editor/url_template_editor.d.ts deleted file mode 100644 index b57133352823f..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/url_template_editor/url_template_editor.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react'; -import { monaco, type CodeEditorProps } from '@kbn/code-editor'; -export interface UrlTemplateEditorVariable { - label: string; - title?: string; - documentation?: string; - kind?: monaco.languages.CompletionItemKind; - sortText?: string; -} -export interface UrlTemplateEditorProps { - value: string; - height?: CodeEditorProps['height']; - fitToContent?: CodeEditorProps['fitToContent']; - variables?: UrlTemplateEditorVariable[]; - onChange: CodeEditorProps['onChange']; - onEditor?: (editor: monaco.editor.IStandaloneCodeEditor) => void; - placeholder?: string; - Editor?: React.ComponentType; -} -export declare const UrlTemplateEditor: React.FC; diff --git a/src/platform/plugins/shared/kibana_react/public/use_execution_context/index.d.ts b/src/platform/plugins/shared/kibana_react/public/use_execution_context/index.d.ts deleted file mode 100644 index b8ce9879bed57..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/use_execution_context/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { useExecutionContext } from './use_execution_context'; diff --git a/src/platform/plugins/shared/kibana_react/public/use_execution_context/use_execution_context.d.ts b/src/platform/plugins/shared/kibana_react/public/use_execution_context/use_execution_context.d.ts deleted file mode 100644 index 62b1269c46688..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/use_execution_context/use_execution_context.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { KibanaExecutionContext, CoreStart } from '@kbn/core/public'; -/** - * Set and clean up application level execution context - * @param executionContext - * @param context - */ -export declare function useExecutionContext(executionContext: CoreStart['executionContext'] | undefined, context: KibanaExecutionContext): void; diff --git a/src/platform/plugins/shared/kibana_react/public/util/index.d.ts b/src/platform/plugins/shared/kibana_react/public/util/index.d.ts deleted file mode 100644 index e79ccf9d90fdd..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/util/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { type Observable } from 'rxjs'; -import type { MountPoint } from '@kbn/core/public'; -import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; -import type { CoreTheme } from '@kbn/core-theme-browser'; -import type { UserProfileService } from '@kbn/core-user-profile-browser'; -/** - * @deprecated use `ToMountPointParams` from `@kbn/react-kibana-mount` - */ -export interface ToMountPointOptions { - analytics?: AnalyticsServiceStart; - theme$?: Observable; - userProfile?: UserProfileService; -} -/** - * @deprecated use `toMountPoint` from `@kbn/react-kibana-mount` - */ -export declare const toMountPoint: (node: React.ReactNode, { analytics, theme$, userProfile }?: ToMountPointOptions) => MountPoint; diff --git a/src/platform/plugins/shared/kibana_react/public/validated_range/index.d.ts b/src/platform/plugins/shared/kibana_react/public/validated_range/index.d.ts deleted file mode 100644 index 8a79ce3517b70..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/validated_range/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { Value } from './validated_dual_range'; -export { ValidatedDualRange } from './validated_dual_range'; diff --git a/src/platform/plugins/shared/kibana_react/public/validated_range/is_range_valid.d.ts b/src/platform/plugins/shared/kibana_react/public/validated_range/is_range_valid.d.ts deleted file mode 100644 index 7a2a62c8f0260..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/validated_range/is_range_valid.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ValueMember, Value } from './validated_dual_range'; -export declare function isRangeValid(value?: Value, min?: ValueMember, max?: ValueMember, allowEmptyRange?: boolean): { - isValid: boolean; - errorMessage: string; -}; diff --git a/src/platform/plugins/shared/kibana_react/public/validated_range/validated_dual_range.d.ts b/src/platform/plugins/shared/kibana_react/public/validated_range/validated_dual_range.d.ts deleted file mode 100644 index 99de9c2abdb84..0000000000000 --- a/src/platform/plugins/shared/kibana_react/public/validated_range/validated_dual_range.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { ReactNode } from 'react'; -import React, { Component } from 'react'; -import type { EuiDualRangeProps } from '@elastic/eui'; -import type { EuiFormRowDisplayKeys } from '@elastic/eui/src/components/form/form_row/form_row'; -export type Value = EuiDualRangeProps['value']; -export type ValueMember = EuiDualRangeProps['value'][0]; -interface Props extends Omit { - value?: Value; - allowEmptyRange?: boolean; - label?: string | ReactNode; - formRowDisplay?: EuiFormRowDisplayKeys; - onChange?: (val: [string, string]) => void; -} -interface State { - isValid?: boolean; - errorMessage?: string; - value: [ValueMember, ValueMember]; - prevValue?: Value; -} -export declare class ValidatedDualRange extends Component { - static defaultProps: { - fullWidth: boolean; - allowEmptyRange: boolean; - compressed: boolean; - }; - static getDerivedStateFromProps(nextProps: Props, prevState: State): { - value: [string | number, string | number] | undefined; - prevValue: [string | number, string | number] | undefined; - isValid: boolean; - errorMessage: string; - } | null; - state: State; - _onChange: (value: Value) => void; - render(): React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/kibana_utils/common/abort_utils.d.ts b/src/platform/plugins/shared/kibana_utils/common/abort_utils.d.ts deleted file mode 100644 index b991d0b56dfdf..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/abort_utils.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -export declare enum AbortReason { - /** - * The request was aborted due to reaching the `search:timeout` advanced setting. - */ - TIMEOUT = "timeout", - /** - * The request was aborted because the data was replaced by a new request (refreshed/re-fetched). - */ - REPLACED = "replaced", - /** - * The request was aborted because the component unmounted or the execution context was destroyed. - */ - CLEANUP = "cleanup", - /** - * The request was aborted because the user explicitly canceled it. - */ - CANCELED = "canceled" -} -/** - * Class used to signify that something was aborted. Useful for applications to conditionally handle - * this type of error differently than other errors. - */ -export declare class AbortError extends Error { - constructor(message?: string); -} -/** - * Returns a `Promise` corresponding with when the given `AbortSignal` is aborted. Useful for - * situations when you might need to `Promise.race` multiple `AbortSignal`s, or an `AbortSignal` - * with any other expected errors (or completions). - * - * @param signal The `AbortSignal` to generate the `Promise` from - */ -export declare function abortSignalToPromise(signal: AbortSignal): { - promise: Promise; - cleanup: () => void; -}; diff --git a/src/platform/plugins/shared/kibana_utils/common/calculate_object_hash.d.ts b/src/platform/plugins/shared/kibana_utils/common/calculate_object_hash.d.ts deleted file mode 100644 index f3d24c7753467..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/calculate_object_hash.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare function sum(o: object): string; -export declare const calculateObjectHash: typeof sum; -export {}; diff --git a/src/platform/plugins/shared/kibana_utils/common/create_getter_setter.d.ts b/src/platform/plugins/shared/kibana_utils/common/create_getter_setter.d.ts deleted file mode 100644 index 662d1a336588f..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/create_getter_setter.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type Get = () => T; -export type Set = (value: T) => void; -export declare const createGetterSetter: (name: string, isValueRequired?: boolean) => [Get, Set]; diff --git a/src/platform/plugins/shared/kibana_utils/common/defer.d.ts b/src/platform/plugins/shared/kibana_utils/common/defer.d.ts deleted file mode 100644 index c981925dc3a4b..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/defer.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * An externally resolvable/rejectable "promise". Use it to resolve/reject - * promise at any time. - * - * ```ts - * const future = new Defer(); - * - * future.promise.then(value => console.log(value)); - * - * future.resolve(123); - * ``` - */ -export declare class Defer { - readonly resolve: (data: T) => void; - readonly reject: (error: any) => void; - readonly promise: Promise; -} -export declare const defer: () => Defer; diff --git a/src/platform/plugins/shared/kibana_utils/common/distinct_until_changed_with_initial_value.d.ts b/src/platform/plugins/shared/kibana_utils/common/distinct_until_changed_with_initial_value.d.ts deleted file mode 100644 index 419b2f581a38d..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/distinct_until_changed_with_initial_value.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { MonoTypeOperatorFunction } from 'rxjs'; -export declare function distinctUntilChangedWithInitialValue(initialValue: T | Promise, compare?: (x: T, y: T) => boolean): MonoTypeOperatorFunction; diff --git a/src/platform/plugins/shared/kibana_utils/common/errors/errors.d.ts b/src/platform/plugins/shared/kibana_utils/common/errors/errors.d.ts deleted file mode 100644 index 66683fa53e0ee..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/errors/errors.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -export declare class KbnError extends Error { - constructor(message: string); -} -/** - * when a mapping already exists for a field the user is attempting to add - * @param {String} name - the field name - */ -export declare class DuplicateField extends KbnError { - constructor(name: string); -} -/** - * when a user is attempting to create a field with disallowed character in the name, like * - * @param {String} character - the character not allowed in name - * @param {String} name - the field name - */ -export declare class CharacterNotAllowedInField extends KbnError { - constructor(character: string, name: string); -} -/** - * A saved object was not found - */ -export declare class SavedObjectNotFound extends KbnError { - savedObjectType: string; - savedObjectTypeDisplayName: string; - savedObjectId?: string; - constructor({ type, typeDisplayName, id, link, customMessage, }: { - type: string; - typeDisplayName?: string; - id?: string; - link?: string; - customMessage?: string; - }); -} -/** - * A saved field doesn't exist anymore - */ -export declare class SavedFieldNotFound extends KbnError { - constructor(message: string); -} -/** - * A saved field type isn't compatible with aggregation - */ -export declare class SavedFieldTypeInvalidForAgg extends KbnError { - constructor(message: string); -} -/** - * This error is for scenarios where a saved object is detected that has invalid JSON properties. - * There was a scenario where we were importing objects with double-encoded JSON, and the system - * was silently failing. This error is now thrown in those scenarios. - */ -export declare class InvalidJSONProperty extends KbnError { - constructor(message: string); -} diff --git a/src/platform/plugins/shared/kibana_utils/common/errors/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/errors/index.d.ts deleted file mode 100644 index 0bc01a85432ac..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/errors/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { KbnError, DuplicateField, CharacterNotAllowedInField, SavedObjectNotFound, SavedFieldNotFound, SavedFieldTypeInvalidForAgg, InvalidJSONProperty, } from './errors'; -export type { KibanaServerError } from './types'; diff --git a/src/platform/plugins/shared/kibana_utils/common/errors/types.d.ts b/src/platform/plugins/shared/kibana_utils/common/errors/types.d.ts deleted file mode 100644 index 17bb6a7b2967a..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/errors/types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface KibanaServerError { - statusCode: number; - message: string; - attributes?: T; -} diff --git a/src/platform/plugins/shared/kibana_utils/common/field_wildcard.d.ts b/src/platform/plugins/shared/kibana_utils/common/field_wildcard.d.ts deleted file mode 100644 index e2bbeabc10d46..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/field_wildcard.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const makeRegEx: ((glob: string) => RegExp) & import("lodash").MemoizedFunction; -export declare function fieldWildcardMatcher(globs?: string[], metaFields?: unknown[]): (val: unknown) => boolean; -export declare function fieldWildcardFilter(globs?: string[], metaFields?: string[]): (val: unknown) => boolean; diff --git a/src/platform/plugins/shared/kibana_utils/common/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/index.d.ts deleted file mode 100644 index 1e25f9aeb915d..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export { Defer, defer } from './defer'; -export { fieldWildcardMatcher, fieldWildcardFilter, makeRegEx } from './field_wildcard'; -export { of } from './of'; -export type { BaseState, BaseStateContainer, StateContainer, ReduxLikeStateContainer, Dispatch, Middleware, Selector, Comparator, MapStateToProps, Connect, Reducer, UnboxState, PureSelectorToSelector, PureSelectorsToSelectors, EnsurePureSelector, EnsurePureTransition, PureSelector, PureTransition, CreateStateContainerOptions, } from './state_containers'; -export { setStateToKbnUrl } from './state_management/set_state_to_kbn_url'; -export { replaceUrlHashQuery } from './state_management/format'; -export { createStateContainerReactHelpers, useContainerSelector, useContainerState, createStateContainer, defaultFreeze, } from './state_containers'; -export type { KibanaServerError } from './errors'; -export { KbnError, CharacterNotAllowedInField, SavedFieldNotFound, SavedObjectNotFound, SavedFieldTypeInvalidForAgg, InvalidJSONProperty, DuplicateField, } from './errors'; -export { AbortError, AbortReason, abortSignalToPromise } from './abort_utils'; -export type { Get, Set } from './create_getter_setter'; -export { createGetterSetter } from './create_getter_setter'; -export { distinctUntilChangedWithInitialValue } from './distinct_until_changed_with_initial_value'; -export { url } from './url'; -export { now } from './now'; -export { calculateObjectHash } from './calculate_object_hash'; -export type { VersionedState, PersistableStateService, PersistableStateMigrateFn, MigrateFunction, MigrateFunctionsObject, GetMigrationFunctionObjectFn, PersistableState, PersistableStateDefinition, } from './persistable_state'; -export { migrateToLatest, mergeMigrationFunctionMaps } from './persistable_state'; diff --git a/src/platform/plugins/shared/kibana_utils/common/now.d.ts b/src/platform/plugins/shared/kibana_utils/common/now.d.ts deleted file mode 100644 index 402d0f414b983..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/now.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Function that returns number in milliseconds since some undefined point in - * time. Use this function for performance measurements. - */ -export declare const now: () => number; diff --git a/src/platform/plugins/shared/kibana_utils/common/of.d.ts b/src/platform/plugins/shared/kibana_utils/common/of.d.ts deleted file mode 100644 index bfd57cffa3e76..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/of.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Given a promise awaits it and returns a 3-tuple, with the following members: - * - * - First entry is either the resolved value of the promise or `undefined`. - * - Second entry is either the error thrown by promise or `undefined`. - * - Third entry is a boolean, truthy if promise was resolved and falsy if rejected. - * - * @param promise Promise to convert to 3-tuple. - */ -export declare const of: (promise: Promise) => Promise<[T | undefined, E | undefined, boolean]>; diff --git a/src/platform/plugins/shared/kibana_utils/common/persistable_state/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/persistable_state/index.d.ts deleted file mode 100644 index 74c6330ffcfcd..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/persistable_state/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { VersionedState, PersistableState, PersistableStateDefinition, PersistableStateMigrateFn, PersistableStateService, MigrateFunctionsObject, MigrateFunction, GetMigrationFunctionObjectFn, } from './types'; -export { migrateToLatest } from './migrate_to_latest'; -export { mergeMigrationFunctionMaps } from './merge_migration_function_map'; diff --git a/src/platform/plugins/shared/kibana_utils/common/persistable_state/merge_migration_function_map.d.ts b/src/platform/plugins/shared/kibana_utils/common/persistable_state/merge_migration_function_map.d.ts deleted file mode 100644 index 52f9bb4880860..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/persistable_state/merge_migration_function_map.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { MigrateFunctionsObject, MigrateFunction } from './types'; -export declare const mergeMigrationFunctionMaps: (obj1: MigrateFunctionsObject, obj2: MigrateFunctionsObject) => { - [semver: string]: MigrateFunction; -} & MigrateFunctionsObject; diff --git a/src/platform/plugins/shared/kibana_utils/common/persistable_state/migrate_to_latest.d.ts b/src/platform/plugins/shared/kibana_utils/common/persistable_state/migrate_to_latest.d.ts deleted file mode 100644 index ceda3d928649f..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/persistable_state/migrate_to_latest.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { VersionedState, MigrateFunctionsObject } from './types'; -export declare function migrateToLatest(migrations: MigrateFunctionsObject, { state, version: oldVersion }: VersionedState, loose?: boolean): S; diff --git a/src/platform/plugins/shared/kibana_utils/common/persistable_state/types.d.ts b/src/platform/plugins/shared/kibana_utils/common/persistable_state/types.d.ts deleted file mode 100644 index 9c3b8c031b798..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/persistable_state/types.d.ts +++ /dev/null @@ -1,146 +0,0 @@ -import type { SerializableRecord, Serializable } from '@kbn/utility-types'; -import type { SavedObjectReference } from '@kbn/core/types'; -/** - * Versioned state is a POJO JavaScript object that can be serialized to JSON, - * and which also contains the version information. The version is stored in - * semver format and corresponds to the Kibana release version when the object - * was created. The version can be used to apply migrations to the object. - * - * For example: - * - * ```ts - * const obj: VersionedState<{ dashboardId: string }> = { - * version: '7.14.0', - * state: { - * dashboardId: '123', - * }, - * }; - * ``` - */ -export interface VersionedState { - version: string; - state: S; -} -/** - * Persistable state interface can be implemented by something that persists - * (stores) state, for example, in a saved object. Once implemented that thing - * will gain ability to "extract" and "inject" saved object references, which - * are necessary for various saved object tasks, such as export. It will also be - * able to do state migrations across Kibana versions, if the shape of the state - * would change over time. - * - * @todo Maybe rename it to `PersistableStateItem`? - */ -export interface PersistableState

{ - /** - * Function which reports telemetry information. This function is essentially - * a "reducer" - it receives the existing "stats" object and returns an - * updated version of the "stats" object. - * - * @param state The persistable state serializable state object. - * @param stats Stats object containing the stats which were already - * collected. This `stats` object shall not be mutated in-line. - * @returns A new stats object augmented with new telemetry information. - */ - telemetry: (state: P, stats: Record) => Record; - /** - * A function which receives state and a list of references and should return - * back the state with references injected. The default is an identity - * function. - * - * @param state The persistable state serializable state object. - * @param references List of saved object references. - * @returns Persistable state object with references injected. - */ - inject: (state: P, references: SavedObjectReference[]) => P; - /** - * A function which receives state and should return the state with references - * extracted and an array of the extracted references. The default case could - * simply return the same state with an empty array of references. - * - * @param state The persistable state serializable state object. - * @returns Persistable state object with references extracted and a list of - * references. - */ - extract: (state: P) => { - state: P; - references: SavedObjectReference[]; - }; - /** - * A list of migration functions, which migrate the persistable state - * serializable object to the next version. Migration functions should be - * keyed using semver, where the version indicates which version the state - * will be migrated to. - */ - migrations: MigrateFunctionsObject | GetMigrationFunctionObjectFn; -} -export type GetMigrationFunctionObjectFn = () => MigrateFunctionsObject; -/** - * Collection of migrations that a given type of persistable state object has - * accumulated over time. Migration functions are keyed using semver version - * of Kibana releases. - */ -export type MigrateFunctionsObject = { - [semver: string]: MigrateFunction; -}; -export type MigrateFunction = (state: FromVersion) => ToVersion; -/** - * migrate function runs the specified migration - * @param state - * @param version - */ -export type PersistableStateMigrateFn = (state: SerializableRecord, version: string) => SerializableRecord; -export type PersistableStateDefinition

= Partial>; -/** - * @todo Add description. - */ -export interface PersistableStateService

{ - /** - * Function which reports telemetry information. This function is essentially - * a "reducer" - it receives the existing "stats" object and returns an - * updated version of the "stats" object. - * - * @param state The persistable state serializable state object. - * @param stats Stats object containing the stats which were already - * collected. This `stats` object shall not be mutated in-line. - * @returns A new stats object augmented with new telemetry information. - */ - telemetry(state: P, collector: Record): Record; - /** - * A function which receives state and a list of references and should return - * back the state with references injected. The default is an identity - * function. - * - * @param state The persistable state serializable state object. - * @param references List of saved object references. - * @returns Persistable state object with references injected. - */ - inject(state: P, references: SavedObjectReference[]): P; - /** - * A function which receives state and should return the state with references - * extracted and an array of the extracted references. The default case could - * simply return the same state with an empty array of references. - * - * @param state The persistable state serializable state object. - * @returns Persistable state object with references extracted and a list of - * references. - */ - extract(state: P): { - state: P; - references: SavedObjectReference[]; - }; - /** - * A function which receives the state of an older object and version and - * should migrate the state of the object to the latest possible version using - * the `.migrations` dictionary provided on a {@link PersistableState} item. - * - * @param state The persistable state serializable state object. - * @param version Current semver version of the `state`. - * @returns A serializable state object migrated to the latest state. - */ - migrateToLatest?: (state: VersionedState

) => P; - /** - * returns all registered migrations - */ - getAllMigrations: () => MigrateFunctionsObject; -} diff --git a/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container.d.ts deleted file mode 100644 index 9fac937be7005..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { ReduxLikeStateContainer, BaseState } from './types'; -export declare const defaultFreeze: (value: T) => T; -/** - * State container options - * @public - */ -export interface CreateStateContainerOptions { - /** - * Function to use when freezing state. Supply identity function. - * If not provided, default `deepFreeze` is used. - * - * @example - * If you expect that your state will be mutated externally an you cannot - * prevent that - * ```ts - * { - * freeze: state => state, - * } - * ``` - */ - freeze?: (state: T) => T; -} -/** - * Creates a state container without transitions and without selectors. - * @param defaultState - initial state - * @typeParam State - shape of state - * @public - */ -export declare function createStateContainer(defaultState: State): ReduxLikeStateContainer; -/** - * Creates a state container with transitions, but without selectors. - * @param defaultState - initial state - * @param pureTransitions - state transitions configuration object. Map of {@link PureTransition}. - * @typeParam State - shape of state - * @public - */ -export declare function createStateContainer(defaultState: State, pureTransitions: PureTransitions): ReduxLikeStateContainer; -/** - * Creates a state container with transitions and selectors. - * @param defaultState - initial state - * @param pureTransitions - state transitions configuration object. Map of {@link PureTransition}. - * @param pureSelectors - state selectors configuration object. Map of {@link PureSelectors}. - * @param options - state container options {@link CreateStateContainerOptions} - * @typeParam State - shape of state - * @public - */ -export declare function createStateContainer(defaultState: State, pureTransitions: PureTransitions, pureSelectors: PureSelectors, options?: CreateStateContainerOptions): ReduxLikeStateContainer; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container_react_helpers.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container_react_helpers.d.ts deleted file mode 100644 index 6bf07dbed85bb..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_containers/create_state_container_react_helpers.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react'; -import type { Comparator, Connect, StateContainer, UnboxState } from './types'; -/** - * React hooks that returns the latest state of a {@link StateContainer}. - * - * @param container - {@link StateContainer} which state to track. - * @returns - latest {@link StateContainer} state - * @public - */ -export declare const useContainerState: >(container: Container) => UnboxState; -/** - * React hook to apply selector to state container to extract only needed information. Will - * re-render your component only when the section changes. - * - * @param container - {@link StateContainer} which state to track. - * @param selector - Function used to pick parts of state. - * @param comparator - {@link Comparator} function used to memoize previous result, to not - * re-render React component if state did not change. By default uses - * `fast-deep-equal` package. - * @returns - result of a selector(state) - * @public - */ -export declare const useContainerSelector: , Result>(container: Container, selector: (state: UnboxState) => Result, comparator?: Comparator) => Result; -/** - * Creates helpers for using {@link StateContainer | State Containers} with react - * Refer to {@link https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/kibana_utils/docs/state_containers/react.md | guide} for details - * @public - */ -export declare const createStateContainerReactHelpers: >() => { - Provider: React.Provider; - Consumer: React.Consumer; - context: React.Context; - useContainer: () => Container; - useState: () => UnboxState; - useTransitions: () => Container["transitions"]; - useSelector: (selector: (state: UnboxState) => Result, comparator?: Comparator) => Result; - connect: Connect>; -}; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_containers/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_containers/index.d.ts deleted file mode 100644 index fd0fc1efbf2b8..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_containers/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * State containers are Redux-store-like objects meant to help you manage state in your services or apps. - * Refer to {@link https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/kibana_utils/docs/state_containers | guides and examples} for more info - * - * @packageDocumentation - */ -export type { BaseState, BaseStateContainer, StateContainer, ReduxLikeStateContainer, Dispatch, Middleware, Selector, Comparator, MapStateToProps, Connect, Reducer, UnboxState, PureSelectorToSelector, PureSelectorsToSelectors, EnsurePureSelector, PureTransitionsToTransitions, PureTransitionToTransition, EnsurePureTransition, PureSelector, PureTransition, Transition, TransitionDescription, } from './types'; -export type { CreateStateContainerOptions } from './create_state_container'; -export { createStateContainer, defaultFreeze } from './create_state_container'; -export { createStateContainerReactHelpers, useContainerSelector, useContainerState, } from './create_state_container_react_helpers'; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_containers/types.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_containers/types.d.ts deleted file mode 100644 index 47f90fcf96115..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_containers/types.d.ts +++ /dev/null @@ -1,148 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Ensure } from '@kbn/utility-types'; -import type { FC, ComponentType } from 'react'; -/** - * Base {@link StateContainer} state shape - * @public - */ -export type BaseState = object; -/** - * @internal - */ -export interface TransitionDescription { - type: Type; - args: Args; -} -/** - * @internal - */ -export type Transition = (...args: Args) => State; -/** - * Given some state and an argument, transform the state and return a new version of the state. - * @public - */ -export type PureTransition = (state: State) => Transition; -/** - * @public - */ -export type EnsurePureTransition = Ensure>; -/** - * @internal - */ -export type PureTransitionToTransition> = ReturnType; -/** - * @internal - */ -export type PureTransitionsToTransitions = { - [K in keyof T]: PureTransitionToTransition>; -}; -/** - * Base state container shape without transitions or selectors - * @typeParam State - Shape of state in the container. Have to match {@link BaseState} constraint - * @public - */ -export interface BaseStateContainer { - /** - * Retrieves current state from the container - * @returns current state - * @public - */ - get: () => State; - /** - * Sets state into container - * @param state - new state to set - */ - set: (state: State) => void; - /** - * {@link Observable} of state - */ - state$: Observable; -} -/** - * Fully featured state container with {@link Selector | Selectors} and {@link Transition | Transitions}. Extends {@link BaseStateContainer}. - * @typeParam State - Shape of state in the container. Has to match {@link BaseState} constraint - * @typeParam PureTransitions - map of {@link PureTransition | transitions} to provide on state container - * @typeParam PureSelectors - map of {@link PureSelector | selectors} to provide on state container - * @public - */ -export interface StateContainer extends BaseStateContainer { - transitions: Readonly>; - selectors: Readonly>; -} -/** - * Fully featured state container which matches Redux store interface. Extends {@link StateContainer}. - * Allows to use state container with redux libraries. - * @public - */ -export interface ReduxLikeStateContainer extends StateContainer { - getState: () => State; - reducer: Reducer; - replaceReducer: (nextReducer: Reducer) => void; - dispatch: (action: TransitionDescription) => void; - addMiddleware: (middleware: Middleware) => void; - subscribe: (listener: (state: State) => void) => () => void; -} -/** - * Redux like dispatch - * @public - */ -export type Dispatch = (action: T) => void; -/** - * Redux like Middleware - * @public - */ -export type Middleware = (store: Pick, 'getState' | 'dispatch'>) => (next: (action: TransitionDescription) => TransitionDescription | any) => Dispatch; -/** - * Redux like Reducer - * @public - */ -export type Reducer = (state: State, action: TransitionDescription) => State; -/** - * Utility type for inferring state shape from {@link StateContainer} - * @public - */ -export type UnboxState> = Container extends StateContainer ? T : never; -/** - * Utility type for inferring transitions type from {@link StateContainer} - * @public - */ -export type UnboxTransitions> = Container extends StateContainer ? T : never; -/** - * @public - */ -export type Selector = (...args: Args) => Result; -/** - * @public - */ -export type PureSelector = (state: State) => Selector; -/** - * @public - */ -export type EnsurePureSelector = Ensure>; -/** - * @public - */ -export type PureSelectorToSelector> = ReturnType>; -/** - * @public - */ -export type PureSelectorsToSelectors = { - [K in keyof T]: PureSelectorToSelector>; -}; -/** - * Used to compare state, see {@link useContainerSelector}. - * @public - */ -export type Comparator = (previous: Result, current: Result) => boolean; -/** - * State container state to component props mapper. - * See {@link Connect} - * @public - */ -export type MapStateToProps = (state: State) => StateProps; -/** - * Similar to `connect` from react-redux, - * allows to map state from state container to component's props. - * @public - */ -export type Connect = (mapStateToProp: MapStateToProps>) => (component: ComponentType) => FC>; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/encode_state.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/encode_state.d.ts deleted file mode 100644 index f93fc6aa3560b..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_management/encode_state.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function encodeState(state: State, useHash: boolean, createHash: (rawState: State) => string): string; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/format.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/format.d.ts deleted file mode 100644 index 71c6709bef38a..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_management/format.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ParsedQuery } from 'query-string'; -export declare function replaceUrlQuery(rawUrl: string, queryReplacer: (query: ParsedQuery) => ParsedQuery): string; -export declare function replaceUrlHashQuery(rawUrl: string, queryReplacer: (query: ParsedQuery) => ParsedQuery): string; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/parse.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/parse.d.ts deleted file mode 100644 index 9fe5da960b113..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_management/parse.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const parseUrl: (url: string) => import("url").UrlWithParsedQuery; -export declare const parseUrlHash: (url: string) => import("url").UrlWithParsedQuery | null; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/set_state_to_kbn_url.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/set_state_to_kbn_url.d.ts deleted file mode 100644 index b76bea5ce419a..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_management/set_state_to_kbn_url.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type SetStateToKbnUrlHashOptions = { - useHash: boolean; - storeInHashQuery?: boolean; -}; -export declare function createSetStateToKbnUrl(createHash: (rawState: State) => string): (key: string, state: State, { useHash, storeInHashQuery }: SetStateToKbnUrlHashOptions | undefined, rawUrl: string) => string; -/** - * Common version of setStateToKbnUrl which doesn't use session storage. - * - * Sets state to the url by key and returns a new url string. - * - * e.g.: - * given a url: http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:indexedFields)&_b=(f:test,i:'',l:'') - * key: '_a' - * and state: {tab: 'other'} - * - * will return url: - * http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:other)&_b=(f:test,i:'',l:'') - * - * By default due to Kibana legacy reasons assumed that state is stored in a query inside a hash part of the URL: - * http://localhost:5601/oxf/app/kibana#/yourApp?_a={STATE} - * - * { storeInHashQuery: true } option should be used in you want to store you state in a main query (not in a hash): - * http://localhost:5601/oxf/app/kibana?_a={STATE}#/yourApp - */ -export declare function setStateToKbnUrl(key: string, state: State, hashOptions: SetStateToKbnUrlHashOptions, rawUrl: string): string; diff --git a/src/platform/plugins/shared/kibana_utils/common/state_management/state_hash.d.ts b/src/platform/plugins/shared/kibana_utils/common/state_management/state_hash.d.ts deleted file mode 100644 index dbb6f01fa1409..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/state_management/state_hash.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function isStateHash(str: string): boolean; -export declare function createStateHash(json: string, existingJsonProvider?: (hash: string) => string | null): string; diff --git a/src/platform/plugins/shared/kibana_utils/common/url/encode_uri_query.d.ts b/src/platform/plugins/shared/kibana_utils/common/url/encode_uri_query.d.ts deleted file mode 100644 index f2e688f7347ad..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/url/encode_uri_query.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ParsedQuery } from 'query-string'; -/** - * This method is intended for encoding *key* or *value* parts of query component. We need a custom - * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be - * encoded per http://tools.ietf.org/html/rfc3986: - * query = *( pchar / "/" / "?" ) - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * pct-encoded = "%" HEXDIG HEXDIG - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ -export declare function encodeUriQuery(val: string, pctEncodeSpaces?: boolean): string; -export declare const encodeQuery: (query: ParsedQuery, encodeFunction?: (val: string, pctEncodeSpaces?: boolean) => string, pctEncodeSpaces?: boolean) => ParsedQuery; -/** - * Method to help modify url query params. - * - * @param params - * @param key - * @param value - */ -export declare const addQueryParam: (params: string, key: string, value?: string) => string; diff --git a/src/platform/plugins/shared/kibana_utils/common/url/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/url/index.d.ts deleted file mode 100644 index 48968b138f2c6..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/url/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { encodeUriQuery } from './encode_uri_query'; -import { validateUrl } from './validate_url'; -export declare const url: { - encodeQuery: (query: import("query-string").ParsedQuery, encodeFunction?: (val: string, pctEncodeSpaces?: boolean) => string, pctEncodeSpaces?: boolean) => import("query-string").ParsedQuery; - encodeUriQuery: typeof encodeUriQuery; - addQueryParam: (params: string, key: string, value?: string) => string; - validate: typeof validateUrl; -}; diff --git a/src/platform/plugins/shared/kibana_utils/common/url/validate_url.d.ts b/src/platform/plugins/shared/kibana_utils/common/url/validate_url.d.ts deleted file mode 100644 index daee54ceb4ce5..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/common/url/validate_url.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare function validateUrl(url: string): { - isValid: boolean; - error?: string; - invalidUrl?: string; -}; diff --git a/src/platform/plugins/shared/kibana_utils/public/core/create_start_service_getter.d.ts b/src/platform/plugins/shared/kibana_utils/public/core/create_start_service_getter.d.ts deleted file mode 100644 index 8dc13ad2a1529..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/core/create_start_service_getter.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { CoreStart, StartServicesAccessor } from '@kbn/core/public'; -interface StartServices { - plugins: Plugins; - self: OwnContract; - core: Core; -} -export type StartServicesGetter = () => StartServices; -/** - * Use this utility to create a synchronous *start* service getter in *setup* - * life-cycle of your plugin. - * - * Below is a usage example in a Kibana plugin. - * - * ```ts - * export interface MyPluginStartDeps { - * data: DataPublicPluginStart; - * expressions: ExpressionsStart; - * inspector: InspectorStart; - * uiActions: UiActionsStart; - * } - * - * class MyPlugin implements Plugin { - * setup(core: CoreSetup, plugins) { - * const start = createStartServicesGetter(core.getStartServices); - * plugins.expressions.registerFunction(myExpressionFunction(start)); - * } - * - * start(core, plugins: MyPluginStartDeps) { - * - * } - * } - * ``` - * - * In `myExpressionFunction` you can make sure you are picking only the dependencies - * your function needs using the `Pick` type. - * - * ```ts - * const myExpressionFunction = - * (start: StartServicesGetter>) => { - * - * start().plugins.indexPatterns.something(123); - * } - * ``` - * - * @param accessor Asynchronous start service accessor provided by platform. - * @returns Returns a function which synchronously returns *start* core services - * and plugin contracts. If you call this function before the *start* life-cycle - * has started it will throw. - */ -export declare const createStartServicesGetter: (accessor: StartServicesAccessor) => StartServicesGetter; -export {}; diff --git a/src/platform/plugins/shared/kibana_utils/public/core/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/core/index.d.ts deleted file mode 100644 index 2a0f4db1724f9..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/core/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { StartServicesGetter } from './create_start_service_getter'; -export { createStartServicesGetter } from './create_start_service_getter'; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/get_query_params.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/get_query_params.d.ts deleted file mode 100644 index 694f5b8070f3f..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/history/get_query_params.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ParsedQuery } from 'query-string'; -import type { Location } from 'history'; -export declare function getQueryParams(location: Location): ParsedQuery; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/history_observable.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/history_observable.d.ts deleted file mode 100644 index 262cb1a83aa37..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/history/history_observable.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Action, History, Location } from 'history'; -import { Observable } from 'rxjs'; -import type { ParsedQuery } from 'query-string'; -/** - * Convert history.listen into an observable - * @param history - {@link History} instance - */ -export declare function createHistoryObservable(history: History): Observable<{ - location: Location; - action: Action; -}>; -/** - * Create an observable that emits every time any of query params change. - * Uses deepEqual check. - * @param history - {@link History} instance - */ -export declare function createQueryParamsObservable(history: History): Observable; -/** - * Create an observable that emits every time _paramKey_ changes - * @param history - {@link History} instance - * @param paramKey - query param key to observe - */ -export declare function createQueryParamObservable(history: History, paramKey: string): Observable; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/index.d.ts deleted file mode 100644 index 27161a4888346..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/history/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { removeQueryParam } from './remove_query_param'; -export { redirectWhenMissing } from './redirect_when_missing'; -export { getQueryParams } from './get_query_params'; -export * from './history_observable'; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/redirect_when_missing.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/redirect_when_missing.d.ts deleted file mode 100644 index 42adde91c4a3a..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/history/redirect_when_missing.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { History } from 'history'; -import type { ApplicationStart, HttpStart, ToastsSetup } from '@kbn/core/public'; -import type { ThemeServiceStart } from '@kbn/core/public'; -import type { UserProfileService } from '@kbn/core-user-profile-browser'; -import type { SavedObjectNotFound } from '..'; -interface Mapping { - [key: string]: string | { - app: string; - path: string; - }; -} -/** - * Creates an error handler that will redirect to a url when a SavedObjectNotFound - * error is thrown - */ -export declare function redirectWhenMissing({ history, navigateToApp, basePath, mapping, toastNotifications, onBeforeRedirect, theme, userProfile, }: { - history: History; - navigateToApp: ApplicationStart['navigateToApp']; - basePath: HttpStart['basePath']; - /** - * a mapping of url's to redirect to based on the saved object that - * couldn't be found, or just a string that will be used for all types - */ - mapping: string | Mapping; - /** - * Toast notifications service to show toasts in error cases. - */ - toastNotifications: ToastsSetup; - /** - * Optional callback invoked directly before a redirect is triggered - */ - onBeforeRedirect?: (error: SavedObjectNotFound) => void; - theme: ThemeServiceStart; - userProfile?: UserProfileService; -}): (error: SavedObjectNotFound) => void; -export {}; diff --git a/src/platform/plugins/shared/kibana_utils/public/history/remove_query_param.d.ts b/src/platform/plugins/shared/kibana_utils/public/history/remove_query_param.d.ts deleted file mode 100644 index 0622f02e76d2c..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/history/remove_query_param.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { History } from 'history'; -export declare function removeQueryParam(history: History, param: string, replace?: boolean): void; diff --git a/src/platform/plugins/shared/kibana_utils/public/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/index.d.ts deleted file mode 100644 index f175129074161..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { KibanaUtilsPublicPlugin } from './plugin'; -export type { Get, Set } from '../common'; -export { AbortError, abortSignalToPromise, calculateObjectHash, defer, Defer, fieldWildcardFilter, fieldWildcardMatcher, of, url, createGetterSetter, } from '../common'; -export type { StartServicesGetter } from './core'; -export { createStartServicesGetter } from './core'; -export type { KibanaServerError } from '../common/errors'; -export { KbnError, CharacterNotAllowedInField, SavedFieldNotFound, SavedObjectNotFound, SavedFieldTypeInvalidForAgg, InvalidJSONProperty, DuplicateField, } from '../common/errors'; -export { RenderCompleteDispatcher, dispatchRenderComplete, dispatchRenderStart, } from './render_complete'; -export { ResizeChecker } from './resize_checker'; -export type { BaseState, BaseStateContainer, StateContainer, ReduxLikeStateContainer, Dispatch, Middleware, Selector, Comparator, MapStateToProps, Connect, Reducer, UnboxState, PureSelectorToSelector, PureSelectorsToSelectors, EnsurePureSelector, EnsurePureTransition, PureSelector, PureTransition, CreateStateContainerOptions, } from '../common/state_containers'; -export { createStateContainerReactHelpers, useContainerSelector, useContainerState, createStateContainer, } from '../common/state_containers'; -export type { IStorageWrapper, IStorage } from './storage'; -export { Storage } from './storage'; -export { hashedItemStore, HashedItemStore } from './storage/hashed_item_store'; -export { persistState, retrieveState } from './state_management/state_hash'; -export { hashQuery, hashUrl, unhashUrl, unhashQuery, createUrlTracker, createKbnUrlTracker, createKbnUrlControls, getStateFromKbnUrl, getStatesFromKbnUrl, setStateToKbnUrl, withNotifyOnErrors, } from './state_management/url'; -export type { IStateStorage, IStateSyncConfig, ISyncStateRef, IKbnUrlStateStorage, INullableBaseStateContainer, ISessionStorageStateStorage, StartSyncStateFnType, StopSyncStateFnType, } from './state_sync'; -export { syncState, syncStates, createKbnUrlStateStorage, createSessionStorageStateStorage, } from './state_sync'; -export type { Configurable, CollectConfigProps } from './ui'; -export { removeQueryParam, redirectWhenMissing, getQueryParams, createQueryParamsObservable, createHistoryObservable, createQueryParamObservable, } from './history'; -export { applyDiff } from './state_management/utils/diff_object'; -export type { KibanaUtilsPublicSetup as KibanaUtilsSetup, KibanaUtilsPublicStart } from './plugin'; -export declare function plugin(): KibanaUtilsPublicPlugin; diff --git a/src/platform/plugins/shared/kibana_utils/public/plugin.d.ts b/src/platform/plugins/shared/kibana_utils/public/plugin.d.ts deleted file mode 100644 index 4153742ad6d8e..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/plugin.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -export type KibanaUtilsPublicSetup = undefined; -export type KibanaUtilsPublicStart = undefined; -export interface KibanaUtilsPublicSetupDependencies { -} -export interface KibanaUtilsPublicStartDependencies { -} -export declare class KibanaUtilsPublicPlugin implements Plugin { - setup(_core: CoreSetup): KibanaUtilsPublicSetup; - start(_core: CoreStart): KibanaUtilsPublicStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/render_complete/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/render_complete/index.d.ts deleted file mode 100644 index a38356194d52a..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/render_complete/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { dispatchRenderStart, dispatchRenderComplete, RenderCompleteDispatcher, } from './render_complete_dispatcher'; diff --git a/src/platform/plugins/shared/kibana_utils/public/render_complete/render_complete_dispatcher.d.ts b/src/platform/plugins/shared/kibana_utils/public/render_complete/render_complete_dispatcher.d.ts deleted file mode 100644 index 5706fc5fb0d01..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/render_complete/render_complete_dispatcher.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export declare function dispatchRenderComplete(el: HTMLElement): void; -export declare function dispatchRenderStart(el: HTMLElement): void; -/** - * Should call `dispatchComplete()` when UI block has finished loading its data and has - * completely rendered. Should `dispatchInProgress()` every time UI block - * starts loading data again. At the start it is assumed that UI block is loading - * so it dispatches "in progress" automatically, so you need to call `setRenderComplete` - * at least once. - * - * This is used for reporting to know that UI block is ready, so - * it can take a screenshot. It is also used in functional tests to know that - * page has stabilized. - */ -export declare class RenderCompleteDispatcher { - private count; - private el?; - constructor(el?: HTMLElement); - setEl(el?: HTMLElement): void; - dispatchInProgress(): void; - dispatchComplete(): void; - dispatchError(): void; - setTitle(title: string): void; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/resize_checker/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/resize_checker/index.d.ts deleted file mode 100644 index 4cb12e0ef31a2..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/resize_checker/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { ResizeChecker } from './resize_checker'; diff --git a/src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.d.ts b/src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.d.ts deleted file mode 100644 index 7d970f0e2abc8..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { EventEmitter } from 'events'; -/** - * ResizeChecker receives an element and emits a "resize" event every time it changes size. - */ -export declare class ResizeChecker extends EventEmitter { - private destroyed; - private el; - private observer; - private expectedSize; - constructor(el: HTMLElement, args?: { - disabled?: boolean; - }); - enable(): void; - /** - * Run a function and ignore all resizes that occur - * while it's running. - */ - modifySizeWithoutTriggeringResize(block: () => void): void; - /** - * Tell the ResizeChecker to shutdown, stop listenings, and never - * emit another resize event. - * - * Cleans up it's listeners and timers. - */ - destroy(): void; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/encode_decode_state.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/encode_decode_state.d.ts deleted file mode 100644 index 834cb0b1c7578..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/encode_decode_state.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function decodeState(expandedOrHashedState: string): State; -export declare function hashedStateToExpandedState(expandedOrHashedState: string): string; -export declare function expandedStateToHashedState(expandedOrHashedState: string): string; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/index.d.ts deleted file mode 100644 index 87f0e58499741..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/state_encoder/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { decodeState, expandedStateToHashedState, hashedStateToExpandedState, } from './encode_decode_state'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/index.d.ts deleted file mode 100644 index 8597c16c6fb35..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { persistState, retrieveState } from './state_hash'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/state_hash.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/state_hash.d.ts deleted file mode 100644 index 3c6a8e310af5a..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/state_hash/state_hash.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function retrieveState(stateHash: string): State; -export declare function persistState(state: State): string; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/errors.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/errors.d.ts deleted file mode 100644 index 8d6513e095e89..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/url/errors.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { NotificationsStart } from '@kbn/core/public'; -export declare const restoreUrlErrorTitle: string; -export declare const saveStateInUrlErrorTitle: string; -export declare const flushNotifyOnErrors: () => void; -/** - * Helper for configuring {@link IKbnUrlStateStorage} to notify about inner errors - * - * @example - * ```ts - * const kbnUrlStateStorage = createKbnUrlStateStorage({ - * history, - * ...withNotifyOnErrors(core.notifications.toast)) - * } - * ``` - * @param toast - toastApi from core.notifications.toasts - */ -export declare const withNotifyOnErrors: (toasts: NotificationsStart["toasts"]) => { - onGetError: (e: Error) => void; - onSetError: (e: Error) => void; -}; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/hash_unhash_url.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/hash_unhash_url.d.ts deleted file mode 100644 index 301c3cf84177f..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/url/hash_unhash_url.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type IParsedUrlQuery = Record; -interface IUrlQueryMapperOptions { - hashableParams: string[]; -} -export type IUrlQueryReplacerOptions = IUrlQueryMapperOptions; -export declare const unhashQuery: (query: IParsedUrlQuery, options?: IUrlQueryMapperOptions) => { - [k: string]: any; -}; -export declare const hashQuery: (query: IParsedUrlQuery, options?: IUrlQueryMapperOptions) => { - [k: string]: any; -}; -export declare const unhashUrl: (url: string) => string; -export declare const hashUrl: (url: string) => string; -export {}; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/index.d.ts deleted file mode 100644 index c15bb97d0bd59..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/url/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { hashUrl, hashQuery, unhashUrl, unhashQuery } from './hash_unhash_url'; -export type { IKbnUrlControls } from './kbn_url_storage'; -export { createKbnUrlControls, setStateToKbnUrl, getStateFromKbnUrl, getStatesFromKbnUrl, } from './kbn_url_storage'; -export { createKbnUrlTracker } from './kbn_url_tracker'; -export { createUrlTracker } from './url_tracker'; -export { withNotifyOnErrors, flushNotifyOnErrors, saveStateInUrlErrorTitle, restoreUrlErrorTitle, } from './errors'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_storage.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_storage.d.ts deleted file mode 100644 index 86a496bd8f4e2..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_storage.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -import type { History } from 'history'; -import type { SetStateToKbnUrlHashOptions } from '../../../common/state_management/set_state_to_kbn_url'; -export declare const getCurrentUrl: (history: History) => string; -/** - * Parses a kibana url and retrieves all the states encoded into the URL, - * Handles both expanded rison state and hashed state (where the actual state stored in sessionStorage) - * e.g.: - * - * given an url: - * http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:indexedFields)&_b=(f:test,i:'',l:'') - * will return object: - * {_a: {tab: 'indexedFields'}, _b: {f: 'test', i: '', l: ''}}; - * - * - * By default due to Kibana legacy reasons assumed that state is stored in a query inside a hash part of the URL: - * http://localhost:5601/oxf/app/kibana#/yourApp?_a={STATE} - * - * { getFromHashQuery: false } option should be used in case state is stored in a main query (not in a hash): - * http://localhost:5601/oxf/app/kibana?_a={STATE}#/yourApp - * - */ -export declare function getStatesFromKbnUrl>(url?: string, keys?: Array, { getFromHashQuery }?: { - getFromHashQuery: boolean; -}): State; -/** - * Retrieves specific state from url by key - * e.g.: - * - * given an url: - * http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:indexedFields)&_b=(f:test,i:'',l:'') - * and key '_a' - * will return object: - * {tab: 'indexedFields'} - * - * - * By default due to Kibana legacy reasons assumed that state is stored in a query inside a hash part of the URL: - * http://localhost:5601/oxf/app/kibana#/yourApp?_a={STATE} - * - * { getFromHashQuery: false } option should be used in case state is stored in a main query (not in a hash): - * http://localhost:5601/oxf/app/kibana?_a={STATE}#/yourApp - */ -export declare function getStateFromKbnUrl(key: string, url?: string, { getFromHashQuery }?: { - getFromHashQuery: boolean; -}): State | null; -/** - * Sets state to the url by key and returns a new url string. - * Doesn't actually updates history - * - * e.g.: - * given a url: http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:indexedFields)&_b=(f:test,i:'',l:'') - * key: '_a' - * and state: {tab: 'other'} - * - * will return url: - * http://localhost:5601/oxf/app/kibana#/yourApp?_a=(tab:other)&_b=(f:test,i:'',l:'') - * - * By default due to Kibana legacy reasons assumed that state is stored in a query inside a hash part of the URL: - * http://localhost:5601/oxf/app/kibana#/yourApp?_a={STATE} - * - * { storeInHashQuery: false } option should be used in you want to store your state in a main query (not in a hash): - * http://localhost:5601/oxf/app/kibana?_a={STATE}#/yourApp - */ -export declare function setStateToKbnUrl(key: string, state: State, { useHash, storeInHashQuery }?: SetStateToKbnUrlHashOptions, rawUrl?: string): string; -/** - * A tiny wrapper around history library to listen for url changes and update url - * History library handles a bunch of cross browser edge cases - */ -export interface IKbnUrlControls { - /** - * Listen for url changes - * @param cb - called when url has been changed - */ - listen: (cb: () => void) => () => void; - /** - * Updates url synchronously, if needed - * skips the update and returns undefined in case when trying to update to current url - * otherwise returns new url - * - * @param url - url to update to - * @param replace - use replace instead of push - */ - update: (url: string, replace: boolean) => string | undefined; - /** - * Schedules url update to next microtask, - * Useful to batch sync changes to url to cause only one browser history update - * @param updater - fn which receives current url and should return next url to update to - * @param replace - use replace instead of push - * - */ - updateAsync: (updater: UrlUpdaterFnType, replace?: boolean) => Promise; - /** - * If there is a pending url update - returns url that is scheduled for update - */ - getPendingUrl: () => string | undefined; - /** - * Synchronously flushes scheduled url updates. Returns new flushed url, if there was an update. Otherwise - undefined. - * @param replace - if replace passed in, then uses it instead of push. Otherwise push or replace is picked depending on updateQueue - */ - flush: (replace?: boolean) => string | undefined; - /** - * Cancels any pending url updates - */ - cancel: () => void; -} -export type UrlUpdaterFnType = (currentUrl: string) => string | undefined; -export declare const createKbnUrlControls: (history?: History) => IKbnUrlControls; -/** - * Depending on history configuration extracts relative path for history updates - * 4 possible cases (see tests): - * 1. Browser history with empty base path - * 2. Browser history with base path - * 3. Hash history with empty base path - * 4. Hash history with base path - */ -export declare function getRelativeToHistoryPath(absoluteUrl: string, history: History): History.Path; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.d.ts deleted file mode 100644 index 1cf085867a953..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import type { History } from 'history'; -import type { BehaviorSubject, Observable } from 'rxjs'; -import type { AppUpdater, ToastsSetup } from '@kbn/core/public'; -export interface KbnUrlTracker { - /** - * Callback to invoke when the app is mounted - */ - appMounted: () => void; - /** - * Callback to invoke when the app is unmounted - */ - appUnMounted: () => void; - /** - * Unregistering the url tracker. This won't reset the current state of the nav link - */ - stop: () => void; - setActiveUrl: (newUrl: string) => void; - getActiveUrl: () => string; - /** - * Resets internal state to the last active url, discarding the most recent change - */ - restorePreviousUrl: () => void; -} -/** - * Listens to history changes and optionally to global state changes and updates the nav link url of - * a given app to point to the last visited page within the app. - * - * This includes the following parts: - * * When the app is currently active, the nav link points to the configurable default url of the app. - * * When the app is not active the last visited url is set to the nav link. - * * When a provided observable emits a new value, the state parameter in the url of the nav link is updated - * as long as the app is not active. - */ -export declare function createKbnUrlTracker({ baseUrl, defaultSubUrl, storageKey, stateParams, navLinkUpdater$, toastNotifications, history, getHistory, storage, shouldTrackUrlUpdate, onBeforeNavLinkSaved, }: { - /** - * Base url of the current app. This will be used as a prefix for the - * nav link in the side bar - */ - baseUrl: string; - /** - * Default sub url for this app. If the app is currently active or no sub url is already stored in session storage and the app hasn't been visited yet, the nav link will be set to this url. - */ - defaultSubUrl: string; - /** - * List of URL mapped states that should get updated even when the app is not currently active - */ - stateParams: Array<{ - /** - * Key of the query parameter containing the state - */ - kbnUrlKey: string; - /** - * Observable providing updates to the state - */ - stateUpdate$: Observable; - }>; - /** - * Key used to store the current sub url in session storage. This key should only be used for one active url tracker at any given time. - */ - storageKey: string; - /** - * App updater subject passed into the application definition to change nav link url. - */ - navLinkUpdater$: BehaviorSubject; - /** - * Toast notifications service to show toasts in error cases. - */ - toastNotifications: ToastsSetup; - /** - * History object to use to track url changes. If this isn't provided, a local history instance will be created. - */ - history?: History; - /** - * Lazily retrieve history instance - */ - getHistory?: () => History; - /** - * Storage object to use to persist currently active url. If this isn't provided, the browser wide session storage instance will be used. - */ - storage?: Storage; - /** - * Checks if pathname belongs to current app. It's used in history listener to define whether it's necessary to set pathname as active url or not. - * The default implementation compares the app name to the first part of pathname. Consumers can override this function for more complex cases. - * - * @param {string} pathname A location's pathname which comes to history listener - */ - shouldTrackUrlUpdate?: (pathname: string) => boolean; - /** - * Called when current subpath is about to be saved to sessionStorage for subsequent use as a nav link. - * Use to mutate app's subpath before it is saved by returning a new subpath. - */ - onBeforeNavLinkSaved?: (newNavLink: string) => string; -}): KbnUrlTracker; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/url/url_tracker.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/url/url_tracker.d.ts deleted file mode 100644 index 0a13de39f0edd..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/url/url_tracker.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { History } from 'history'; -export interface IUrlTracker { - startTrackingUrl: (history?: History) => () => void; - getTrackedUrl: () => string | null; - trackUrl: (url: string) => void; -} -/** - * Replicates what src/legacy/ui/public/chrome/api/nav.ts did - * Persists the url in sessionStorage so it could be restored if navigated back to the app - */ -export declare function createUrlTracker(key: string, storage?: Storage): IUrlTracker; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_management/utils/diff_object.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_management/utils/diff_object.d.ts deleted file mode 100644 index b8ba1bd81ef66..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_management/utils/diff_object.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface IDiffObject { - removed: string[]; - added: string[]; - changed: string[]; - keys: string[]; -} -export declare function applyDiff(target: Record, source: Record): IDiffObject; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/index.d.ts deleted file mode 100644 index 3c19ab8afa127..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_sync/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * State syncing utilities are a set of helpers for syncing your application state - * with browser URL or browser storage. - * - * They are designed to work together with {@link https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/kibana_utils/docs/state_containers | state containers}. But state containers are not required. - * - * State syncing utilities include: - * - * *{@link syncState} util which: - * * Subscribes to state changes and pushes them to state storage. - * * Optionally subscribes to state storage changes and pushes them to state. - * * Two types of storages compatible with `syncState`: - * * {@link IKbnUrlStateStorage} - Serializes state and persists it to URL's query param in rison or hashed format. - * Listens for state updates in the URL and pushes them back to state. - * * {@link ISessionStorageStateStorage} - Serializes state and persists it to browser storage. - * - * Refer {@link https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/kibana_utils/docs/state_sync | here} for a complete guide and examples. - * @packageDocumentation - */ -export type { IKbnUrlStateStorage, ISessionStorageStateStorage, IStateStorage, } from './state_sync_state_storage'; -export { createSessionStorageStateStorage, createKbnUrlStateStorage, } from './state_sync_state_storage'; -export type { IStateSyncConfig, INullableBaseStateContainer } from './types'; -export type { StopSyncStateFnType, StartSyncStateFnType, ISyncStateRef } from './state_sync'; -export { syncState, syncStates } from './state_sync'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync.d.ts deleted file mode 100644 index d1ba2364703a8..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -import type { IStateSyncConfig } from './types'; -import type { IStateStorage } from './state_sync_state_storage'; -import type { BaseState } from '../../common/state_containers'; -/** - * @public - */ -export type StopSyncStateFnType = () => void; -/** - * @public - */ -export type StartSyncStateFnType = () => void; -/** - * @public - */ -export interface ISyncStateRef { - /** - * stop state syncing - */ - stop: StopSyncStateFnType; - /** - * start state syncing - */ - start: StartSyncStateFnType; -} -/** - * Utility for syncing application state wrapped in state container - * with some kind of storage (e.g. URL) - * - * Go {@link https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/kibana_utils/docs/state_sync | here} for a complete guide and examples. - * - * @example - * - * the simplest use case - * ```ts - * const stateStorage = createKbnUrlStateStorage(); - * syncState({ - * storageKey: '_s', - * stateContainer, - * stateStorage - * }); - * ``` - * - * @example - * conditionally configuring sync strategy - * ```ts - * const stateStorage = createKbnUrlStateStorage({useHash: config.get('state:stateContainerInSessionStorage')}) - * syncState({ - * storageKey: '_s', - * stateContainer, - * stateStorage - * }); - * ``` - * - * @example - * implementing custom sync strategy - * ```ts - * const localStorageStateStorage = { - * set: (storageKey, state) => localStorage.setItem(storageKey, JSON.stringify(state)), - * get: (storageKey) => localStorage.getItem(storageKey) ? JSON.parse(localStorage.getItem(storageKey)) : null - * }; - * syncState({ - * storageKey: '_s', - * stateContainer, - * stateStorage: localStorageStateStorage - * }); - * ``` - * - * @example - * transforming state before serialising - * Useful for: - * * Migration / backward compatibility - * * Syncing part of state - * * Providing default values - * ```ts - * const stateToStorage = (s) => ({ tab: s.tab }); - * syncState({ - * storageKey: '_s', - * stateContainer: { - * get: () => stateToStorage(stateContainer.get()), - * set: stateContainer.set(({ tab }) => ({ ...stateContainer.get(), tab }), - * state$: stateContainer.state$.pipe(map(stateToStorage)) - * }, - * stateStorage - * }); - * ``` - * - * @param - syncing config {@link IStateSyncConfig} - * @returns - {@link ISyncStateRef} - * @public - */ -export declare function syncState({ storageKey, stateStorage, stateContainer, }: IStateSyncConfig): ISyncStateRef; -/** - * @example - * sync multiple different sync configs - * ```ts - * syncStates([ - * { - * storageKey: '_s1', - * stateStorage: stateStorage1, - * stateContainer: stateContainer1, - * }, - * { - * storageKey: '_s2', - * stateStorage: stateStorage2, - * stateContainer: stateContainer2, - * }, - * ]); - * ``` - * @param stateSyncConfigs - Array of {@link IStateSyncConfig} to sync - */ -export declare function syncStates(stateSyncConfigs: Array>): ISyncStateRef; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.d.ts deleted file mode 100644 index 0fc030ea48ede..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Observable } from 'rxjs'; -import type { History } from 'history'; -import type { IStateStorage } from './types'; -import type { IKbnUrlControls } from '../../state_management/url'; -/** - * KbnUrlStateStorage is a state storage for {@link syncState} utility which: - * - * 1. Keeps state in sync with the URL. - * 2. Serializes data and stores it in the URL in one of the supported formats: - * * Rison encoded. - * * Hashed URL: In URL we store only the hash from the serialized state, but the state itself is stored in sessionStorage. See Kibana's `state:storeInSessionStorage` advanced option for more context. - * 3. Takes care of listening to the URL updates and notifies state about the updates. - * 4. Takes care of batching URL updates to prevent redundant browser history records. - * - * {@link https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/kibana_utils/docs/state_sync/storages/kbn_url_storage.md | Refer to this guide for more info} - * @public - */ -export interface IKbnUrlStateStorage extends IStateStorage { - set: (key: string, state: State, opts?: { - replace: boolean; - }) => Promise; - get: (key: string) => State | null; - change$: (key: string) => Observable; - /** - * Cancels any pending url updates - */ - cancel: () => void; - /** - * Lower level wrapper around history library that handles batching multiple URL updates into one history change - */ - kbnUrlControls: IKbnUrlControls; -} -/** - * Creates {@link IKbnUrlStateStorage} state storage - * @returns - {@link IKbnUrlStateStorage} - * @public - */ -export declare const createKbnUrlStateStorage: ({ useHash, useHashQuery, history, onGetError, onSetError, }?: { - useHash: boolean; - useHashQuery?: boolean; - history?: History; - onGetError?: (error: Error) => void; - onSetError?: (error: Error) => void; -}) => IKbnUrlStateStorage; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.d.ts deleted file mode 100644 index 74b364e6e568c..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { IStateStorage } from './types'; -/** - * {@link IStateStorage} for storing state in browser {@link Storage} - * {@link https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/kibana_utils/docs/state_sync/storages/session_storage.md | guide} - * @public - */ -export interface ISessionStorageStateStorage extends IStateStorage { - set: (key: string, state: State) => void; - get: (key: string) => State | null; -} -/** - * Creates {@link ISessionStorageStateStorage} - * {@link https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/kibana_utils/docs/state_sync/storages/session_storage.md | guide} - * @param storage - Option {@link Storage} to use for storing state. By default window.sessionStorage. - * @returns - {@link ISessionStorageStateStorage} - * @public - */ -export declare const createSessionStorageStateStorage: (storage?: Storage) => ISessionStorageStateStorage; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/index.d.ts deleted file mode 100644 index 8f5bb8d74c241..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type { IStateStorage } from './types'; -export type { IKbnUrlStateStorage } from './create_kbn_url_state_storage'; -export { createKbnUrlStateStorage } from './create_kbn_url_state_storage'; -export type { ISessionStorageStateStorage } from './create_session_storage_state_storage'; -export { createSessionStorageStateStorage } from './create_session_storage_state_storage'; diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/types.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/types.d.ts deleted file mode 100644 index eb651e1b81900..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_sync/state_sync_state_storage/types.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Observable } from 'rxjs'; -/** - * Any StateStorage have to implement IStateStorage interface - * StateStorage is responsible for: - * * state serialisation / deserialization - * * persisting to and retrieving from storage - * - * For an example take a look at already implemented {@link IKbnUrlStateStorage} and {@link ISessionStorageStateStorage} state storages - * @public - */ -export interface IStateStorage { - /** - * Take in a state object, should serialise and persist - */ - set: (key: string, state: State) => any; - /** - * Should retrieve state from the storage and deserialize it - */ - get: (key: string) => State | null; - /** - * Should notify when the stored state has changed - */ - change$?: (key: string) => Observable; - /** - * Optional method to cancel any pending activity - * {@link syncState} will call it during destroy, if it is provided by IStateStorage - */ - cancel?: () => void; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/state_sync/types.d.ts b/src/platform/plugins/shared/kibana_utils/public/state_sync/types.d.ts deleted file mode 100644 index 4561ed1df4ecd..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/state_sync/types.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { BaseState, BaseStateContainer } from '../../common/state_containers/types'; -import type { IStateStorage } from './state_sync_state_storage'; -/** - * Extension of {@link BaseStateContainer} with one constraint: set state should handle `null` as incoming state - * @remarks - * State container for `stateSync()` have to accept `null` - * for example, `set()` implementation could handle null and fallback to some default state - * this is required to handle edge case, when state in storage becomes empty and syncing is in progress. - * State container will be notified about about storage becoming empty with null passed in. - * @public - */ -export interface INullableBaseStateContainer extends BaseStateContainer { - set: (state: State | null) => void; -} -/** - * Config for setting up state syncing with {@link stateSync} - * @typeParam State - State shape to sync to storage, has to extend {@link BaseState} - * @typeParam StateStorage - used state storage to sync state with - * @public - */ -export interface IStateSyncConfig { - /** - * Storage key to use for syncing, - * e.g. storageKey '_a' should sync state to ?_a query param - */ - storageKey: string; - /** - * State container to keep in sync with storage, have to implement {@link INullableBaseStateContainer} interface - * We encourage to use {@link BaseStateContainer} as a state container, - * but it is also possible to implement own custom container for advanced use cases - */ - stateContainer: INullableBaseStateContainer; - /** - * State storage to use, - * State storage is responsible for serialising / deserialising and persisting / retrieving stored state - * - * There are common strategies already implemented: - * see {@link IKbnUrlStateStorage} - * which replicate what State (AppState, GlobalState) in legacy world did - * - */ - stateStorage: StateStorage; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/hashed_item_store.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/hashed_item_store.d.ts deleted file mode 100644 index 88cfc71e35002..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/hashed_item_store.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { IStorage } from '../types'; -export declare class HashedItemStore implements IStorage { - static readonly PERSISTED_INDEX_KEY = "kbn.hashedItemsIndex.v1"; - private storage; - /** - * HashedItemStore uses objects called indexed items to refer to items that have been persisted - * in storage. An indexed item is shaped {hash, touched}. The touched date is when the item - * was last referenced by the browser history. - */ - constructor(storage: Storage); - setItem(hash: string, item: string): boolean; - getItem(hash: string): string | null; - removeItem(hash: string): string | null; - clear(): void; - private ensuredSorting; - private getIndexedItems; - private setIndexedItems; - private getIndexedItem; - private persistItem; - private removeOldestItem; - private touchHash; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/index.d.ts deleted file mode 100644 index 247f8be4b6c85..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/storage/hashed_item_store/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { HashedItemStore } from './hashed_item_store'; -export { HashedItemStore }; -export declare const hashedItemStore: HashedItemStore; diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/index.d.ts deleted file mode 100644 index c19d070b06964..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/storage/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { Storage } from './storage'; -export type { IStorage, IStorageWrapper } from './types'; diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/storage.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/storage.d.ts deleted file mode 100644 index e103f73776f21..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/storage/storage.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { IStorage, IStorageWrapper } from './types'; -export declare class Storage implements IStorageWrapper { - store: IStorage; - constructor(store: IStorage); - get: (key: string) => any; - set: (key: string, value: any, includeUndefined?: boolean) => false | void; - remove: (key: string) => any; - clear: () => void; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/storage/types.d.ts b/src/platform/plugins/shared/kibana_utils/public/storage/types.d.ts deleted file mode 100644 index cde8661922f9c..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/storage/types.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface IStorageWrapper { - get: (key: string) => T | null; - set: (key: string, value: T) => S; - remove: (key: string) => T | null; - clear: () => void; -} -export interface IStorage { - getItem: (key: string) => T | null; - setItem: (key: string, value: T) => S; - removeItem: (key: string) => T | null; - clear: () => void; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/theme/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/theme/index.d.ts deleted file mode 100644 index 250a27019f94a..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/theme/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { KibanaThemeProvider } from './kibana_theme_provider'; diff --git a/src/platform/plugins/shared/kibana_utils/public/theme/kibana_theme_provider.d.ts b/src/platform/plugins/shared/kibana_utils/public/theme/kibana_theme_provider.d.ts deleted file mode 100644 index 97b47444b2d7c..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/theme/kibana_theme_provider.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { FC, PropsWithChildren } from 'react'; -import React from 'react'; -import type { Observable } from 'rxjs'; -import type { EuiProviderProps } from '@elastic/eui'; -import type { CoreTheme } from '@kbn/core-theme-browser'; -import type { UserProfileService } from '@kbn/core-user-profile-browser'; -export interface KibanaThemeProviderProps { - theme$: Observable; - userProfile?: UserProfileService; - modify?: EuiProviderProps<{}>['modify']; - children: React.ReactNode; -} -/** @deprecated use `KibanaThemeProvider` from `@kbn/react-kibana-context-theme */ -export declare const KibanaThemeProvider: FC>; diff --git a/src/platform/plugins/shared/kibana_utils/public/ui/configurable.d.ts b/src/platform/plugins/shared/kibana_utils/public/ui/configurable.d.ts deleted file mode 100644 index c6d80bae1e054..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/ui/configurable.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { FC } from 'react'; -/** - * Represents something that can be configured by user using UI. - */ -export interface Configurable { - /** - * Create default config for this item, used when item is created for the first time. - */ - readonly createConfig: (context: Context) => Config; - /** - * Is this config valid. Used to validate user's input before saving. - */ - readonly isConfigValid: (config: Config, context: Context) => boolean; - /** - * Component to be rendered when collecting configuration for this item. - */ - readonly CollectConfig: FC>; -} -/** - * Props provided to `CollectConfig` component on every re-render. - */ -export interface CollectConfigProps { - /** - * Current (latest) config of the item. - */ - config: Config; - /** - * Callback called when user updates the config in UI. - */ - onConfig: (config: Config) => void; - /** - * Context information about where component is being rendered. - */ - context: Context; -} diff --git a/src/platform/plugins/shared/kibana_utils/public/ui/index.d.ts b/src/platform/plugins/shared/kibana_utils/public/ui/index.d.ts deleted file mode 100644 index 620039ad5cdb9..0000000000000 --- a/src/platform/plugins/shared/kibana_utils/public/ui/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './configurable'; diff --git a/src/platform/plugins/shared/management/common/contants.d.ts b/src/platform/plugins/shared/management/common/contants.d.ts deleted file mode 100644 index cb1009c94e337..0000000000000 --- a/src/platform/plugins/shared/management/common/contants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const MANAGEMENT_APP_ID = "management"; diff --git a/src/platform/plugins/shared/management/common/locator.d.ts b/src/platform/plugins/shared/management/common/locator.d.ts deleted file mode 100644 index 2e2ca0113a9bb..0000000000000 --- a/src/platform/plugins/shared/management/common/locator.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/common'; -export interface ManagementAppLocatorParams extends SerializableRecord { - sectionId: string; - appId?: string; -} -export type ManagementAppLocator = LocatorPublic; -export declare class ManagementAppLocatorDefinition implements LocatorDefinition { - readonly id = "MANAGEMENT_APP_LOCATOR"; - readonly getLocation: (params: ManagementAppLocatorParams) => Promise<{ - app: string; - path: string; - state: {}; - }>; -} diff --git a/src/platform/plugins/shared/management/public/application.d.ts b/src/platform/plugins/shared/management/public/application.d.ts deleted file mode 100644 index 13c5fde9a158c..0000000000000 --- a/src/platform/plugins/shared/management/public/application.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AppMountParameters } from '@kbn/core/public'; -import type { ManagementAppDependencies } from './components/management_app'; -export declare const renderApp: ({ history, appBasePath, element, theme$ }: AppMountParameters, dependencies: ManagementAppDependencies) => Promise<() => boolean>; diff --git a/src/platform/plugins/shared/management/public/components/landing/classic_empty_prompt.d.ts b/src/platform/plugins/shared/management/public/components/landing/classic_empty_prompt.d.ts deleted file mode 100644 index 74aff18cf47e7..0000000000000 --- a/src/platform/plugins/shared/management/public/components/landing/classic_empty_prompt.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type FC } from 'react'; -interface Props { - kibanaVersion: string; -} -export declare const ClassicEmptyPrompt: FC; -export {}; diff --git a/src/platform/plugins/shared/management/public/components/landing/index.d.ts b/src/platform/plugins/shared/management/public/components/landing/index.d.ts deleted file mode 100644 index d7309ad0c21c2..0000000000000 --- a/src/platform/plugins/shared/management/public/components/landing/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { ManagementLandingPage } from './landing'; diff --git a/src/platform/plugins/shared/management/public/components/landing/landing.d.ts b/src/platform/plugins/shared/management/public/components/landing/landing.d.ts deleted file mode 100644 index 2198aaec34c1a..0000000000000 --- a/src/platform/plugins/shared/management/public/components/landing/landing.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -interface ManagementLandingPageProps { - onAppMounted: (id: string) => void; - setBreadcrumbs: () => void; -} -export declare const ManagementLandingPage: ({ setBreadcrumbs, onAppMounted, }: ManagementLandingPageProps) => React.JSX.Element | null; -export {}; diff --git a/src/platform/plugins/shared/management/public/components/landing/solution_empty_prompt.d.ts b/src/platform/plugins/shared/management/public/components/landing/solution_empty_prompt.d.ts deleted file mode 100644 index 2773479f50750..0000000000000 --- a/src/platform/plugins/shared/management/public/components/landing/solution_empty_prompt.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { type FC } from 'react'; -import { type CoreStart } from '@kbn/core/public'; -interface Props { - kibanaVersion: string; - coreStart: CoreStart; -} -export declare const SolutionEmptyPrompt: FC; -export {}; diff --git a/src/platform/plugins/shared/management/public/components/management_app/index.d.ts b/src/platform/plugins/shared/management/public/components/management_app/index.d.ts deleted file mode 100644 index 3b39b4ec138e5..0000000000000 --- a/src/platform/plugins/shared/management/public/components/management_app/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { ManagementAppDependencies } from './management_app'; -export { ManagementApp } from './management_app'; diff --git a/src/platform/plugins/shared/management/public/components/management_app/management_app.d.ts b/src/platform/plugins/shared/management/public/components/management_app/management_app.d.ts deleted file mode 100644 index e3d092bb063b1..0000000000000 --- a/src/platform/plugins/shared/management/public/components/management_app/management_app.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import type { BehaviorSubject, Observable } from 'rxjs'; -import type { AppMountParameters, ChromeBreadcrumb } from '@kbn/core/public'; -import type { CoreStart } from '@kbn/core/public'; -import type { ChromeStyle } from '@kbn/core-chrome-browser'; -import type { SectionsServiceStart, NavigationCardsSubject, AutoOpsStatusHook } from '../../types'; -interface ManagementAppProps { - appBasePath: string; - history: AppMountParameters['history']; - dependencies: ManagementAppDependencies; -} -export interface ManagementAppDependencies { - sections: SectionsServiceStart; - kibanaVersion: string; - coreStart: CoreStart; - cloud?: { - isCloudEnabled: boolean; - baseUrl?: string; - }; - isAirGapped: boolean; - setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void; - isSidebarEnabled$: BehaviorSubject; - cardsNavigationConfig$: BehaviorSubject; - chromeStyle$: Observable; - getAutoOpsStatusHook: () => AutoOpsStatusHook; -} -export declare const ManagementApp: ({ dependencies, history, appBasePath }: ManagementAppProps) => React.JSX.Element | null; -export {}; diff --git a/src/platform/plugins/shared/management/public/components/management_app/management_context.d.ts b/src/platform/plugins/shared/management/public/components/management_app/management_context.d.ts deleted file mode 100644 index 4d426832d15d9..0000000000000 --- a/src/platform/plugins/shared/management/public/components/management_app/management_context.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import type { AppDependencies } from '../../types'; -export declare const AppContext: React.Context; -export declare const AppContextProvider: ({ children, value, }: { - children: React.ReactNode; - value: AppDependencies; -}) => React.JSX.Element; -export declare const useAppContext: () => AppDependencies; diff --git a/src/platform/plugins/shared/management/public/components/management_app/management_router.d.ts b/src/platform/plugins/shared/management/public/components/management_app/management_router.d.ts deleted file mode 100644 index ed75718376f51..0000000000000 --- a/src/platform/plugins/shared/management/public/components/management_app/management_router.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import type { AnalyticsServiceStart, AppMountParameters, ChromeBreadcrumb, ScopedHistory, ThemeServiceStart } from '@kbn/core/public'; -import type { ManagementSection } from '../../utils'; -interface ManagementRouterProps { - history: AppMountParameters['history']; - theme: ThemeServiceStart; - setBreadcrumbs: (crumbs?: ChromeBreadcrumb[], appHistory?: ScopedHistory) => void; - onAppMounted: (id: string) => void; - sections: ManagementSection[]; - analytics: AnalyticsServiceStart; -} -export declare const ManagementRouter: React.MemoExoticComponent<({ history, setBreadcrumbs, onAppMounted, sections, theme, analytics, }: ManagementRouterProps) => React.JSX.Element>; -export {}; diff --git a/src/platform/plugins/shared/management/public/components/management_app_wrapper/index.d.ts b/src/platform/plugins/shared/management/public/components/management_app_wrapper/index.d.ts deleted file mode 100644 index 0181eb807c1a2..0000000000000 --- a/src/platform/plugins/shared/management/public/components/management_app_wrapper/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { ManagementAppWrapper } from './management_app_wrapper'; diff --git a/src/platform/plugins/shared/management/public/components/management_app_wrapper/management_app_wrapper.d.ts b/src/platform/plugins/shared/management/public/components/management_app_wrapper/management_app_wrapper.d.ts deleted file mode 100644 index 14a46723455d3..0000000000000 --- a/src/platform/plugins/shared/management/public/components/management_app_wrapper/management_app_wrapper.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import React, { Component } from 'react'; -import type { ChromeBreadcrumb, AppMountParameters, ScopedHistory, ThemeServiceStart } from '@kbn/core/public'; -import type { ManagementApp } from '../../utils'; -interface ManagementSectionWrapperProps { - app: ManagementApp; - setBreadcrumbs: (crumbs?: ChromeBreadcrumb[], history?: ScopedHistory) => void; - onAppMounted: (id: string) => void; - history: AppMountParameters['history']; - theme: ThemeServiceStart; -} -interface ManagementSectionWrapperState { - error: Error | null; -} -export declare class ManagementAppWrapper extends Component { - private unmount?; - private mountElementRef; - constructor(props: ManagementSectionWrapperProps); - componentDidMount(): void; - componentWillUnmount(): Promise; - render(): React.JSX.Element; -} -export {}; diff --git a/src/platform/plugins/shared/management/public/components/management_sections.d.ts b/src/platform/plugins/shared/management/public/components/management_sections.d.ts deleted file mode 100644 index 5acc96ee665ef..0000000000000 --- a/src/platform/plugins/shared/management/public/components/management_sections.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { ManagementSectionId } from '../types'; -export declare const IngestSection: { - id: ManagementSectionId; - title: string; - tip: string; - order: number; -}; -export declare const DataSection: { - id: ManagementSectionId; - title: string; - tip: string; - order: number; -}; -export declare const InsightsAndAlertingSection: { - id: ManagementSectionId; - title: string; - tip: string; - order: number; -}; -export declare const ClusterPerformanceSection: { - id: ManagementSectionId; - title: string; - order: number; -}; -export declare const MachineLearningSection: { - id: ManagementSectionId; - title: string; - tip: string; - order: number; -}; -export declare const ModelManagementSection: { - id: ManagementSectionId; - title: string; - tip: string; - order: number; -}; -export declare const SecuritySection: { - id: string; - title: string; - tip: string; - order: number; -}; -export declare const KibanaSection: { - id: ManagementSectionId; - title: string; - tip: string; - order: number; -}; -export declare const AISection: { - id: ManagementSectionId; - title: string; - order: number; -}; -export declare const StackSection: { - id: ManagementSectionId; - title: string; - tip: string; - order: number; -}; -export declare const managementSections: ({ - id: ManagementSectionId; - title: string; - order: number; -} | { - id: string; - title: string; - tip: string; - order: number; -})[]; diff --git a/src/platform/plugins/shared/management/public/components/management_sidebar_nav/management_sidebar_nav.d.ts b/src/platform/plugins/shared/management/public/components/management_sidebar_nav/management_sidebar_nav.d.ts deleted file mode 100644 index daef53a47f70c..0000000000000 --- a/src/platform/plugins/shared/management/public/components/management_sidebar_nav/management_sidebar_nav.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { EuiSideNavItemType } from '@elastic/eui'; -import type { AppMountParameters } from '@kbn/core/public'; -import type { ManagementSection } from '../../utils'; -interface ManagementSidebarNavProps { - sections: ManagementSection[]; - history: AppMountParameters['history']; - selectedId: string; -} -/** @internal **/ -export declare const managementSidebarNav: ({ selectedId, sections, history, }: ManagementSidebarNavProps) => EuiSideNavItemType[]; -export {}; diff --git a/src/platform/plugins/shared/management/public/index.d.ts b/src/platform/plugins/shared/management/public/index.d.ts deleted file mode 100644 index 84b675fbc645b..0000000000000 --- a/src/platform/plugins/shared/management/public/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import { ManagementPlugin } from './plugin'; -export declare function plugin(initializerContext: PluginInitializerContext): ManagementPlugin; -export type { RegisterManagementAppArgs } from './utils'; -export { ManagementSection, ManagementApp } from './utils'; -export type { ManagementAppMountParams, ManagementSetup, ManagementStart, DefinedSections, AutoOpsStatusHook, AutoOpsStatusResult, } from './types'; -export { MANAGEMENT_APP_ID } from '../common/contants'; diff --git a/src/platform/plugins/shared/management/public/management_sections_service.d.ts b/src/platform/plugins/shared/management/public/management_sections_service.d.ts deleted file mode 100644 index 1620e9aef5668..0000000000000 --- a/src/platform/plugins/shared/management/public/management_sections_service.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ManagementSection } from './utils'; -import type { SectionsServiceSetup, SectionsServiceStartDeps, DefinedSections, ManagementSectionsStartPrivate } from './types'; -declare const getSectionsServiceStartPrivate: import("@kbn/kibana-utils-plugin/public").Get; -export { getSectionsServiceStartPrivate }; -export declare class ManagementSectionsService { - definedSections: DefinedSections; - constructor(); - private sections; - getAllSections: () => ManagementSection[]; - private registerSection; - setup(): SectionsServiceSetup; - start({ capabilities }: SectionsServiceStartDeps): {}; -} diff --git a/src/platform/plugins/shared/management/public/plugin.d.ts b/src/platform/plugins/shared/management/public/plugin.d.ts deleted file mode 100644 index 4c112e41af524..0000000000000 --- a/src/platform/plugins/shared/management/public/plugin.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; -import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; -import type { ServerlessPluginStart } from '@kbn/serverless/public'; -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { ConfigSchema, ManagementSetup, ManagementStart, AutoOpsStatusHook } from './types'; -interface ManagementSetupDependencies { - home?: HomePublicPluginSetup; - share: SharePluginSetup; - cloud?: { - isCloudEnabled: boolean; - baseUrl?: string; - }; -} -interface ManagementStartDependencies { - share: SharePluginStart; - serverless?: ServerlessPluginStart; - cloud?: { - isCloudEnabled: boolean; - baseUrl?: string; - }; -} -export declare class ManagementPlugin implements Plugin { - private initializerContext; - private readonly managementSections; - private readonly appUpdater; - private hasAnyEnabledApps; - private isSidebarEnabled$; - private cardsNavigationConfig$; - private autoOpsStatusHook?; - constructor(initializerContext: PluginInitializerContext); - private registerAutoOpsStatusHook; - private getAutoOpsStatusHook; - setup(core: CoreSetup, { home, share, cloud }: ManagementSetupDependencies): { - sections: import("./types").SectionsServiceSetup; - locator: import("@kbn/share-plugin/public").LocatorPublic; - registerAutoOpsStatusHook: (hook: AutoOpsStatusHook) => void; - }; - start(core: CoreStart, plugins: ManagementStartDependencies): ManagementStart; -} -export {}; diff --git a/src/platform/plugins/shared/management/public/types.d.ts b/src/platform/plugins/shared/management/public/types.d.ts deleted file mode 100644 index 965307f52fe69..0000000000000 --- a/src/platform/plugins/shared/management/public/types.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { ScopedHistory, Capabilities, ThemeServiceStart, CoreStart, ChromeBreadcrumb, CoreTheme, AppDeepLinkLocations } from '@kbn/core/public'; -import type { LocatorPublic } from '@kbn/share-plugin/common'; -import type { CardsNavigationComponentProps } from '@kbn/management-cards-navigation'; -import type { ChromeStyle } from '@kbn/core-chrome-browser'; -import type { ManagementSection, RegisterManagementSectionArgs } from './utils'; -import type { ManagementAppLocatorParams } from '../common/locator'; -/** @public */ -export interface AutoOpsStatusResult { - isCloudConnectAutoopsEnabled: boolean; - isLoading: boolean; -} -/** @public */ -export type AutoOpsStatusHook = () => AutoOpsStatusResult; -export interface ManagementSetup { - sections: SectionsServiceSetup; - locator: LocatorPublic; - /** - * Registers a hook that returns the AutoOps status. - * Used by the cloud_connect plugin to provide connection status to the management landing page. - */ - registerAutoOpsStatusHook: (hook: AutoOpsStatusHook) => void; -} -export interface DefinedSections { - ingest: ManagementSection; - data: ManagementSection; - insightsAndAlerting: ManagementSection; - machineLearning: ManagementSection; - modelManagement: ManagementSection; - security: ManagementSection; - kibana: ManagementSection; - stack: ManagementSection; - ai: ManagementSection; - clusterPerformance: ManagementSection; -} -export interface ManagementStart { - setupCardsNavigation: ({ enabled, hideLinksTo, extendCardNavDefinitions, }: NavigationCardsSubject) => void; -} -export interface ManagementSectionsStartPrivate { - getSectionsEnabled: () => ManagementSection[]; -} -export interface SectionsServiceStartDeps { - capabilities: Capabilities; -} -export interface SectionsServiceSetup { - register: (args: Omit) => ManagementSection; - section: DefinedSections; -} -export interface SectionsServiceStart { - getSectionsEnabled: () => ManagementSection[]; -} -export declare enum ManagementSectionId { - Ingest = "ingest", - Data = "data", - InsightsAndAlerting = "insightsAndAlerting", - MachineLearning = "ml", - ModelManagement = "modelManagement", - Security = "security", - Kibana = "kibana", - Stack = "stack", - AI = "ai", - ClusterPerformance = "clusterPerformance" -} -export type Unmount = () => Promise | void; -export type Mount = (params: ManagementAppMountParams) => Unmount | Promise; -export interface ManagementAppMountParams { - basePath: string; - element: HTMLElement; - setBreadcrumbs: (crumbs: ChromeBreadcrumb[]) => void; - history: ScopedHistory; - theme: ThemeServiceStart; - /** @deprecated - use `theme` **/ - theme$: Observable; -} -export interface CreateManagementItemArgs { - id: string; - title: string; - tip?: string; - order?: number; - euiIconType?: string; - icon?: string; - hideFromSidebar?: boolean; - hideFromGlobalSearch?: boolean; - visibleIn?: AppDeepLinkLocations[]; - capabilitiesId?: string; - redirectFrom?: string; -} -export interface NavigationCardsSubject extends Pick { - enabled: boolean; - extendCardNavDefinitions?: CardsNavigationComponentProps['extendedCardNavigationDefinitions']; -} -export interface AppDependencies { - appBasePath: string; - kibanaVersion: string; - sections: ManagementSection[]; - cardsNavigationConfig?: NavigationCardsSubject; - chromeStyle?: ChromeStyle; - coreStart: CoreStart; - cloud?: { - isCloudEnabled: boolean; - baseUrl?: string; - }; - isAirGapped: boolean; - getAutoOpsStatusHook: () => AutoOpsStatusHook; -} -export interface ConfigSchema { - deeplinks: { - navLinkStatus: 'default' | 'visible'; - }; -} diff --git a/src/platform/plugins/shared/management/public/utils/breadcrumbs.d.ts b/src/platform/plugins/shared/management/public/utils/breadcrumbs.d.ts deleted file mode 100644 index 8388a0d56433d..0000000000000 --- a/src/platform/plugins/shared/management/public/utils/breadcrumbs.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare const MANAGEMENT_BREADCRUMB_NO_HREF: { - text: string; -}; -export declare const MANAGEMENT_BREADCRUMB: { - text: string; - href: string; -}; diff --git a/src/platform/plugins/shared/management/public/utils/index.d.ts b/src/platform/plugins/shared/management/public/utils/index.d.ts deleted file mode 100644 index a743504ed2c36..0000000000000 --- a/src/platform/plugins/shared/management/public/utils/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { MANAGEMENT_BREADCRUMB, MANAGEMENT_BREADCRUMB_NO_HREF } from './breadcrumbs'; -export type { RegisterManagementAppArgs } from './management_app'; -export { ManagementApp } from './management_app'; -export type { RegisterManagementSectionArgs } from './management_section'; -export { ManagementSection } from './management_section'; diff --git a/src/platform/plugins/shared/management/public/utils/management_app.d.ts b/src/platform/plugins/shared/management/public/utils/management_app.d.ts deleted file mode 100644 index e0093c523cc8d..0000000000000 --- a/src/platform/plugins/shared/management/public/utils/management_app.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { CreateManagementItemArgs, Mount } from '../types'; -import { ManagementItem } from './management_item'; -export interface RegisterManagementAppArgs extends CreateManagementItemArgs { - mount: Mount; - basePath: string; - keywords?: string[]; -} -export declare class ManagementApp extends ManagementItem { - readonly mount: Mount; - readonly basePath: string; - readonly keywords: string[]; - constructor(args: RegisterManagementAppArgs); -} diff --git a/src/platform/plugins/shared/management/public/utils/management_item.d.ts b/src/platform/plugins/shared/management/public/utils/management_item.d.ts deleted file mode 100644 index d8b63f89db442..0000000000000 --- a/src/platform/plugins/shared/management/public/utils/management_item.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AppDeepLinkLocations } from '@kbn/core/public'; -import type { CreateManagementItemArgs } from '../types'; -export declare class ManagementItem { - readonly id: string; - readonly title: string; - readonly tip?: string; - readonly order: number; - readonly hideFromSidebar?: boolean; - readonly hideFromGlobalSearch?: boolean; - readonly visibleIn?: AppDeepLinkLocations[]; - readonly euiIconType?: string; - readonly icon?: string; - readonly capabilitiesId?: string; - readonly redirectFrom?: string; - enabled: boolean; - constructor({ id, title, tip, order, hideFromSidebar, hideFromGlobalSearch, visibleIn, euiIconType, icon, capabilitiesId, redirectFrom, }: CreateManagementItemArgs); - disable(): void; - enable(): void; -} diff --git a/src/platform/plugins/shared/management/public/utils/management_section.d.ts b/src/platform/plugins/shared/management/public/utils/management_section.d.ts deleted file mode 100644 index a4dc48f58e500..0000000000000 --- a/src/platform/plugins/shared/management/public/utils/management_section.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Assign } from '@kbn/utility-types'; -import type { CreateManagementItemArgs, ManagementSectionId } from '../types'; -import { ManagementItem } from './management_item'; -import type { RegisterManagementAppArgs } from './management_app'; -import { ManagementApp } from './management_app'; -export type RegisterManagementSectionArgs = Assign; -export declare class ManagementSection extends ManagementItem { - readonly apps: ManagementApp[]; - constructor(args: RegisterManagementSectionArgs); - registerApp(args: Omit): ManagementApp; - getApp(id: ManagementApp['id']): ManagementApp | undefined; - getAppsEnabled(): ManagementApp[]; -} diff --git a/src/platform/plugins/shared/screenshot_mode/common/constants.d.ts b/src/platform/plugins/shared/screenshot_mode/common/constants.d.ts deleted file mode 100644 index 0a76f881cccca..0000000000000 --- a/src/platform/plugins/shared/screenshot_mode/common/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const KBN_SCREENSHOT_MODE_HEADER: string; diff --git a/src/platform/plugins/shared/screenshot_mode/common/context.d.ts b/src/platform/plugins/shared/screenshot_mode/common/context.d.ts deleted file mode 100644 index 19ce7ea5816e4..0000000000000 --- a/src/platform/plugins/shared/screenshot_mode/common/context.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -type Context = Record; -declare global { - interface Window { - __KBN_SCREENSHOT_CONTEXT__?: Context; - } -} -/** - * Stores a value in the screenshotting context. - * @param key Context key to set. - * @param value Value to set. - */ -export declare function setScreenshotContext(key: string, value: T): void; -/** - * Retrieves a value from the screenshotting context. - * @param key Context key to get. - * @param defaultValue Value to return if the key is not found. - * @return The value stored in the screenshotting context. - */ -export declare function getScreenshotContext(key: string, defaultValue?: T): T | undefined; -export {}; diff --git a/src/platform/plugins/shared/screenshot_mode/common/index.d.ts b/src/platform/plugins/shared/screenshot_mode/common/index.d.ts deleted file mode 100644 index 2052a8a232b25..0000000000000 --- a/src/platform/plugins/shared/screenshot_mode/common/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { getScreenshotContext, setScreenshotContext } from './context'; -export { getScreenshotMode, setScreenshotModeEnabled, setScreenshotModeDisabled, KBN_SCREENSHOT_MODE_ENABLED_KEY, } from './mode'; -export { KBN_SCREENSHOT_MODE_HEADER } from './constants'; diff --git a/src/platform/plugins/shared/screenshot_mode/common/mode.d.ts b/src/platform/plugins/shared/screenshot_mode/common/mode.d.ts deleted file mode 100644 index 7fd7fda9d1534..0000000000000 --- a/src/platform/plugins/shared/screenshot_mode/common/mode.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export declare const KBN_SCREENSHOT_MODE_ENABLED_KEY = "__KBN_SCREENSHOT_MODE_ENABLED_KEY__"; -declare global { - interface Window { - [KBN_SCREENSHOT_MODE_ENABLED_KEY]?: boolean; - } -} -/** - * This function is responsible for detecting whether we are currently in screenshot mode. - * - * We check in the current window context whether screenshot mode is enabled, otherwise we check - * localStorage. The ability to set a value in localStorage enables more convenient development and testing - * in functionality that needs to detect screenshot mode. - */ -export declare const getScreenshotMode: () => boolean; -/** - * Use this function to set the current browser to screenshot mode. - * - * This function should be called as early as possible to ensure that screenshot mode is - * correctly detected for the first page load. It is not suitable for use inside any plugin - * code unless the plugin code is guaranteed to, somehow, load before any other code. - * - * Additionally, we don't know what environment this code will run in so we remove as many external - * references as possible to make it portable. For instance, running inside puppeteer. - */ -export declare const setScreenshotModeEnabled: () => void; -export declare const setScreenshotModeDisabled: () => void; diff --git a/src/platform/plugins/shared/screenshot_mode/public/index.d.ts b/src/platform/plugins/shared/screenshot_mode/public/index.d.ts deleted file mode 100644 index 9054ea5da6bd6..0000000000000 --- a/src/platform/plugins/shared/screenshot_mode/public/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ScreenshotModePlugin } from './plugin'; -export declare function plugin(): ScreenshotModePlugin; -export { KBN_SCREENSHOT_MODE_HEADER, setScreenshotModeEnabled, KBN_SCREENSHOT_MODE_ENABLED_KEY, } from '../common'; -export type { ScreenshotModePublicSetup as ScreenshotModePluginSetup, ScreenshotModePublicStart as ScreenshotModePluginStart, } from './types'; diff --git a/src/platform/plugins/shared/screenshot_mode/public/plugin.d.ts b/src/platform/plugins/shared/screenshot_mode/public/plugin.d.ts deleted file mode 100644 index b0d2562a5a20b..0000000000000 --- a/src/platform/plugins/shared/screenshot_mode/public/plugin.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import type { ScreenshotModePublicSetup, ScreenshotModePublicSetupDependencies, ScreenshotModePublicStart, ScreenshotModePublicStartDependencies } from './types'; -export declare class ScreenshotModePlugin implements Plugin { - private publicContract; - setup(_core: CoreSetup): ScreenshotModePublicSetup; - start(_core: CoreStart): ScreenshotModePublicStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/screenshot_mode/public/types.d.ts b/src/platform/plugins/shared/screenshot_mode/public/types.d.ts deleted file mode 100644 index f20e03be960cb..0000000000000 --- a/src/platform/plugins/shared/screenshot_mode/public/types.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface ScreenshotModePublicSetup { - /** - * Retrieves a value from the screenshotting context. - * @param key Context key to get. - * @param defaultValue Value to return if the key is not found. - * @return The value stored in the screenshotting context. - */ - getScreenshotContext(key: string, defaultValue?: T): T | undefined; - /** - * Returns a boolean indicating whether the current user agent (browser) would like to view UI optimized for - * screenshots or printing. - */ - isScreenshotMode(): boolean; -} -export type ScreenshotModePublicStart = ScreenshotModePublicSetup; -export interface ScreenshotModePublicSetupDependencies { -} -export interface ScreenshotModePublicStartDependencies { -} diff --git a/src/platform/plugins/shared/share/common/anonymous_access/index.d.ts b/src/platform/plugins/shared/share/common/anonymous_access/index.d.ts deleted file mode 100644 index a83c10ecadad6..0000000000000 --- a/src/platform/plugins/shared/share/common/anonymous_access/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { AnonymousAccessServiceContract, AnonymousAccessState } from './types'; diff --git a/src/platform/plugins/shared/share/common/anonymous_access/types.d.ts b/src/platform/plugins/shared/share/common/anonymous_access/types.d.ts deleted file mode 100644 index 3329bf686e54e..0000000000000 --- a/src/platform/plugins/shared/share/common/anonymous_access/types.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Capabilities } from '@kbn/core/public'; -/** - * The contract that is used to check anonymous access for the purposes of sharing public links. The implementation is intended to be - * provided by the security plugin. - */ -export interface AnonymousAccessServiceContract { - /** - * This function returns the current state of anonymous access. - */ - getState: () => Promise; - /** - * This function returns the capabilities of the anonymous access user. - */ - getCapabilities: () => Promise; -} -/** - * The state of anonymous access. - */ -export interface AnonymousAccessState { - /** - * Whether anonymous access is enabled or not. - */ - isEnabled: boolean; - /** - * If anonymous access is enabled, this reflects what URL parameters need to be added to a Kibana link to make it publicly accessible. - * Note that if anonymous access is the only authentication method, this will be null. - */ - accessURLParameters: Record | null; -} diff --git a/src/platform/plugins/shared/share/common/constants.d.ts b/src/platform/plugins/shared/share/common/constants.d.ts deleted file mode 100644 index 14f61e2e7d2d7..0000000000000 --- a/src/platform/plugins/shared/share/common/constants.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const CSV_SEPARATOR_SETTING = "csv:separator"; -export declare const CSV_QUOTE_VALUES_SETTING = "csv:quoteValues"; diff --git a/src/platform/plugins/shared/share/common/index.d.ts b/src/platform/plugins/shared/share/common/index.d.ts deleted file mode 100644 index b1f66026fe42d..0000000000000 --- a/src/platform/plugins/shared/share/common/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { LocatorDefinition, LocatorPublic } from './url_service'; -export { useLocatorUrl } from './url_service'; -export type { AnonymousAccessServiceContract, AnonymousAccessState } from './anonymous_access'; diff --git a/src/platform/plugins/shared/share/common/url_service/index.d.ts b/src/platform/plugins/shared/share/common/url_service/index.d.ts deleted file mode 100644 index 76012c40fd338..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './url_service'; -export * from './locators'; -export type * from './short_urls'; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/index.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/index.d.ts deleted file mode 100644 index eba4349a97365..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type * from './types'; -export * from './locator'; -export * from './locator_client'; -export * from './redirect'; -export { useLocatorUrl } from './use_locator_url'; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/legacy_short_url_locator.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/legacy_short_url_locator.d.ts deleted file mode 100644 index 93d2e676f7854..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/legacy_short_url_locator.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { KibanaLocation, LocatorDefinition } from '..'; -export declare const LEGACY_SHORT_URL_LOCATOR_ID = "LEGACY_SHORT_URL_LOCATOR"; -export interface LegacyShortUrlLocatorParams extends SerializableRecord { - url: string; -} -export declare class LegacyShortUrlLocatorDefinition implements LocatorDefinition { - readonly id = "LEGACY_SHORT_URL_LOCATOR"; - getLocation(params: LegacyShortUrlLocatorParams): Promise; -} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/locator.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/locator.d.ts deleted file mode 100644 index cc4f60fdb4b71..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/locator.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { DependencyList } from 'react'; -import type { PersistableState } from '@kbn/kibana-utils-plugin/common'; -import type { LocatorDefinition, LocatorPublic, KibanaLocation, LocatorNavigationParams, LocatorGetUrlParams } from './types'; -import type { GetRedirectUrlOptions } from './redirect'; -export interface LocatorDependencies { - /** - * Public URL of the Kibana server. - */ - baseUrl?: string; - /** - * Current version of Kibana, e.g. `7.0.0`. - */ - version?: string; - /** - * Navigate without reloading the page to a KibanaLocation. - */ - navigate: (location: KibanaLocation, params?: LocatorNavigationParams) => Promise; - /** - * Resolve a Kibana URL given KibanaLocation. - */ - getUrl: (location: KibanaLocation, getUrlParams: LocatorGetUrlParams) => Promise; -} -export declare class Locator

implements LocatorPublic

{ - readonly definition: LocatorDefinition

; - protected readonly deps: LocatorDependencies; - readonly id: string; - readonly migrations: PersistableState

['migrations']; - constructor(definition: LocatorDefinition

, deps: LocatorDependencies); - readonly telemetry: PersistableState

['telemetry']; - readonly inject: PersistableState

['inject']; - readonly extract: PersistableState

['extract']; - getLocation(params: P): Promise; - getUrl(params: P, { absolute }?: LocatorGetUrlParams): Promise; - getRedirectUrl(params: P, options?: GetRedirectUrlOptions): string; - navigate(params: P, { replace }?: LocatorNavigationParams): Promise; - navigateSync(locatorParams: P, navigationParams?: LocatorNavigationParams): void; - readonly useUrl: (params: P, getUrlParams?: LocatorGetUrlParams, deps?: DependencyList) => string; -} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/locator_client.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/locator_client.d.ts deleted file mode 100644 index ad3fa21c5ec24..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/locator_client.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { MigrateFunctionsObject } from '@kbn/kibana-utils-plugin/common'; -import type { SavedObjectReference } from '@kbn/core/server'; -import type { DependencyList } from 'react'; -import type { LocatorDependencies } from './locator'; -import type { LocatorDefinition, LocatorPublic, ILocatorClient, LocatorData, LocatorGetUrlParams } from './types'; -import { Locator } from './locator'; -import type { LocatorsMigrationMap } from '.'; -export type LocatorClientDependencies = LocatorDependencies; -export declare class LocatorClient implements ILocatorClient { - protected readonly deps: LocatorClientDependencies; - /** - * Collection of registered locators. - */ - protected locators: Map>; - constructor(deps: LocatorClientDependencies); - /** - * Creates and register a URL locator. - * - * @param definition A definition of URL locator. - * @returns A public interface of URL locator. - */ - create

(definition: LocatorDefinition

): LocatorPublic

; - /** - * Returns a previously registered URL locator. - * - * @param id ID of a URL locator. - * @returns A public interface of a registered URL locator. - */ - get

(id: string): undefined | LocatorPublic

; - readonly useUrl:

(params: () => { - id: string; - params: P; - }, deps?: DependencyList, getUrlParams?: LocatorGetUrlParams) => string | undefined; - protected getOrThrow

(id: string): LocatorPublic

; - migrations(): { - [locatorId: string]: MigrateFunctionsObject; - }; - telemetry(state: LocatorData, collector: Record): Record; - inject(state: LocatorData, references: SavedObjectReference[]): LocatorData; - extract(state: LocatorData): { - state: LocatorData; - references: SavedObjectReference[]; - }; - readonly getAllMigrations: () => LocatorsMigrationMap; -} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/format_search_params.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/format_search_params.d.ts deleted file mode 100644 index 48f445e5f0315..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/redirect/format_search_params.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { RedirectOptions } from './types'; -export interface FormatSearchParamsOptions { - lzCompress?: boolean; -} -export declare function formatSearchParams(opts: RedirectOptions, { lzCompress }?: FormatSearchParamsOptions): URLSearchParams; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/index.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/index.d.ts deleted file mode 100644 index ea179fa712190..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/redirect/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type * from './types'; -export * from './format_search_params'; -export * from './parse_search_params'; -export * from './space_url_parser'; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/parse_search_params.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/parse_search_params.d.ts deleted file mode 100644 index 35559cfac3694..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/redirect/parse_search_params.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { RedirectOptions } from './types'; -/** - * Parses redirect endpoint URL path search parameters. Expects them in the - * following form: - * - * ``` - * /r?l=&v=&p= - * ``` - * - * @param urlSearch Search part of URL path. - * @returns Parsed out locator ID, version, and locator params. - */ -export declare function parseSearchParams

(urlSearch: string): RedirectOptions

; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/space_url_parser.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/space_url_parser.d.ts deleted file mode 100644 index d974d553fe12d..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/redirect/space_url_parser.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function addSpaceIdToPath(basePath?: string, spaceId?: string, requestedPath?: string): string; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/redirect/types.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/redirect/types.d.ts deleted file mode 100644 index 8109fa12945db..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/redirect/types.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { FormatSearchParamsOptions } from './format_search_params'; -/** - * @public - * Serializable locator parameters that can be used by the redirect service to navigate to a - * location in Kibana. - * - * When passed to the public `share` plugin `.navigate()` function, locator params will also - * be migrated. - */ -export interface RedirectOptions

{ - /** Locator ID. */ - id: string; - /** Kibana version when locator params were generated. */ - version: string; - /** Locator params. */ - params: P; -} -export interface GetRedirectUrlOptions extends FormatSearchParamsOptions { - /** - * Optional space ID to use when generating the URL. - * If not provided: - * - on the client the current space ID will be used. - * - on the server the URL will be generated without a space ID. - */ - spaceId?: string; -} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/short_url_assert_valid.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/short_url_assert_valid.d.ts deleted file mode 100644 index e1df30231aa95..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/short_url_assert_valid.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function shortUrlAssertValid(url: string): void; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/short_url_redirect_locator.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/short_url_redirect_locator.d.ts deleted file mode 100644 index 2efaae88e2f81..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/short_url_redirect_locator.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { KibanaLocation, LocatorDefinition } from '..'; -export declare const SHORT_URL_REDIRECT_LOCATOR = "SHORT_URL_REDIRECT_LOCATOR"; -export interface ShortUrlRedirectLocatorParams extends SerializableRecord { - slug: string; -} -/** - * Locator that points to a frontend short URL redirect app by slug. - */ -export declare class ShortUrlRedirectLocatorDefinition implements LocatorDefinition { - readonly id = "SHORT_URL_REDIRECT_LOCATOR"; - getLocation(params: ShortUrlRedirectLocatorParams): Promise; -} diff --git a/src/platform/plugins/shared/share/common/url_service/locators/types.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/types.d.ts deleted file mode 100644 index 685cb1fb67af3..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/types.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { DependencyList } from 'react'; -import type { MigrateFunction, PersistableState, PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common'; -import type { GetRedirectUrlOptions } from './redirect'; -/** - * URL locator registry. - */ -export interface ILocatorClient extends PersistableStateService { - /** - * Create and register a new locator. - * - * @param locatorDefinition Definition of the new locator. - */ - create

(locatorDefinition: LocatorDefinition

): LocatorPublic

; - /** - * Retrieve a previously registered locator. - * - * @param id Unique ID of the locator. - */ - get

(id: string): undefined | LocatorPublic

; -} -/** - * A convenience interface used to define and register a locator. - */ -export interface LocatorDefinition

extends Partial> { - /** - * Unique ID of the locator. Should be constant and unique across Kibana. - */ - id: string; - /** - * Returns a deep link, including location state, which can be used for - * navigation in Kibana. - * - * @param params Parameters from which to generate a Kibana location. - */ - getLocation(params: P): Promise; -} -/** - * Public interface of a registered locator. - */ -export interface LocatorPublic

extends PersistableState

{ - readonly id: string; - /** - * Returns a reference to a Kibana client-side location. - * - * @param params URL locator parameters. - */ - getLocation(params: P): Promise; - /** - * Returns a URL as a string. - * - * You may want to use `getRedirectUrl` instead. `getRedirectUrl` will - * preserve the location state, whereas the `getUrl` just returns the URL - * without the location state. Use this method if you know you don't need - * remember the location state and version of the URL locator. - * - * @param params URL locator parameters. - * @param getUrlParams URL construction parameters. - */ - getUrl(params: P, getUrlParams?: LocatorGetUrlParams): Promise; - /** - * Returns a URL to the redirect endpoint, which will redirect the user to - * the final destination. - * - * @param params URL locator parameters. - * @param options URL serialization options. - */ - getRedirectUrl(params: P, options?: GetRedirectUrlOptions): string; - /** - * Navigate using the `core.application.navigateToApp()` method to a Kibana - * location generated by this locator. This method is available only on the - * browser. - * - * @param params URL locator parameters. - * @param navigationParams Navigation parameters. - */ - navigate(params: P, navigationParams?: LocatorNavigationParams): Promise; - /** - * Synchronous fire-and-forget navigation method. Use it when you want to - * navigate without waiting for the navigation to complete and you don't - * care to process any async promise errors. - * - * @param params URL locator parameters. - * @param navigationParams Navigation parameters. - */ - navigateSync(params: P, navigationParams?: LocatorNavigationParams): void; - /** - * React hook which returns a URL string given locator parameters. Returns - * empty string if URL is being loaded or an error happened. - */ - useUrl: (params: P, getUrlParams?: LocatorGetUrlParams, deps?: DependencyList) => string; -} -/** - * Parameters used when navigating on client-side using browser history object. - */ -export interface LocatorNavigationParams { - /** - * Whether to replace a navigation entry in history queue or push a new entry. - */ - replace?: boolean; -} -/** - * Parameters used when constructing a string URL. - */ -export interface LocatorGetUrlParams { - /** - * Whether to return an absolute long URL or relative short URL. - */ - absolute?: boolean; -} -/** - * This interface represents a location in Kibana to which one can navigate - * using the `core.application.navigateToApp()` method. - */ -export interface KibanaLocation { - /** - * Kibana application ID. - */ - app: string; - /** - * A relative URL path within a Kibana application. - */ - path: string; - /** - * A serializable location state object, which the app can use to determine - * what should be displayed on the screen. - */ - state: S; -} -/** - * Represents a serializable state of a locator. Includes locator ID, version - * and its params. - */ -export interface LocatorData extends VersionedState, SerializableRecord { - /** - * Locator ID. - */ - id: string; -} -export interface LocatorsMigrationMap { - [semver: string]: LocatorMigrationFunction; -} -export type LocatorMigrationFunction = MigrateFunction; diff --git a/src/platform/plugins/shared/share/common/url_service/locators/use_locator_url.d.ts b/src/platform/plugins/shared/share/common/url_service/locators/use_locator_url.d.ts deleted file mode 100644 index 77cf9a7aa16f7..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/locators/use_locator_url.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { DependencyList } from 'react'; -import type { SerializableRecord } from '@kbn/utility-types'; -import type { LocatorGetUrlParams, LocatorPublic } from '..'; -export declare const useLocatorUrl:

(locator: LocatorPublic

| null | undefined, params: P, getUrlParams?: LocatorGetUrlParams, deps?: DependencyList) => string; diff --git a/src/platform/plugins/shared/share/common/url_service/short_urls/index.d.ts b/src/platform/plugins/shared/share/common/url_service/short_urls/index.d.ts deleted file mode 100644 index a2dddad7107a4..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/short_urls/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './types'; diff --git a/src/platform/plugins/shared/share/common/url_service/short_urls/types.d.ts b/src/platform/plugins/shared/share/common/url_service/short_urls/types.d.ts deleted file mode 100644 index d1f702b478163..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/short_urls/types.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { LocatorPublic, ILocatorClient, LocatorData } from '../locators'; -/** - * A factory for Short URL Service. We need this factory as the dependency - * injection is different between the server and the client. On the server, - * the Short URL Service needs a saved object client scoped to the current - * request and the current Kibana version. On the client, the Short URL Service - * needs no dependencies. - */ -export interface IShortUrlClientFactory { - get(dependencies: D): Client; -} -export type IShortUrlClientFactoryProvider = (params: { - locators: ILocatorClient; -}) => IShortUrlClientFactory; -/** - * CRUD-like API for short URLs. - */ -export interface IShortUrlClient { - /** - * Create a new short URL. - * - * @param locator The locator for the URL. - * @param param The parameters for the URL. - * @returns The created short URL. - */ - create

(params: ShortUrlCreateParams

): Promise>; - /** - * Delete a short URL. - * - * @param slug The ID of the short URL. - */ - delete(id: string): Promise; - /** - * Fetch a short URL. - * - * @param id The ID of the short URL. - */ - get(id: string): Promise; - /** - * Fetch a short URL by its slug. - * - * @param slug The slug of the short URL. - */ - resolve(slug: string): Promise; -} -/** - * New short URL creation parameters. - */ -export interface ShortUrlCreateParams

{ - /** - * Locator which will be used to resolve the short URL. - */ - locator: LocatorPublic

; - /** - * Locator parameters which will be used to resolve the short URL. - */ - params: P; - /** - * Optional, short URL slug - the part that will be used to resolve the short - * URL. This part will be visible to the user, it can have user-friendly text. - */ - slug?: string; -} -/** - * A representation of a short URL. - */ -export interface ShortUrl { - /** - * Serializable state of the short URL, which is stored in Kibana. - */ - readonly data: ShortUrlData; -} -/** - * A representation of a short URL's data. - */ -export interface ShortUrlData { - /** - * Unique ID of the short URL. - */ - readonly id: string; - /** - * The slug of the short URL, the part after the `/` in the URL. - */ - readonly slug: string; - /** - * Number of times the short URL has been resolved. - */ - readonly accessCount: number; - /** - * The timestamp of the last time the short URL was resolved. - */ - readonly accessDate: number; - /** - * The timestamp when the short URL was created. - */ - readonly createDate: number; - /** - * The timestamp when the short URL was last modified. - */ - readonly locator: LocatorData; -} -export type { LocatorData }; diff --git a/src/platform/plugins/shared/share/common/url_service/url_service.d.ts b/src/platform/plugins/shared/share/common/url_service/url_service.d.ts deleted file mode 100644 index c49ee541b1167..0000000000000 --- a/src/platform/plugins/shared/share/common/url_service/url_service.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { LocatorClientDependencies } from './locators'; -import { LocatorClient } from './locators'; -import type { IShortUrlClientFactoryProvider, IShortUrlClientFactory, IShortUrlClient } from './short_urls'; -export interface UrlServiceDependencies extends LocatorClientDependencies { - shortUrls: IShortUrlClientFactoryProvider; -} -/** - * Common URL Service client interface for server-side and client-side. - */ -export declare class UrlService { - protected readonly deps: UrlServiceDependencies; - /** - * Client to work with locators. - */ - readonly locators: LocatorClient; - readonly shortUrls: IShortUrlClientFactory; - constructor(deps: UrlServiceDependencies); -} diff --git a/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/draft_mode_callout.d.ts b/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/draft_mode_callout.d.ts deleted file mode 100644 index 2de78d376b3d9..0000000000000 --- a/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/draft_mode_callout.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; -import type { CommonProps } from '@elastic/eui'; -export interface SaveButtonProps extends CommonProps { - onSave: () => Promise; - label?: string; - isSaving?: boolean; -} -export interface DraftModeCalloutProps extends CommonProps { - message?: string; - saveButtonProps?: SaveButtonProps; -} -/** - * A warning callout to indicate the user has unsaved changes. - */ -export declare const DraftModeCallout: ({ message, ["data-test-subj"]: dataTestSubj, saveButtonProps, }: DraftModeCalloutProps) => React.JSX.Element; diff --git a/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/index.d.ts b/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/index.d.ts deleted file mode 100644 index 8bdccf2e1b99c..0000000000000 --- a/src/platform/plugins/shared/share/public/components/common/draft_mode_callout/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { DraftModeCallout } from './draft_mode_callout'; -export type { DraftModeCalloutProps } from './draft_mode_callout'; diff --git a/src/platform/plugins/shared/share/public/components/context/index.d.ts b/src/platform/plugins/shared/share/public/components/context/index.d.ts deleted file mode 100644 index 2f5e1bd28bba1..0000000000000 --- a/src/platform/plugins/shared/share/public/components/context/index.d.ts +++ /dev/null @@ -1,146 +0,0 @@ -import React, { type PropsWithChildren } from 'react'; -import type { ShareConfigs, ShareTypes, ShowShareMenuOptions } from '../../types'; -export interface IShareContext extends Omit { - onClose: () => void; - shareMenuItems: ShareConfigs[]; - isSaving?: boolean; -} -export declare const ShareProvider: ({ shareContext, children, }: PropsWithChildren<{ - shareContext: IShareContext; -}>) => React.JSX.Element; -export declare const useShareContext: () => IShareContext; -export declare const useShareTypeContext: , G extends T extends "integration" ? string : never>(shareType: T, groupId?: G) => { - objectTypeMeta: Omit; - export: { - [x: string]: { - draftModeCallOut?: boolean | import("../common/draft_mode_callout").DraftModeCalloutProps; - helpText?: React.ReactNode; - CTAButtonConfig?: { - id: string; - dataTestSubj: string; - label: string; - }; - disabled?: boolean; - }; - }; - }; - }>, "config"> & { - config: T extends "integration" ? NonNullable; - export: { - [x: string]: { - draftModeCallOut?: boolean | import("../common/draft_mode_callout").DraftModeCalloutProps; - helpText?: React.ReactNode; - CTAButtonConfig?: { - id: string; - dataTestSubj: string; - label: string; - }; - disabled?: boolean; - }; - }; - }; - }>>["integration"]>[G] | undefined : Exclude; - export: { - [x: string]: { - draftModeCallOut?: boolean | import("../common/draft_mode_callout").DraftModeCalloutProps; - helpText?: React.ReactNode; - CTAButtonConfig?: { - id: string; - dataTestSubj: string; - label: string; - }; - disabled?: boolean; - }; - }; - }; - }>>, "integration">[T]; - }; - shareMenuItems: T extends "integration" ? (Extract | Extract | Extract | Extract | Extract | Extract)[] : Extract | Extract | Extract | Extract | Extract | Extract; - onClose: () => void; - isSaving?: boolean; - onSave?: (() => Promise) | undefined; - objectType: string; - objectTypeAlias?: string | undefined; - objectId?: string | undefined; - shareableUrl?: string | undefined; - shareableUrlForSavedObject?: string | undefined; - shareableUrlLocatorParams?: { - locator: import("../..").LocatorPublic; - params: import("../../types").ShareableLocatorParams; - } | undefined; - sharingData: import("../../types").SharingData & Record; - isDirty: boolean; - anchorElement?: HTMLElement | undefined; - asExport?: boolean | undefined; - allowShortUrl: boolean; - publicAPIEnabled?: boolean | undefined; -}; diff --git a/src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.d.ts b/src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.d.ts deleted file mode 100644 index e99bcafc0b27a..0000000000000 --- a/src/platform/plugins/shared/share/public/components/export_integrations/export_integrations.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import React, { type FC } from 'react'; -import type { InjectedIntl } from '@kbn/i18n-react'; -import { type IShareContext, useShareTypeContext } from '../context'; -import type { ExportShareConfig, ShareContext } from '../../types'; -export declare const ExportMenu: FC<{ - shareContext: IShareContext; -}>; -export interface ManagedExportFlyoutProps { - exportIntegration: ExportShareConfig; - intl: InjectedIntl; - isDirty: boolean; - onCloseFlyout: () => void; - publicAPIEnabled?: boolean; - shareObjectType: string; - shareObjectTypeAlias?: string; - shareObjectTypeMeta: ReturnType>['objectTypeMeta']; - onSave?: () => Promise; - isSaving?: boolean; - sharingData: { - [key: string]: unknown; - }; - shareableUrlLocatorParams?: ShareContext['shareableUrlLocatorParams']; -} -export declare function ManagedExportFlyout({ exportIntegration, intl, isDirty, onCloseFlyout, publicAPIEnabled, shareObjectTypeMeta, shareObjectType, shareObjectTypeAlias, onSave, isSaving, sharingData, }: ManagedExportFlyoutProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/share/public/components/export_integrations/index.d.ts b/src/platform/plugins/shared/share/public/components/export_integrations/index.d.ts deleted file mode 100644 index 0c08172b0c8b8..0000000000000 --- a/src/platform/plugins/shared/share/public/components/export_integrations/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { ExportMenu, ManagedExportFlyout, type ManagedExportFlyoutProps, } from './export_integrations'; diff --git a/src/platform/plugins/shared/share/public/components/share_tabs.d.ts b/src/platform/plugins/shared/share/public/components/share_tabs.d.ts deleted file mode 100644 index 031f7868cef13..0000000000000 --- a/src/platform/plugins/shared/share/public/components/share_tabs.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React, { type FC } from 'react'; -import { type IShareContext } from './context'; -export declare const ShareMenu: FC<{ - shareContext: IShareContext; -}>; -export declare const ShareMenuTabs: () => React.JSX.Element | null; diff --git a/src/platform/plugins/shared/share/public/components/tabs/embed/embed_content.d.ts b/src/platform/plugins/shared/share/public/components/tabs/embed/embed_content.d.ts deleted file mode 100644 index 2a1cca37dd9ba..0000000000000 --- a/src/platform/plugins/shared/share/public/components/tabs/embed/embed_content.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import { type IShareContext } from '../../context'; -import type { EmbedShareConfig, EmbedShareUIConfig } from '../../../types'; -type EmbedProps = Pick & EmbedShareConfig['config'] & { - objectConfig?: EmbedShareUIConfig; -}; -export declare const EmbedContent: ({ shareableUrlForSavedObject, shareableUrl, shareableUrlLocatorParams, objectType, objectConfig, isDirty, allowShortUrl, shortUrlService, anonymousAccess, }: EmbedProps) => React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/share/public/components/tabs/embed/index.d.ts b/src/platform/plugins/shared/share/public/components/tabs/embed/index.d.ts deleted file mode 100644 index 5d7c69f209d18..0000000000000 --- a/src/platform/plugins/shared/share/public/components/tabs/embed/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { type IModalTabDeclaration } from '@kbn/shared-ux-tabbed-modal'; -type IEmbedTab = IModalTabDeclaration<{ - url: string; - isNotSaved: boolean; -}>; -export declare const embedTab: IEmbedTab; -export {}; diff --git a/src/platform/plugins/shared/share/public/components/tabs/index.d.ts b/src/platform/plugins/shared/share/public/components/tabs/index.d.ts deleted file mode 100644 index 944ac113d8015..0000000000000 --- a/src/platform/plugins/shared/share/public/components/tabs/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { linkTab } from './link'; -export { embedTab } from './embed'; diff --git a/src/platform/plugins/shared/share/public/components/tabs/link/index.d.ts b/src/platform/plugins/shared/share/public/components/tabs/link/index.d.ts deleted file mode 100644 index 514fdd6c70ad3..0000000000000 --- a/src/platform/plugins/shared/share/public/components/tabs/link/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { type IModalTabDeclaration } from '@kbn/shared-ux-tabbed-modal'; -type ILinkTab = IModalTabDeclaration<{ - dashboardUrl: string; - isNotSaved: boolean; - setIsClicked: boolean; -}>; -export declare const linkTab: ILinkTab; -export {}; diff --git a/src/platform/plugins/shared/share/public/components/tabs/link/link_content.d.ts b/src/platform/plugins/shared/share/public/components/tabs/link/link_content.d.ts deleted file mode 100644 index 693f0474c08b1..0000000000000 --- a/src/platform/plugins/shared/share/public/components/tabs/link/link_content.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import { type IShareContext } from '../../context'; -import type { LinkShareConfig, LinkShareUIConfig } from '../../../types'; -type LinkProps = Pick & LinkShareConfig['config'] & { - objectConfig?: LinkShareUIConfig; -}; -export declare const LinkContent: ({ isDirty, objectType, objectConfig, shareableUrl, shortUrlService, shareableUrlLocatorParams, allowShortUrl, }: LinkProps) => React.JSX.Element; -export {}; diff --git a/src/platform/plugins/shared/share/public/components/tabs/link/time_type_section.d.ts b/src/platform/plugins/shared/share/public/components/tabs/link/time_type_section.d.ts deleted file mode 100644 index d54e071325709..0000000000000 --- a/src/platform/plugins/shared/share/public/components/tabs/link/time_type_section.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -interface TimeRange { - from: string; - to: string; -} -interface Props { - timeRange?: TimeRange; - isAbsoluteTimeByDefault: boolean; - onTimeTypeChange?: (isAbsolute: boolean) => void; -} -export declare const TimeTypeSection: ({ timeRange, onTimeTypeChange, isAbsoluteTimeByDefault, }: Props) => React.JSX.Element | null; -export {}; diff --git a/src/platform/plugins/shared/share/public/index.d.ts b/src/platform/plugins/shared/share/public/index.d.ts deleted file mode 100644 index 0b648f9342cc9..0000000000000 --- a/src/platform/plugins/shared/share/public/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -export type { ConfigSchema } from '../server/config'; -export { CSV_QUOTE_VALUES_SETTING, CSV_SEPARATOR_SETTING } from '../common/constants'; -export type { LocatorDefinition, LocatorPublic, KibanaLocation } from '../common/url_service'; -export type { SharePublicSetup as SharePluginSetup, SharePublicStart as SharePluginStart, } from './plugin'; -export type { ShareContext, ShareMenuItemLegacy, ShowShareMenuOptions, ShareContextMenuPanelItem, BrowserUrlService, ExportShare, ExportShareConfig, ExportShareDerivatives, ExportShareParameters, RegisterShareIntegrationArgs, ShareableLocatorParams, SharingData, ShareActionConfigArgs, } from './types'; -export type { RedirectOptions } from '../common/url_service'; -export { useLocatorUrl } from '../common/url_service/locators/use_locator_url'; -import { SharePlugin } from './plugin'; -export { downloadMultipleAs, downloadFileAs } from './lib/download_as'; -export type { DownloadableContent } from './lib/download_as'; -export { convertRelativeTimeStringToAbsoluteTimeString } from './lib/time_utils'; -export declare function plugin(ctx: PluginInitializerContext): SharePlugin; -export { useShareTypeContext } from './components/context'; diff --git a/src/platform/plugins/shared/share/public/lib/download_as.d.ts b/src/platform/plugins/shared/share/public/lib/download_as.d.ts deleted file mode 100644 index dd25c903a62f0..0000000000000 --- a/src/platform/plugins/shared/share/public/lib/download_as.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type DownloadableContent = { - content: string; - type: string; -} | Blob; -/** - * Convenient method to use for a single file download - * **Note**: for multiple files use the downloadMultipleAs method, do not iterate with this method here - * @param filename full name of the file - * @param payload either a Blob content, or a Record with a stringified content and type - * - * @returns a Promise that resolves when the download has been correctly started - */ -export declare function downloadFileAs(filename: string, payload: DownloadableContent): Promise; -/** - * Multiple files download method - * @param files a Record containing one entry per file: the key entry should be the filename - * and the value either a Blob content, or a Record with a stringified content and type - * - * @returns a Promise that resolves when all the downloads have been correctly started - */ -export declare function downloadMultipleAs(files: Record): Promise; diff --git a/src/platform/plugins/shared/share/public/lib/get_home_href.d.ts b/src/platform/plugins/shared/share/public/lib/get_home_href.d.ts deleted file mode 100644 index b32c5e0b746bd..0000000000000 --- a/src/platform/plugins/shared/share/public/lib/get_home_href.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { HttpSetup, IUiSettingsClient } from '@kbn/core/public'; -export declare function getHomeHref(http: HttpSetup, uiSettings: IUiSettingsClient): string; diff --git a/src/platform/plugins/shared/share/public/lib/registrations.d.ts b/src/platform/plugins/shared/share/public/lib/registrations.d.ts deleted file mode 100644 index 4d01e86bcd52f..0000000000000 --- a/src/platform/plugins/shared/share/public/lib/registrations.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AnalyticsServiceSetup } from '@kbn/core-analytics-browser'; -interface SetupDeps { - analytics: AnalyticsServiceSetup; -} -export declare const registrations: { - setup(deps: SetupDeps): void; -}; -export {}; diff --git a/src/platform/plugins/shared/share/public/lib/time_utils.d.ts b/src/platform/plugins/shared/share/public/lib/time_utils.d.ts deleted file mode 100644 index 381ce83839c20..0000000000000 --- a/src/platform/plugins/shared/share/public/lib/time_utils.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export declare const getRelativeTimeValueAndUnitFromTimeString: (dateString?: string) => { - value: number; - unit: string | undefined; - roundingUnit: string | undefined; -} | undefined; -export declare const convertRelativeTimeStringToAbsoluteTimeDate: (dateString?: string, options?: { - roundUp?: boolean; -}) => Date | undefined; -export declare const convertRelativeTimeStringToAbsoluteTimeString: (dateString?: string, options?: { - roundUp?: boolean; -}) => string | undefined; -export declare const isTimeRangeAbsoluteTime: (timeRange?: { - from: string; - to: string; -}) => boolean; diff --git a/src/platform/plugins/shared/share/public/plugin.d.ts b/src/platform/plugins/shared/share/public/plugin.d.ts deleted file mode 100644 index e0d419643b20d..0000000000000 --- a/src/platform/plugins/shared/share/public/plugin.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; -import type { ShareMenuManagerStart } from './services'; -import type { ShareMenuRegistrySetup } from './services'; -import { ShareRegistry } from './services'; -import type { RedirectOptions } from '../common/url_service/locators/redirect'; -import type { AnonymousAccessServiceContract } from '../common'; -import type { BrowserUrlService } from './types'; -/** @public */ -export interface SharePublicSetup extends ShareMenuRegistrySetup { - /** - * Utilities to work with URL locators and short URLs. - */ - url: BrowserUrlService; - /** - * Accepts serialized values for extracting a locator, migrating state from a provided version against - * the locator, then using the locator to navigate. - */ - navigate(options: RedirectOptions): void; - /** - * Sets the provider for the anonymous access service; this is consumed by the Security plugin to avoid a circular dependency. - */ - setAnonymousAccessServiceProvider: (provider: () => AnonymousAccessServiceContract) => void; -} -/** @public */ -export type SharePublicStart = ShareMenuManagerStart & { - /** - * Utilities to work with URL locators and short URLs. - */ - url: BrowserUrlService; - /** - * Accepts serialized values for extracting a locator, migrating state from a provided version against - * the locator, then using the locator to navigate. - */ - navigate(options: RedirectOptions): void; - /** - * method to get all available integrations - */ - availableIntegrations: ShareRegistry['availableIntegrations']; -}; -export interface SharePublicSetupDependencies { -} -export interface SharePublicStartDependencies { -} -export declare class SharePlugin implements Plugin { - private readonly initializerContext; - private readonly shareRegistry; - private readonly shareContextMenu; - private redirectManager?; - private url?; - private anonymousAccessServiceProvider?; - private licenseSubscription?; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup): SharePublicSetup; - start(core: CoreStart, { licensing }: { - licensing?: LicensingPluginStart; - }): SharePublicStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/share/public/services/index.d.ts b/src/platform/plugins/shared/share/public/services/index.d.ts deleted file mode 100644 index fdef4c71d793e..0000000000000 --- a/src/platform/plugins/shared/share/public/services/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './share_menu_registry'; -export * from './share_menu_manager'; diff --git a/src/platform/plugins/shared/share/public/services/share_menu_manager.d.ts b/src/platform/plugins/shared/share/public/services/share_menu_manager.d.ts deleted file mode 100644 index bc93f5ed8db89..0000000000000 --- a/src/platform/plugins/shared/share/public/services/share_menu_manager.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { InjectedIntl } from '@kbn/i18n-react'; -import type { ShowShareMenuOptions } from '../types'; -import type { ShareRegistry } from './share_menu_registry'; -interface ShareMenuManagerStartDeps { - core: CoreStart; - isServerless: boolean; - resolveShareItemsForShareContext: ShareRegistry['resolveShareItemsForShareContext']; -} -export declare class ShareMenuManager { - private isOpen; - private container; - start({ core, resolveShareItemsForShareContext, isServerless }: ShareMenuManagerStartDeps): { - /** - * Collects share menu items from registered providers and mounts the share context menu under - * the given `anchorElement`. If the context menu is already opened, a call to this method closes it. - * @param options - */ - toggleShareContextMenu: (options: ShowShareMenuOptions) => Promise; - /** - * Returns a handler to trigger a specific export integration by ID. - * For direct exports, executes immediately; otherwise opens a flyout. - */ - getExportHandler: (options: Omit, exportId: string, intl: InjectedIntl) => Promise<(() => Promise) | null>; - /** - * Returns a handler to trigger an export derivative by ID, opening its custom flyout. - */ - getExportDerivativeHandler: (options: Omit, derivativeId: string) => Promise<(() => Promise) | null>; - }; - /** - * Method for handling export operations flexibly. - */ - private createExportHandler; - private onClose; - private toggleShareContextMenu; -} -export type ShareMenuManagerStart = ReturnType; -export {}; diff --git a/src/platform/plugins/shared/share/public/services/share_menu_registry.d.ts b/src/platform/plugins/shared/share/public/services/share_menu_registry.d.ts deleted file mode 100644 index cac9ebc59a9e5..0000000000000 --- a/src/platform/plugins/shared/share/public/services/share_menu_registry.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { ShareContext, ShareConfigs, ShareRegistryPublicApi, ShareActionIntents, ShareRegistryApiStart, ShareMenuProviderLegacy, RegisterShareIntegrationArgs } from '../types'; -export declare class ShareRegistry implements ShareRegistryPublicApi { - private urlService?; - private anonymousAccessServiceProvider?; - private capabilities?; - private getLicense?; - private readonly globalMarker; - constructor(); - private readonly shareOptionsStore; - setup(): { - /** - * @deprecated Use {@link registerShareIntegration} instead. - */ - register: (value: ShareMenuProviderLegacy) => void; - registerShareIntegration: (...args: [string, RegisterShareIntegrationArgs] | [RegisterShareIntegrationArgs]) => void; - }; - start({ urlService, anonymousAccessServiceProvider, capabilities, getLicense, }: ShareRegistryApiStart): { - availableIntegrations: (objectType: string, groupId?: string) => ShareActionIntents[]; - resolveShareItemsForShareContext: ({ objectType, isServerless, ...shareContext }: ShareContext & { - isServerless: boolean; - }) => Promise; - }; - private registerShareIntentAction; - private registerLinkShareAction; - private registerEmbedShareAction; - /** - * @description provides an escape hatch to support allowing legacy share menu items to be registered - */ - private register; - private registerShareIntegration; - private getShareConfigOptionsForObject; - /** - * Returns all share actions that are available for the given object type. - */ - private availableIntegrations; - private resolveShareItemsForShareContext; -} -export type ShareMenuRegistryStart = ReturnType; -export type ShareMenuRegistrySetup = ReturnType; diff --git a/src/platform/plugins/shared/share/public/types.d.ts b/src/platform/plugins/shared/share/public/types.d.ts deleted file mode 100644 index f8e927f9fa1e6..0000000000000 --- a/src/platform/plugins/shared/share/public/types.d.ts +++ /dev/null @@ -1,362 +0,0 @@ -import type { ComponentType, ReactNode } from 'react'; -import type { InjectedIntl } from '@kbn/i18n-react'; -import type { EuiContextMenuPanelDescriptor } from '@elastic/eui'; -import { type EuiCodeProps, type EuiIconProps, type EuiFlyoutProps } from '@elastic/eui'; -import type { EuiContextMenuPanelItemDescriptorEntry } from '@elastic/eui/src/components/context_menu/context_menu'; -import type { ILicense } from '@kbn/licensing-types'; -import type { Capabilities } from '@kbn/core/public'; -import type { TimeRange } from '@kbn/es-query'; -import type { SerializableRecord } from '@kbn/utility-types'; -import type { UrlService, LocatorPublic } from '../common/url_service'; -import type { BrowserShortUrlClientFactoryCreateParams } from './url_service/short_urls/short_url_client_factory'; -import type { BrowserShortUrlClient } from './url_service/short_urls/short_url_client'; -import type { AnonymousAccessServiceContract } from '../common/anonymous_access'; -import type { DraftModeCalloutProps } from './components/common/draft_mode_callout'; -export interface ShareRegistryApiStart { - capabilities: Capabilities; - urlService: BrowserUrlService; - anonymousAccessServiceProvider?: () => AnonymousAccessServiceContract; - getLicense: () => ILicense | undefined; -} -export type ShareActionConfigArgs = ShareContext & Pick; -export type ShareTypes = 'link' | 'embed' | 'legacy' | 'integration'; -export type InternalShareActionIntent = Exclude; -type ShareActionUserInputBase = Record> = { - /** - * The draft mode callout content to be shown when there are unsaved changes. - * - `true`: Shows the default callout. - * - `false` or `undefined`: Shows no callout. - * - `DraftModeCalloutProps`: - * - `message`: callout message custom content - */ - draftModeCallOut?: boolean | DraftModeCalloutProps; - helpText?: ReactNode; - CTAButtonConfig?: { - id: string; - dataTestSubj: string; - label: string; - }; - disabled?: boolean; -} & E; -export interface ShareMenuProviderLegacy { - readonly id: string; - getShareMenuItemsLegacy: (context: ShareContext) => ShareMenuItemLegacy[]; -} -type ShareImplementationFactory, C extends Record = Record, S extends SharingData = SharingData> = T extends 'integration' ? { - id: string; - groupId?: string; - shareType: T; - /** - * Callback that yields the configured methods for the current share implementation as a promise, enables the possibility to dynamically fetch the share configuration - */ - config: (ctx: ShareActionConfigArgs) => Promise; - /** - * When provided, this method will be used to evaluate if this integration should be available, - * given the current license and capabilities of kibana - */ - prerequisiteCheck?: (args: { - capabilities: Capabilities; - objectType: ShareContext['objectType']; - license?: ILicense; - }) => boolean; -} : { - shareType: T; - config: (ctx: ShareActionConfigArgs) => C | null; -}; -type ShareImplementation = Omit & { - config: T extends ShareImplementationFactory ? R : never; -}; -/** - * @description implementation definition for creating a share action for sharing object links - */ -export type LinkShare = ShareImplementationFactory<'link', { - shortUrlService: ReturnType; -}>; -/** - * @description Implementation definition for creating a share action for sharing embed links - */ -export type EmbedShare = ShareImplementationFactory<'embed', { - anonymousAccess: AnonymousAccessServiceContract; - shortUrlService: ReturnType; -}>; -/** - * @description Skeleton definition for implementing a share action integration - */ -export type ShareIntegration = Record, S extends SharingData = SharingData> = ShareImplementationFactory<'integration', IntegrationParameters, S>; -/** - * @description Implementation definition to support legacy share implementation - */ -export interface ShareLegacy { - shareType: 'legacy'; - id: ShareMenuProviderLegacy['id']; - config: ShareMenuProviderLegacy['getShareMenuItemsLegacy']; -} -/** - * @description Share integration implementation definition for performing exports within kibana - */ -export interface ExportShare extends ShareIntegration<{ - /** - * @deprecated only kept around for legacy reasons - */ - name?: string; - icon?: EuiIconProps['type']; - sortOrder?: number; - /** - * @deprecated only kept around for legacy reasons - */ - toolTipContent?: string; - label: string; - exportType: string; - /** - * allows disabling the export action, for instance the current app has no data to export - */ - disabled?: boolean; - helpText?: ReactNode; - generateExportButtonLabel?: ReactNode; - generateAssetExport: (args: ExportGenerationOpts) => Promise; - renderCopyURIButton?: boolean; - warnings?: Array<{ - title: string; - message: string; - }>; - requiresSavedState?: boolean; - supportedLayoutOptions?: Array<'print'>; - renderLayoutOptionSwitch?: boolean; - /** - * indicates if the export integration supports generating it exports with absolute time ranges - */ - supportsAbsoluteTime?: boolean; - renderTotalHitsSizeWarning?: (totalHits?: number) => ReactNode | undefined; -} & ({ - generateAssetComponent?: never; - copyAssetURIConfig: { - headingText: string; - helpText?: string; - contentType: EuiCodeProps['language']; - generateAssetURIValue: (args: ExportGenerationOpts) => string | undefined; - }; -} | { - generateAssetComponent: ReactNode; - copyAssetURIConfig?: never; -} | { - generateAssetComponent?: never; - copyAssetURIConfig?: never; -}), S> { - groupId: 'export'; -} -export interface ExportShareParameters extends Record { - label: React.FC<{ - openFlyout: () => void; - }>; - toolTipContent?: ReactNode; - flyoutContent: React.FC<{ - closeFlyout: () => void; - flyoutRef: React.RefObject; - }>; - flyoutSizing?: Pick; - shouldRender: ({ availableExportItems, }: { - availableExportItems: ExportShareConfig[]; - }) => boolean; -} -/** - * @description Share integration implementation definition that build off exports within kibana, - * reach out to the shared ux team before settling on using this interface - */ -export interface ExportShareDerivatives extends ShareIntegration { - groupId: 'exportDerivatives'; -} -export type ShareActionIntents = LinkShare | EmbedShare | ShareLegacy | ShareIntegration; -export type LinkShareConfig = ShareImplementation; -export type EmbedShareConfig = ShareImplementation; -export type ExportShareConfig = ShareImplementation; -export type ExportShareDerivativesConfig = ShareImplementation; -export type ShareIntegrationConfig = ShareImplementation; -export type LegacyIntegrationConfig = Omit & { - config: ReturnType; -}; -export type ShareConfigs = LinkShareConfig | EmbedShareConfig | ShareIntegrationConfig | ExportShareConfig | ExportShareDerivativesConfig | LegacyIntegrationConfig; -export type LinkShareUIConfig = ShareActionUserInputBase<{ - /** - * - * @description allows a consumer to provide a custom method which when invoked - * handles providing a share url in the context of said consumer - */ - delegatedShareUrlHandler?: () => Promise; -}>; -export type EmbedShareUIConfig = ShareActionUserInputBase<{ - embedUrlParamExtensions?: UrlParamExtension[]; - computeAnonymousCapabilities?: (anonymousUserCapabilities: Capabilities) => boolean; - /** - * @deprecated use computeAnonymousCapabilities defined on objectTypeMeta config - */ - showPublicUrlSwitch?: (anonymousUserCapabilities: Capabilities) => boolean; -}>; -/** - * @description record of user config for each registered export integration - */ -type ExportShareUIConfig = Record>; -export interface ShareUIConfig { - link: LinkShareUIConfig; - embed: EmbedShareUIConfig; - integration: { - [key: string]: ShareActionUserInputBase; - export: ExportShareUIConfig; - }; -} -/** - * One locator (typical link/export flows) or several (e.g. CSV reporting). - */ -export type SharingDataLocatorParams

= { - id: string; - params: P; - version?: string; -} | Array<{ - id: string; - params: P; - version?: string; -}>; -export interface SharingData

extends Record { - title: string; - locatorParams: SharingDataLocatorParams

; -} -export type ShareIntegrationMapKey = `integration-${string}`; -/** - * Registration payload for a share integration. - * We infer sharing-data `S` from `I` instead of constraining `I extends ShareIntegration` (defaults on - * `ShareIntegration` use `SharingData`, and `config`'s `ctx` is contravariant in `S`, so - * `ExportShare` is not assignable to the default `ShareIntegration`). - */ -export type RegisterShareIntegrationArgs = I extends ShareIntegration ? P extends Record ? S extends SharingData ? Pick & { - getShareIntegrationConfig: (ctx: ShareActionConfigArgs) => ReturnType; -} : never : never : never; -export interface ShareRegistryInternalApi { - registerShareIntegration(shareObject: string, arg: RegisterShareIntegrationArgs): void; - registerShareIntegration(arg: RegisterShareIntegrationArgs): void; - resolveShareItemsForShareContext(args: ShareContext & { - isServerless: boolean; - }): Promise; -} -export declare abstract class ShareRegistryPublicApi { - abstract setup(): { - /** - * @description registers a share menu provider for a specific object type - */ - registerShareIntegration: ShareRegistryInternalApi['registerShareIntegration']; - }; - abstract start(args: ShareRegistryApiStart): { - resolveShareItemsForShareContext: ShareRegistryInternalApi['resolveShareItemsForShareContext']; - }; -} -export type BrowserUrlService = UrlService; -export type ShareableLocatorParams = SerializableRecord & { - timeRange: TimeRange | undefined; -}; -/** - * @public - * Properties of the current object to share. Registered share - * menu providers will provide suitable items which have to - * be rendered in an appropriate place by the caller. - * - * It is possible to use the static function `toggleShareContextMenu` - * to render the menu as a popover. - * */ -export interface ShareContext { - /** - * The type of the object to share. for example lens, dashboard, etc. - */ - objectType: string; - /** - * An alias of type of the object to share, that's more human friendly. - */ - objectTypeAlias?: string; - /** - * Allows for passing contextual information that each consumer can provide to customize the share menu - */ - objectTypeMeta: { - title: string; - config: Partial<{ - [T in Exclude]: ShareUIConfig[T]; - }>; - }; - /** - * Id of the object that's been attempted to be shared - */ - objectId?: string; - /** - * Current url for sharing. This can be set in cases where `window.location.href` - * does not contain a shareable URL (e.g. if using session storage to store the current - * app state is enabled). In these cases the property should contain the URL in a - * format which makes it possible to use it without having access to any other state - * like the current session. - * - * If not set it will default to `window.location.href` - */ - shareableUrl?: string; - /** - * @deprecated prefer {@link delegatedShareUrlHandler} - */ - shareableUrlForSavedObject?: string; - shareableUrlLocatorParams?: { - locator: LocatorPublic; - params: ShareableLocatorParams; - }; - sharingData: S; - isDirty: boolean; - onClose: () => void; -} -/** - * @public - * Eui context menu entry shown directly in the context menu. `sortOrder` is - * used to order the individual items in a flat list returned by all registered - * menu providers. - * */ -export interface ShareContextMenuPanelItem extends Omit { - name: string; - sortOrder?: number; -} -/** - * @public - * Definition of a menu item rendered in the share menu. In the redesign, the - * `shareMenuItem` is shown in a modal. However, Canvas - * uses the legacy panel implementation. - * */ -interface ShareMenuItemBase { - shareMenuItem?: ShareContextMenuPanelItem; -} -export interface ShareMenuItemLegacy extends ShareMenuItemBase { - panel?: EuiContextMenuPanelDescriptor; -} -export interface ExportGenerationOpts { - optimizedForPrinting?: boolean; - intl: InjectedIntl; -} -interface UrlParamExtensionProps { - setParamValue: (values: {}) => void; -} -export interface UrlParamExtension { - paramName: string; - component: ComponentType; -} -/** @public */ -export interface ShowShareMenuOptions< -/** - * Specifies the type of the locator params for the sharing data. - */ -P extends SerializableRecord = SerializableRecord, -/** - * Specifies the type of the sharing data. - */ -S extends Record = Record> extends Omit & S>, 'onClose'> { - asExport?: boolean; - anchorElement?: HTMLElement; - allowShortUrl: boolean; - onClose?: () => void; - publicAPIEnabled?: boolean; - onSave?: () => Promise; -} -export interface ClientConfigType { - new_version: { - enabled: boolean; - }; -} -export {}; diff --git a/src/platform/plugins/shared/share/public/url_service/index.d.ts b/src/platform/plugins/shared/share/public/url_service/index.d.ts deleted file mode 100644 index f882b5de4dd31..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './redirect'; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/components/empty_prompt.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/components/empty_prompt.d.ts deleted file mode 100644 index 72117adfe207e..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/redirect/components/empty_prompt.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as React from 'react'; -import type { ChromeDocTitle } from '@kbn/core-chrome-browser'; -export interface ErrorProps { - title?: string; - body?: string; - homeHref: string; - docTitle: ChromeDocTitle; - error: Error; -} -export declare const RedirectEmptyPrompt: React.FC; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/components/page.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/components/page.d.ts deleted file mode 100644 index ba99db67d9b5d..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/redirect/components/page.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import type { CustomBrandingSetup } from '@kbn/core-custom-branding-browser'; -import type { ChromeDocTitle, ThemeServiceSetup } from '@kbn/core/public'; -import type { UserProfileService } from '@kbn/core-user-profile-browser'; -import type { RedirectManager } from '../redirect_manager'; -export interface PageProps { - homeHref: string; - docTitle: ChromeDocTitle; - customBranding: CustomBrandingSetup; - manager: Pick; - theme: ThemeServiceSetup; - userProfile: UserProfileService; -} -export declare const Page: React.FC; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/components/spinner.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/components/spinner.d.ts deleted file mode 100644 index 3c4803a8554f7..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/redirect/components/spinner.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as React from 'react'; -export declare const Spinner: React.FC<{ - showPlainSpinner: boolean; -}>; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/index.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/index.d.ts deleted file mode 100644 index 1390f34c349e0..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/redirect/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './redirect_manager'; diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/redirect_manager.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/redirect_manager.d.ts deleted file mode 100644 index afa1dd56e8d51..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/redirect/redirect_manager.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CoreSetup } from '@kbn/core/public'; -import type { Location } from 'history'; -import { BehaviorSubject } from 'rxjs'; -import type { UrlService } from '../../../common/url_service'; -import type { RedirectOptions } from '../../../common/url_service/locators/redirect'; -export interface RedirectManagerDependencies { - url: UrlService; -} -export declare class RedirectManager { - readonly deps: RedirectManagerDependencies; - readonly error$: BehaviorSubject; - constructor(deps: RedirectManagerDependencies); - registerLocatorRedirectApp(core: CoreSetup): void; - registerLegacyShortUrlRedirectApp(core: CoreSetup): void; - onMount(location: Location, abortSignal?: AbortSignal): void; - private navigateToShortUrlBySlug; - navigate(options: RedirectOptions): void; - protected parseSearchParams(urlLocationSearch: string): RedirectOptions; -} diff --git a/src/platform/plugins/shared/share/public/url_service/redirect/render.d.ts b/src/platform/plugins/shared/share/public/url_service/redirect/render.d.ts deleted file mode 100644 index ab99a95cc05cf..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/redirect/render.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { PageProps } from './components/page'; -export declare const render: (container: HTMLElement, props: PageProps) => () => void; diff --git a/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client.d.ts b/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client.d.ts deleted file mode 100644 index 04e44a9a64727..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { SerializableRecord } from '@kbn/utility-types'; -import type { LegacyShortUrlLocatorParams } from '../../../common/url_service/locators/legacy_short_url_locator'; -import type { ShortUrlRedirectLocatorParams } from '../../../common/url_service/locators/short_url_redirect_locator'; -import type { IShortUrlClient, ShortUrl, ShortUrlCreateParams, ILocatorClient, LocatorPublic } from '../../../common/url_service'; -export interface BrowserShortUrlClientHttp { - basePath: { - get: () => string; - }; - fetch: (url: string, params: BrowserShortUrlClientHttpFetchParams) => Promise; -} -interface BrowserShortUrlClientHttpFetchParams { - method: 'GET' | 'POST' | 'DELETE'; - body?: string; -} -/** - * Dependencies of the Short URL Client. - */ -export interface BrowserShortUrlClientDependencies { - /** - * The locators service. - */ - locators: ILocatorClient; - /** - * HTTP client. - */ - http: BrowserShortUrlClientHttp; -} -export declare class BrowserShortUrlClient implements IShortUrlClient { - private readonly dependencies; - constructor(dependencies: BrowserShortUrlClientDependencies); - create

({ locator, params, slug, }: ShortUrlCreateParams

): Promise>; - createWithLocator

(params: ShortUrlCreateParams

, isAbsoluteTime?: boolean): Promise>; - createFromLongUrl(longUrl: string, isAbsoluteTime?: boolean): Promise; - get(id: string): Promise; - resolve(slug: string): Promise; - delete(id: string): Promise; -} -export interface ShortUrlCreateResponse extends ShortUrl { - locator: LocatorPublic; - params: ShortUrlRedirectLocatorParams; -} -export interface ShortUrlCreateFromLongUrlResponse extends ShortUrlCreateResponse { - url: string; -} -export {}; diff --git a/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client_factory.d.ts b/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client_factory.d.ts deleted file mode 100644 index 95bbfa6d0f174..0000000000000 --- a/src/platform/plugins/shared/share/public/url_service/short_urls/short_url_client_factory.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IShortUrlClientFactory } from '../../../common/url_service'; -import type { BrowserShortUrlClientDependencies } from './short_url_client'; -import { BrowserShortUrlClient } from './short_url_client'; -export type BrowserShortUrlClientFactoryDependencies = BrowserShortUrlClientDependencies; -export type BrowserShortUrlClientFactoryCreateParams = null; -export declare class BrowserShortUrlClientFactory implements IShortUrlClientFactory { - private readonly dependencies; - constructor(dependencies: BrowserShortUrlClientFactoryDependencies); - get(params: BrowserShortUrlClientFactoryCreateParams): BrowserShortUrlClient; -} diff --git a/src/platform/plugins/shared/share/server/config.d.ts b/src/platform/plugins/shared/share/server/config.d.ts deleted file mode 100644 index 86ab29457193d..0000000000000 --- a/src/platform/plugins/shared/share/server/config.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -export declare const configSchema: import("@kbn/config-schema").ObjectType<{ - new_version: import("@kbn/config-schema").ObjectType<{ - enabled: import("@kbn/config-schema").Type; - }>; - url_expiration: import("@kbn/config-schema").ObjectType<{ - enabled: import("@kbn/config-schema").Type; - duration: import("@kbn/config-schema").Type; - check_interval: import("@kbn/config-schema").Type; - url_limit: import("@kbn/config-schema").Type; - }>; -}>; -export type ConfigSchema = TypeOf; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/constants.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/constants.d.ts deleted file mode 100644 index 706e358c0c334..0000000000000 --- a/src/platform/plugins/shared/share/server/unused_urls_task/constants.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const TASK_ID = "unusedUrlsCleanupTask"; -export declare const SAVED_OBJECT_TYPE = "url"; -export declare const DEFAULT_URL_LIMIT = 10000; -export declare const DEFAULT_URL_EXPIRATION_DURATION = "1y"; -export declare const DEFAULT_URL_EXPIRATION_CHECK_INTERVAL = "7d"; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/index.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/index.d.ts deleted file mode 100644 index 2c5551da5e77a..0000000000000 --- a/src/platform/plugins/shared/share/server/unused_urls_task/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './constants'; -export * from './task'; -export * from './register_unused_urls_task_routes'; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/register_delete_unused_urls_route.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/register_delete_unused_urls_route.d.ts deleted file mode 100644 index 8ab5ede23e7c5..0000000000000 --- a/src/platform/plugins/shared/share/server/unused_urls_task/register_delete_unused_urls_route.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Duration } from 'moment'; -import type { IRouter, Logger } from '@kbn/core/server'; -import type { CoreSetup } from '@kbn/core/server'; -export declare const registerDeleteUnusedUrlsRoute: ({ router, core, urlExpirationDuration, urlLimit, logger, isEnabled, }: { - router: IRouter; - core: CoreSetup; - urlExpirationDuration: Duration; - urlLimit: number; - logger: Logger; - isEnabled: boolean; -}) => void; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/register_unused_urls_task_routes.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/register_unused_urls_task_routes.d.ts deleted file mode 100644 index a5f3ecc5caf1b..0000000000000 --- a/src/platform/plugins/shared/share/server/unused_urls_task/register_unused_urls_task_routes.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Duration } from 'moment'; -import type { CoreSetup, IRouter, Logger } from '@kbn/core/server'; -export declare const registerUrlServiceRoutes: ({ router, core, urlExpirationDuration, urlLimit, logger, isEnabled, }: { - router: IRouter; - core: CoreSetup; - urlExpirationDuration: Duration; - urlLimit: number; - logger: Logger; - isEnabled: boolean; -}) => void; diff --git a/src/platform/plugins/shared/share/server/unused_urls_task/task.d.ts b/src/platform/plugins/shared/share/server/unused_urls_task/task.d.ts deleted file mode 100644 index fa81925fc1cc5..0000000000000 --- a/src/platform/plugins/shared/share/server/unused_urls_task/task.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { Duration } from 'moment'; -import type { CoreSetup, ISavedObjectsRepository, SavedObjectsBulkDeleteObject } from '@kbn/core/server'; -import type { Logger } from '@kbn/logging'; -import type { TaskInstanceWithId } from '@kbn/task-manager-plugin/server/task'; -import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; -export declare const durationToSeconds: (duration: Duration) => string; -export declare const getDeleteUnusedUrlTaskInstance: (interval: Duration) => TaskInstanceWithId; -export declare const deleteUnusedUrls: ({ savedObjectsRepository, unusedUrls, namespace, logger, }: { - savedObjectsRepository: ISavedObjectsRepository; - unusedUrls: SavedObjectsBulkDeleteObject[]; - namespace: string; - logger: Logger; -}) => Promise; -export declare const fetchUnusedUrlsFromFirstNamespace: ({ savedObjectsRepository, urlExpirationDuration, urlLimit, }: { - savedObjectsRepository: ISavedObjectsRepository; - urlExpirationDuration: Duration; - urlLimit: number; -}) => Promise<{ - unusedUrls: { - id: string; - type: string; - }[]; - hasMore: boolean; - namespace: string; -}>; -export declare const runDeleteUnusedUrlsTask: ({ core, urlExpirationDuration, urlLimit, logger, isEnabled, }: { - core: CoreSetup; - urlExpirationDuration: Duration; - urlLimit: number; - logger: Logger; - isEnabled: boolean; -}) => Promise<{ - deletedCount: number; -}>; -export declare const scheduleUnusedUrlsCleanupTask: ({ taskManager, checkInterval, isEnabled, logger, }: { - taskManager: TaskManagerStartContract; - checkInterval: Duration; - isEnabled: boolean; - logger: Logger; -}) => Promise; diff --git a/src/platform/plugins/shared/ui_actions/common/trigger_ids.d.ts b/src/platform/plugins/shared/ui_actions/common/trigger_ids.d.ts deleted file mode 100644 index 0fe4f96f9a8ce..0000000000000 --- a/src/platform/plugins/shared/ui_actions/common/trigger_ids.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * These triggers have been updated to use a more consistent naming schema that works with REST APIs. - * They are generic events which can apply to many interactions in Kibana. Try to use these first when - * building a new UI action. - */ -export declare const ON_CLICK_VALUE = "on_click_value"; -export declare const ON_CLICK_IMAGE = "on_click_image"; -export declare const ON_CLICK_ROW = "on_click_row"; -export declare const ON_SELECT_RANGE = "on_select_range"; -export declare const ON_APPLY_FILTER = "on_apply_filter"; -export declare const ON_OPEN_PANEL_MENU = "on_open_panel_menu"; -/** - * These triggers have not yet been updated, and may be removed or consolidated later. - */ -export declare const ADD_PANEL_TRIGGER = "ADD_PANEL_TRIGGER"; -export declare const ALERT_RULE_TRIGGER = "alertRule"; -export declare const VISUALIZE_FIELD_TRIGGER = "VISUALIZE_FIELD_TRIGGER"; -export declare const VISUALIZE_GEO_FIELD_TRIGGER = "VISUALIZE_GEO_FIELD_TRIGGER"; -export declare const CONTROL_HOVER_TRIGGER_ID = "CONTROL_HOVER_TRIGGER"; -export declare const CONTROL_MENU_TRIGGER = "CONTROL_MENU_TRIGGER"; -export declare const EDIT_LOOKUP_INDEX_CONTENT_TRIGGER_ID = "EDIT_LOOKUP_INDEX_CONTENT_TRIGGER_ID"; -export declare const SEARCH_EMBEDDABLE_CELL_ACTIONS_TRIGGER_ID = "SEARCH_EMBEDDABLE_CELL_ACTIONS_TRIGGER_ID"; -export declare const DISCOVER_CELL_ACTIONS_TRIGGER_ID = "DISCOVER_CELL_ACTIONS_TRIGGER_ID"; -export declare const PANEL_BADGE_TRIGGER = "PANEL_BADGE_TRIGGER"; -export declare const PANEL_NOTIFICATION_TRIGGER = "PANEL_NOTIFICATION_TRIGGER"; -export declare const MULTI_VALUE_CLICK_TRIGGER = "MULTI_VALUE_CLICK_TRIGGER"; -export declare const CELL_VALUE_TRIGGER = "CELL_VALUE_TRIGGER"; -export declare const ESQL_CONTROL_TRIGGER = "ESQL_CONTROL_TRIGGER"; -export declare const UPDATE_ESQL_QUERY_TRIGGER = "UPDATE_ESQL_QUERY_TRIGGER"; -export declare const UPDATE_FILTER_REFERENCES_TRIGGER = "UPDATE_FILTER_REFERENCES_TRIGGER"; -export declare const VISUALIZE_EDITOR_TRIGGER = "VISUALIZE_EDITOR_TRIGGER"; -export declare const AGG_BASED_VISUALIZATION_TRIGGER = "AGG_BASED_VISUALIZATION_TRIGGER"; -export declare const DASHBOARD_VISUALIZATION_PANEL_TRIGGER = "DASHBOARD_VISUALIZATION_PANEL_TRIGGER"; -export declare const ADD_CANVAS_ELEMENT_TRIGGER = "ADD_CANVAS_ELEMENT_TRIGGER"; -export declare const OPEN_FILE_UPLOAD_LITE_TRIGGER = "OPEN_FILE_UPLOAD_LITE_TRIGGER"; -export declare const CATEGORIZE_FIELD_TRIGGER = "CATEGORIZE_FIELD_TRIGGER"; -export declare const IN_APP_EMBEDDABLE_EDIT_TRIGGER = "IN_APP_EMBEDDABLE_EDIT_TRIGGER"; -export declare const CREATE_PATTERN_ANALYSIS_TO_ML_AD_JOB_TRIGGER = "CREATE_PATTERN_ANALYSIS_TO_ML_AD_JOB_TRIGGER"; -export declare const SWIM_LANE_SELECTION_TRIGGER = "SWIM_LANE_SELECTION_TRIGGER"; -export declare const EXPLORER_ENTITY_FIELD_SELECTION_TRIGGER = "EXPLORER_ENTITY_FIELD_SELECTION_TRIGGER"; -export declare const SINGLE_METRIC_VIEWER_ENTITY_FIELD_SELECTION_TRIGGER = "SINGLE_METRIC_VIEWER_ENTITY_FIELD_SELECTION_TRIGGER"; -export declare const O11Y_APM_TRANSACTION_CONTEXT_MENU_TRIGGER = "apmTransactionContextMenu"; -export declare const O11Y_APM_ERROR_CONTEXT_MENU_TRIGGER = "apmErrorContextMenu"; -export declare const SECURITY_ESQL_IN_TIMELINE_HISTOGRAM_TRIGGER = "security-discoverInTimeline-histogramTrigger"; -export declare const SECURITY_CELL_ACTIONS_DEFAULT = "security-default-cellActions"; -export declare const SECURITY_CELL_ACTIONS_DETAILS_FLYOUT = "security-detailsFlyout-cellActions"; -export declare const SECURITY_CELL_ACTIONS_ALERTS_COUNT = "security-alertsCount-cellActions"; -export declare const SECURITY_CELL_ACTIONS_CASE_EVENTS = "security-case-events-cellActions"; diff --git a/src/platform/plugins/shared/ui_actions/public/actions/action.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/action.d.ts deleted file mode 100644 index 41b1bdb47de62..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/actions/action.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -import type { Presentable } from '@kbn/ui-actions-browser/src/types'; -import type { IconType } from '@elastic/eui'; -import type { Observable } from 'rxjs'; -import type { Trigger } from '../types'; -/** - * During action execution we can provide additional information, - * for example, trigger, that caused the action execution - */ -export interface ActionExecutionMeta { - /** - * Trigger that executed the action - */ - trigger: Trigger; - /** - * The event that caused the action to execute (e.g., mouse click, keyboard event) - */ - event?: React.MouseEvent; -} -/** - * Action methods are executed with Context from trigger + {@link ActionExecutionMeta} - */ -export type ActionExecutionContext = Context & ActionExecutionMeta; -/** - * Simplified action context for {@link ActionDefinition} - * When defining action consumer may use either it's own Context - * or an ActionExecutionContext to get access to {@link ActionExecutionMeta} params - */ -export type ActionDefinitionContext = Context | ActionExecutionContext; -export interface ActionMenuItemProps { - context: ActionExecutionContext; -} -export type FrequentCompatibilityChangeAction = Action & Required, 'getCompatibilityChangesSubject' | 'couldBecomeCompatible'>>; -export interface Action extends Partial>> { - /** - * Determined the order when there is more than one action matched to a trigger. - * Higher numbers are displayed first. - */ - order?: number; - /** - * A unique identifier for this action instance. - */ - id: string; - /** - * The action type is what determines the context shape. - */ - readonly type: string; - /** - * Optional EUI icon type that can be displayed along with the title. - */ - getIconType(context: ActionExecutionContext): IconType | undefined; - /** - * Returns a title to be displayed to the user. - * @param context - */ - getDisplayName(context: ActionExecutionContext): string; - /** - * Returns a promise that resolves to true if this action is compatible given the context, - * otherwise resolves to false. - */ - isCompatible(context: ActionExecutionContext): Promise; - /** - * Executes the action. - */ - execute(context: ActionExecutionContext): Promise; - /** - * This method should return a link if this item can be clicked on. The link - * is used to navigate user if user middle-clicks it or Ctrl + clicks or - * right-clicks and selects "Open in new tab". - */ - getHref?(context: ActionExecutionContext): Promise; - /** - * Determines if action should be executed automatically, - * without first showing up in context menu. - * false by default. - */ - shouldAutoExecute?(context: ActionExecutionContext): Promise; - /** - * @returns an Observable that emits when this action's compatibility changes. - */ - getCompatibilityChangesSubject?: (context: Context) => Observable | undefined; - /** - * Determines if action could become compatible given the context. If present, - * it should be much more lenient than `isCompatible` and return true if there - * is any chance that `isCompatible` could return true in the future. - */ - couldBecomeCompatible?: (context: Context) => boolean; - /** - * Determines if the action is disabled or not - */ - isDisabled?(context: ActionExecutionContext): boolean; - /** - * @returns an Observable that emits when this action's disabled state should be recalculated. - */ - getDisabledStateChangesSubject?: (context: Context) => Observable | undefined; - /** - * Determines if notification should be shown in menu for that action - * - */ - showNotification?: boolean; - extension?: ActionExtension; -} -/** - * A convenience interface used to register an action. - */ -export type ActionDefinition = Partial>> & { - extension?: ActionExtension; -} & { - /** - * ID of the action that uniquely identifies this action in the actions registry. - */ - readonly id: string; - /** - * ID of the factory for this action. Used to construct dynamic actions. - */ - readonly type?: string; - /** - * Returns a promise that resolves to true if this item is compatible given - * the context and should be displayed to user, otherwise resolves to false. - */ - isCompatible?(context: ActionDefinitionContext): Promise; - /** - * Executes the action. - */ - execute(context: ActionDefinitionContext): Promise; - /** - * Determines if action should be executed automatically, - * without first showing up in context menu. - * false by default. - */ - shouldAutoExecute?(context: ActionDefinitionContext): Promise; - /** - * This method should return a link if this item can be clicked on. The link - * is used to navigate user if user middle-clicks it or Ctrl + clicks or - * right-clicks and selects "Open in new tab". - */ - getHref?(context: ActionDefinitionContext): Promise; - /** - * Determines if the action is disabled or not - */ - isDisabled?(context: ActionDefinitionContext): boolean; - /** - * @returns an Observable that emits when this action's disabled state should be recalculated. - */ - getDisabledStateChangesSubject?: (context: Context) => Observable | undefined; - /** - * Determines if notification should be shown in menu for that action - * - */ - showNotification?: boolean; - /** - * @returns an Observable that emits when this action's compatibility should be recalculated. - */ - getCompatibilityChangesSubject?: (context: Context) => Observable | undefined; - /** - * Determines if action could become compatible given the context. If present, - * it should be much more lenient than `isCompatible` and return true if there - * is any chance that `isCompatible` could return true in the future. - */ - couldBecomeCompatible?: (context: Context) => boolean; -}; -export type ActionContext = A extends ActionDefinition ? Context : never; diff --git a/src/platform/plugins/shared/ui_actions/public/actions/action_internal.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/action_internal.d.ts deleted file mode 100644 index 8cdca56195257..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/actions/action_internal.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type * as React from 'react'; -import type { Presentable, PresentableGrouping } from '@kbn/ui-actions-browser/src/types'; -import type { IconType } from '@elastic/eui'; -import type { Action, ActionDefinition, ActionMenuItemProps } from './action'; -/** - * @internal - */ -export declare class ActionInternal implements Action, Presentable { - readonly definition: ActionDefinition; - readonly id: string; - readonly type: string; - readonly order: number; - readonly MenuItem?: React.FC>; - readonly grouping?: PresentableGrouping; - readonly showNotification?: boolean; - readonly isDisabled: Action['isDisabled']; - readonly getDisabledStateChangesSubject?: Action['getDisabledStateChangesSubject']; - readonly getCompatibilityChangesSubject?: Action['getCompatibilityChangesSubject']; - readonly couldBecomeCompatible?: Action['couldBecomeCompatible']; - errorLogged?: boolean; - readonly extension?: ActionExtension; - constructor(definition: ActionDefinition); - execute(context: Context): Promise; - getIconType(context: Context): IconType | undefined; - getDisplayName(context: Context): string; - getDisplayNameTooltip(context: Context): string; - isCompatible(context: Context): Promise; - getHref(context: Context): Promise; - shouldAutoExecute(context: Context): Promise; -} diff --git a/src/platform/plugins/shared/ui_actions/public/actions/create_action.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/create_action.d.ts deleted file mode 100644 index a00969b066783..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/actions/create_action.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ActionDefinition, Action } from './action'; -export declare function createAction(action: ActionDefinition): Action; diff --git a/src/platform/plugins/shared/ui_actions/public/actions/incompatible_action_error.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/incompatible_action_error.d.ts deleted file mode 100644 index 9f561779d88e9..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/actions/incompatible_action_error.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare class IncompatibleActionError extends Error { - code: string; - constructor(); -} diff --git a/src/platform/plugins/shared/ui_actions/public/actions/index.d.ts b/src/platform/plugins/shared/ui_actions/public/actions/index.d.ts deleted file mode 100644 index cd6d1d4f494ef..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/actions/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type * from './action'; -export * from './action_internal'; -export * from './create_action'; -export * from './incompatible_action_error'; diff --git a/src/platform/plugins/shared/ui_actions/public/context_menu/build_eui_context_menu_panels.d.ts b/src/platform/plugins/shared/ui_actions/public/context_menu/build_eui_context_menu_panels.d.ts deleted file mode 100644 index e2765aa7fd2eb..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/context_menu/build_eui_context_menu_panels.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { EuiContextMenuPanelDescriptor } from '@elastic/eui'; -import type { Trigger } from '../types'; -import type { Action, ActionInternal } from '../actions'; -export declare const defaultTitle: string; -export declare const txtMore: string; -export interface ActionWithContext { - action: Action | ActionInternal; - context: Context; - /** - * Trigger that caused this action - */ - trigger: Trigger; -} -export interface BuildContextMenuParams { - actions: ActionWithContext[]; - title?: string; - closeMenu?: () => void; -} -/** - * Transforms an array of Actions to the shape EuiContextMenuPanel expects. - */ -export declare function buildContextMenuForActions({ actions, title, closeMenu, }: BuildContextMenuParams): Promise; diff --git a/src/platform/plugins/shared/ui_actions/public/context_menu/index.d.ts b/src/platform/plugins/shared/ui_actions/public/context_menu/index.d.ts deleted file mode 100644 index 0412fe6a547ea..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/context_menu/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { buildContextMenuForActions } from './build_eui_context_menu_panels'; -export { openContextMenu } from './open_context_menu'; diff --git a/src/platform/plugins/shared/ui_actions/public/context_menu/open_context_menu.d.ts b/src/platform/plugins/shared/ui_actions/public/context_menu/open_context_menu.d.ts deleted file mode 100644 index ed3a4f8f7b70f..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/context_menu/open_context_menu.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { EuiContextMenuPanelDescriptor } from '@elastic/eui'; -import { EventEmitter } from 'events'; -/** - * Tries to find best position for opening context menu using mousemove and click event - * Returned position is relative to document - */ -export declare function createInteractionPositionTracker(): { - resolveLastPosition: () => { - x: number; - y: number; - }; -}; -/** - * A FlyoutSession describes the session of one opened flyout panel. It offers - * methods to close the flyout panel again. If you open a flyout panel you should make - * sure you call {@link ContextMenuSession#close} when it should be closed. - * Since a flyout could also be closed without calling this method (e.g. because - * the user closes it), you must listen to the "closed" event on this instance. - * It will be emitted whenever the flyout will be closed and you should throw - * away your reference to this instance whenever you receive that event. - * @extends EventEmitter - */ -declare class ContextMenuSession extends EventEmitter { - /** - * Closes the opened flyout as long as it's still the open one. - * If this is not the active session, this method will do nothing. - * If this session was still active and a flyout was closed, the 'closed' - * event will be emitted on this FlyoutSession instance. - */ - close(): void; -} -/** - * Opens a flyout panel with the given component inside. You can use - * {@link ContextMenuSession#close} on the return value to close the flyout. - * - * @param flyoutChildren - Mounts the children inside a fly out panel - * @return {FlyoutSession} The session instance for the opened flyout panel. - */ -export declare function openContextMenu(panels: EuiContextMenuPanelDescriptor[], props?: { - closeButtonAriaLabel?: string; - onClose?: () => void; - 'data-test-subj'?: string; -}): ContextMenuSession; -export { ContextMenuSession }; diff --git a/src/platform/plugins/shared/ui_actions/public/index.d.ts b/src/platform/plugins/shared/ui_actions/public/index.d.ts deleted file mode 100644 index cc08a54459520..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import { UiActionsPlugin } from './plugin'; -export declare function plugin(initializerContext: PluginInitializerContext): UiActionsPlugin; -export type { UiActionsPublicSetup as UiActionsSetup, UiActionsPublicStart as UiActionsStart, } from './plugin'; -export type { Action, ActionDefinition as UiActionsActionDefinition } from './actions'; -export { ActionInternal, createAction, IncompatibleActionError } from './actions'; -export { buildContextMenuForActions } from './context_menu'; -export type { Presentable as UiActionsPresentable, PresentableGroup as UiActionsPresentableGroup, PresentableGrouping as UiActionsPresentableGrouping, } from '@kbn/ui-actions-browser/src/types'; -export type { Trigger, RowClickContext, VisualizeFieldContext } from './types'; -export { ACTION_VISUALIZE_FIELD, ACTION_VISUALIZE_GEO_FIELD, ACTION_VISUALIZE_LENS_FIELD, } from './types'; -export type { ActionExecutionContext, ActionExecutionMeta, ActionMenuItemProps, FrequentCompatibilityChangeAction, } from './actions'; -export { triggers } from './triggers'; diff --git a/src/platform/plugins/shared/ui_actions/public/plugin.d.ts b/src/platform/plugins/shared/ui_actions/public/plugin.d.ts deleted file mode 100644 index f5f5c59d4e2fd..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/plugin.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { CoreStart, CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { PublicMethodsOf } from '@kbn/utility-types'; -import { UiActionsService } from './service'; -export type UiActionsPublicSetup = Pick; -export type UiActionsPublicStart = PublicMethodsOf; -export interface UiActionsPublicSetupDependencies { -} -export interface UiActionsPublicStartDependencies { -} -export declare class UiActionsPlugin implements Plugin { - private readonly service; - constructor(_initializerContext: PluginInitializerContext); - setup(_core: CoreSetup): UiActionsPublicSetup; - start(core: CoreStart): UiActionsPublicStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/ui_actions/public/service/index.d.ts b/src/platform/plugins/shared/ui_actions/public/service/index.d.ts deleted file mode 100644 index 1ed7801f9e4f2..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/service/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ui_actions_service'; diff --git a/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.d.ts b/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.d.ts deleted file mode 100644 index a1a82ba55d016..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Trigger } from '../types'; -import type { Action } from '../actions'; -export declare class UiActionsExecutionService { - private readonly batchingQueue; - private readonly pendingTasks; - constructor(); - execute({ action, context, trigger, }: { - action: Action; - context: object; - trigger: Trigger; - }, alwaysShowPopup?: boolean): Promise; - private scheduleFlush; - private executeSingleTask; - private showActionPopupMenu; -} diff --git a/src/platform/plugins/shared/ui_actions/public/service/ui_actions_service.d.ts b/src/platform/plugins/shared/ui_actions/public/service/ui_actions_service.d.ts deleted file mode 100644 index 53ba3f8149725..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/service/ui_actions_service.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { Trigger, ActionRegistry, TriggerToActionsRegistry } from '../types'; -import type { Action, ActionDefinition, FrequentCompatibilityChangeAction } from '../actions'; -import { UiActionsExecutionService } from './ui_actions_execution_service'; -export interface UiActionsServiceParams { - readonly actions?: ActionRegistry; - /** - * A 1-to-N mapping from `Trigger` to zero or more `Action`. - */ - readonly triggerToActions?: TriggerToActionsRegistry; -} -export declare class UiActionsService { - readonly executionService: UiActionsExecutionService; - protected readonly actions: ActionRegistry; - protected readonly triggerToActions: TriggerToActionsRegistry; - constructor({ actions, triggerToActions }?: UiActionsServiceParams); - readonly getTrigger: (triggerId: string) => Trigger; - readonly registerActionAsync: (id: string, getDefinition: () => Promise>) => void; - readonly unregisterAction: (actionId: string) => void; - readonly hasAction: (actionId: string) => boolean; - readonly attachAction: (triggerId: string, actionId: string) => void; - readonly detachAction: (triggerId: string, actionId: string) => void; - /** - * `addTriggerActionAsync` is similar to `attachAction` as it attaches action to a - * trigger, but it also registers the action, if it has not been registered, yet. - */ - readonly addTriggerActionAsync: (triggerId: string, actionId: string, getDefinition: () => Promise>) => void; - readonly getAction: (id: string) => Promise; - readonly getTriggerActions: (triggerId: string) => Promise; - readonly getTriggerCompatibleActions: (triggerId: string, context: object) => Promise; - readonly getFrequentlyChangingActionsForTrigger: (triggerId: string, context: object) => Promise; - readonly executeTriggerActions: (triggerId: string, context: object, alwaysShowPopup?: boolean) => Promise; - /** - * Removes all registered triggers and actions. - */ - readonly clear: () => void; - /** - * "Fork" a separate instance of `UiActionsService` that inherits all existing - * triggers and actions, but going forward all new triggers and actions added - * to this instance of `UiActionsService` are only available within this instance. - */ - readonly fork: () => UiActionsService; -} diff --git a/src/platform/plugins/shared/ui_actions/public/services.d.ts b/src/platform/plugins/shared/ui_actions/public/services.d.ts deleted file mode 100644 index 04b64a60f5552..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/services.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AnalyticsServiceStart, I18nStart, ThemeServiceSetup, UserProfileService } from '@kbn/core/public'; -export declare const getAnalytics: import("@kbn/kibana-utils-plugin/public").Get, setAnalytics: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getI18n: import("@kbn/kibana-utils-plugin/public").Get, setI18n: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getNotifications: import("@kbn/kibana-utils-plugin/public").Get, setNotifications: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getTheme: import("@kbn/kibana-utils-plugin/public").Get, setTheme: import("@kbn/kibana-utils-plugin/public").Set; -export declare const getUserProfile: import("@kbn/kibana-utils-plugin/public").Get, setUserProfile: import("@kbn/kibana-utils-plugin/public").Set; diff --git a/src/platform/plugins/shared/ui_actions/public/triggers.d.ts b/src/platform/plugins/shared/ui_actions/public/triggers.d.ts deleted file mode 100644 index a766f5a602939..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/triggers.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Trigger } from './types'; -export declare const triggers: { - [key: string]: Trigger; -}; diff --git a/src/platform/plugins/shared/ui_actions/public/types.d.ts b/src/platform/plugins/shared/ui_actions/public/types.d.ts deleted file mode 100644 index 8ca85e9f6538e..0000000000000 --- a/src/platform/plugins/shared/ui_actions/public/types.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { EmbeddableApiContext } from '@kbn/presentation-publishing'; -import type { Datatable } from '@kbn/expressions-plugin/common'; -import type { DatatableColumn } from '@kbn/expressions-plugin/common'; -import type { AggregateQuery } from '@kbn/es-query'; -import type { DataViewSpec } from '@kbn/data-views-plugin/public'; -import type { ActionInternal } from './actions/action_internal'; -export type ActionRegistry = Map Promise>; -export type TriggerToActionsRegistry = Map; -export interface VisualizeFieldContext { - fieldName: string; - dataViewSpec: DataViewSpec; - contextualFields?: string[]; - textBasedColumns?: DatatableColumn[]; - originatingApp?: string; - query?: AggregateQuery; -} -export declare const ACTION_VISUALIZE_FIELD = "ACTION_VISUALIZE_FIELD"; -export declare const ACTION_VISUALIZE_GEO_FIELD = "ACTION_VISUALIZE_GEO_FIELD"; -export declare const ACTION_VISUALIZE_LENS_FIELD = "ACTION_VISUALIZE_LENS_FIELD"; -export interface Trigger { - /** - * Unique name of the trigger as identified in `ui_actions` plugin trigger registry. - */ - id: string; - /** - * User friendly name of the trigger. - */ - title?: string; - /** - * A longer user friendly description of the trigger. - */ - description?: string; -} -export type RowClickContext = Partial & { - data: { - /** - * Row index, starting from 0, where user clicked. - */ - rowIndex: number; - table: Datatable; - /** - * Sorted list column IDs that were visible to the user. Useful when only - * a subset of datatable columns should be used. - */ - columns?: string[]; - }; -}; diff --git a/src/platform/plugins/shared/usage_collection/common/application_usage.d.ts b/src/platform/plugins/shared/usage_collection/common/application_usage.d.ts deleted file mode 100644 index b4f75a88a7436..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/application_usage.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const getDailyId: ({ appId, dayId, viewId, }: { - viewId: string; - appId: string; - dayId: string; -}) => string; diff --git a/src/platform/plugins/shared/usage_collection/common/constants.d.ts b/src/platform/plugins/shared/usage_collection/common/constants.d.ts deleted file mode 100644 index 54d5e50ed5c5c..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const KIBANA_STATS_TYPE = "kibana_stats"; -export declare const DEFAULT_MAXIMUM_WAIT_TIME_FOR_ALL_COLLECTORS_IN_S = 1; -export declare const MAIN_APP_DEFAULT_VIEW_ID = "main"; -export declare const USAGE_COUNTERS_BACKOFF_DELAY_IN_MS = 500; diff --git a/src/platform/plugins/shared/usage_collection/common/index.d.ts b/src/platform/plugins/shared/usage_collection/common/index.d.ts deleted file mode 100644 index 024bf28844abe..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { UsageCounters } from './types'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/index.d.ts b/src/platform/plugins/shared/usage_collection/common/types/index.d.ts deleted file mode 100644 index c2219391768ee..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type * as Stats from './stats'; -export type * as UiCounters from './ui_counters'; -export type * as UsageCounters from './usage_counters'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/stats/core_metrics.d.ts b/src/platform/plugins/shared/usage_collection/common/types/stats/core_metrics.d.ts deleted file mode 100644 index 2df967b5ece16..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/stats/core_metrics.d.ts +++ /dev/null @@ -1,200 +0,0 @@ -/** - * The types are exact duplicates of the ops metrics types declared in core needed for reporting in the stats api. - * We use a copy of these to detect changes in the ops metrics reported from core - * See src/core/packages/metrics/server/index.ts - */ -/** - * an IntervalHistogram object that samples and reports the event loop delay over time. - * The delays will be reported in milliseconds. - * See {@link IntervalHistogram} - * @public - */ -export interface IntervalHistogram { - fromTimestamp: string; - lastUpdatedAt: string; - min: number; - max: number; - mean: number; - exceeds: number; - stddev: number; - percentiles: { - 50: number; - 75: number; - 95: number; - 99: number; - }; -} -/** - * See {@link ElasticsearchClientProtocol} - * Protocol(s) used by the Elasticsearch Client - * @public - */ -export type ElasticsearchClientProtocol = 'none' | 'http' | 'https' | 'mixed'; -/** - * See {@link ElasticsearchClientsMetrics} - * Metrics related to the elasticsearch clients - * @public - */ -export interface ElasticsearchClientsMetrics { - /** Total number of active sockets (all nodes, all connections) */ - totalActiveSockets: number; - /** Total number of available sockets (alive but idle, all nodes, all connections) */ - totalIdleSockets: number; - /** Total number of queued requests (all nodes, all connections) */ - totalQueuedRequests: number; -} -/** - * See {@link OpsProcessMetrics} - * Process related metrics - * @public - */ -export interface OpsProcessMetrics { - /** pid of the kibana process */ - pid: number; - /** process memory usage */ - memory: { - /** heap memory usage */ - heap: { - /** total heap available */ - total_in_bytes: number; - /** used heap */ - used_in_bytes: number; - /** v8 heap size limit */ - size_limit: number; - }; - /** node rss */ - resident_set_size_in_bytes: number; - /** memory usage of C++ objects bound to JavaScript objects managed by V8 */ - external_in_bytes: number; - /** memory allocated for array buffers. This is also included in the external value*/ - array_buffers_in_bytes: number; - }; - /** max event loop delay since last collection */ - event_loop_delay: number; - /** node event loop delay histogram since last collection */ - event_loop_delay_histogram: IntervalHistogram; - /** uptime of the kibana process */ - uptime_in_millis: number; -} -/** - * See {@link OpsOsMetrics} - * OS related metrics - * @public - */ -export interface OpsOsMetrics { - /** The os platform */ - platform: NodeJS.Platform; - /** The os platform release, prefixed by the platform name */ - platformRelease: string; - /** The os distrib. Only present for linux platforms */ - distro?: string; - /** The os distrib release, prefixed by the os distrib. Only present for linux platforms */ - distroRelease?: string; - /** cpu load metrics */ - load: { - /** load for last minute */ - '1m': number; - /** load for last 5 minutes */ - '5m': number; - /** load for last 15 minutes */ - '15m': number; - }; - /** system memory usage metrics */ - memory: { - /** total memory available */ - total_in_bytes: number; - /** current free memory */ - free_in_bytes: number; - /** current used memory */ - used_in_bytes: number; - }; - /** the OS uptime */ - uptime_in_millis: number; - /** cpu accounting metrics, undefined when not running in a cgroup */ - cpuacct?: { - /** name of this process's cgroup */ - control_group: string; - /** cpu time used by this process's cgroup */ - usage_nanos: number; - }; - /** cpu cgroup metrics, undefined when not running in a cgroup */ - cpu?: { - /** name of this process's cgroup */ - control_group: string; - /** the length of the cfs period */ - cfs_period_micros: number; - /** total available run-time within a cfs period */ - cfs_quota_micros: number; - /** current stats on the cfs periods */ - stat: { - /** number of cfs periods that elapsed */ - number_of_elapsed_periods: number; - /** number of times the cgroup has been throttled */ - number_of_times_throttled: number; - /** total amount of time the cgroup has been throttled for */ - time_throttled_nanos: number; - }; - }; - /** memory cgroup metrics, undefined when not running in cgroup v2 */ - cgroup_memory?: { - /** The total amount of memory currently being used by the cgroup and its descendants. */ - current_in_bytes: number; - /** The total amount of swap currently being used by the cgroup and its descendants. */ - swap_current_in_bytes: number; - }; -} -/** - * {@link OpsServerMetrics} - * server related metrics - * @public - */ -export interface OpsServerMetrics { - /** server response time stats */ - response_times: { - /** average response time */ - avg_in_millis: number; - /** maximum response time */ - max_in_millis: number; - }; - /** server requests stats */ - requests: { - /** number of disconnected requests since startup */ - disconnects: number; - /** total number of requests handled since startup */ - total: number; - /** number of request handled per response status code */ - statusCodes: Record; - }; - /** number of current concurrent connections to the server */ - concurrent_connections: number; -} -/** - * {@link OpsMetrics} - * Regroups metrics gathered by all the collectors. - * This contains metrics about the os/runtime, the kibana process and the http server. - - * @public - */ -export interface OpsMetrics { - /** Time metrics were recorded at. */ - collected_at: Date; - /** - * Metrics related to the elasticsearch client - */ - elasticsearch_client: ElasticsearchClientsMetrics; - /** - * Process related metrics. - * @remarks processes field preferred - */ - process: OpsProcessMetrics; - /** Process related metrics. Reports an array of objects for each kibana pid.*/ - processes: OpsProcessMetrics[]; - /** OS related metrics */ - os: OpsOsMetrics; - /** server response time stats */ - response_times: OpsServerMetrics['response_times']; - /** server requests stats */ - requests: OpsServerMetrics['requests']; - /** number of current concurrent connections to the server */ - concurrent_connections: OpsServerMetrics['concurrent_connections']; -} diff --git a/src/platform/plugins/shared/usage_collection/common/types/stats/index.d.ts b/src/platform/plugins/shared/usage_collection/common/types/stats/index.d.ts deleted file mode 100644 index 291374f591a63..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/stats/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * as v1 from './v1'; -export type * from './latest'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/stats/latest.d.ts b/src/platform/plugins/shared/usage_collection/common/types/stats/latest.d.ts deleted file mode 100644 index 27ff62df5012c..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/stats/latest.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * as OpsMetricsCopy from './core_metrics'; -export type * from './v1'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/stats/v1.d.ts b/src/platform/plugins/shared/usage_collection/common/types/stats/v1.d.ts deleted file mode 100644 index 16bd1b8e920f8..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/stats/v1.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type * as OpsMetricsCopy from './core_metrics'; -/** v1 types Start */ -/** - * stats query v1 - * @remarks exclude_usage is always interpreted as true. query param retained to prevent breaking changes to existing consumers. - */ -export interface StatsHTTPQuery { - extended?: boolean | ''; - legacy?: boolean | ''; - exclude_usage?: boolean | ''; -} -export interface UsageObject { - kibana?: UsageObject; - xpack?: UsageObject; - [key: string]: unknown | UsageObject; -} -export interface ClusterUuidLegacy { - clusterUuid?: string; -} -export interface ClusterUuid { - cluster_uuid?: string; -} -/** - * Extended usage stats. - * @remarks - * Legacy implementation used to conditionally include kibana usage metrics - * as of https://github.com/elastic/kibana/pull/151082, usage is no longer reported - * and set to an empty object to prevent breaking changes to existing consumers. - */ -export interface ExtendedStats { - [key: string]: unknown | UsageObject; - clusterUuid?: string; - cluster_uuid?: string; -} -/** - * OpsMetrics: aliased from a duplicate of core's OpsMetrics types - * @remarks the alternative to creating a local copy of the OpsMetrics types is to declare them as `unknown` and assume validation happens elsewhere. - * The disadvantage is that any changes made to the original OpsMetrics will be passed through without needing to update the API types. - */ -export type LastOpsMetrics = OpsMetricsCopy.OpsMetrics; -export type KibanaServiceStatus = Record; -/** explicitly typed stats for kibana */ -export interface KibanaStats { - kibana: { - uuid: string; - name: string; - index: string; - host: string; - locale: string; - transport_address: string; - version: string; - snapshot: boolean; - status: string; - }; -} -/** Stats response body */ -export type StatsHTTPBodyTyped = LastOpsMetrics | KibanaStats | ExtendedStats; diff --git a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/index.d.ts b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/index.d.ts deleted file mode 100644 index 291374f591a63..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * as v1 from './v1'; -export type * from './latest'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/latest.d.ts b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/latest.d.ts deleted file mode 100644 index 18944dc1d81e5..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/latest.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * as v1 from './v1'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/v1.d.ts b/src/platform/plugins/shared/usage_collection/common/types/ui_counters/v1.d.ts deleted file mode 100644 index 793cc4270d263..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/ui_counters/v1.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * ui_counters query v1 - * @remarks - */ -export interface UiCountersRequestBody { - report: { - reportVersion?: 3; - userAgent?: Record>; - uiCounter?: Record>; - application_usage?: Record>; - }; -} -/** explicit response type for store report success. The status value is hardcoded. */ -export interface UiCountersResponseOk { - status: 'ok'; -} -/** explicit response type for store report fail. The status value is hardcoded. */ -export interface UiCountersResponseFail { - status: 'fail'; -} diff --git a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/index.d.ts b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/index.d.ts deleted file mode 100644 index 291374f591a63..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * as v1 from './v1'; -export type * from './latest'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/latest.d.ts b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/latest.d.ts deleted file mode 100644 index f2a121bd50e6a..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/latest.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './v1'; diff --git a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/v1.d.ts b/src/platform/plugins/shared/usage_collection/common/types/usage_counters/v1.d.ts deleted file mode 100644 index e4016363cd31d..0000000000000 --- a/src/platform/plugins/shared/usage_collection/common/types/usage_counters/v1.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -export type CounterEventSource = 'server' | 'ui'; -export interface AbstractCounter { - /** The domainId used to create the Counter API */ - domainId: string; - /** The name of the counter */ - counterName: string; - /** The type of counter (defaults to 'count') */ - counterType: string; - /** The source of this counter: 'server' | 'ui' */ - source: CounterEventSource; - /** Namespace associated to this counter */ - namespace?: string; -} -export interface CounterMetric extends AbstractCounter { - /** Amount of units to increment this counter */ - incrementBy: number; -} -/** - * Details about the counter to be incremented - */ -export interface IncrementCounterParams { - /** The namespace to increment this counter on */ - namespace?: string; - /** The name of the counter **/ - counterName: string; - /** The counter type ("count" by default) **/ - counterType?: string; - /** The source of the event we are counting */ - source?: CounterEventSource; - /** Increment the counter by this number (1 if not specified) **/ - incrementBy?: number; -} diff --git a/src/platform/plugins/shared/usage_collection/public/components/index.d.ts b/src/platform/plugins/shared/usage_collection/public/components/index.d.ts deleted file mode 100644 index 395a70a5e754f..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/components/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { TrackApplicationView } from './track_application_view'; -export type { TrackApplicationViewProps } from './track_application_view'; diff --git a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/index.d.ts b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/index.d.ts deleted file mode 100644 index 48bf0162eb73e..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { TrackApplicationViewProps } from './types'; -export { ApplicationUsageContext, TrackApplicationView } from './track_application_view'; diff --git a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view.d.ts b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view.d.ts deleted file mode 100644 index 0b1a8d3b897e9..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { FC } from 'react'; -import React from 'react'; -import type { IApplicationUsageTracker } from '../../plugin'; -import type { TrackApplicationViewProps } from './types'; -export declare const ApplicationUsageContext: React.Context; -/** - * React component to track the number of clicks and minutes on screen of the children components. - * @param props {@link TrackApplicationViewProps} - * @constructor - */ -export declare const TrackApplicationView: FC; diff --git a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view_component.d.ts b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view_component.d.ts deleted file mode 100644 index f9828df6e6148..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/track_application_view_component.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import type { IApplicationUsageTracker } from '../../plugin'; -import type { TrackApplicationViewProps } from './types'; -interface Props extends TrackApplicationViewProps { - applicationUsageTracker?: IApplicationUsageTracker; -} -export declare class TrackApplicationViewComponent extends React.Component { - private parentNode; - onClick: (e: MouseEvent) => void; - componentDidMount(): void; - componentWillUnmount(): void; - render(): React.ReactNode; -} -export {}; diff --git a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/types.d.ts b/src/platform/plugins/shared/usage_collection/public/components/track_application_view/types.d.ts deleted file mode 100644 index fec891ee964f4..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/components/track_application_view/types.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ReactNode } from 'react'; -/** - * Props to provide to the {@link TrackApplicationView} component. - * @public - */ -export interface TrackApplicationViewProps { - /** - * The name of the view to be tracked. The appId will be obtained automatically. - * @public - */ - viewId: string; - /** - * The React component to be tracked. - * @public - */ - children: ReactNode; -} diff --git a/src/platform/plugins/shared/usage_collection/public/index.d.ts b/src/platform/plugins/shared/usage_collection/public/index.d.ts deleted file mode 100644 index 8f93a62db9366..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import { UsageCollectionPlugin } from './plugin'; -export type { UsageCollectionSetup, UsageCollectionStart } from './plugin'; -export { TrackApplicationView } from './components'; -export type { TrackApplicationViewProps } from './components'; -export declare function plugin(initializerContext: PluginInitializerContext): UsageCollectionPlugin; diff --git a/src/platform/plugins/shared/usage_collection/public/plugin.d.ts b/src/platform/plugins/shared/usage_collection/public/plugin.d.ts deleted file mode 100644 index c84c0303d93a5..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/plugin.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { ApplicationUsageTracker } from '@kbn/analytics'; -import type { UiCounterMetricType } from '@kbn/analytics'; -import type { FC, PropsWithChildren } from 'react'; -import type { PluginInitializerContext, Plugin, CoreSetup, CoreStart, HttpSetup } from '@kbn/core/public'; -import type { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; -export interface PublicConfigType { - uiCounters: { - enabled: boolean; - debug: boolean; - }; -} -export type IApplicationUsageTracker = Pick; -interface UsageCollectionStartDependencies { - screenshotMode: ScreenshotModePluginStart; -} -/** Public's setup APIs exposed by the UsageCollection Service **/ -export interface UsageCollectionSetup { - /** Component helpers to track usage collection in the UI **/ - components: { - /** - * The context provider to wrap the application if planning to use - * {@link TrackApplicationView} somewhere inside the app. - * - * @example - * ```typescript jsx - * class MyPlugin implements Plugin { - * ... - * public setup(core: CoreSetup, plugins: { usageCollection?: UsageCollectionSetup }) { - * const ApplicationUsageTrackingProvider = plugins.usageCollection?.components.ApplicationUsageTrackingProvider ?? React.Fragment; - * - * core.application.register({ - * id, - * title, - * ..., - * mount: async (params: AppMountParameters) => { - * ReactDOM.render( - * // Set the tracking context provider at the App level - * - * - * - * , - * element - * ); - * return () => ReactDOM.unmountComponentAtNode(element); - * }, - * }); - * } - * ... - * } - * ``` - */ - ApplicationUsageTrackingProvider: FC>; - }; - /** Report whenever a UI event occurs for UI counters to report it **/ - reportUiCounter: (appName: string, type: UiCounterMetricType, eventNames: string | string[], count?: number) => void; -} -/** Public's start APIs exposed by the UsageCollection Service **/ -export interface UsageCollectionStart { - /** Report whenever a UI event occurs for UI counters to report it **/ - reportUiCounter: (appName: string, type: UiCounterMetricType, eventNames: string | string[], count?: number) => void; -} -export declare function isUnauthenticated(http: HttpSetup): boolean; -export declare class UsageCollectionPlugin implements Plugin { - private readonly initContext; - private applicationUsageTracker?; - private subscriptions; - private reporter?; - private config; - constructor(initContext: PluginInitializerContext); - setup({ http }: CoreSetup): UsageCollectionSetup; - start({ http, application }: CoreStart, { screenshotMode }: UsageCollectionStartDependencies): { - reportUiCounter: (appName: string, type: string, eventNames: string | string[], count?: number) => void; - }; - stop(): void; - private getPublicApplicationUsageTracker; -} -export {}; diff --git a/src/platform/plugins/shared/usage_collection/public/services/application_usage.d.ts b/src/platform/plugins/shared/usage_collection/public/services/application_usage.d.ts deleted file mode 100644 index 6d53391f2e104..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/services/application_usage.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { ApplicationUsageTracker } from '@kbn/analytics'; -export declare function trackApplicationUsageChange(currentAppId$: Observable, applicationUsageTracker: Pick): import("rxjs").Subscription[]; diff --git a/src/platform/plugins/shared/usage_collection/public/services/create_reporter.d.ts b/src/platform/plugins/shared/usage_collection/public/services/create_reporter.d.ts deleted file mode 100644 index 02b394404860e..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/services/create_reporter.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Logger } from '@kbn/logging'; -import type { Storage } from '@kbn/analytics'; -import { Reporter } from '@kbn/analytics'; -import type { HttpSetup } from '@kbn/core/public'; -interface AnalyticsReporterConfig { - localStorage: Storage; - logger: Logger; - fetch: HttpSetup; -} -export declare function createReporter(config: AnalyticsReporterConfig): Reporter; -export {}; diff --git a/src/platform/plugins/shared/usage_collection/public/services/index.d.ts b/src/platform/plugins/shared/usage_collection/public/services/index.d.ts deleted file mode 100644 index 9f25d6654da01..0000000000000 --- a/src/platform/plugins/shared/usage_collection/public/services/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { createReporter } from './create_reporter'; -export { trackApplicationUsageChange } from './application_usage'; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector.d.ts deleted file mode 100644 index 8c5121907589e..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/collector.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { CollectorFetchMethod, CollectorOptions, ICollector } from './types'; -export declare class Collector implements ICollector { - readonly log: Logger; - readonly type: CollectorOptions['type']; - readonly fetch: CollectorFetchMethod; - readonly isReady: CollectorOptions['isReady']; - /** - * @internal Constructor of a Collector. It should be called via the CollectorSet factory methods: `makeStatsCollector` and `makeUsageCollector` - * @param log {@link Logger} - * @param collectorDefinition {@link CollectorOptions} - */ - constructor(log: Logger, { type, fetch, isReady, ...options }: CollectorOptions); -} diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector_set.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector_set.d.ts deleted file mode 100644 index ec315fd13c2d2..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/collector_set.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import type { Logger, ElasticsearchClient, SavedObjectsClientContract, ExecutionContextSetup } from '@kbn/core/server'; -import { Collector } from './collector'; -import type { ICollector, CollectorOptions, ICollectorSet } from './types'; -import { UsageCollector, type UsageCollectorOptions } from './usage_collector'; -type AnyCollector = ICollector; -export interface CollectorSetConfig { - logger: Logger; - executionContext: ExecutionContextSetup; - maximumWaitTimeForAllCollectorsInS?: number; - collectors?: AnyCollector[]; - maxCollectorConcurrency?: number; -} -export declare class CollectorSet implements ICollectorSet { - private readonly logger; - private readonly executionContext; - private readonly maximumWaitTimeForAllCollectorsInS; - private readonly collectors; - private readonly fetchingCollectors; - private readonly maxCollectorConcurrency; - constructor({ logger, executionContext, maximumWaitTimeForAllCollectorsInS, collectors, maxCollectorConcurrency, }: CollectorSetConfig); - /** - * Instantiates a stats collector with the definition provided in the options - * @param options Definition of the collector {@link CollectorOptions} - */ - makeStatsCollector: (options: CollectorOptions) => Collector; - /** - * Instantiates an usage collector with the definition provided in the options - * @param options Definition of the collector {@link CollectorOptions} - */ - makeUsageCollector: (options: UsageCollectorOptions) => UsageCollector; - /** - * Registers a collector to be used when collecting all the usage and stats data - * @param collector Collector to be added to the set (previously created via `makeUsageCollector` or `makeStatsCollector`) - */ - registerCollector: (collector: Collector) => void; - getCollectorByType: (type: string) => AnyCollector | undefined; - private getReadyCollectors; - private fetchCollector; - bulkFetch: (esClient: ElasticsearchClient, soClient: SavedObjectsClientContract, collectors?: Map) => Promise<{ - type: string; - result: unknown; - }[]>; - private getFilteredCollectorSet; - bulkFetchUsage: (esClient: ElasticsearchClient, savedObjectsClient: SavedObjectsClientContract) => Promise<{ - type: string; - result: unknown; - }[]>; - /** - * Convert an array of fetched stats results into key/object - * @param statsData Array of fetched stats results - */ - toObject: , T = unknown>(statsData?: Array<{ - type: string; - result: T; - }>) => Result; - /** - * Rename fields to use API conventions - * @param apiData Data to be normalized - */ - toApiFieldNames: (apiData: Record | unknown[]) => Record | unknown[]; - private getValueOrRecurse; - private makeCollectorSetFromArray; -} -export {}; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/index.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/index.d.ts deleted file mode 100644 index ac1a55fa9c364..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { usageCollectorsStatsCollector } from './usage_collector_stats_collector'; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/schema.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/schema.d.ts deleted file mode 100644 index d9da8c1f7b471..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/schema.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { MakeSchemaFrom } from '../types'; -import type { CollectorsStats } from './usage_collector_stats_collector'; -export declare const collectorsStatsSchema: MakeSchemaFrom; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/usage_collector_stats_collector.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/usage_collector_stats_collector.d.ts deleted file mode 100644 index f188d454a0899..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/collector_stats/usage_collector_stats_collector.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { ICollectorSet } from '../types'; -export interface CollectorsStats { - not_ready: { - count: number; - names: string[]; - }; - not_ready_timeout: { - count: number; - names: string[]; - }; - succeeded: { - count: number; - names: string[]; - }; - failed: { - count: number; - names: string[]; - }; - total_duration: number; - total_is_ready_duration: number; - total_fetch_duration: number; - is_ready_duration_breakdown: Array<{ - name: string; - duration: number; - }>; - fetch_duration_breakdown: Array<{ - name: string; - duration: number; - }>; -} -export interface CollectorsStatsCollectorParams { - nonReadyCollectorTypes: string[]; - timedOutCollectorsTypes: string[]; - isReadyExecutionDurationByType: Array<{ - duration: number; - type: string; - }>; - fetchExecutionDurationByType: Array<{ - duration: number; - type: string; - status: 'failed' | 'success'; - }>; -} -export declare const usageCollectorsStatsCollector: (usageCollection: Pick, { nonReadyCollectorTypes, timedOutCollectorsTypes, isReadyExecutionDurationByType, fetchExecutionDurationByType, }: CollectorsStatsCollectorParams) => import("../types").ICollector; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/index.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/index.d.ts deleted file mode 100644 index d9ca823af4281..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { ICollectorSet } from './types'; -export { CollectorSet } from './collector_set'; -export type { AllowedSchemaTypes, AllowedSchemaNumberTypes, AllowedSchemaBooleanTypes, AllowedSchemaStringTypes, RecursiveMakeSchemaFrom, MakeSchemaFrom, CollectorOptions, CollectorFetchContext, CollectorFetchMethod, ICollector as Collector, } from './types'; -export type { UsageCollectorOptions } from './usage_collector'; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/measure_duration.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/measure_duration.d.ts deleted file mode 100644 index 18961c6a5dd3e..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/measure_duration.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare const createPerformanceObsHook: () => () => Record; -/** - * A wrapper around performance.timerify which defined the name of the returned - * wrapped function to help identify observed function types inside the `PerformanceObserver`. - * - * @param name name of the function used to track the performance of the function execution - * @param fn the function to be wrapped by the performance.timerify method. - * @returns - */ -export declare const perfTimerify: unknown>(name: string, fn: T) => T; diff --git a/src/platform/plugins/shared/usage_collection/server/collector/types.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/types.d.ts deleted file mode 100644 index 346c09cb45535..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/types.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -import type { ElasticsearchClient, SavedObjectsClientContract, Logger } from '@kbn/core/server'; -import type { PossibleSchemaTypes, SchemaMetaOptional } from '@elastic/ebt/client'; -export type { AllowedSchemaTypes, AllowedSchemaStringTypes, AllowedSchemaBooleanTypes, AllowedSchemaNumberTypes, PossibleSchemaTypes, } from '@elastic/ebt/client'; -import type { Collector, UsageCollectorOptions } from '.'; -/** - * Interface to register and manage Usage Collectors through a CollectorSet - */ -export interface ICollectorSet { - /** - * Creates a usage collector to collect plugin telemetry data. - * registerCollector must be called to connect the created collector with the service. - */ - makeUsageCollector: (options: UsageCollectorOptions) => Collector; - /** - * Register a usage collector or a stats collector. - * Used to connect the created collector to telemetry. - */ - registerCollector: (collector: Collector) => void; - /** - * Returns a usage collector by type - */ - getCollectorByType: (type: string) => Collector | undefined; - /** - * Fetches the collection from all the registered collectors - * @internal: telemetry use - */ - bulkFetch: (esClient: ElasticsearchClient, soClient: SavedObjectsClientContract, collectors?: Map>) => Promise>; - /** - * Converts an array of fetched stats results into key/object - * @internal: telemetry use - */ - toObject: , T = unknown>(statsData?: Array<{ - type: string; - result: T; - }>) => Result; - /** - * Rename fields to use API conventions - * @internal: monitoring use - */ - toApiFieldNames: (apiData: Record | unknown[]) => Record | unknown[]; - /** - * Creates a stats collector to collect plugin telemetry data. - * registerCollector must be called to connect the created collector with the service. - * @internal: telemetry and monitoring use - */ - makeStatsCollector: (options: CollectorOptions) => Collector; -} -/** - * Helper to find out whether to keep recursively looking or if we are on an end value - */ -export type RecursiveMakeSchemaFrom = U extends object ? Record extends U ? { - type: 'pass_through'; - _meta: { - description: string; - } & SchemaMetaOptional; -} | MakeSchemaFrom : MakeSchemaFrom : RequireMeta extends true ? { - type: PossibleSchemaTypes; - _meta: { - description: string; - }; -} : { - type: PossibleSchemaTypes; - _meta?: { - description: string; - }; -}; -/** - * The `schema` property in {@link CollectorOptions} must match the output of - * the `fetch` method. This type helps ensure that is correct - */ -export type MakeSchemaFrom = { - [Key in keyof Required]: Required[Key] extends Array ? { - type: 'array'; - items: RecursiveMakeSchemaFrom; - } : RecursiveMakeSchemaFrom[Key], RequireMeta>; -}; -/** - * The context for the `fetch` method: It includes the most commonly used clients in the collectors (ES and SO clients). - * Both are scoped based on the request and the context: - * - When users are requesting a sample of data, it is scoped to their role to avoid exposing data they shouldn't read - * - When building the telemetry data payload to report to the remote cluster, the requests are scoped to the `kibana` internal user - * - * @remark Bear in mind when testing your collector that your user has the same privileges as the Kibana Internal user to ensure the expected data is sent to the remote cluster. - */ -export interface CollectorFetchContext { - /** - * Request-scoped Elasticsearch client - * @remark Bear in mind when testing your collector that your user has the same privileges as the Kibana Internal user to ensure the expected data is sent to the remote cluster (more info: {@link CollectorFetchContext}) - */ - esClient: ElasticsearchClient; - /** - * Request-scoped Saved Objects client - * @remark Bear in mind when testing your collector that your user has the same privileges as the Kibana Internal user to ensure the expected data is sent to the remote cluster (more info: {@link CollectorFetchContext}) - */ - soClient: SavedObjectsClientContract; -} -/** - * The fetch method has the context of the Collector itself - * (this has access to all the properties of the collector like the logger) - * and the first parameter is {@link CollectorFetchContext}. - */ -export type CollectorFetchMethod = (this: ICollector & ExtraOptions, // Specify the context of `this` for this.log and others to become available -context: CollectorFetchContext) => Promise | TReturn; -/** - * Options to instantiate a collector - */ -export type CollectorOptions = { - /** - * Unique string identifier for the collector - */ - type: string; - /** - * Method to return `true`/`false` or Promise(`true`/`false`) to confirm if the collector is ready for the `fetch` method to be called. - */ - isReady: () => Promise | boolean; - /** - * Schema definition of the output of the `fetch` method. - */ - schema?: MakeSchemaFrom; - /** - * The method that will collect and return the data in the final format. - * @param collectorFetchContext {@link CollectorFetchContext} - */ - fetch: CollectorFetchMethod; -} & ExtraOptions; -/** - * Common interface for Usage and Stats Collectors - */ -export interface ICollector { - /** Logger **/ - readonly log: Logger; - /** The registered type (aka name) of the collector **/ - readonly type: CollectorOptions['type']; - /** - * The actual logic that reports the Usage collection. - * It will be called on every collection request. - * Whatever is returned in this method will be passed through as-is under - * the {@link ICollector.type} key. - * - * @example - * { - * [type]: await fetch(context) - * } - */ - readonly fetch: CollectorFetchMethod; - /** - * Should return `true` when it's safe to call the `fetch` method. - */ - readonly isReady: CollectorOptions['isReady']; -} diff --git a/src/platform/plugins/shared/usage_collection/server/collector/usage_collector.d.ts b/src/platform/plugins/shared/usage_collection/server/collector/usage_collector.d.ts deleted file mode 100644 index 7cf20723b5fa1..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/collector/usage_collector.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { CollectorOptions } from './types'; -import { Collector } from './collector'; -/** - * Same as {@link CollectorOptions} but with the `schema` property enforced - */ -export type UsageCollectorOptions = CollectorOptions & Required, 'schema'>>; -/** - * @internal Only used in fixtures as a type - */ -export declare class UsageCollector extends Collector { - constructor(log: Logger, collectorOptions: UsageCollectorOptions); -} diff --git a/src/platform/plugins/shared/usage_collection/server/config.d.ts b/src/platform/plugins/shared/usage_collection/server/config.d.ts deleted file mode 100644 index 46e7f049df3f1..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/config.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -import type { PluginConfigDescriptor } from '@kbn/core/server'; -export declare const configSchema: import("@kbn/config-schema").ObjectType<{ - usageCounters: import("@kbn/config-schema").ObjectType<{ - enabled: import("@kbn/config-schema").Type; - retryCount: import("@kbn/config-schema").Type; - bufferDuration: import("@kbn/config-schema").Type; - }>; - uiCounters: import("@kbn/config-schema").ObjectType<{ - enabled: import("@kbn/config-schema").Type; - debug: import("@kbn/config-schema").Type; - }>; - maximumWaitTimeForAllCollectorsInS: import("@kbn/config-schema").Type; - maxCollectorConcurrency: import("@kbn/config-schema").Type; -}>; -export type ConfigType = TypeOf; -export declare const config: PluginConfigDescriptor; diff --git a/src/platform/plugins/shared/usage_collection/server/index.d.ts b/src/platform/plugins/shared/usage_collection/server/index.d.ts deleted file mode 100644 index 7dc150eeac4fd..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/server'; -export type { Collector, ICollectorSet, AllowedSchemaTypes, MakeSchemaFrom, CollectorOptions, UsageCollectorOptions, CollectorFetchContext, CollectorFetchMethod, } from './collector'; -export type { UsageCountersSavedObject, UsageCountersSavedObjectAttributes, IncrementCounterParams, UsageCounter, } from './usage_counters'; -export { serializeCounterKey, USAGE_COUNTERS_SAVED_OBJECT_TYPE } from './usage_counters'; -export type { UsageCollectionSetup, UsageCollectionStart } from './plugin'; -export { config } from './config'; -export declare const plugin: (initializerContext: PluginInitializerContext) => Promise; diff --git a/src/platform/plugins/shared/usage_collection/server/plugin.d.ts b/src/platform/plugins/shared/usage_collection/server/plugin.d.ts deleted file mode 100644 index eb67fb51bb640..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/plugin.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; -import type { ICollectorSet } from './collector/types'; -import type { UsageCountersServiceSetup, UsageCountersServiceStart } from './usage_counters/types'; -/** Plugin's setup API **/ -export type UsageCollectionSetup = ICollectorSet & UsageCountersServiceSetup; -/** Plugin's start API **/ -export type UsageCollectionStart = UsageCountersServiceStart; -export declare class UsageCollectionPlugin implements Plugin { - private readonly initializerContext; - private readonly logger; - private savedObjects?; - private usageCountersService?; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup): UsageCollectionSetup; - start({ savedObjects }: CoreStart): UsageCollectionStart; - stop(): void; -} diff --git a/src/platform/plugins/shared/usage_collection/server/report/index.d.ts b/src/platform/plugins/shared/usage_collection/server/report/index.d.ts deleted file mode 100644 index 063f0f945af74..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/report/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { storeUiReport } from './store_ui_report'; -export { reportSchema } from './schema'; diff --git a/src/platform/plugins/shared/usage_collection/server/report/schema.d.ts b/src/platform/plugins/shared/usage_collection/server/report/schema.d.ts deleted file mode 100644 index 8df3657ccabcf..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/report/schema.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -declare const applicationUsageReportSchema: import("@kbn/config-schema").ObjectType<{ - minutesOnScreen: import("@kbn/config-schema").Type; - numberOfClicks: import("@kbn/config-schema").Type; - appId: import("@kbn/config-schema").Type; - viewId: import("@kbn/config-schema").Type; -}>; -export declare const reportSchema: import("@kbn/config-schema").ObjectType<{ - reportVersion: import("@kbn/config-schema").Type<3 | undefined>; - userAgent: import("@kbn/config-schema").Type> | undefined>; - uiCounter: import("@kbn/config-schema").Type> | undefined>; - application_usage: import("@kbn/config-schema").Type> | undefined>; -}>; -export type ReportSchemaType = TypeOf; -export type ApplicationUsageReport = TypeOf; -export {}; diff --git a/src/platform/plugins/shared/usage_collection/server/report/store_application_usage.d.ts b/src/platform/plugins/shared/usage_collection/server/report/store_application_usage.d.ts deleted file mode 100644 index f8045f9fdbc55..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/report/store_application_usage.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ISavedObjectsRepository } from '@kbn/core/server'; -import type { ApplicationUsageReport } from './schema'; -export declare const storeApplicationUsage: (repository: ISavedObjectsRepository, appUsages: ApplicationUsageReport[], timestamp: Date) => Promise>[] | undefined>; diff --git a/src/platform/plugins/shared/usage_collection/server/report/store_ui_report.d.ts b/src/platform/plugins/shared/usage_collection/server/report/store_ui_report.d.ts deleted file mode 100644 index 3a237338bd789..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/report/store_ui_report.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ISavedObjectsRepository } from '@kbn/core/server'; -import type { ReportSchemaType } from './schema'; -import { type UsageCountersServiceSetup } from '../usage_counters'; -export declare function storeUiReport(internalRepository: ISavedObjectsRepository, usageCounters: UsageCountersServiceSetup, report: ReportSchemaType): Promise<[...PromiseSettledResult | import("@kbn/core/packages/saved-objects/common").SavedObject>[], PromiseSettledResult>[] | undefined>]>; diff --git a/src/platform/plugins/shared/usage_collection/server/routes/index.d.ts b/src/platform/plugins/shared/usage_collection/server/routes/index.d.ts deleted file mode 100644 index 177824a421095..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/routes/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { IRouter, ISavedObjectsRepository, ServiceStatus } from '@kbn/core/server'; -import { type MetricsServiceSetup } from '@kbn/core/server'; -import type { Observable } from 'rxjs'; -import type { ICollectorSet } from '../collector'; -import type { UsageCountersServiceSetup } from '../usage_counters'; -export declare function setupRoutes({ router, usageCounters, getSavedObjects, ...rest }: { - router: IRouter; - getSavedObjects: () => ISavedObjectsRepository | undefined; - usageCounters: UsageCountersServiceSetup; - config: { - allowAnonymous: boolean; - kibanaIndex: string; - kibanaVersion: string; - uuid: string; - server: { - name: string; - hostname: string; - port: number; - }; - }; - collectorSet: ICollectorSet; - metrics: MetricsServiceSetup; - overallStatus$: Observable; -}): void; diff --git a/src/platform/plugins/shared/usage_collection/server/routes/stats/index.d.ts b/src/platform/plugins/shared/usage_collection/server/routes/stats/index.d.ts deleted file mode 100644 index d9fb90de65cd8..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/routes/stats/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { registerStatsRoute } from './stats'; diff --git a/src/platform/plugins/shared/usage_collection/server/routes/stats/stats.d.ts b/src/platform/plugins/shared/usage_collection/server/routes/stats/stats.d.ts deleted file mode 100644 index 3ce446643028b..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/routes/stats/stats.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { IRouter, ServiceStatus } from '@kbn/core/server'; -import { type MetricsServiceSetup } from '@kbn/core/server'; -import type { ICollectorSet } from '../../collector'; -export declare function registerStatsRoute({ router, config, collectorSet, metrics, overallStatus$, }: { - router: IRouter; - config: { - allowAnonymous: boolean; - kibanaIndex: string; - kibanaVersion: string; - uuid: string; - server: { - name: string; - hostname: string; - port: number; - }; - }; - collectorSet: ICollectorSet; - metrics: MetricsServiceSetup; - overallStatus$: Observable; -}): void; diff --git a/src/platform/plugins/shared/usage_collection/server/routes/ui_counters.d.ts b/src/platform/plugins/shared/usage_collection/server/routes/ui_counters.d.ts deleted file mode 100644 index 8f1aa905c0a73..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/routes/ui_counters.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IRouter, ISavedObjectsRepository } from '@kbn/core/server'; -import type { UsageCountersServiceSetup } from '../usage_counters'; -export declare function registerUiCountersRoute(router: IRouter, getSavedObjects: () => ISavedObjectsRepository | undefined, usageCounters: UsageCountersServiceSetup): void; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/common/kuery_utils.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/common/kuery_utils.d.ts deleted file mode 100644 index dc3471f56f249..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/common/kuery_utils.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { type KueryNode } from '@kbn/es-query'; -import type { UsageCountersSearchFilters } from '../types'; -export declare function usageCountersSearchParamsToKueryFilter(params: Omit): KueryNode; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/index.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/index.d.ts deleted file mode 100644 index 0feb4c84da21b..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { UsageCounters } from '../../common'; -export type IncrementCounterParams = UsageCounters.v1.IncrementCounterParams; -export type { UsageCountersServiceSetup, UsageCountersServiceStart } from './types'; -export type { UsageCountersSavedObjectAttributes, UsageCountersSavedObject } from './saved_objects'; -export type { IUsageCounter as UsageCounter } from './usage_counter'; -export { UsageCountersService } from './usage_counters_service'; -export { serializeCounterKey, USAGE_COUNTERS_SAVED_OBJECT_TYPE } from './saved_objects'; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/constants.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/constants.d.ts deleted file mode 100644 index 3cf4bdb5adeba..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/constants.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Roll indices every hour - */ -export declare const ROLL_INDICES_INTERVAL = 3600000; -/** - * Start rolling indices after 5 minutes up - */ -export declare const ROLL_INDICES_START: number; -/** - * Number of days to keep the Usage counters saved object documents - */ -export declare const USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS = 5; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/index.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/index.d.ts deleted file mode 100644 index e144d63725527..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { registerUsageCountersRollups } from './register_rollups'; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/register_rollups.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/register_rollups.d.ts deleted file mode 100644 index 5f62696e1d1ea..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/register_rollups.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type Observable } from 'rxjs'; -import type { Logger, ISavedObjectsRepository } from '@kbn/core/server'; -import type { IUsageCounter } from '../usage_counter'; -export declare function registerUsageCountersRollups({ logger, getRegisteredUsageCounters, internalRepository, pluginStop$, }: { - logger: Logger; - getRegisteredUsageCounters: () => IUsageCounter[]; - internalRepository: ISavedObjectsRepository; - pluginStop$: Observable; -}): void; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/rollups.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/rollups.d.ts deleted file mode 100644 index 0ce297034ccdc..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/rollups/rollups.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import moment from 'moment'; -import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; -import type { IUsageCounter } from '../usage_counter'; -export declare function rollUsageCountersIndices({ logger, getRegisteredUsageCounters, internalRepository, now, }: { - logger: Logger; - getRegisteredUsageCounters: () => IUsageCounter[]; - internalRepository?: ISavedObjectsRepository; - now?: moment.Moment; -}): Promise; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/saved_objects.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/saved_objects.d.ts deleted file mode 100644 index 1996aee5d2bc8..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/saved_objects.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import moment from 'moment'; -import type { SavedObject, SavedObjectsRepository, SavedObjectsServiceSetup } from '@kbn/core/server'; -import type { UsageCounters } from '../../common'; -/** - * The attributes stored in the UsageCounters' SavedObjects - */ -export interface UsageCountersSavedObjectAttributes extends UsageCounters.v1.AbstractCounter { - /** Number of times the event has occurred **/ - count: number; -} -/** - * The structure of the SavedObjects of type "usage-counters" - */ -export type UsageCountersSavedObject = SavedObject; -/** The Saved Objects type for Usage Counters **/ -export declare const USAGE_COUNTERS_SAVED_OBJECT_TYPE = "usage-counter"; -export declare const registerUsageCountersSavedObjectTypes: (savedObjectsSetup: SavedObjectsServiceSetup) => void; -/** - * Parameters to the `serializeCounterKey` method - * @internal used in kibana_usage_collectors - */ -export interface SerializeCounterKeyParams extends UsageCounters.v1.AbstractCounter { - /** The date to which serialize the key (defaults to 'now') **/ - date?: moment.MomentInput; -} -/** - * Generates a key based on the UsageCounter details - * @internal used in kibana_usage_collectors - * @param opts {@link SerializeCounterKeyParams} - */ -export declare const serializeCounterKey: (params: SerializeCounterKeyParams) => string; -export interface StoreCounterParams { - metric: UsageCounters.v1.CounterMetric; - soRepository: Pick; -} -export declare const storeCounter: ({ metric, soRepository }: StoreCounterParams) => Promise>; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/search/index.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/search/index.d.ts deleted file mode 100644 index 3534d1da9c929..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/search/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { searchUsageCounters } from './search'; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/search/search.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/search/search.d.ts deleted file mode 100644 index 6baf805bd665e..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/search/search.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ISavedObjectsRepository } from '@kbn/core-saved-objects-api-server'; -import type { UsageCountersSearchParams, UsageCountersSearchResult } from '../types'; -export declare function searchUsageCounters(repository: ISavedObjectsRepository, params: UsageCountersSearchParams): Promise; diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/types.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/types.d.ts deleted file mode 100644 index 88706760f7ff3..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/types.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { UsageCounters } from '../../common/types'; -import type { UsageCounter } from '.'; -export interface CreateUsageCounterParams { - /** - * Number of days a usage counter must be kept in the persistence layer. - * See USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS for default value. - */ - retentionPeriodDays?: number; -} -/** - * Provides the necessary tools to create and incremement Usage Counters - */ -export interface UsageCountersServiceSetup { - /** - * Returns a usage counter by domainId - */ - getUsageCounterByDomainId: (domainId: string) => UsageCounter | undefined; - /** - * Registers a usage counter to collect daily aggregated plugin counter events - */ - createUsageCounter: (domainId: string, params?: CreateUsageCounterParams) => UsageCounter; -} -export interface UsageCountersSearchParams { - /** A set of filters to limit the results of the search operation */ - filters: UsageCountersSearchFilters; - /** A set of options to modify the behavior of the search operation */ - options?: UsageCountersSearchOptions; -} -export interface UsageCountersSearchFilters { - /** The domainId used to create the Counter API */ - domainId: string; - /** The name of the counter. Optional, will return all counters in the same domainId that match the rest of filters if omitted */ - counterName?: string; - /** The type of counter. Optional, will return all counters in the same domainId that match the rest of filters if omitted */ - counterType?: string; - /** Namespace of the counter. Optional, counters of the 'default' namespace will be returned if omitted */ - namespace?: string; - /** ISO date string to limit search results: get counters that are more recent than the provided date (if specified) */ - from?: string; - /** ISO date string to limit search results: get counters that are older than the provided date (if specified) */ - to?: string; - /** Return counters from a given source only. Optional, both 'ui' and 'server' counters will be returned if omitted */ - source?: 'server' | 'ui'; -} -export interface UsageCountersSearchOptions { - /** Number of counters to retrieve per page, when querying ES (defaults to 100) */ - perPage?: number; -} -/** - * The result of a Usage Counters search operation - */ -export interface UsageCountersSearchResult { - /** - * The counters that matched the search criteria - */ - counters: UsageCounterSnapshot[]; -} -/** - * Represents the current state of a Usage Counter at a given point in time - */ -export interface UsageCounterSnapshot extends UsageCounters.v1.AbstractCounter { - /** List of daily records captured for this counter */ - records: UsageCounterRecord[]; - /** Number of events captured (adds up all records) */ - count: number; -} -/** - * Number of events counted on a given day - */ -export interface UsageCounterRecord { - /** Date where the counter was last updated */ - updatedAt: string; - /** Number of events captured on that day */ - count: number; -} -/** - * Interface to allow searching for persisted usage-counters - */ -export interface UsageCountersServiceStart { - search: (params: UsageCountersSearchParams) => Promise; -} diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counter.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counter.d.ts deleted file mode 100644 index 71b3db339a154..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counter.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type * as Rx from 'rxjs'; -import type { UsageCounters } from '../../common'; -export interface UsageCounterParams { - domainId: string; - counter$: Rx.Subject; - retentionPeriodDays?: number; -} -/** - * Usage Counter allows to keep track of any events that occur. - * By calling {@link IUsageCounter.incrementCounter} devs can notify this - * API whenever the event happens. - */ -export interface IUsageCounter { - /** - * Defines a domainId (aka a namespace) under which multiple counters can be stored - */ - domainId: string; - /** - * Defines custom retention period for the counters under this domain. - * This is the number of days worth of counters that must be kept in the system indices. - * See USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS for default value - */ - retentionPeriodDays?: number; - /** - * Notifies the counter about a new event happening so it can increase the count internally. - * @param params {@link IncrementCounterParams} - */ - incrementCounter: (params: UsageCounters.v1.IncrementCounterParams) => void; -} -export declare class UsageCounter implements IUsageCounter { - readonly domainId: string; - private counter$; - readonly retentionPeriodDays?: number | undefined; - constructor({ domainId, counter$, retentionPeriodDays }: UsageCounterParams); - incrementCounter: (params: UsageCounters.v1.IncrementCounterParams) => void; -} diff --git a/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counters_service.d.ts b/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counters_service.d.ts deleted file mode 100644 index 1628fae21f297..0000000000000 --- a/src/platform/plugins/shared/usage_collection/server/usage_counters/usage_counters_service.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { SavedObjectsServiceSetup, SavedObjectsServiceStart } from '@kbn/core/server'; -import type { Logger } from '@kbn/core/server'; -import type { UsageCountersServiceSetup, UsageCountersServiceStart } from './types'; -export interface UsageCountersServiceDeps { - logger: Logger; - retryCount: number; - bufferDurationMs: number; -} -export interface UsageCountersServiceSetupDeps { - savedObjects: SavedObjectsServiceSetup; -} -export interface UsageCountersServiceStartDeps { - savedObjects: SavedObjectsServiceStart; -} -export declare class UsageCountersService { - private readonly stop$; - private readonly retryCount; - private readonly bufferDurationMs; - private readonly counterSets; - private readonly source$; - private readonly counter$; - private readonly flushCache$; - private readonly stopCaching$; - private repository?; - private readonly logger; - constructor({ logger, retryCount, bufferDurationMs }: UsageCountersServiceDeps); - setup: ({ savedObjects }: UsageCountersServiceSetupDeps) => UsageCountersServiceSetup; - start: ({ savedObjects }: UsageCountersServiceStartDeps) => UsageCountersServiceStart; - stop: () => UsageCountersServiceStart; - private backoffDelay; - private storeDate$; - private createUsageCounter; - private getUsageCounterByDomainId; - private mergeCounters; - private search; -} diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/index.d.ts deleted file mode 100644 index 0d6787b122bb9..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type { AlertInstanceContext } from './src/alert_instance'; -export type { TrackedLifecycleAlertState, WrappedLifecycleRuleState } from './src/lifecycle_state'; -export { wrappedStateRt } from './src/lifecycle_state'; -export type { RuleTaskParams } from './src/rule_task_instance'; -export { ActionsCompletion, ruleParamsSchema } from './src/rule_task_instance'; -export type { LatestTaskStateSchema as RuleTaskState, MutableLatestTaskStateSchema as MutableRuleTaskState, LatestRawAlertInstanceSchema as RawAlertInstance, LatestAlertInstanceMetaSchema as AlertInstanceMeta, MutableLatestAlertInstanceMetaSchema as MutableAlertInstanceMeta, LatestAlertInstanceStateSchema as AlertInstanceState, LatestThrottledActionSchema as ThrottledActions, LatestLastScheduledActionsSchema as LastScheduledActions, } from './src/task_state'; -export { stateSchemaByVersion, emptyState as emptyTaskState } from './src/task_state'; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/alert_instance.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/alert_instance.d.ts deleted file mode 100644 index 2e03968655114..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/alert_instance.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as t from 'io-ts'; -declare const contextSchema: t.RecordC; -export type AlertInstanceContext = t.TypeOf; -export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/lifecycle_state.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/lifecycle_state.d.ts deleted file mode 100644 index fab9784f4bd50..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/lifecycle_state.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as t from 'io-ts'; -declare const trackedAlertStateRt: t.TypeC<{ - alertId: t.StringC; - alertUuid: t.StringC; - started: t.StringC; - flappingHistory: t.ArrayC; - flapping: t.BooleanC; - pendingRecoveredCount: t.NumberC; - activeCount: t.NumberC; -}>; -export type TrackedLifecycleAlertState = t.TypeOf; -type RuleTypeState = Record; -export declare const alertTypeStateRt: () => t.Type; -export declare const wrappedStateRt: () => t.TypeC<{ - wrapped: t.Type; - trackedAlerts: t.RecordC; - flapping: t.BooleanC; - pendingRecoveredCount: t.NumberC; - activeCount: t.NumberC; - }>>; - trackedAlertsRecovered: t.RecordC; - flapping: t.BooleanC; - pendingRecoveredCount: t.NumberC; - activeCount: t.NumberC; - }>>; -}>; -/** - * This is redefined instead of derived from above `wrappedStateRt` because - * there's no easy way to instantiate generic values such as the runtime type - * factory function. - */ -export type WrappedLifecycleRuleState = RuleTypeState & { - wrapped: State; - trackedAlerts: Record; - trackedAlertsRecovered: Record; -}; -export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/rule_task_instance.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/rule_task_instance.d.ts deleted file mode 100644 index 2ad4dcc885dc3..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/rule_task_instance.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as t from 'io-ts'; -export declare enum ActionsCompletion { - COMPLETE = "complete", - PARTIAL = "partial" -} -export declare const ruleParamsSchema: t.IntersectionC<[t.TypeC<{ - alertId: t.StringC; -}>, t.PartialC<{ - spaceId: t.StringC; -}>]>; -export type RuleTaskParams = t.TypeOf; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/index.d.ts deleted file mode 100644 index 271f0c6bf1c1c..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/index.d.ts +++ /dev/null @@ -1,374 +0,0 @@ -import { type TypeOf } from '@kbn/config-schema'; -import * as v3 from './v3'; -export declare const stateSchemaByVersion: { - 1: { - up: (state: Record) => Readonly<{ - alertTypeState?: Record | undefined; - alertInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - alertRecoveredInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - previousStartedAt?: string | null | undefined; - summaryActions?: Record> | undefined; - } & {}>; - schema: import("@kbn/config-schema").ObjectType<{ - alertTypeState: import("@kbn/config-schema").Type | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; - }>; - }; - 2: { - up: (state: Record) => Readonly<{ - alertTypeState?: Record | undefined; - alertInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - alertRecoveredInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - previousStartedAt?: string | null | undefined; - summaryActions?: Record> | undefined; - trackedExecutions?: string[] | undefined; - } & {}>; - schema: import("@kbn/config-schema").ObjectType | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; - }, "trackedExecutions"> & { - trackedExecutions: import("@kbn/config-schema").Type; - }>; - }; - 3: { - up: (state: Record) => Readonly<{ - alertTypeState?: Record | undefined; - alertInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - alertRecoveredInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - previousStartedAt?: string | null | undefined; - summaryActions?: Record> | undefined; - } & {}>; - schema: import("@kbn/config-schema").ObjectType<{ - alertTypeState: import("@kbn/config-schema").Type | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; - }>; - }; -}; -declare const latest: typeof v3; -/** - * WARNING: Do not modify the code below when doing a new version. - * Update the "latest" variable instead. - */ -declare const latestTaskStateSchema: import("@kbn/config-schema").ObjectType<{ - alertTypeState: import("@kbn/config-schema").Type | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; -}>; -export type LatestTaskStateSchema = TypeOf; -export type LatestRawAlertInstanceSchema = TypeOf; -export type LatestAlertInstanceMetaSchema = TypeOf; -export type LatestAlertInstanceStateSchema = TypeOf; -export type LatestThrottledActionSchema = TypeOf; -export type LatestLastScheduledActionsSchema = TypeOf; -export declare const emptyState: LatestTaskStateSchema; -type Mutable = { - -readonly [k in keyof T]: Mutable; -}; -export type MutableLatestTaskStateSchema = Mutable; -export type MutableLatestAlertInstanceMetaSchema = Mutable; -export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/lib/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/lib/index.d.ts deleted file mode 100644 index 22fca8c0446bb..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/lib/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare function isJSONObject(obj: unknown): obj is Record; -export declare function isString(value: unknown): value is string; -export declare function isBoolean(value: unknown): value is boolean; -export declare function isNumber(value: unknown): value is number; -export declare function isStringArray(value: unknown): value is string[]; -export declare function isBooleanArray(value: unknown): value is boolean[]; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/index.d.ts deleted file mode 100644 index 0727e379eb9a2..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -export { versionSchema, throttledActionSchema, rawAlertInstanceSchema, metaSchema, alertStateSchema, lastScheduledActionsSchema, } from './schema'; -export declare const versionDefinition: { - up: (state: Record) => Readonly<{ - alertTypeState?: Record | undefined; - alertInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - alertRecoveredInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - previousStartedAt?: string | null | undefined; - summaryActions?: Record> | undefined; - } & {}>; - schema: import("@kbn/config-schema").ObjectType<{ - alertTypeState: import("@kbn/config-schema").Type | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; - }>; -}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/migration.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/migration.d.ts deleted file mode 100644 index 9834d60bf9db9..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/migration.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type TypeOf } from '@kbn/config-schema'; -import type { versionSchema, throttledActionSchema, rawAlertInstanceSchema, metaSchema, lastScheduledActionsSchema } from './schema'; -type VersionSchema = TypeOf; -type ThrottledActionsSchema = TypeOf; -type LastScheduledActionsSchema = TypeOf; -type RawAlertInstanceSchema = TypeOf; -export declare function migrateThrottledActions(throttledActions: unknown): ThrottledActionsSchema | undefined; -export declare function migrateLastScheduledActions(lastScheduledActions: unknown): LastScheduledActionsSchema | undefined; -export declare function migrateMeta(meta: unknown): TypeOf | undefined; -export declare function migrateAlertInstances(alertInstances: unknown): Record | undefined; -export declare const upMigration: (state: Record) => VersionSchema; -export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/schema.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/schema.d.ts deleted file mode 100644 index 219e73bcd3ef8..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v1/schema.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -export declare const throttledActionSchema: import("@kbn/config-schema").Type>>; -export declare const alertStateSchema: import("@kbn/config-schema").Type>; -export declare const lastScheduledActionsSchema: import("@kbn/config-schema").ObjectType<{ - subgroup: import("@kbn/config-schema").Type; - group: import("@kbn/config-schema").Type; - date: import("@kbn/config-schema").Type; - actions: import("@kbn/config-schema").Type> | undefined>; -}>; -export declare const metaSchema: import("@kbn/config-schema").ObjectType<{ - lastScheduledActions: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined>; - flappingHistory: import("@kbn/config-schema").Type; - flapping: import("@kbn/config-schema").Type; - maintenanceWindowIds: import("@kbn/config-schema").Type; - maintenanceWindowNames: import("@kbn/config-schema").Type; - pendingRecoveredCount: import("@kbn/config-schema").Type; - uuid: import("@kbn/config-schema").Type; - activeCount: import("@kbn/config-schema").Type; -}>; -export declare const rawAlertInstanceSchema: import("@kbn/config-schema").ObjectType<{ - meta: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined>; - state: import("@kbn/config-schema").Type | undefined>; -}>; -export declare const versionSchema: import("@kbn/config-schema").ObjectType<{ - alertTypeState: import("@kbn/config-schema").Type | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; -}>; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/index.d.ts deleted file mode 100644 index cd485d2f222cc..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/index.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -export { versionSchema, throttledActionSchema, rawAlertInstanceSchema, metaSchema, alertStateSchema, lastScheduledActionsSchema, } from './schema'; -export declare const versionDefinition: { - up: (state: Record) => Readonly<{ - alertTypeState?: Record | undefined; - alertInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - alertRecoveredInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - previousStartedAt?: string | null | undefined; - summaryActions?: Record> | undefined; - trackedExecutions?: string[] | undefined; - } & {}>; - schema: import("@kbn/config-schema").ObjectType | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; - }, "trackedExecutions"> & { - trackedExecutions: import("@kbn/config-schema").Type; - }>; -}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/migration.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/migration.d.ts deleted file mode 100644 index 7a5874a96000a..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/migration.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { type TypeOf } from '@kbn/config-schema'; -import type { versionSchema } from './schema'; -type VersionSchema = TypeOf; -export declare const upMigration: (state: Record) => VersionSchema; -export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/schema.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/schema.d.ts deleted file mode 100644 index 97081740921aa..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v2/schema.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export * from '../v1'; -export declare const versionSchema: import("@kbn/config-schema").ObjectType | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; -}, "trackedExecutions"> & { - trackedExecutions: import("@kbn/config-schema").Type; -}>; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/index.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/index.d.ts deleted file mode 100644 index 0727e379eb9a2..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -export { versionSchema, throttledActionSchema, rawAlertInstanceSchema, metaSchema, alertStateSchema, lastScheduledActionsSchema, } from './schema'; -export declare const versionDefinition: { - up: (state: Record) => Readonly<{ - alertTypeState?: Record | undefined; - alertInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - alertRecoveredInstances?: Record> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined; - previousStartedAt?: string | null | undefined; - summaryActions?: Record> | undefined; - } & {}>; - schema: import("@kbn/config-schema").ObjectType<{ - alertTypeState: import("@kbn/config-schema").Type | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; - }>; -}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/migration.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/migration.d.ts deleted file mode 100644 index 7a5874a96000a..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/migration.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { type TypeOf } from '@kbn/config-schema'; -import type { versionSchema } from './schema'; -type VersionSchema = TypeOf; -export declare const upMigration: (state: Record) => VersionSchema; -export {}; diff --git a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/schema.d.ts b/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/schema.d.ts deleted file mode 100644 index 35c47a820d88d..0000000000000 --- a/x-pack/platform/packages/private/kbn-alerting-state-types/src/task_state/v3/schema.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -export * from '../v1'; -export declare const versionSchema: import("@kbn/config-schema").ObjectType<{ - alertTypeState: import("@kbn/config-schema").Type | undefined>; - alertInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - alertRecoveredInstances: import("@kbn/config-schema").Type> | undefined; - } & { - date: string; - group: string; - }> | undefined; - maintenanceWindowIds?: string[] | undefined; - maintenanceWindowNames?: string[] | undefined; - uuid?: string | undefined; - } & {}> | undefined; - state?: Record | undefined; - } & {}>> | undefined>; - previousStartedAt: import("@kbn/config-schema").Type; - summaryActions: import("@kbn/config-schema").Type> | undefined>; -}>; diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/index.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/index.d.ts deleted file mode 100644 index d3ef9127d2210..0000000000000 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type * from './src/types'; -export * from './src/index_templates'; -export * from './src/home_sections'; -export type * from './src/services'; -export * from './src/constants'; diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/constants.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/constants.d.ts deleted file mode 100644 index 1e63a3ced7efd..0000000000000 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/constants.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Locator ID used to navigate to the Index Management application. - * - * Kept in `@kbn/index-management-shared-types` so other plugins can reference it - * without depending on `@kbn/index-management-plugin`. - */ -export declare const INDEX_MANAGEMENT_LOCATOR_ID = "INDEX_MANAGEMENT_LOCATOR_ID"; diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/home_sections.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/home_sections.d.ts deleted file mode 100644 index 1739750a20af8..0000000000000 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/home_sections.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { FunctionComponent, ReactNode } from 'react'; -import type { ApplicationStart } from '@kbn/core-application-browser'; -import type { EuiBreadcrumb, EuiThemeComputed } from '@elastic/eui'; -import type { Index } from './types'; -export declare enum Section { - Indices = "indices", - DataStreams = "data_streams", - IndexTemplates = "templates", - ComponentTemplates = "component_templates", - EnrichPolicies = "enrich_policies" -} -export declare enum IndexDetailsSection { - Overview = "overview", - Mappings = "mappings", - Settings = "settings", - Stats = "stats" -} -export type IndexDetailsTabId = IndexDetailsSection | string; -export interface IndexDetailsTab { - id: IndexDetailsTabId; - name: ReactNode; - /** - * A function that renders the content of the tab. - * - * IMPORTANT: This expects an arrow function that returns JSX, NOT a component passed directly. - * - * @example - * // Correct - arrow function returning JSX: - * renderTabContent: ({ index, getUrlForApp }) => ( - * - * ) - * - * // Wrong - passing a component directly will break if it uses hooks: - * renderTabContent: MyTabComponent - */ - renderTabContent: (args: { - index: Index; - getUrlForApp: ApplicationStart['getUrlForApp']; - euiTheme: EuiThemeComputed; - }) => ReturnType; - order: number; - shouldRenderTab?: (args: { - index: Index; - }) => boolean; - breadcrumb?: EuiBreadcrumb; -} diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/index_templates.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/index_templates.d.ts deleted file mode 100644 index 5ba765ea780df..0000000000000 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/index_templates.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -export type TemplateType = 'default' | 'managed' | 'cloudManaged' | 'system'; -export declare const IndexMode: { - readonly standard: "standard"; - readonly logsdb: "logsdb"; - readonly time_series: "time_series"; - readonly lookup: "lookup"; -}; -export type IndexMode = (typeof IndexMode)[keyof typeof IndexMode]; -export interface DataRetention { - enabled: boolean; - infiniteDataRetention?: boolean; - value?: number; - unit?: string; -} -/** - * Interface for the template list returned by Index Management's - * `GET /api/index_management/index_templates` endpoint. - * - * This is a copy of the plugin's TemplateListItem interface with additional fields added during deserialization, - * kept here to allow cross-plugin consumption without creating cyclic dependencies. - */ -export interface TemplateListItem { - name: string; - indexPatterns: string[]; - version?: number; - order?: number; - priority?: number; - hasSettings: boolean; - hasAliases: boolean; - hasMappings: boolean; - deprecated?: boolean; - ilmPolicy?: { - name: string; - }; - composedOf?: string[]; - _kbnMeta: { - type: TemplateType; - hasDatastream: boolean; - isLegacy?: boolean; - }; - lifecycle?: DataRetention; - ignoreMissingComponentTemplates?: string[]; - allowAutoCreate: string; - indexMode?: IndexMode; - _meta?: { - [key: string]: any; - }; - dataStream?: { - hidden?: boolean; - [key: string]: any; - }; -} -export interface GetIndexTemplatesResponse { - templates: TemplateListItem[]; - legacyTemplates: TemplateListItem[]; -} diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/extensions_service.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/extensions_service.d.ts deleted file mode 100644 index 7dfbb7541dac6..0000000000000 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/extensions_service.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { FunctionComponent, ReactNode } from 'react'; -import type { ApplicationStart } from '@kbn/core-application-browser'; -import type { EuiBadgeProps } from '@elastic/eui'; -import type { IndexDetailsTab } from '../home_sections'; -import type { Index } from '../types'; -export interface IndexContent { - renderContent: (args: { - index: Index; - getUrlForApp: ApplicationStart['getUrlForApp']; - }) => ReturnType; -} -export interface IndexToggle { - matchIndex: (index: Index) => boolean; - label: string; - name: string; -} -export interface IndexBadge { - matchIndex: (index: Index) => boolean; - label: string; - filterExpression?: string; - color: EuiBadgeProps['color']; -} -export interface EmptyListContent { - renderContent: (args: { - createIndexButton: ReturnType; - }) => ReturnType; -} -export interface IndicesListColumn { - fieldName: string; - label: string; - order: number; - render?: (index: Index) => ReactNode; - sort?: (index: Index) => any; -} -export interface ExtensionsSetup { - addAction(action: any): void; - addBanner(banner: any): void; - addFilter(filter: any): void; - addBadge(badge: IndexBadge): void; - addToggle(toggle: IndexToggle): void; - addColumn(column: IndicesListColumn): void; - setEmptyListContent(content: EmptyListContent): void; - addIndexDetailsTab(tab: IndexDetailsTab): void; - setIndexOverviewContent(content: IndexContent): void; -} diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/index.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/index.d.ts deleted file mode 100644 index e980193220c1d..0000000000000 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * from './extensions_service'; -export type * from './public_api_service'; diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/public_api_service.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/public_api_service.d.ts deleted file mode 100644 index 58a42cab2bbce..0000000000000 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/services/public_api_service.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { EnrichPolicyType, IndicesSimulateTemplateResponse } from '@elastic/elasticsearch/lib/api/types'; -import type { SendRequestResponse } from '../types'; -import type { GetIndexTemplatesResponse } from '../index_templates'; -export interface SerializedEnrichPolicy { - type: EnrichPolicyType; - name: string; - sourceIndices: string[]; - matchField: string; - enrichFields: string[]; - query?: Record; -} -export type SimulateIndexTemplateResponse = IndicesSimulateTemplateResponse; -export interface PublicApiServiceSetup { - getAllEnrichPolicies(): Promise>; - /** - * Fetches composable and legacy index templates as returned by Index Management's - * `GET /api/index_management/index_templates` endpoint. - */ - getIndexTemplates(options?: { - signal?: AbortSignal; - }): Promise; - /** - * Simulates an index template by name using the - * `POST /api/index_management/index_templates/simulate/{templateName}` endpoint. - * Returns the resolved template configuration that would be applied to matching indices. - */ - simulateIndexTemplate(options: { - templateName: string; - signal?: AbortSignal; - }): Promise; -} diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.d.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.d.ts deleted file mode 100644 index 05759697d1fae..0000000000000 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.d.ts +++ /dev/null @@ -1,141 +0,0 @@ -import type { IlmExplainLifecycleLifecycleExplain, HealthStatus, Uuid } from '@elastic/elasticsearch/lib/api/types'; -import type { ScopedHistory } from '@kbn/core-application-browser'; -import type { SerializableRecord } from '@kbn/utility-types'; -import type { LocatorPublic } from '@kbn/share-plugin/public'; -import type { ManagementAppMountParams } from '@kbn/management-plugin/public'; -import type { HttpSetup } from '@kbn/core/public'; -import type { ExtensionsSetup } from './services/extensions_service'; -import type { PublicApiServiceSetup } from './services/public_api_service'; -export interface EnricherResponse { - source: string; - indices?: Index[]; - error?: boolean; - /** - * Apply this enricher's updates to any index aliases - */ - applyToAliases?: boolean; -} -export interface Enricher { - name: string; - fn: (client: HttpSetup, signal: AbortSignal) => Promise; -} -export type IndexManagementLocatorParams = SerializableRecord & ({ - page: 'index_list'; - filter?: string; - includeHiddenIndices?: boolean; -} | { - page: 'data_stream_index_list'; - dataStreamName: string; -} | { - page: 'data_streams_details'; - dataStreamName?: string; -} | { - page: 'index_template'; - indexTemplate: string; -} | { - page: 'index_template_edit'; - indexTemplate: string; -} | { - page: 'index_template_clone'; - indexTemplate: string; -} | { - page: 'create_template'; -} | { - page: 'component_template'; - componentTemplate: string; -} | { - page: 'component_template_list'; - filter?: string; -} | { - page: 'edit_component_template'; - componentTemplate: string; -} | { - page: 'clone_component_template'; - componentTemplate: string; -} | { - page: 'create_component_template'; - componentTemplate: string; -} | { - page: 'index_details'; - indexName: string; - tab?: string; -}); -export type IndexManagementLocator = LocatorPublic; -export type IndexManagementAppMountParams = Pick & { - element: HTMLElement | null; -}; -export interface IndexManagementPluginSetup { - apiService: PublicApiServiceSetup; - extensionsService: ExtensionsSetup; - renderIndexManagementApp: (params: IndexManagementAppMountParams) => Promise<() => void>; - locator?: IndexManagementLocator; - indexDataEnricher: { - add: (enricher: Enricher) => void; - }; -} -export interface IndexManagementPluginStart { - apiService: PublicApiServiceSetup; - extensionsService: ExtensionsSetup; - getIndexMappingComponent: (deps: { - history: ScopedHistory; - }) => React.FC; - getIndexSettingsComponent: (deps: { - history: ScopedHistory; - }) => React.FC; - getComponentTemplateFlyoutComponent: (deps: { - history: ScopedHistory; - }) => React.FC; - getIndexTemplateFlyoutComponent: (deps: { - history: ScopedHistory; - }) => React.FC; - getDatastreamFlyoutComponent: (deps: { - history: ScopedHistory; - }) => React.FC; -} -export interface Index extends IndexAttributes { - name: string; -} -export interface IndexAttributes { - primary?: number | string; - replica?: number | string; - isFrozen?: boolean; - hidden?: boolean; - aliases?: string | string[]; - data_stream?: string; - mode?: string; - isRollupIndex?: boolean; - ilm?: IlmExplainLifecycleLifecycleExplain; - isFollowerIndex?: boolean; - health?: HealthStatus; - status?: string; - uuid?: Uuid; - documents?: number; - size?: number; - primary_size?: number; - documents_deleted?: number; -} -export interface ComponentTemplateFlyoutProps { - componentTemplateName: string; - onClose: () => void; -} -export interface IndexTemplateFlyoutProps { - indexTemplateName: string; - onClose: () => void; - reload: () => void; -} -export interface DatastreamFlyoutProps { - datastreamName: string; - onClose: () => void; -} -export interface IndexMappingProps { - index?: Index; - showAboutMappings?: boolean; -} -export interface IndexSettingProps { - indexName: string; - hasUpdateSettingsPrivilege?: boolean; -} -export interface SendRequestResponse { - data: D | null; - error: E | null; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/es_fields.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/es_fields.d.ts deleted file mode 100644 index 012caa1f72ccc..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/es_fields.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './src/es_fields/apm'; -export * from './src/es_fields/otel'; -export * from './src/es_fields/common'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_raw.d.ts deleted file mode 100644 index 26f386679ed48..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_raw.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * from './src/es_schemas/raw'; -export type * from './src/es_schemas/raw/fields'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_ui.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_ui.d.ts deleted file mode 100644 index 6fceaaa803bbf..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/es_schemas_ui.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * from './src/es_schemas/ui'; -export type * from './src/es_schemas/ui/fields'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/index.d.ts deleted file mode 100644 index 6cd6f7e999ec2..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -export * from './es_fields'; -export type * from './es_schemas_raw'; -export type * from './es_schemas_ui'; -export * from './src/agent_explorer'; -export * from './src/aggregation_type'; -export * from './src/annotations'; -export * from './src/anomaly_detector_type'; -export type * from './src/apm_event'; -export type * from './src/apm_ml_job'; -export type * from './src/apm_telemetry'; -export * from './src/apm_timeseries'; -export * from './src/connections'; -export type * from './src/container_type'; -export type * from './src/coordinate'; -export type * from './src/correlations'; -export * from './src/custom_dashboards'; -export * from './src/custom_link'; -export type * from './src/data_source'; -export type * from './src/diagnostics'; -export * from './src/document_type'; -export * from './src/downstream_dependencies'; -export * from './src/environment_filter_values'; -export * from './src/environment_rt'; -export type * from './src/errors'; -export type * from './src/focused_trace_waterfall'; -export type * from './src/full_trace_waterfall'; -export * from './src/ilm_types'; -export * from './src/instances'; -export * from './src/latency_aggregation_types'; -export type * from './src/latency_distribution'; -export * from './src/latency_distribution_chart_types'; -export * from './src/mobile_types'; -export * from './src/processor_event'; -export * from './src/rollup'; -export * from './src/serverless'; -export type * from './src/service_anomalies'; -export type * from './src/service_anomaly_stats'; -export type * from './src/service_anomaly_timeseries'; -export type * from './src/service_groups'; -export * from './src/service_health_status'; -export type * from './src/service_inventory'; -export type * from './src/service_map'; -export type * from './src/service_map_diagnostic_types'; -export type * from './src/span_links'; -export * from './src/storage_explorer_types'; -export type * from './src/time_range_metadata'; -export type * from './src/timeseries'; -export type * from './src/traces'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/agent_explorer.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/agent_explorer.d.ts deleted file mode 100644 index c2a8a96a4fe24..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/agent_explorer.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export declare enum AgentExplorerFieldName { - ServiceName = "serviceName", - Environments = "environments", - AgentName = "agentName", - AgentVersion = "agentVersion", - AgentLastVersion = "agentLastVersion", - AgentDocsPageUrl = "agentDocsPageUrl", - Instances = "instances" -} -export interface ElasticApmAgentLatestVersion { - latest_version: string; -} -export interface OtelAgentLatestVersion { - sdk_latest_version: string; - auto_latest_version?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/aggregation_type.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/aggregation_type.d.ts deleted file mode 100644 index aaedf9eb301a2..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/aggregation_type.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare enum AggregationType { - Avg = "avg", - P95 = "95th", - P99 = "99th" -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/annotations.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/annotations.d.ts deleted file mode 100644 index adf9985d5854b..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/annotations.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare enum AnnotationType { - VERSION = "version" -} -export interface Annotation { - type: AnnotationType; - id: string; - '@timestamp': number; - text: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/anomaly_detector_type.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/anomaly_detector_type.d.ts deleted file mode 100644 index 0555a096ef03c..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/anomaly_detector_type.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare enum AnomalyDetectorType { - txLatency = "txLatency", - txThroughput = "txThroughput", - txFailureRate = "txFailureRate" -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_event.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_event.d.ts deleted file mode 100644 index fc41cb00cbb5c..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_event.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface ApmEvent { - legacy?: boolean; - name: string; - kuery: string; - index: string[]; - docCount: number; - intervals?: Record; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_ml_job.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_ml_job.d.ts deleted file mode 100644 index 7b2b7bb4a1bf0..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_ml_job.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { Environment } from './environment_rt'; -declare enum JOB_STATE { - CLOSED = "closed", - CLOSING = "closing", - FAILED = "failed", - OPENED = "opened", - OPENING = "opening", - DELETED = "deleted" -} -declare enum DATAFEED_STATE { - STARTED = "started", - STARTING = "starting", - STOPPED = "stopped", - STOPPING = "stopping", - DELETED = "deleted" -} -export interface ApmMlJob { - environment: Environment; - version: number; - jobId: string; - jobState?: JOB_STATE; - datafeedId?: string; - datafeedState?: DATAFEED_STATE; - bucketSpan?: string; -} -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_telemetry.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_telemetry.d.ts deleted file mode 100644 index 82e3794bd0610..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_telemetry.d.ts +++ /dev/null @@ -1,254 +0,0 @@ -import type { DeepPartial } from 'utility-types'; -import type { AgentName } from '@kbn/elastic-agent-utils'; -import type { RollupInterval } from './rollup'; -export interface TimeframeMap { - '1d': number; - all: number; -} -export type TimeframeMap1d = Pick; -export type TimeframeMapAll = Pick; -export interface AggregatedTransactionsCounts { - expected_metric_document_count: number; - transaction_count: number; -} -export interface APMPerAgentConfigSettings { - agent_name: string; - has_error: boolean; - settings: string[]; - advanced_settings: string[]; -} -export interface APMPerService { - service_id: string; - timed_out: boolean; - num_service_nodes: number; - num_transaction_types: number; - cloud: { - availability_zones: string[]; - regions: string[]; - providers: string[]; - }; - faas: { - trigger: { - type: string[]; - }; - }; - agent: { - name: string; - version: string; - activation_method: string; - }; - service: { - language: { - name: string; - version: string; - }; - framework: { - name: string; - version: string; - }; - runtime: { - name: string; - version: string; - }; - }; - kubernetes: { - pod: { - name: string; - }; - }; - container: { - id: string; - }; -} -export interface APMUsage { - has_any_services_per_official_agent: boolean; - has_any_services: boolean; - services_per_agent: Record; - version: { - apm_server: { - minor: number; - major: number; - patch: number; - }; - }; - environments: { - services_without_environment: number; - services_with_multiple_environments: number; - top_environments: string[]; - }; - aggregated_transactions: { - current_implementation: AggregatedTransactionsCounts; - no_observer_name: AggregatedTransactionsCounts; - no_rum: AggregatedTransactionsCounts; - no_rum_no_observer_name: AggregatedTransactionsCounts; - only_rum: AggregatedTransactionsCounts; - only_rum_no_observer_name: AggregatedTransactionsCounts; - }; - cloud: { - availability_zone: string[]; - provider: string[]; - region: string[]; - }; - host: { - os: { - platform: string[]; - }; - }; - counts: { - transaction: TimeframeMap; - span: TimeframeMap; - error: TimeframeMap; - metric: TimeframeMap; - onboarding: TimeframeMap; - agent_configuration: TimeframeMapAll; - max_transaction_groups_per_service: TimeframeMap1d; - max_error_groups_per_service: TimeframeMap1d; - traces: TimeframeMap; - services: TimeframeMap1d; - environments: TimeframeMap1d; - span_destination_service_resource: TimeframeMap1d; - global_labels: TimeframeMap1d; - }; - cardinality: { - client: { - geo: { - country_iso_code: { - rum: TimeframeMap1d; - }; - }; - }; - user_agent: { - original: { - all_agents: TimeframeMap1d; - rum: TimeframeMap1d; - }; - }; - transaction: { - name: { - all_agents: TimeframeMap1d; - rum: TimeframeMap1d; - }; - }; - }; - retainment: Record<'span' | 'transaction' | 'error' | 'metric' | 'onboarding', { - ms: number; - }>; - integrations: { - ml: { - all_jobs_count: number; - }; - }; - agents: Record; - indices: { - traces: { - shards: { - total: number; - }; - all: { - total: { - docs: { - count: number; - }; - store: { - size_in_bytes: number; - }; - }; - }; - }; - metric: { - shards: { - total: number; - }; - all: { - total: { - docs: { - count: number; - }; - store: { - size_in_bytes: number; - }; - }; - }; - metricset: DataStreamStats; - }; - shards: { - total: number; - }; - all: { - total: { - docs: { - count: number; - }; - store: { - size_in_bytes: number; - }; - }; - }; - }; - service_groups: { - kuery_fields: string[]; - total: number; - }; - custom_dashboards: { - kuery_fields: string[]; - total: number; - }; - per_service: APMPerService[]; - per_agent_config_settings: APMPerAgentConfigSettings[]; - top_traces: { - max: number; - median: number; - }; - tasks: Record<'aggregated_transactions' | 'cloud' | 'host' | 'processor_events' | 'agent_configuration' | 'global_labels' | 'services' | 'versions' | 'groupings' | 'integrations' | 'agents' | 'indices_stats' | 'cardinality' | 'environments' | 'service_groups' | 'custom_dashboards' | 'per_service' | 'top_traces' | 'per_agent_config_settings', { - took: { - ms: number; - }; - }>; -} -export type MetricRollupIntervals = RollupInterval.OneMinute | RollupInterval.TenMinutes | RollupInterval.SixtyMinutes; -export type MetricSupportingRollUp = 'service_destination' | 'transaction' | 'service_summary' | 'service_transaction' | 'span_breakdown'; -export type MetricNotSupportingRollup = 'app'; -export type MetricTypes = MetricSupportingRollUp | MetricNotSupportingRollup; -export interface CapturedMetricStats { - total: { - shards: number; - docs: { - count: number; - }; - store: { - size_in_bytes: number; - }; - }; -} -export interface LastDayCount { - doc_count: number; -} -export interface DataStreamCombined { - all: CapturedMetricStats; - '1d': LastDayCount; -} -export type DataStreamStats = Record; -export type APMDataTelemetry = DeepPartial; -export type APMTelemetry = APMDataTelemetry; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_timeseries.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/apm_timeseries.d.ts deleted file mode 100644 index dc5c21192f46c..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/apm_timeseries.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import * as t from 'io-ts'; -import type { ChangePointType } from '@kbn/es-types/src'; -import { LatencyAggregationType } from './latency_aggregation_types'; -export declare enum ApmTimeseriesType { - transactionThroughput = "transaction_throughput", - transactionLatency = "transaction_latency", - transactionFailureRate = "transaction_failure_rate", - exitSpanThroughput = "exit_span_throughput", - exitSpanLatency = "exit_span_latency", - exitSpanFailureRate = "exit_span_failure_rate", - errorEventRate = "error_event_rate" -} -export declare const getApmTimeseriesRt: t.TypeC<{ - stats: t.ArrayC, t.LiteralC]>; - }>, t.PartialC<{ - 'transaction.type': t.StringC; - 'transaction.name': t.StringC; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC]>; - }>, t.PartialC<{ - 'span.destination.service.resource': t.StringC; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.LiteralC; - function: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC]>; - }>, t.PartialC<{ - 'transaction.type': t.StringC; - 'transaction.name': t.StringC; - }>]>, t.TypeC<{ - name: t.LiteralC; - }>]>; - }>, t.PartialC<{ - filter: t.StringC; - offset: t.StringC; - 'service.environment': t.StringC; - }>]>>; - start: t.StringC; - end: t.StringC; -}>; -export interface TimeseriesChangePoint { - change_point?: number | undefined; - r_value?: number | undefined; - trend?: string | undefined; - p_value?: number; - date: string | undefined; - type: ChangePointType; -} -export interface ApmTimeseries { - stat: t.TypeOf['stats'][number]; - group: string; - id: string; - data: Array<{ - x: number; - y: number | null; - }>; - value: number | null; - start: number; - end: number; - unit: string; - changes: TimeseriesChangePoint[]; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/connections.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/connections.d.ts deleted file mode 100644 index f49c7896450dc..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/connections.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { Coordinate } from './coordinate'; -import type { AgentName } from './es_schemas/ui/fields/agent'; -export declare enum NodeType { - service = "service", - dependency = "dependency" -} -interface NodeBase { - id: string; -} -export interface ServiceNode extends NodeBase { - type: NodeType.service; - serviceName: string; - agentName: AgentName; - environment: string; - dependencyName?: string; -} -export interface DependencyNode extends NodeBase { - type: NodeType.dependency; - dependencyName: string; - spanType: string; - spanSubtype: string; -} -export type Node = ServiceNode | DependencyNode; -export interface ConnectionStats { - latency: { - value: number | null; - timeseries?: Coordinate[]; - }; - throughput: { - value: number | null; - timeseries?: Coordinate[]; - }; - errorRate: { - value: number | null; - timeseries?: Coordinate[]; - }; - totalTime: { - value: number | null; - timeseries?: Coordinate[]; - }; -} -export interface ConnectionStatsItem { - location: Node; - stats: ConnectionStats; -} -export interface ConnectionStatsItemWithImpact extends ConnectionStatsItem { - stats: ConnectionStatsItem['stats'] & { - impact: number; - }; -} -export interface ConnectionStatsItemWithComparisonData { - location: Node; - currentStats: ConnectionStatsItemWithImpact['stats']; - previousStats: ConnectionStatsItemWithImpact['stats'] | null; -} -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/container_type.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/container_type.d.ts deleted file mode 100644 index f109bc857fe19..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/container_type.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type ContainerType = 'Kubernetes' | 'Docker' | undefined; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/coordinate.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/coordinate.d.ts deleted file mode 100644 index f0d65390790ea..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/coordinate.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Maybe } from '@kbn/apm-types-shared'; -export interface Coordinate { - x: number; - y: Maybe; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/correlations.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/correlations.d.ts deleted file mode 100644 index ecb0a294486ac..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/correlations.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import type { Environment } from './environment_rt'; -export interface FieldValuePair { - fieldName: string; - fieldValue: string | number; - isFallbackResult?: boolean; -} -export interface HistogramItem { - key: number; - doc_count: number; -} -export interface ResponseHitSource { - [s: string]: unknown; -} -export interface ResponseHit { - _source: ResponseHitSource; -} -export interface CommonCorrelationsQueryParams { - start: number; - end: number; - kuery: string; - environment: Environment; - query: QueryDslQueryContainer; -} -export type EntityType = 'transaction' | 'exit_span'; -export type MetricCorrelation = 'latency' | 'failure_rate'; -export interface UnifiedCorrelation { - fieldName: string; - fieldValue: string | number; - correlation?: number; - ksTest?: number; - pValue?: number | null; - score?: number; - normalizedScore?: number; - histogram?: HistogramItem[]; - isFallbackResult?: boolean; - doc_count?: number; - bg_count?: number; - failurePercentage?: number; - successPercentage?: number; -} -export interface CorrelationsResponse { - overallHistogram?: HistogramItem[]; - errorHistogram?: HistogramItem[]; - totalDocCount: number; - percentileThresholdValue?: number | null; - durationMin: number; - durationMax: number; - fieldCandidates: string[]; - correlations: UnifiedCorrelation[]; - ccsWarning: boolean; - fallbackResult?: UnifiedCorrelation; -} -export interface LatencyCorrelation extends FieldValuePair { - correlation: number; - histogram?: HistogramItem[]; - ksTest: number; - isFallbackResult?: boolean; -} -export interface LatencyCorrelationsResponse { - ccsWarning: boolean; - totalDocCount?: number; - overallHistogram?: HistogramItem[]; - percentileThresholdValue?: number | null; - latencyCorrelations?: LatencyCorrelation[]; -} -export interface FailedTransactionsCorrelation extends FieldValuePair { - doc_count: number; - bg_count: number; - score: number; - pValue: number | null; - normalizedScore: number; - failurePercentage: number; - successPercentage: number; - /** Present when histograms were requested (default for legacy p-values API). */ - histogram?: HistogramItem[]; -} -export type FailedTransactionsCorrelationsImpactThreshold = string; -export interface FailedTransactionsCorrelationsResponse { - ccsWarning: boolean; - failedTransactionsCorrelations?: FailedTransactionsCorrelation[]; - percentileThresholdValue?: number | null; - overallHistogram?: HistogramItem[]; - totalDocCount?: number; - errorHistogram?: HistogramItem[]; - fallbackResult?: FailedTransactionsCorrelation; -} -export interface TopValueBucket { - key: string | number; - doc_count: number; -} -export interface TopValuesStats { - count?: number; - fieldName: string; - topValues: TopValueBucket[]; - topValuesSampleSize: number; - isTopValuesSampled?: boolean; - topValuesSamplerShardSize?: number; -} -export type FieldValueFieldStats = TopValuesStats; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/custom_dashboards.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/custom_dashboards.d.ts deleted file mode 100644 index 5852284627ce8..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/custom_dashboards.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare const APM_CUSTOM_DASHBOARDS_SAVED_OBJECT_TYPE = "apm-custom-dashboards"; -export interface ApmCustomDashboard { - dashboardSavedObjectId: string; - serviceNameFilterEnabled: boolean; - serviceEnvironmentFilterEnabled: boolean; - kuery?: string; -} -export interface SavedApmCustomDashboard extends ApmCustomDashboard { - id: string; - updatedAt: number; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/custom_link.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/custom_link.d.ts deleted file mode 100644 index 42627c5f0dc85..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/custom_link.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SERVICE_NAME, SERVICE_ENVIRONMENT, TRANSACTION_NAME, TRANSACTION_TYPE } from '../es_fields'; -export declare const FILTER_OPTIONS: readonly ["service.name", "service.environment", "transaction.type", "transaction.name"]; -export type FilterKey = (typeof FILTER_OPTIONS)[number]; -export interface CustomLinkES { - id?: string; - '@timestamp'?: number; - label: string; - url: string; - [SERVICE_NAME]?: string[]; - [SERVICE_ENVIRONMENT]?: string[]; - [TRANSACTION_NAME]?: string[]; - [TRANSACTION_TYPE]?: string[]; -} -export interface Filter { - id?: string; - key: FilterKey | ''; - value: string; -} -export interface CustomLink { - id?: string; - '@timestamp'?: number; - label: string; - url: string; - filters?: Filter[]; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/data_source.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/data_source.d.ts deleted file mode 100644 index 7d0ab47b9d398..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/data_source.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ApmDocumentType } from './document_type'; -import type { RollupInterval } from './rollup'; -type AnyApmDocumentType = ApmDocumentType.ServiceTransactionMetric | ApmDocumentType.TransactionMetric | ApmDocumentType.TransactionEvent | ApmDocumentType.ServiceDestinationMetric | ApmDocumentType.ServiceSummaryMetric | ApmDocumentType.ErrorEvent | ApmDocumentType.SpanEvent; -export interface ApmDataSource { - rollupInterval: RollupInterval; - documentType: TDocumentType; -} -export type ApmDataSourceWithSummary = ApmDataSource & { - hasDurationSummaryField: boolean; - hasDocs: boolean; -}; -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/diagnostics.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/diagnostics.d.ts deleted file mode 100644 index 0cc0cc6a37d66..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/diagnostics.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface IndiciesItem { - index: string; - fieldMappings: { - isValid: boolean; - invalidType?: string; - }; - ingestPipeline: { - isValid?: boolean; - id?: string; - }; - dataStream?: string; - isValid: boolean; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/document_type.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/document_type.d.ts deleted file mode 100644 index 744790a5b8e67..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/document_type.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare enum ApmDocumentType { - TransactionMetric = "transactionMetric", - ServiceTransactionMetric = "serviceTransactionMetric", - TransactionEvent = "transactionEvent", - ServiceDestinationMetric = "serviceDestinationMetric", - ServiceSummaryMetric = "serviceSummaryMetric", - ErrorEvent = "error", - SpanEvent = "span" -} -export type ApmServiceTransactionDocumentType = ApmDocumentType.ServiceTransactionMetric | ApmDocumentType.TransactionMetric | ApmDocumentType.TransactionEvent; -export type ApmTransactionDocumentType = ApmDocumentType.TransactionMetric | ApmDocumentType.TransactionEvent; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/downstream_dependencies.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/downstream_dependencies.d.ts deleted file mode 100644 index b00698fd2bae6..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/downstream_dependencies.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import * as t from 'io-ts'; -export declare const downstreamDependenciesRouteRt: t.IntersectionC<[t.TypeC<{ - serviceName: t.StringC; - start: t.StringC; - end: t.StringC; -}>, t.PartialC<{ - serviceEnvironment: t.StringC; -}>]>; -export interface APMDownstreamDependency { - 'service.name'?: string; - 'span.destination.service.resource': string; - 'span.type'?: string; - 'span.subtype'?: string; - errorRate?: number; - latencyMs?: number; - throughputPerMin?: number; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/environment_filter_values.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/environment_filter_values.d.ts deleted file mode 100644 index c21f6b1a955ab..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/environment_filter_values.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Environment } from './environment_rt'; -export declare const ENVIRONMENT_ALL_VALUE: "ENVIRONMENT_ALL"; -export declare const ENVIRONMENT_NOT_DEFINED_VALUE: "ENVIRONMENT_NOT_DEFINED"; -export declare const allOptionText: string; -export declare function getEnvironmentLabel(environment: string): string; -export declare const ENVIRONMENT_ALL: { - value: "ENVIRONMENT_ALL"; - label: string; -}; -export declare const ENVIRONMENT_NOT_DEFINED: { - value: "ENVIRONMENT_NOT_DEFINED"; - label: string; -}; -export declare function isEnvironmentDefined(environment: string): boolean | ""; -export declare function getEnvironmentEsField(environment: string): { - "service.environment"?: undefined; -} | { - "service.environment": string; -}; -export declare function getEnvironmentKuery(environment: string): string | null; -export declare function getNextEnvironmentUrlParam({ requestedEnvironment, currentEnvironmentUrlParam, }: { - requestedEnvironment?: string; - currentEnvironmentUrlParam: Environment; -}): string; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/environment_rt.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/environment_rt.d.ts deleted file mode 100644 index 3d43ebc125568..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/environment_rt.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as t from 'io-ts'; -export declare const environmentStringRt: t.UnionC<[t.LiteralC<"ENVIRONMENT_NOT_DEFINED">, t.LiteralC<"ENVIRONMENT_ALL">, t.StringC, t.BrandC]>; -export declare const environmentRt: t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"ENVIRONMENT_NOT_DEFINED">, t.LiteralC<"ENVIRONMENT_ALL">, t.StringC, t.BrandC]>; -}>; -export type Environment = t.TypeOf['environment']; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/errors.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/errors.d.ts deleted file mode 100644 index f194ac415ab5a..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/errors.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { TimestampUs } from '../es_schemas_raw'; -import type { Exception } from './es_schemas/raw/error_raw'; -export interface ErrorData { - exception?: Exception; - grouping_key?: string; - culprit?: string; - id?: string; - log?: { - message?: string; - }; -} -export interface Error { - id: string; - index?: string; - parent?: { - id?: string; - }; - trace?: { - id?: string; - }; - span?: { - id?: string; - }; - transaction?: { - id?: string; - }; - service: { - name: string; - }; - eventName?: string; - error: ErrorData; - timestamp: TimestampUs; -} -export interface ErrorsByTraceId { - traceErrors: Error[]; - source: 'apm' | 'unprocessedOtel'; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/apm.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/apm.d.ts deleted file mode 100644 index 4e664ea7386d3..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/apm.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -export declare const ID = "_id"; -export declare const TIMESTAMP_US = "timestamp.us"; -export declare const AT_TIMESTAMP = "@timestamp"; -export declare const AGENT = "agent"; -export declare const AGENT_NAME = "agent.name"; -export declare const AGENT_VERSION = "agent.version"; -export declare const AGENT_ACTIVATION_METHOD = "agent.activation_method"; -export declare const DESTINATION_ADDRESS = "destination.address"; -export declare const CLOUD = "cloud"; -export declare const CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; -export declare const CLOUD_PROVIDER = "cloud.provider"; -export declare const CLOUD_REGION = "cloud.region"; -export declare const CLOUD_MACHINE_TYPE = "cloud.machine.type"; -export declare const CLOUD_ACCOUNT_ID = "cloud.account.id"; -export declare const CLOUD_ACCOUNT_NAME = "cloud.account.name"; -export declare const CLOUD_INSTANCE_ID = "cloud.instance.id"; -export declare const CLOUD_INSTANCE_NAME = "cloud.instance.name"; -export declare const CLOUD_SERVICE_NAME = "cloud.service.name"; -export declare const CLOUD_PROJECT_NAME = "cloud.project.name"; -export declare const EVENT_SUCCESS_COUNT = "event.success_count"; -export declare const SERVICE = "service"; -export declare const SERVICE_NAME = "service.name"; -export declare const SERVICE_ENVIRONMENT = "service.environment"; -export declare const SERVICE_FRAMEWORK_NAME = "service.framework.name"; -export declare const SERVICE_FRAMEWORK_VERSION = "service.framework.version"; -export declare const SERVICE_LANGUAGE_NAME = "service.language.name"; -export declare const SERVICE_LANGUAGE_VERSION = "service.language.version"; -export declare const SERVICE_RUNTIME_NAME = "service.runtime.name"; -export declare const SERVICE_RUNTIME_VERSION = "service.runtime.version"; -export declare const SERVICE_NODE_NAME = "service.node.name"; -export declare const SERVICE_VERSION = "service.version"; -export declare const SERVICE_TARGET_TYPE = "service.target.type"; -export declare const SERVICE_OVERFLOW_COUNT = "service_transaction.aggregation.overflow_count"; -export declare const URL_FULL = "url.full"; -export declare const HTTP_REQUEST_METHOD = "http.request.method"; -export declare const HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"; -export declare const USER_ID = "user.id"; -export declare const USER_AGENT_ORIGINAL = "user_agent.original"; -export declare const USER_AGENT_NAME = "user_agent.name"; -export declare const USER_AGENT_VERSION = "user_agent.version"; -export declare const OBSERVER_VERSION = "observer.version"; -export declare const OBSERVER_VERSION_MAJOR = "observer.version_major"; -export declare const OBSERVER_HOSTNAME = "observer.hostname"; -export declare const OBSERVER_LISTENING = "observer.listening"; -export declare const PROCESSOR_EVENT = "processor.event"; -export declare const PROCESSOR_NAME = "processor.name"; -export declare const TRANSACTION_MARKS_AGENT = "transaction.marks.agent"; -export declare const TRANSACTION_DURATION = "transaction.duration.us"; -export declare const TRANSACTION_DURATION_HISTOGRAM = "transaction.duration.histogram"; -export declare const TRANSACTION_DURATION_SUMMARY = "transaction.duration.summary"; -export declare const TRANSACTION_TYPE = "transaction.type"; -export declare const TRANSACTION_RESULT = "transaction.result"; -export declare const TRANSACTION_NAME = "transaction.name"; -export declare const TRANSACTION_ID = "transaction.id"; -export declare const TRANSACTION_SAMPLED = "transaction.sampled"; -export declare const TRANSACTION_PAGE_URL = "transaction.page.url"; -export declare const TRANSACTION_FAILURE_COUNT = "transaction.failure_count"; -export declare const TRANSACTION_SUCCESS_COUNT = "transaction.success_count"; -export declare const TRANSACTION_OVERFLOW_COUNT = "transaction.aggregation.overflow_count"; -export declare const TRANSACTION_ROOT = "transaction.root"; -export declare const TRANSACTION_PROFILER_STACK_TRACE_IDS = "transaction.profiler_stack_trace_ids"; -export declare const ELASTIC_PROFILER_STACK_TRACE_IDS = "elastic.profiler_stack_trace_ids"; -export declare const EVENT_OUTCOME = "event.outcome"; -export declare const TRACE_ID = "trace.id"; -export declare const SPAN_DURATION = "span.duration.us"; -export declare const SPAN_TYPE = "span.type"; -export declare const SPAN_SUBTYPE = "span.subtype"; -export declare const SPAN_SELF_TIME_SUM = "span.self_time.sum.us"; -export declare const SPAN_ACTION = "span.action"; -export declare const SPAN_NAME = "span.name"; -export declare const SPAN_ID = "span.id"; -export declare const SPAN_DESTINATION_SERVICE_RESOURCE = "span.destination.service.resource"; -export declare const SPAN_DESTINATION_SERVICE_RESPONSE_TIME_COUNT = "span.destination.service.response_time.count"; -export declare const SPAN_DESTINATION_SERVICE_RESPONSE_TIME_SUM = "span.destination.service.response_time.sum.us"; -export declare const SPAN_LINKS = "span.links"; -export declare const SPAN_LINKS_TRACE_ID = "span.links.trace.id"; -export declare const SPAN_LINKS_SPAN_ID = "span.links.span.id"; -export declare const SPAN_COMPOSITE_COUNT = "span.composite.count"; -export declare const SPAN_COMPOSITE_SUM = "span.composite.sum.us"; -export declare const SPAN_COMPOSITE_COMPRESSION_STRATEGY = "span.composite.compression_strategy"; -export declare const SPAN_SYNC = "span.sync"; -export declare const SPAN_STACKTRACE = "span.stacktrace"; -export declare const PARENT_ID = "parent.id"; -export declare const ERROR_ID = "error.id"; -export declare const ERROR_GROUP_ID = "error.grouping_key"; -export declare const ERROR_GROUP_NAME = "error.grouping_name"; -export declare const ERROR_CULPRIT = "error.culprit"; -export declare const ERROR_LOG_LEVEL = "error.log.level"; -export declare const ERROR_LOG_MESSAGE = "error.log.message"; -export declare const ERROR_EXCEPTION = "error.exception"; -export declare const ERROR_EXC_MESSAGE = "error.exception.message"; -export declare const ERROR_EXC_HANDLED = "error.exception.handled"; -export declare const ERROR_EXC_TYPE = "error.exception.type"; -export declare const ERROR_PAGE_URL = "error.page.url"; -export declare const ERROR_STACK_TRACE = "error.stack_trace"; -export declare const ERROR_TYPE = "error.type"; -export declare const ERROR_CODE = "error.code"; -export declare const ANOMALY_DETECTOR_TYPE = "anomaly.detector_type"; -export declare const METRIC_SYSTEM_FREE_MEMORY = "system.memory.actual.free"; -export declare const METRIC_SYSTEM_TOTAL_MEMORY = "system.memory.total"; -export declare const METRIC_SYSTEM_CPU_PERCENT = "system.cpu.total.norm.pct"; -export declare const METRIC_PROCESS_CPU_PERCENT = "system.process.cpu.total.norm.pct"; -export declare const METRIC_CGROUP_MEMORY_LIMIT_BYTES = "system.process.cgroup.memory.mem.limit.bytes"; -export declare const METRIC_CGROUP_MEMORY_USAGE_BYTES = "system.process.cgroup.memory.mem.usage.bytes"; -export declare const METRIC_JAVA_HEAP_MEMORY_MAX = "jvm.memory.heap.max"; -export declare const METRIC_JAVA_HEAP_MEMORY_COMMITTED = "jvm.memory.heap.committed"; -export declare const METRIC_JAVA_HEAP_MEMORY_USED = "jvm.memory.heap.used"; -export declare const METRIC_JAVA_NON_HEAP_MEMORY_MAX = "jvm.memory.non_heap.max"; -export declare const METRIC_JAVA_NON_HEAP_MEMORY_COMMITTED = "jvm.memory.non_heap.committed"; -export declare const METRIC_JAVA_NON_HEAP_MEMORY_USED = "jvm.memory.non_heap.used"; -export declare const METRIC_JAVA_THREAD_COUNT = "jvm.thread.count"; -export declare const METRIC_JAVA_GC_COUNT = "jvm.gc.count"; -export declare const METRIC_JAVA_GC_TIME = "jvm.gc.time"; -export declare const METRICSET_NAME = "metricset.name"; -export declare const METRICSET_INTERVAL = "metricset.interval"; -export declare const LABEL_NAME = "labels.name"; -export declare const LABEL_GC = "labels.gc"; -export declare const LABEL_TYPE = "labels.type"; -export declare const LABEL_TELEMETRY_AUTO_VERSION = "labels.telemetry_auto_version"; -export declare const LABEL_LIFECYCLE_STATE = "labels.lifecycle_state"; -export declare const HOST = "host"; -export declare const HOST_HOSTNAME = "host.hostname"; -export declare const HOST_NAME = "host.name"; -export declare const HOST_OS_PLATFORM = "host.os.platform"; -export declare const HOST_ARCHITECTURE = "host.architecture"; -export declare const HOST_OS_VERSION = "host.os.version"; -export declare const CONTAINER_ID = "container.id"; -export declare const CONTAINER = "container"; -export declare const CONTAINER_IMAGE = "container.image.name"; -export declare const KUBERNETES = "kubernetes"; -export declare const KUBERNETES_POD_NAME = "kubernetes.pod.name"; -export declare const KUBERNETES_POD_NAME_OTEL = "k8s.pod.name"; -export declare const KUBERNETES_POD_UID = "kubernetes.pod.uid"; -export declare const KUBERNETES_NAMESPACE = "kubernetes.namespace"; -export declare const KUBERNETES_NODE_NAME = "kubernetes.node.name"; -export declare const KUBERNETES_CONTAINER_NAME = "kubernetes.container.name"; -export declare const KUBERNETES_CONTAINER_ID = "kubernetes.container.id"; -export declare const KUBERNETES_DEPLOYMENT_NAME = "kubernetes.deployment.name"; -export declare const KUBERNETES_REPLICASET_NAME = "kubernetes.replicaset.name"; -export declare const FAAS_ID = "faas.id"; -export declare const FAAS_NAME = "faas.name"; -export declare const FAAS_COLDSTART = "faas.coldstart"; -export declare const FAAS_TRIGGER_TYPE = "faas.trigger.type"; -export declare const FAAS_DURATION = "faas.duration"; -export declare const FAAS_COLDSTART_DURATION = "faas.coldstart_duration"; -export declare const FAAS_BILLED_DURATION = "faas.billed_duration"; -export declare const METRIC_OTEL_SYSTEM_CPU_UTILIZATION = "system.cpu.utilization"; -export declare const METRIC_OTEL_SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization"; -export declare const METRIC_OTEL_JVM_PROCESS_CPU_PERCENT = "process.runtime.jvm.cpu.utilization"; -export declare const METRIC_OTEL_JVM_PROCESS_MEMORY_USAGE = "process.runtime.jvm.memory.usage"; -export declare const METRIC_OTEL_JVM_PROCESS_MEMORY_COMMITTED = "process.runtime.jvm.memory.committed"; -export declare const METRIC_OTEL_JVM_PROCESS_MEMORY_LIMIT = "process.runtime.jvm.memory.limit"; -export declare const METRIC_OTEL_JVM_PROCESS_THREADS_COUNT = "process.runtime.jvm.threads.count"; -export declare const METRIC_OTEL_JVM_SYSTEM_CPU_PERCENT = "process.runtime.jvm.system.cpu.utilization"; -export declare const METRIC_OTEL_JVM_GC_DURATION = "process.runtime.jvm.gc.duration"; -export declare const METRIC_OTEL_JVM_CPU_PERCENT = "metrics.jvm.cpu.recent_utilization"; -export declare const METRIC_OTEL_JVM_MEMORY_USED = "metrics.jvm.memory.used"; -export declare const METRIC_OTEL_JVM_MEMORY_COMMITTED = "metrics.jvm.memory.committed"; -export declare const METRIC_OTEL_JVM_MEMORY_LIMIT = "metrics.jvm.memory.limit"; -export declare const METRIC_OTEL_JVM_THREAD_COUNT = "metrics.jvm.thread.count"; -export declare const METRIC_OTEL_JVM_SYSTEM_CPU = "metrics.jvm.system.cpu.utilization"; -export declare const METRIC_OTEL_JVM_GC_DURATION_SECONDS = "metrics.jvm.gc.duration"; -export declare const ATTRIBUTE_OTEL_JVM_MEMORY_TYPE = "attributes.jvm.memory.type"; -export declare const LABEL_OTEL_JVM_MEMORY_TYPE = "labels.jvm_memory_type"; -export declare const VALUE_OTEL_JVM_MEMORY_TYPE_HEAP = "heap"; -export declare const VALUE_OTEL_JVM_MEMORY_TYPE_NON_HEAP = "non_heap"; -export declare const TELEMETRY_SDK_NAME = "telemetry.sdk.name"; -export declare const TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; -export declare const TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; -export declare const URL_PATH = "url.path"; -export declare const URL_SCHEME = "url.scheme"; -export declare const SERVER_ADDRESS = "server.address"; -export declare const SERVER_PORT = "server.port"; -export declare const OTEL_SPAN_LINKS = "links"; -export declare const OTEL_SPAN_LINKS_SPAN_ID = "links.span_id"; -export declare const OTEL_SPAN_LINKS_TRACE_ID = "links.trace_id"; -export declare const TIER = "_tier"; -export declare const INDEX = "_index"; -export declare const DATA_STEAM_TYPE = "data_stream.type"; -export declare const NETWORK_CONNECTION_TYPE = "network.connection.type"; -export declare const DEVICE_MODEL_IDENTIFIER = "device.model.identifier"; -export declare const SESSION_ID = "session.id"; -export declare const APP_LAUNCH_TIME = "application.launch.time"; -export declare const EVENT_NAME = "event.name"; -export declare const CLIENT_GEO_COUNTRY_ISO_CODE = "client.geo.country_iso_code"; -export declare const CLIENT_GEO_REGION_ISO_CODE = "client.geo.region_iso_code"; -export declare const CLIENT_GEO_COUNTRY_NAME = "client.geo.country_name"; -export declare const CLIENT_GEO_CITY_NAME = "client.geo.city_name"; -export declare const CLIENT_GEO_REGION_NAME = "client.geo.region_name"; -export declare const CHILD_ID = "child.id"; -export declare const LOG_LEVEL = "log.level"; -export declare const PROCESS_ARGS = "process.args"; -export declare const PROCESS_PID = "process.pid"; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/common.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/common.d.ts deleted file mode 100644 index 2bc9c2b165662..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/common.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const ERROR_MESSAGE = "error.message"; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/otel.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/otel.d.ts deleted file mode 100644 index db64f78b3afc7..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_fields/otel.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export declare const STATUS_CODE = "status.code"; -export declare const OTEL_EVENT_NAME = "event_name"; -export declare const EXCEPTION_TYPE = "exception.type"; -export declare const EXCEPTION_MESSAGE = "exception.message"; -export declare const DURATION = "duration"; -export declare const KIND = "kind"; -export declare const RESOURCE_ATTRIBUTES_TELEMETRY_SDK_LANGUAGE = "resource.attributes.telemetry.sdk.language"; -export declare const LINKS_TRACE_ID = "links.trace_id"; -export declare const LINKS_SPAN_ID = "links.span_id"; -export declare const ATTRIBUTE_HTTP_SCHEME = "attributes.http.scheme"; -export declare const ATTRIBUTE_HTTP_STATUS_CODE = "attributes.http.status_code"; -export declare const PROCESS_RUNTIME_VERSION = "process.runtime.version"; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/apm_base_doc.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/apm_base_doc.d.ts deleted file mode 100644 index 0548ed5e74dff..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/apm_base_doc.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Observer } from './fields/observer'; -export interface APMBaseDoc { - '@timestamp': string; - agent: { - name: string; - version?: string; - }; - parent?: { - id?: string; - }; - trace?: { - id?: string; - }; - labels?: { - [key: string]: string | number | boolean; - }; - observer?: Observer; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/error_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/error_raw.d.ts deleted file mode 100644 index 25e786a46d00e..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/error_raw.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { APMBaseDoc } from './apm_base_doc'; -import type { Container, Host, Http, Kubernetes, Page, Process, Service, Stackframe, TimestampUs, Url, User } from './fields'; -import type { Server } from './fields/server'; -export interface Processor { - name: 'error'; - event: 'error'; -} -export interface Exception { - attributes?: { - response?: string; - }; - code?: string; - message?: string; - type?: string; - module?: string; - handled?: boolean; - stacktrace?: Stackframe[]; -} -export interface Log { - message: string; - stacktrace?: Stackframe[]; -} -export interface ErrorRaw extends APMBaseDoc { - processor: Processor; - timestamp: TimestampUs; - transaction?: { - id: string; - sampled?: boolean; - type: string; - }; - error: { - id: string; - culprit?: string; - grouping_key: string; - exception?: Exception[]; - page?: Page; - log?: Log; - stack_trace?: string; - custom?: Record; - message?: string; - code?: string; - type?: string; - }; - container?: Container; - host?: Host; - http?: Http; - kubernetes?: Kubernetes; - process?: Process; - service: Service; - url?: Url; - server?: Server; - user?: User; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/event_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/event_raw.d.ts deleted file mode 100644 index 22ddfcc44d9b8..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/event_raw.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { APMBaseDoc } from './apm_base_doc'; -import type { TimestampUs } from './fields/timestamp_us'; -export interface EventRaw extends APMBaseDoc { - timestamp: TimestampUs; - transaction?: { - id: string; - sampled?: boolean; - type: string; - }; - log: { - message?: string; - }; - event: { - action: string; - category: string; - }; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/cloud.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/cloud.d.ts deleted file mode 100644 index 5bceb47a575e7..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/cloud.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export interface Cloud { - availability_zone?: string; - instance?: { - name?: string; - id?: string; - }; - machine?: { - type?: string; - }; - project?: { - id?: string; - name?: string; - }; - provider?: string; - region?: string; - account?: { - id?: string; - name?: string; - }; - image?: { - id?: string; - }; - service?: { - name?: string; - }; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/container.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/container.d.ts deleted file mode 100644 index 0e73f48b204ba..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/container.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface Container { - id?: string | null; - image?: { - name?: string; - }; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/event_outcome.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/event_outcome.d.ts deleted file mode 100644 index d6e3bcbbe87e1..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/event_outcome.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type EventOutcome = 'success' | 'failure' | 'unknown'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/faas.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/faas.d.ts deleted file mode 100644 index d34e189ebfdaf..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/faas.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface Faas { - id: string; - coldstart?: boolean; - execution?: string; - trigger?: { - type?: string; - request_id?: string; - }; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/host.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/host.d.ts deleted file mode 100644 index e56da08c01143..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/host.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface Host { - architecture?: string; - hostname?: string; - name?: string; - ip?: string; - os?: { - platform?: string; - }; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/http.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/http.d.ts deleted file mode 100644 index 22c71a227faec..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/http.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface Http { - request?: { - method?: string; - }; - response?: { - status_code?: number; - }; - version?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/index.d.ts deleted file mode 100644 index 93fdaaec806a6..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type * from './cloud'; -export type * from './container'; -export type * from './event_outcome'; -export type * from './faas'; -export type * from './host'; -export type * from './http'; -export type * from './kubernetes'; -export type * from './observer'; -export type * from './page'; -export type * from './process'; -export type * from './service'; -export type * from './span_links'; -export type * from './stackframe'; -export type * from './timestamp_us'; -export type * from './url'; -export type * from './user_agent'; -export type * from './user'; -export type * from './otel'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/kubernetes.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/kubernetes.d.ts deleted file mode 100644 index eb1b540cf7bde..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/kubernetes.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface Kubernetes { - pod?: { - uid?: string | null; - name?: string; - }; - namespace?: string; - replicaset?: { - name?: string; - }; - deployment?: { - name?: string; - }; - container?: { - id?: string; - name?: string; - }; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/observer.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/observer.d.ts deleted file mode 100644 index b67630b76bf55..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/observer.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface Observer { - ephemeral_id?: string; - hostname?: string; - id?: string; - name?: string; - type?: string; - version?: string; - version_major?: number; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/index.d.ts deleted file mode 100644 index ed303982e28a0..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './status_code'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/status_code.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/status_code.d.ts deleted file mode 100644 index aa285806f98c0..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/otel/status_code.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type StatusCode = 'Ok' | 'Unset' | 'Error'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/page.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/page.d.ts deleted file mode 100644 index f1f7a69ca9c99..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/page.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Page { - url?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/process.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/process.d.ts deleted file mode 100644 index f476db85e9c91..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/process.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface Process { - args?: string[]; - pid: number; - ppid?: number; - title?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/server.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/server.d.ts deleted file mode 100644 index 9bf2a65caef76..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/server.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface Server { - address?: string; - port?: number; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/service.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/service.d.ts deleted file mode 100644 index 95805c9644753..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/service.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface Service { - name: string; - environment?: string; - framework?: { - name?: string; - version?: string; - }; - node?: { - name?: string; - }; - runtime?: { - name?: string; - version?: string; - }; - language?: { - name?: string; - version?: string; - }; - version?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/span_links.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/span_links.d.ts deleted file mode 100644 index c5ba5acfbc49e..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/span_links.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface SpanLink { - trace: { - id: string; - }; - span: { - id: string; - }; -} -export interface OtelSpanLink { - span_id: Array; - trace_id: Array; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/stackframe.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/stackframe.d.ts deleted file mode 100644 index 0fc22ed9450a9..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/stackframe.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -interface Line { - column?: number; - number: number; -} -interface Sourcemap { - error?: string; - updated?: boolean; -} -interface StackframeBase { - abs_path?: string; - classname?: string; - context?: { - post?: string[]; - pre?: string[]; - }; - exclude_from_grouping?: boolean; - filename?: string; - function?: string; - module?: string; - library_frame?: boolean; - line?: Line; - sourcemap?: Sourcemap; - vars?: { - [key: string]: unknown; - }; -} -export type StackframeWithLineContext = StackframeBase & { - line: Line & { - context: string; - }; -}; -export type Stackframe = StackframeBase | StackframeWithLineContext; -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/timestamp_us.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/timestamp_us.d.ts deleted file mode 100644 index bcf7c4ebd448a..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/timestamp_us.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface TimestampUs { - us: number; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/url.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/url.d.ts deleted file mode 100644 index 2abcb889afd84..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/url.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface Url { - domain?: string; - full?: string; - original?: string; - scheme?: string; - path?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user.d.ts deleted file mode 100644 index 907637b97307d..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface User { - id?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user_agent.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user_agent.d.ts deleted file mode 100644 index 64b64db75e9e4..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/fields/user_agent.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface UserAgent { - device?: { - name: string; - }; - name?: string; - original?: string; - os?: { - name: string; - version?: string; - full?: string; - }; - version?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/index.d.ts deleted file mode 100644 index 764c6be75929c..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type * from './apm_base_doc'; -export type * from './error_raw'; -export type * from './event_raw'; -export type * from './metric_raw'; -export type * from './span_raw'; -export type * from './transaction_raw'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/metric_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/metric_raw.d.ts deleted file mode 100644 index f789545fe7413..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/metric_raw.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { APMBaseDoc } from './apm_base_doc'; -import type { Cloud } from './fields/cloud'; -import type { Container } from './fields/container'; -import type { Host } from './fields/host'; -import type { Kubernetes } from './fields/kubernetes'; -import type { Service } from './fields/service'; -type BaseMetric = APMBaseDoc & { - processor: { - name: 'metric'; - event: 'metric'; - }; - cloud?: Cloud; - container?: Container; - kubernetes?: Kubernetes; - service?: Service; - host?: Host; -}; -type BaseBreakdownMetric = BaseMetric & { - transaction: { - name: string; - type: string; - }; - span: { - self_time: { - count: number; - sum: { - us: number; - }; - }; - }; -}; -type TransactionBreakdownMetric = BaseBreakdownMetric & { - transaction: { - duration: { - count: number; - sum: { - us: number; - }; - }; - breakdown: { - count: number; - }; - }; -}; -type SpanBreakdownMetric = BaseBreakdownMetric & { - span: { - type: string; - subtype?: string; - }; -}; -type SystemMetric = BaseMetric & { - system: unknown; - service: { - node?: { - name: string; - }; - }; -}; -type CGroupMetric = SystemMetric; -type JVMMetric = SystemMetric & { - jvm: unknown; -}; -type TransactionDurationMetric = BaseMetric & { - transaction: { - name: string; - type: string; - result?: string; - duration: { - histogram: { - values: number[]; - counts: number[]; - }; - }; - }; - service: { - name: string; - node?: { - name: string; - }; - environment?: string; - version?: string; - }; -}; -export type SpanDestinationMetric = BaseMetric & { - span: { - destination: { - service: { - resource: string; - response_time: { - count: number; - sum: { - us: number; - }; - }; - }; - }; - }; -}; -export type MetricRaw = BaseMetric | TransactionBreakdownMetric | SpanBreakdownMetric | TransactionDurationMetric | SpanDestinationMetric | SystemMetric | CGroupMetric | JVMMetric; -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/span_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/span_raw.d.ts deleted file mode 100644 index 6fe8bfced1607..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/span_raw.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -import type { APMBaseDoc } from './apm_base_doc'; -import type { EventOutcome } from './fields/event_outcome'; -import type { Http } from './fields/http'; -import type { Server } from './fields/server'; -import type { SpanLink } from './fields/span_links'; -import type { Stackframe } from './fields/stackframe'; -import type { TimestampUs } from './fields/timestamp_us'; -import type { Url } from './fields/url'; -interface Processor { - name: 'transaction'; - event: 'span'; -} -export interface SpanRaw extends APMBaseDoc { - processor: Processor; - trace: { - id: string; - }; - event?: { - outcome?: EventOutcome; - }; - service: { - name: string; - environment?: string; - }; - span: { - destination?: { - service: { - resource: string; - }; - }; - action?: string; - duration: { - us: number; - }; - id: string; - name: string; - stacktrace?: Stackframe[]; - subtype?: string; - sync?: boolean; - type: string; - http?: { - url?: { - original?: string; - }; - response: { - status_code: number; - }; - method?: string; - }; - db?: { - statement?: string; - type?: string; - }; - message?: { - queue?: { - name: string; - }; - age?: { - ms: number; - }; - body?: string; - headers?: Record; - }; - composite?: { - count: number; - sum: { - us: number; - }; - compression_strategy: string; - }; - links?: SpanLink[]; - }; - timestamp: TimestampUs; - transaction?: { - id: string; - }; - child?: { - id: string[]; - }; - code?: { - stacktrace?: string; - }; - http?: Http; - url?: Url; - server?: Server; -} -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/transaction_raw.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/transaction_raw.d.ts deleted file mode 100644 index 7618d627e1a34..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/raw/transaction_raw.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { APMBaseDoc } from './apm_base_doc'; -import type { Cloud } from './fields/cloud'; -import type { Container } from './fields/container'; -import type { EventOutcome } from './fields/event_outcome'; -import type { Host } from './fields/host'; -import type { Http } from './fields/http'; -import type { Kubernetes } from './fields/kubernetes'; -import type { Page } from './fields/page'; -import type { Process } from './fields/process'; -import type { Service } from './fields/service'; -import type { TimestampUs } from './fields/timestamp_us'; -import type { Url } from './fields/url'; -import type { User } from './fields/user'; -import type { UserAgent } from './fields/user_agent'; -import type { Faas } from './fields/faas'; -import type { SpanLink } from './fields/span_links'; -import type { Server } from './fields/server'; -interface Processor { - name: 'transaction'; - event: 'transaction'; -} -export interface TransactionRaw extends APMBaseDoc { - processor: Processor; - timestamp: TimestampUs; - trace: { - id: string; - }; - event?: { - outcome?: EventOutcome; - }; - transaction: { - duration: { - us: number; - }; - id: string; - marks?: { - agent?: { - [name: string]: number; - }; - }; - name?: string; - page?: Page; - result?: string; - sampled?: boolean; - span_count?: { - started?: number; - dropped?: number; - }; - type: string; - custom?: Record; - message?: { - queue?: { - name: string; - }; - age?: { - ms: number; - }; - body?: string; - headers?: Record; - }; - }; - container?: Container; - ecs?: { - version?: string; - }; - host?: Host; - http?: Http; - server?: Server; - kubernetes?: Kubernetes; - process?: Process; - service: Service; - url?: Url; - user?: User; - user_agent?: UserAgent; - cloud?: Cloud; - faas?: Faas; - span?: { - links?: SpanLink[]; - }; -} -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/apm_error.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/apm_error.d.ts deleted file mode 100644 index b189f4c27b2ac..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/apm_error.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ErrorRaw } from '../raw/error_raw'; -import type { Agent } from './fields/agent'; -export interface APMError extends ErrorRaw { - agent: Agent; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/event.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/event.d.ts deleted file mode 100644 index 11158127f6581..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/event.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { EventRaw } from '../raw/event_raw'; -import type { Agent } from './fields/agent'; -export interface Event extends EventRaw { - agent: Agent; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/agent.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/agent.d.ts deleted file mode 100644 index dd7d7ebf94885..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/agent.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { AgentName } from '@kbn/elastic-agent-utils'; -export type { ElasticAgentName, OpenTelemetryAgentName, AgentName } from '@kbn/elastic-agent-utils'; -export interface Agent { - ephemeral_id?: string; - name: AgentName; - version?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/index.d.ts deleted file mode 100644 index eba5b6968a216..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/fields/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './agent'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/index.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/index.d.ts deleted file mode 100644 index 0a7b87ae933ca..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type * from './apm_error'; -export type * from './event'; -export type * from './metric'; -export type * from './span'; -export type * from './transaction'; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/metric.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/metric.d.ts deleted file mode 100644 index 5562855bcd1ae..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/metric.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { MetricRaw } from '../raw/metric_raw'; -export type Metric = MetricRaw; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/span.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/span.d.ts deleted file mode 100644 index 890e53b4b7407..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/span.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { SpanRaw } from '../raw/span_raw'; -import type { Agent } from './fields/agent'; -export interface Span extends SpanRaw { - agent: Agent; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/transaction.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/transaction.d.ts deleted file mode 100644 index fee63c0b3d508..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/es_schemas/ui/transaction.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { TransactionRaw } from '../raw/transaction_raw'; -import type { Agent } from './fields/agent'; -type InnerTransaction = TransactionRaw['transaction']; -interface InnerTransactionWithName extends InnerTransaction { - name: string; -} -export interface Transaction extends TransactionRaw { - agent: Agent; - transaction: InnerTransactionWithName; -} -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/focused_trace_waterfall.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/focused_trace_waterfall.d.ts deleted file mode 100644 index 02117267c50b3..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/focused_trace_waterfall.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface FocusedTraceWaterfallProps { - traceId: string; - rangeFrom: string; - rangeTo: string; - docId?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/full_trace_waterfall.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/full_trace_waterfall.d.ts deleted file mode 100644 index 656b4c7d534e6..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/full_trace_waterfall.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -type FullTraceWaterfallScrollProps = { - scrollStrategy?: 'window'; - contextSpanIds?: string[]; -} | { - scrollStrategy: 'parent'; - contextSpanIds?: string[]; - scrollToContextOnMount?: boolean; -}; -export type FullTraceWaterfallProps = { - traceId: string; - rangeFrom: string; - rangeTo: string; - serviceName?: string; - scrollElement?: Element; - onNodeClick?: (nodeSpanId: string) => void; - onErrorClick?: FullTraceWaterfallOnErrorClick; - ebt: { - row: { - element: string; - }; - errorBadge: { - element: string; - }; - serviceBadge: { - element: string; - }; - }; -} & FullTraceWaterfallScrollProps; -export type FullTraceWaterfallOnErrorClick = (params: { - traceId: string; - docId: string; - errorCount: number; - errorDocId?: string; - docIndex?: string; -}) => void; -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/ilm_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/ilm_types.d.ts deleted file mode 100644 index 9edf09f1175f0..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/ilm_types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export declare enum IndexLifecyclePhaseSelectOption { - All = "all", - Hot = "hot", - Warm = "warm", - Cold = "cold", - Frozen = "frozen" -} -export declare const indexLifeCyclePhaseToDataTier: { - readonly hot: "data_hot"; - readonly warm: "data_warm"; - readonly cold: "data_cold"; - readonly frozen: "data_frozen"; -}; -export type DataTier = (typeof indexLifeCyclePhaseToDataTier)[keyof typeof indexLifeCyclePhaseToDataTier]; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/instances.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/instances.d.ts deleted file mode 100644 index 6fe527ab82e88..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/instances.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as t from 'io-ts'; -export declare const instancesSortFieldRt: t.KeyofC<{ - serviceNodeName: null; - latency: null; - throughput: null; - errorRate: null; - cpuUsage: null; - memoryUsage: null; -}>; -export type InstancesSortField = t.TypeOf; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_aggregation_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_aggregation_types.d.ts deleted file mode 100644 index 5e37314290ac0..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_aggregation_types.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as t from 'io-ts'; -export declare enum LatencyAggregationType { - avg = "avg", - p99 = "p99", - p95 = "p95" -} -export declare const latencyAggregationTypeRt: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC]>; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution.d.ts deleted file mode 100644 index a4091b50f5dc4..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface OverallLatencyDistributionResponse { - durationMin?: number; - durationMax?: number; - totalDocCount?: number; - percentileThresholdValue?: number | null; - overallHistogram?: Array<{ - key: number; - doc_count: number; - }>; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution_chart_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution_chart_types.d.ts deleted file mode 100644 index 161b843e4594f..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/latency_distribution_chart_types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as t from 'io-ts'; -export declare enum LatencyDistributionChartType { - transactionLatency = "transactionLatency", - spanLatency = "spanLatency", - latencyCorrelations = "latencyCorrelations", - failedTransactionsCorrelations = "failedTransactionsCorrelations", - dependencyLatency = "dependencyLatency" -} -export declare const latencyDistributionChartTypeRt: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC]>; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/mobile_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/mobile_types.d.ts deleted file mode 100644 index 439ec2e4976e9..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/mobile_types.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare enum MobileProperty { - Device = "device", - NetworkConnectionType = "netConnectionType", - OsVersion = "osVersion", - AppVersion = "appVersion" -} -export type MobilePropertyType = MobileProperty.Device | MobileProperty.OsVersion | MobileProperty.AppVersion | MobileProperty.NetworkConnectionType; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/processor_event.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/processor_event.d.ts deleted file mode 100644 index f6ea07af69277..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/processor_event.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ProcessorEvent } from '@kbn/apm-types-shared'; -import * as t from 'io-ts'; -export declare const processorEventRt: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC]>; -/** - * Processor events that are searchable in the UI via the query bar. - * - * Some client-side routes will define 1 or more processor events that - * will be used to fetch the dynamic data view for the query bar. - */ -export type UIProcessorEvent = ProcessorEvent.transaction | ProcessorEvent.error | ProcessorEvent.metric; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/rollup.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/rollup.d.ts deleted file mode 100644 index 18dab62ebb734..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/rollup.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare enum RollupInterval { - OneMinute = "1m", - TenMinutes = "10m", - SixtyMinutes = "60m", - None = "none" -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/serverless.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/serverless.d.ts deleted file mode 100644 index c6460eea48c36..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/serverless.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare enum ServerlessType { - AWS_LAMBDA = "aws.lambda", - AZURE_FUNCTIONS = "azure.functions" -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomalies.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomalies.d.ts deleted file mode 100644 index 121dcc7d38549..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomalies.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface ServiceAnomaliesResponse { - mlJobIds: string[]; - serviceAnomalies: Array<{ - serviceName: string; - jobId: string; - transactionType: string; - actualValue: number; - anomalyScore: number; - }>; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_stats.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_stats.d.ts deleted file mode 100644 index c01bad7f71b3e..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_stats.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface ServiceAnomalyStats { - transactionType?: string; - anomalyScore?: number; - actualValue?: number; - jobId?: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_timeseries.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_timeseries.d.ts deleted file mode 100644 index a523e0b0e4427..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/service_anomaly_timeseries.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Coordinate } from './coordinate'; -import type { AnomalyDetectorType } from './anomaly_detector_type'; -export interface ServiceAnomalyTimeseries { - jobId: string; - type: AnomalyDetectorType; - environment: string; - serviceName: string; - version: number; - transactionType: string; - anomalies: Array; - bounds: Array<{ - x: number; - y0: number | null; - y1: number | null; - }>; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_groups.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_groups.d.ts deleted file mode 100644 index cd8c0f50b40bd..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/service_groups.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface ServiceGroup { - groupName: string; - kuery: string; - description?: string; - color?: string; -} -export interface SavedServiceGroup extends ServiceGroup { - id: string; - updatedAt: number; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_health_status.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_health_status.d.ts deleted file mode 100644 index be39214f78ed6..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/service_health_status.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare enum ServiceHealthStatus { - healthy = "healthy", - critical = "critical", - warning = "warning", - unknown = "unknown" -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_inventory.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_inventory.d.ts deleted file mode 100644 index c50d2f86f54a6..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/service_inventory.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { GroupedStatsResult } from '@kbn/slo-schema'; -export type SloStatus = keyof GroupedStatsResult['summary']; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_map.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_map.d.ts deleted file mode 100644 index be8a685410aab..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/service_map.d.ts +++ /dev/null @@ -1,215 +0,0 @@ -import type { AlertStatus } from '@kbn/rule-data-utils'; -import type { Edge, Node, EdgeMarker as ReactFlowEdgeMarker } from '@xyflow/react'; -import type { AGENT_NAME, SERVICE_ENVIRONMENT, SERVICE_NAME, SPAN_DESTINATION_SERVICE_RESOURCE, SPAN_SUBTYPE, SPAN_TYPE } from './es_fields/apm'; -import type { Coordinate } from './coordinate'; -import type { SloStatus } from './service_inventory'; -import type { ServiceAnomaliesResponse } from './service_anomalies'; -import type { ServiceAnomalyStats } from './service_anomaly_stats'; -import type { AgentName } from './es_schemas/ui/fields/agent'; -export interface ServiceMapTelemetry { - tracesCount: number; - nodesCount: number; -} -export type GroupedConnection = { - label: string; -} & (ConnectionNode | ConnectionEdge); -export interface GroupedNode { - data: { - id: string; - 'span.type': string; - 'span.subtype'?: string; - label: string; - groupedConnections: GroupedConnection[]; - }; -} -export interface GroupedEdge { - data: { - id: string; - source: string; - target: string; - }; -} -export interface GroupResourceNodesResponse extends Pick { - elements: Array; -} -export type ConnectionType = Connection | ConnectionLegacy; -export type DestinationType = ExitSpanDestination | ExitSpanDestinationLegacy; -export interface ServiceMapRawResponse { - spans: ServiceMapSpan[]; - servicesData: ServicesResponse[]; - anomalies: ServiceAnomaliesResponse; -} -export type ServiceMapResponse = Pick & ServiceMapRawResponse; -export interface ServicesResponse { - [SERVICE_NAME]: string; - [AGENT_NAME]: string; - [SERVICE_ENVIRONMENT]: string | null; -} -export interface ServiceConnectionNode extends ServicesResponse { - id: string; - serviceAnomalyStats?: ServiceAnomalyStats; - label?: string; -} -export interface ExternalConnectionNode { - id: string; - [SPAN_DESTINATION_SERVICE_RESOURCE]: string; - [SPAN_TYPE]: string; - [SPAN_SUBTYPE]: string; - label?: string; -} -export type ConnectionNode = ServiceConnectionNode | ExternalConnectionNode; -export type ConnectionNodeLegacy = Omit | Omit; -export interface ConnectionEdge { - id: string; - source: ConnectionNode['id']; - target: ConnectionNode['id']; - label?: string; - bidirectional?: boolean; - isInverseEdge?: boolean; - resources?: string[]; - sourceData?: ConnectionNode; - targetData?: ConnectionNode; - sourceLabel?: string; - targetLabel?: string; -} -export type NodeItem = { - id: string; -} & ConnectionNode; -export interface ConnectionElement { - data: ConnectionNode | ConnectionEdge; -} -export interface Connection { - source: ConnectionNode; - destination: ConnectionNode; -} -export interface ConnectionLegacy { - source: ConnectionNodeLegacy; - destination: ConnectionNodeLegacy; -} -export interface NodeStats { - transactionStats?: { - latency?: { - value: number | null; - timeseries?: Coordinate[]; - }; - throughput?: { - value: number | null; - timeseries?: Coordinate[]; - }; - }; - failedTransactionsRate?: { - value: number | null; - timeseries?: Coordinate[]; - }; - cpuUsage?: { - value?: number | null; - timeseries?: Coordinate[]; - }; - memoryUsage?: { - value?: number | null; - timeseries?: Coordinate[]; - }; -} -export interface ExitSpanDestination { - from: ExternalConnectionNode; - to: ServiceConnectionNode; -} -export interface ExitSpanDestinationLegacy { - from: Omit; - to: Omit; -} -export interface ServiceMapService { - serviceName: string; - agentName: AgentName; - serviceEnvironment?: string; - serviceNodeName?: string; -} -export interface ServiceMapExitSpan extends ServiceMapService { - spanId: string; - spanType: string; - spanSubtype: string; - spanDestinationServiceResource: string; -} -export type ServiceMapSpan = ServiceMapExitSpan & { - destinationService?: ServiceMapService; -}; -interface BaseNodeData extends Record { - id: string; - label: string; -} -export interface ServiceNodeData extends BaseNodeData { - isService: true; - contextHighlight?: boolean; - agentName?: AgentName; - serviceAnomalyStats?: ServiceAnomalyStats; - alertsCount?: number; - alertsByStatus?: Partial>; - sloStatus?: SloStatus | 'noSLOs'; - sloCount?: number; -} -export interface DependencyNodeData extends BaseNodeData { - isService: false; - spanType?: string; - spanSubtype?: string; - [SPAN_TYPE]?: string; - [SPAN_SUBTYPE]?: string; -} -export interface GroupedConnectionInfo { - id: string; - label: string; - spanType?: string; - spanSubtype?: string; - [SPAN_TYPE]?: string; - [SPAN_SUBTYPE]?: string; - [SPAN_DESTINATION_SERVICE_RESOURCE]?: string; -} -export interface GroupInfo { - id: string; - sources: string[]; - targets: string[]; -} -export interface GroupedNodeData extends BaseNodeData { - isService: false; - isGrouped: true; - spanType?: string; - spanSubtype?: string; - groupedConnections: GroupedConnectionInfo[]; - count: number; -} -export type ServiceMapNodeData = ServiceNodeData | DependencyNodeData | GroupedNodeData; -export type ServiceMapNode = Node; -export interface EdgeMarker extends ReactFlowEdgeMarker { - width: number; - height: number; - color: string; -} -export interface ServiceMapEdgeData extends Record { - isBidirectional: boolean; - isGrouped?: boolean; - sourceData?: ConnectionNode; - targetData?: ConnectionNode; - sourceLabel?: string; - targetLabel?: string; - resources?: string[]; -} -export interface ServiceMapEdge extends Edge { - type: 'default'; - style: { - stroke: string; - strokeWidth: number; - }; - markerEnd: EdgeMarker; - markerStart?: EdgeMarker; -} -export interface GroupResourceNodesResult { - nodes: ServiceMapNode[]; - edges: ServiceMapEdge[]; - nodesCount: number; -} -export interface ReactFlowServiceMapResponse { - nodes: ServiceMapNode[]; - edges: ServiceMapEdge[]; - nodesCount: number; - tracesCount: number; -} -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/service_map_diagnostic_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/service_map_diagnostic_types.d.ts deleted file mode 100644 index 690668e4fef39..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/service_map_diagnostic_types.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { ESSearchResponse, ESSearchRequest } from '@kbn/es-types'; -export interface ExitSpanFields { - destinationService: string; - spanId: string; - transactionId: string; - serviceNodeName: string; - traceId: string; - agentName: string; -} -export interface ServiceMapDiagnosticResponse { - analysis: { - exitSpans: { - found: boolean; - totalConnections: number; - apmExitSpans: ExitSpanFields[] | []; - hasMatchingDestinationResources: boolean; - }; - parentRelationships: { - found: boolean; - documentCount: number; - sourceSpanIds: string[]; - }; - traceCorrelation?: { - found: boolean; - foundInSourceNode: boolean; - foundInDestinationNode: boolean; - sourceNodeDocumentCount: number; - destinationNodeDocumentCount: number; - }; - }; - elasticsearchResponses: { - exitSpansQuery?: ESSearchResponse; - sourceSpansQuery?: ESSearchResponse; - destinationParentIdsQuery?: ESSearchResponse; - traceCorrelationQuery?: ESSearchResponse; - }; -} -export interface DiagnosticNodeSelection { - field: string; - value: string; -} -export interface ServiceMapDiagnosticRequest { - start: number; - end: number; - sourceNode: DiagnosticNodeSelection; - destinationNode: DiagnosticNodeSelection; - traceId: string; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/span_links.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/span_links.d.ts deleted file mode 100644 index d6a3d705150db..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/span_links.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AgentName } from '../es_schemas_ui'; -export interface SpanLinkDetails { - traceId: string; - spanId: string; - details?: { - agentName: AgentName; - serviceName: string; - duration: number; - environment: string; - transactionId?: string; - spanName?: string; - spanSubtype?: string; - spanType?: string; - }; -} -export interface SpanLinks { - outgoingSpanLinks: SpanLinkDetails[]; - incomingSpanLinks: SpanLinkDetails[]; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/storage_explorer_types.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/storage_explorer_types.d.ts deleted file mode 100644 index 58ba9a09eaaa7..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/storage_explorer_types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as t from 'io-ts'; -import { IndexLifecyclePhaseSelectOption } from './ilm_types'; -export declare const indexLifecyclePhaseRt: t.TypeC<{ - indexLifecyclePhase: t.UnionC<[t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC, t.LiteralC]>; -}>; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/time_range_metadata.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/time_range_metadata.d.ts deleted file mode 100644 index 1fbc2f8a7f1e0..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/time_range_metadata.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ApmDataSource } from './data_source'; -export interface TimeRangeMetadata { - isUsingServiceDestinationMetrics: boolean; - sources: Array; -} diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/timeseries.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/timeseries.d.ts deleted file mode 100644 index f34ff2ea5940d..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/timeseries.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { AccessorFn, AreaSeriesStyle, Fit, FitConfig, LineSeriesStyle, RecursivePartial, SeriesColorAccessorFn, SeriesColorsArray } from '@elastic/charts'; -import type { Coordinate } from './coordinate'; -export interface BandCoordinate { - x: number; - y0: number | null; - y1: number | null; -} -export interface RectCoordinate { - x: number; - x0: number; -} -type Accessor = Array; -export type TimeSeries = APMChartSpec; -export interface APMChartSpec { - title: string; - id?: string; - titleShort?: string; - hideLegend?: boolean; - hideTooltipValue?: boolean; - data: TCoordinate[]; - legendValue?: string; - type: string; - color?: string | SeriesColorsArray | SeriesColorAccessorFn; - areaColor?: string; - fit?: Exclude | FitConfig; - stackAccessors?: Accessor; - yAccessors?: Accessor; - y0Accessors?: Accessor; - splitSeriesAccessors?: Accessor; - markSizeAccessor?: string | AccessorFn; - lineSeriesStyle?: RecursivePartial; - areaSeriesStyle?: RecursivePartial; - groupId?: string; -} -export type ChartType = 'area' | 'linemark' | 'bar'; -export type YUnit = 'percent' | 'bytes' | 'number' | 'time' | 'integer'; -export {}; diff --git a/x-pack/platform/packages/shared/kbn-apm-types/src/traces.d.ts b/x-pack/platform/packages/shared/kbn-apm-types/src/traces.d.ts deleted file mode 100644 index f81f59524707b..0000000000000 --- a/x-pack/platform/packages/shared/kbn-apm-types/src/traces.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { AgentName } from './es_schemas/ui/fields/agent'; -import type { EventOutcome } from './es_schemas/raw/fields/event_outcome'; -import type { StatusCode } from './es_schemas/raw/fields/otel/status_code'; -import type { Span } from './es_schemas/ui/span'; -import type { Transaction } from './es_schemas/ui/transaction'; -declare const STATUS_FIELD_NAME: readonly ["event.outcome", "status.code"]; -export type CompressionStrategy = 'exact_match' | 'same_kind'; -export interface TraceItemComposite { - count: number; - sum: number; - compressionStrategy: CompressionStrategy; -} -export type TraceItemDocType = 'span' | 'transaction'; -export interface TraceItem { - id: string; - timestampUs: number; - name: string; - traceId: string; - duration: number; - result?: string; - errors: Array<{ - errorDocId: string; - errorDocIndex?: string; - }>; - status?: { - fieldName: (typeof STATUS_FIELD_NAME)[number]; - value: EventOutcome | StatusCode; - }; - parentId?: string; - serviceName: string; - serviceEnvironment?: string; - type?: string; - sync?: boolean; - agentName?: AgentName; - spanLinksCount: { - incoming: number; - outgoing: number; - }; - icon?: string; - coldstart?: boolean; - composite?: TraceItemComposite; - docType: TraceItemDocType; - missingDestination?: boolean; -} -export interface TraceItemChild { - traceDoc: TraceItem; - children?: TraceItemChild[]; -} -export interface FocusedTraceItems { - rootDoc: TraceItem; - parentDoc?: TraceItem; - focusedTraceDoc: TraceItem; - focusedTraceTree: TraceItemChild[]; -} -export interface TransactionDetailRedirectInfo { - '@timestamp': string; - trace: { - id: string; - }; - transaction: { - id: string; - type: string; - name: string; - duration: { - us: number; - }; - }; - service: { - name: string; - }; -} -export interface TraceRootSpan { - duration: number; -} -export interface UnifiedSpanDocument extends Omit, Pick { - _id: string; - _index: string; - duration?: number[] | string; -} -export {}; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/index.d.ts deleted file mode 100644 index 2aba82a79caf9..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './src/schema'; -export * from './src/rest_specs'; -export * from './src/models'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/constants.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/constants.d.ts deleted file mode 100644 index a8185f3459ca1..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const ALL_VALUE = "*"; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.d.ts deleted file mode 100644 index 38d3a44a36d1e..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as moment from 'moment'; -declare enum DurationUnit { - 'Minute' = "m", - 'Hour' = "h", - 'Day' = "d", - 'Week' = "w", - 'Month' = "M" -} -declare class Duration { - readonly value: number; - readonly unit: DurationUnit; - constructor(value: number, unit: DurationUnit); - add(other: Duration): Duration; - isShorterThan(other: Duration): boolean; - isLongerOrEqualThan(other: Duration): boolean; - isEqual(other: Duration): boolean; - format(): string; - asSeconds(): number; - asMinutes(): number; -} -declare const toDurationUnit: (unit: string) => DurationUnit; -declare const toMomentUnitOfTime: (unit: DurationUnit) => moment.unitOfTime.Diff; -export { Duration, DurationUnit, toMomentUnitOfTime, toDurationUnit }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.d.ts deleted file mode 100644 index 370dfa5ee22e0..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type * from './pagination'; -export * from './duration'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.d.ts deleted file mode 100644 index f18061cd2f444..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface Paginated { - total: number; - page: number; - perPage: number; - results: T[]; -} -export interface Pagination { - page: number; - perPage: number; -} diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.d.ts deleted file mode 100644 index ea23565b05608..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type * as t from 'io-ts'; -import type { budgetingMethodSchema, groupSummarySchema, objectiveSchema, statusSchema, timeWindowTypeSchema } from '../schema'; -type BudgetingMethod = t.OutputOf; -type TimeWindowType = t.OutputOf; -type GroupSummary = t.TypeOf; -type Objective = t.OutputOf; -type Status = t.OutputOf; -export type { BudgetingMethod, GroupSummary, Objective, Status, TimeWindowType }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.d.ts deleted file mode 100644 index 1e1d02555370d..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './slo'; -export * from './routes'; -export type * from './indicators'; -export type * from './common'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.d.ts deleted file mode 100644 index 9c9da9c2c549d..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type * as t from 'io-ts'; -import type { apmTransactionDurationIndicatorSchema, apmTransactionErrorRateIndicatorSchema, histogramIndicatorSchema, indicatorSchema, indicatorTypesSchema, kqlCustomIndicatorSchema, kqlWithFiltersSchema, metricCustomIndicatorSchema, querySchema, filtersSchema, groupingsSchema, syntheticsAvailabilityIndicatorSchema, timesliceMetricBasicMetricWithField, timesliceMetricDocCountMetric, timesliceMetricIndicatorSchema, timesliceMetricPercentileMetric } from '../schema'; -type IndicatorType = t.OutputOf; -type Indicator = t.OutputOf; -type APMTransactionErrorRateIndicator = t.OutputOf; -type APMTransactionDurationIndicator = t.OutputOf; -type SyntheticsAvailabilityIndicator = t.OutputOf; -type MetricCustomIndicator = t.OutputOf; -type TimesliceMetricIndicator = t.OutputOf; -type TimesliceMetricBasicMetricWithField = t.OutputOf; -type TimesliceMetricDocCountMetric = t.OutputOf; -type TimesclieMetricPercentileMetric = t.OutputOf; -type HistogramIndicator = t.OutputOf; -type KQLCustomIndicator = t.OutputOf; -type KqlWithFiltersSchema = t.TypeOf; -type QuerySchema = t.TypeOf; -type FiltersSchema = t.TypeOf; -type GroupingsSchema = t.TypeOf; -export type { APMTransactionDurationIndicator, APMTransactionErrorRateIndicator, SyntheticsAvailabilityIndicator, IndicatorType, Indicator, MetricCustomIndicator, TimesliceMetricIndicator, TimesliceMetricBasicMetricWithField, TimesclieMetricPercentileMetric, TimesliceMetricDocCountMetric, HistogramIndicator, KQLCustomIndicator, KqlWithFiltersSchema, QuerySchema, FiltersSchema, GroupingsSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_delete.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_delete.d.ts deleted file mode 100644 index f5127aed5e486..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_delete.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as t from 'io-ts'; -declare const bulkDeleteParamsSchema: t.TypeC<{ - body: t.TypeC<{ - list: t.ArrayC>; - }>; -}>; -declare const bulkDeleteStatusParamsSchema: t.TypeC<{ - path: t.TypeC<{ - taskId: t.StringC; - }>; -}>; -type BulkDeleteInput = t.OutputOf; -type BulkDeleteParams = t.TypeOf; -interface BulkDeleteResponse { - taskId: string; -} -interface BulkDeleteResult { - id: string; - success: boolean; - error?: string; -} -interface BulkDeleteStatusResponse { - isDone: boolean; - results?: BulkDeleteResult[]; - error?: string; -} -export type { BulkDeleteInput, BulkDeleteParams, BulkDeleteResponse, BulkDeleteResult, BulkDeleteStatusResponse, }; -export { bulkDeleteParamsSchema, bulkDeleteStatusParamsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_purge_rollup.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_purge_rollup.d.ts deleted file mode 100644 index 02a231422da5a..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/bulk_purge_rollup.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as t from 'io-ts'; -import type { DeleteByQueryResponse } from '@elastic/elasticsearch/lib/api/types'; -declare const bulkPurgePolicy: t.UnionC<[t.TypeC<{ - purgeType: t.LiteralC<"fixed_age">; - age: t.Type; -}>, t.TypeC<{ - purgeType: t.LiteralC<"fixed_time">; - timestamp: t.Type; -}>]>; -declare const bulkPurgeRollupSchema: t.TypeC<{ - body: t.IntersectionC<[t.TypeC<{ - list: t.ArrayC; - purgePolicy: t.UnionC<[t.TypeC<{ - purgeType: t.LiteralC<"fixed_age">; - age: t.Type; - }>, t.TypeC<{ - purgeType: t.LiteralC<"fixed_time">; - timestamp: t.Type; - }>]>; - }>, t.PartialC<{ - force: t.BooleanC; - }>]>; -}>; -interface BulkPurgeRollupResponse { - taskId?: DeleteByQueryResponse['task']; -} -type BulkPurgePolicyInput = t.OutputOf; -type BulkPurgeRollupInput = t.OutputOf; -type BulkPurgeRollupParams = t.TypeOf; -export type { BulkPurgeRollupResponse, BulkPurgePolicyInput, BulkPurgeRollupInput, BulkPurgeRollupParams, }; -export { bulkPurgeRollupSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_batch_get.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_batch_get.d.ts deleted file mode 100644 index e922de1e83049..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_batch_get.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { z } from '@kbn/zod'; -declare const batchGetCompositeSLOParamsSchema: z.ZodObject<{ - body: z.ZodObject<{ - ids: z.ZodArray; - }, z.core.$strip>; -}, z.core.$strip>; -declare const batchGetCompositeSLOResponseSchema: z.ZodArray; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - tags: z.ZodArray; - enabled: z.ZodBoolean; - createdAt: z.ZodString; - updatedAt: z.ZodString; - createdBy: z.ZodString; - updatedBy: z.ZodString; - version: z.ZodNumber; - summary: z.ZodObject<{ - sliValue: z.ZodNumber; - errorBudget: z.ZodObject<{ - initial: z.ZodNumber; - consumed: z.ZodNumber; - remaining: z.ZodNumber; - isEstimated: z.ZodBoolean; - }, z.core.$strip>; - status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - fiveMinuteBurnRate: z.ZodNumber; - oneHourBurnRate: z.ZodNumber; - oneDayBurnRate: z.ZodNumber; - }, z.core.$strip>; - members: z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - errorBudget: z.ZodOptional>; - fiveMinuteBurnRate: z.ZodOptional; - oneHourBurnRate: z.ZodOptional; - oneDayBurnRate: z.ZodOptional; - instanceId: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>>; -type BatchGetCompositeSLOParams = z.infer; -type BatchGetCompositeSLOResponse = z.infer; -export { batchGetCompositeSLOParamsSchema, batchGetCompositeSLOResponseSchema }; -export type { BatchGetCompositeSLOParams, BatchGetCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_create.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_create.d.ts deleted file mode 100644 index 20c60c50e46a8..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_create.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { z } from '@kbn/zod'; -declare const createCompositeSLOBodySchema: z.ZodObject<{ - name: z.ZodString; - description: z.ZodString; - members: z.ZodArray; - }, z.core.$strip>>; - compositeMethod: z.ZodLiteral<"weightedAverage">; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - id: z.ZodOptional; - tags: z.ZodOptional>; - enabled: z.ZodOptional; -}, z.core.$strip>; -declare const createCompositeSLOParamsSchema: z.ZodObject<{ - body: z.ZodObject<{ - name: z.ZodString; - description: z.ZodString; - members: z.ZodArray; - }, z.core.$strip>>; - compositeMethod: z.ZodLiteral<"weightedAverage">; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - id: z.ZodOptional; - tags: z.ZodOptional>; - enabled: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -declare const createCompositeSLOResponseSchema: z.ZodObject<{ - id: z.ZodString; - name: z.ZodString; - description: z.ZodString; - compositeMethod: z.ZodLiteral<"weightedAverage">; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - tags: z.ZodArray; - enabled: z.ZodBoolean; - createdAt: z.ZodString; - updatedAt: z.ZodString; - createdBy: z.ZodString; - updatedBy: z.ZodString; - version: z.ZodNumber; - members: z.ZodArray; - }, z.core.$strip>>; -}, z.core.$strip>; -type CreateCompositeSLOInput = z.input; -type CreateCompositeSLOResponse = z.infer; -export { createCompositeSLOParamsSchema, createCompositeSLOResponseSchema }; -export type { CreateCompositeSLOInput, CreateCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_delete.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_delete.d.ts deleted file mode 100644 index f3810d868aafa..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_delete.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { z } from '@kbn/zod'; -declare const deleteCompositeSLOParamsSchema: z.ZodObject<{ - path: z.ZodObject<{ - id: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -export { deleteCompositeSLOParamsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_find.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_find.d.ts deleted file mode 100644 index 89af60654ab4e..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_find.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { z } from '@kbn/zod'; -declare const findCompositeSLOQuerySchema: z.ZodObject<{ - search: z.ZodOptional; - page: z.ZodOptional; - perPage: z.ZodOptional; - sortBy: z.ZodOptional, z.ZodLiteral<"createdAt">, z.ZodLiteral<"updatedAt">]>>; - sortDirection: z.ZodOptional, z.ZodLiteral<"desc">]>>; - tags: z.ZodOptional; - status: z.ZodOptional>, z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>>>>; -}, z.core.$strip>; -declare const findCompositeSLOParamsSchema: z.ZodObject<{ - query: z.ZodOptional; - page: z.ZodOptional; - perPage: z.ZodOptional; - sortBy: z.ZodOptional, z.ZodLiteral<"createdAt">, z.ZodLiteral<"updatedAt">]>>; - sortDirection: z.ZodOptional, z.ZodLiteral<"desc">]>>; - tags: z.ZodOptional; - status: z.ZodOptional>, z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>>>>; - }, z.core.$strip>>; -}, z.core.$strip>; -declare const findCompositeSLOResponseSchema: z.ZodObject<{ - page: z.ZodNumber; - perPage: z.ZodNumber; - total: z.ZodNumber; - results: z.ZodArray; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - tags: z.ZodArray; - enabled: z.ZodBoolean; - createdAt: z.ZodString; - updatedAt: z.ZodString; - createdBy: z.ZodString; - updatedBy: z.ZodString; - version: z.ZodNumber; - members: z.ZodArray; - }, z.core.$strip>>; - }, z.core.$strip>>; -}, z.core.$strip>; -type FindCompositeSLOParams = z.infer; -type FindCompositeSLOResponse = z.infer; -export { findCompositeSLOParamsSchema, findCompositeSLOResponseSchema }; -export type { FindCompositeSLOParams, FindCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_get.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_get.d.ts deleted file mode 100644 index 1f5c80d9252c5..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_get.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { z } from '@kbn/zod'; -declare const getCompositeSLOParamsSchema: z.ZodObject<{ - path: z.ZodObject<{ - id: z.ZodString; - }, z.core.$strip>; -}, z.core.$strip>; -declare const getCompositeSLOResponseSchema: z.ZodObject<{ - id: z.ZodString; - name: z.ZodString; - description: z.ZodString; - compositeMethod: z.ZodLiteral<"weightedAverage">; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - tags: z.ZodArray; - enabled: z.ZodBoolean; - createdAt: z.ZodString; - updatedAt: z.ZodString; - createdBy: z.ZodString; - updatedBy: z.ZodString; - version: z.ZodNumber; - summary: z.ZodObject<{ - sliValue: z.ZodNumber; - errorBudget: z.ZodObject<{ - initial: z.ZodNumber; - consumed: z.ZodNumber; - remaining: z.ZodNumber; - isEstimated: z.ZodBoolean; - }, z.core.$strip>; - status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - fiveMinuteBurnRate: z.ZodNumber; - oneHourBurnRate: z.ZodNumber; - oneDayBurnRate: z.ZodNumber; - }, z.core.$strip>; - members: z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - errorBudget: z.ZodOptional>; - fiveMinuteBurnRate: z.ZodOptional; - oneHourBurnRate: z.ZodOptional; - oneDayBurnRate: z.ZodOptional; - instanceId: z.ZodOptional; - }, z.core.$strip>>; -}, z.core.$strip>; -type GetCompositeSLOResponse = z.infer; -export { getCompositeSLOParamsSchema, getCompositeSLOResponseSchema }; -export type { GetCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_historical_summary.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_historical_summary.d.ts deleted file mode 100644 index b72a045b1cf7a..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_historical_summary.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { z } from '@kbn/zod'; -declare const fetchCompositeHistoricalSummaryParamsSchema: z.ZodObject<{ - body: z.ZodObject<{ - list: z.ZodArray; - }, z.core.$strip>; -}, z.core.$strip>; -declare const fetchCompositeHistoricalSummaryResponseSchema: z.ZodArray, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - sliValue: z.ZodNumber; - errorBudget: z.ZodObject<{ - initial: z.ZodNumber; - consumed: z.ZodNumber; - remaining: z.ZodNumber; - isEstimated: z.ZodBoolean; - }, z.core.$strip>; - }, z.core.$strip>>; -}, z.core.$strip>>; -type FetchCompositeHistoricalSummaryParams = z.infer; -type FetchCompositeHistoricalSummaryResponse = z.infer; -export { fetchCompositeHistoricalSummaryParamsSchema, fetchCompositeHistoricalSummaryResponseSchema, }; -export type { FetchCompositeHistoricalSummaryParams, FetchCompositeHistoricalSummaryResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_summary_refresh.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_summary_refresh.d.ts deleted file mode 100644 index 8bd03f003d520..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_summary_refresh.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { z } from '@kbn/zod'; -declare const postCompositeSloSummaryRefreshParamsSchema: z.ZodObject<{}, z.core.$strip>; -export type CompositeSloSummaryRefreshSkippedReason = 'task_disabled' | 'cooldown' | 'task_not_scheduled' | 'already_running' | 'run_soon_failed'; -export type PostCompositeSloSummaryRefreshResponse = { - readonly triggered: true; -} | { - readonly triggered: false; - readonly reason: CompositeSloSummaryRefreshSkippedReason; -}; -export { postCompositeSloSummaryRefreshParamsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_update.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_update.d.ts deleted file mode 100644 index f117d5387867f..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/composite_slo/composite_slo_update.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { z } from '@kbn/zod'; -declare const updateCompositeSLOParamsSchema: z.ZodObject<{ - path: z.ZodObject<{ - id: z.ZodString; - }, z.core.$strip>; - body: z.ZodObject<{ - name: z.ZodOptional; - description: z.ZodOptional; - members: z.ZodOptional; - }, z.core.$strip>>>; - compositeMethod: z.ZodOptional>; - timeWindow: z.ZodOptional; - }, z.core.$strip>>; - budgetingMethod: z.ZodOptional>; - objective: z.ZodOptional>; - tags: z.ZodOptional>; - enabled: z.ZodOptional; - }, z.core.$strip>; -}, z.core.$strip>; -declare const updateCompositeSLOResponseSchema: z.ZodObject<{ - id: z.ZodString; - name: z.ZodString; - description: z.ZodString; - compositeMethod: z.ZodLiteral<"weightedAverage">; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - tags: z.ZodArray; - enabled: z.ZodBoolean; - createdAt: z.ZodString; - updatedAt: z.ZodString; - createdBy: z.ZodString; - updatedBy: z.ZodString; - version: z.ZodNumber; - members: z.ZodArray; - }, z.core.$strip>>; -}, z.core.$strip>; -type UpdateCompositeSLOInput = z.input; -type UpdateCompositeSLOResponse = z.infer; -export { updateCompositeSLOParamsSchema, updateCompositeSLOResponseSchema }; -export type { UpdateCompositeSLOInput, UpdateCompositeSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.d.ts deleted file mode 100644 index 0f6af8b9c921b..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.d.ts +++ /dev/null @@ -1,642 +0,0 @@ -import * as t from 'io-ts'; -declare const createSLOParamsSchema: t.TypeC<{ - body: t.IntersectionC<[t.TypeC<{ - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - }>, t.PartialC<{ - id: t.Type; - settings: t.PartialC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>; - tags: t.ArrayC; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - revision: t.NumberC; - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; - }>]>; -}>; -declare const createSLOResponseSchema: t.TypeC<{ - id: t.Type; -}>; -type CreateSLOInput = t.OutputOf; -type CreateSLOParams = t.TypeOf; -type CreateSLOResponse = t.TypeOf; -export { createSLOParamsSchema, createSLOResponseSchema }; -export type { CreateSLOInput, CreateSLOParams, CreateSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.d.ts deleted file mode 100644 index 23db51aae3c4c..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as t from 'io-ts'; -declare const deleteSLOParamsSchema: t.TypeC<{ - path: t.TypeC<{ - id: t.Type; - }>; -}>; -export { deleteSLOParamsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.d.ts deleted file mode 100644 index be84a4220253a..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as t from 'io-ts'; -declare const deleteSLOInstancesParamsSchema: t.TypeC<{ - body: t.TypeC<{ - list: t.ArrayC; - instanceId: t.StringC; - }>, t.PartialC<{ - excludeRollup: t.BooleanC; - }>]>>; - }>; -}>; -type DeleteSLOInstancesInput = t.OutputOf; -type DeleteSLOInstancesParams = t.TypeOf; -export { deleteSLOInstancesParamsSchema }; -export type { DeleteSLOInstancesInput, DeleteSLOInstancesParams }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.d.ts deleted file mode 100644 index b2e72e5bea73b..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import * as t from 'io-ts'; -declare const fetchHistoricalSummaryParamsSchema: t.TypeC<{ - body: t.TypeC<{ - list: t.ArrayC; - instanceId: t.StringC; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - revision: t.NumberC; - }>, t.PartialC<{ - remoteName: t.StringC; - range: t.TypeC<{ - from: t.Type; - to: t.Type; - }>; - }>]>>; - }>; -}>; -declare const historicalSummarySchema: t.TypeC<{ - date: t.Type; - status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; - sliValue: t.NumberC; - errorBudget: t.TypeC<{ - initial: t.NumberC; - consumed: t.NumberC; - remaining: t.NumberC; - isEstimated: t.BooleanC; - }>; -}>; -declare const fetchHistoricalSummaryResponseSchema: t.ArrayC; - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - data: t.ArrayC; - status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; - sliValue: t.NumberC; - errorBudget: t.TypeC<{ - initial: t.NumberC; - consumed: t.NumberC; - remaining: t.NumberC; - isEstimated: t.BooleanC; - }>; - }>>; -}>>; -type FetchHistoricalSummaryParams = t.TypeOf; -type FetchHistoricalSummaryResponse = t.OutputOf; -type HistoricalSummaryResponse = t.OutputOf; -export { fetchHistoricalSummaryParamsSchema, fetchHistoricalSummaryResponseSchema, historicalSummarySchema, }; -export type { FetchHistoricalSummaryParams, FetchHistoricalSummaryResponse, HistoricalSummaryResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.d.ts deleted file mode 100644 index 3a35b6dd8feac..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.d.ts +++ /dev/null @@ -1,695 +0,0 @@ -import * as t from 'io-ts'; -declare const findSLOParamsSchema: t.PartialC<{ - query: t.PartialC<{ - filters: t.StringC; - kqlQuery: t.StringC; - page: t.StringC; - perPage: t.StringC; - sortBy: t.UnionC<[t.LiteralC<"error_budget_consumed">, t.LiteralC<"error_budget_remaining">, t.LiteralC<"sli_value">, t.LiteralC<"status">, t.LiteralC<"burn_rate_5m">, t.LiteralC<"burn_rate_1h">, t.LiteralC<"burn_rate_1d">]>; - sortDirection: t.UnionC<[t.LiteralC<"asc">, t.LiteralC<"desc">]>; - hideStale: t.Type; - searchAfter: t.Type<(string | number)[], string, unknown>; - size: t.StringC; - }>; -}>; -declare const findSLOResponseSchema: t.IntersectionC<[t.TypeC<{ - page: t.NumberC; - perPage: t.NumberC; - total: t.NumberC; - results: t.ArrayC; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; - }>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; - }>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; - }>]>, t.TypeC<{ - summary: t.IntersectionC<[t.TypeC<{ - status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; - sliValue: t.NumberC; - errorBudget: t.TypeC<{ - initial: t.NumberC; - consumed: t.NumberC; - remaining: t.NumberC; - isEstimated: t.BooleanC; - }>; - fiveMinuteBurnRate: t.NumberC; - oneHourBurnRate: t.NumberC; - oneDayBurnRate: t.NumberC; - }>, t.PartialC<{ - summaryUpdatedAt: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - groupings: t.RecordC>; - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>, t.PartialC<{ - meta: t.PartialC<{ - synthetics: t.TypeC<{ - monitorId: t.StringC; - locationId: t.StringC; - configId: t.StringC; - }>; - }>; - remote: t.TypeC<{ - remoteName: t.StringC; - kibanaUrl: t.StringC; - }>; - }>]>>; -}>, t.PartialC<{ - searchAfter: t.ArrayC>; - size: t.NumberC; -}>]>; -type FindSLOParams = t.TypeOf; -type FindSLOResponse = t.OutputOf; -export { findSLOParamsSchema, findSLOResponseSchema }; -export type { FindSLOParams, FindSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.d.ts deleted file mode 100644 index ac3676e38ac71..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.d.ts +++ /dev/null @@ -1,1339 +0,0 @@ -import * as t from 'io-ts'; -declare const findSloDefinitionsParamsSchema: t.PartialC<{ - query: t.PartialC<{ - search: t.StringC; - includeOutdatedOnly: t.Type; - includeHealth: t.Type; - tags: t.StringC; - page: t.StringC; - perPage: t.StringC; - }>; -}>; -declare const sloDefinitionResponseSchema: t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{ - id: t.Type; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; -}>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; -}>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; -}>]>, t.PartialC<{ - health: t.TypeC<{ - isProblematic: t.BooleanC; - rollup: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; - }>, t.PartialC<{ - stateMatches: t.BooleanC; - }>]>; - summary: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; - }>, t.PartialC<{ - stateMatches: t.BooleanC; - }>]>; - }>; -}>]>; -declare const findSloDefinitionsResponseSchema: t.TypeC<{ - page: t.NumberC; - perPage: t.NumberC; - total: t.NumberC; - results: t.ArrayC; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; - }>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; - }>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; - }>]>, t.PartialC<{ - health: t.TypeC<{ - isProblematic: t.BooleanC; - rollup: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; - }>, t.PartialC<{ - stateMatches: t.BooleanC; - }>]>; - summary: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; - }>, t.PartialC<{ - stateMatches: t.BooleanC; - }>]>; - }>; - }>]>>; -}>; -type FindSLODefinitionsParams = t.TypeOf; -type FindSLODefinitionsResponse = t.OutputOf; -type SLODefinitionResponse = t.OutputOf; -export { findSloDefinitionsParamsSchema, findSloDefinitionsResponseSchema, sloDefinitionResponseSchema, }; -export type { FindSLODefinitionsParams, FindSLODefinitionsResponse, SLODefinitionResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.d.ts deleted file mode 100644 index d3f5a3cfa5584..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import * as t from 'io-ts'; -declare const findSLOGroupsParamsSchema: t.PartialC<{ - query: t.PartialC<{ - page: t.StringC; - perPage: t.StringC; - groupBy: t.UnionC<[t.LiteralC<"ungrouped">, t.LiteralC<"slo.tags">, t.LiteralC<"status">, t.LiteralC<"slo.indicator.type">, t.LiteralC<"slo.instanceId">, t.LiteralC<"_index">, t.LiteralC<"slo.id">]>; - groupsFilter: t.UnionC<[t.ArrayC, t.StringC]>; - kqlQuery: t.StringC; - filters: t.StringC; - }>; -}>; -declare const sloGroupWithSummaryResponseSchema: t.TypeC<{ - group: t.StringC; - groupBy: t.UnionC<[t.LiteralC<"ungrouped">, t.LiteralC<"slo.tags">, t.LiteralC<"status">, t.LiteralC<"slo.indicator.type">, t.LiteralC<"slo.instanceId">, t.LiteralC<"_index">, t.LiteralC<"slo.id">]>; - summary: t.TypeC<{ - total: t.NumberC; - worst: t.TypeC<{ - sliValue: t.NumberC; - status: t.StringC; - slo: t.IntersectionC<[t.TypeC<{ - id: t.StringC; - instanceId: t.StringC; - name: t.StringC; - }>, t.PartialC<{ - groupings: t.RecordC; - }>]>; - }>; - violated: t.NumberC; - healthy: t.NumberC; - degrading: t.NumberC; - noData: t.NumberC; - }>; -}>; -declare const findSLOGroupsResponseSchema: t.TypeC<{ - page: t.NumberC; - perPage: t.NumberC; - total: t.NumberC; - results: t.ArrayC, t.LiteralC<"slo.tags">, t.LiteralC<"status">, t.LiteralC<"slo.indicator.type">, t.LiteralC<"slo.instanceId">, t.LiteralC<"_index">, t.LiteralC<"slo.id">]>; - summary: t.TypeC<{ - total: t.NumberC; - worst: t.TypeC<{ - sliValue: t.NumberC; - status: t.StringC; - slo: t.IntersectionC<[t.TypeC<{ - id: t.StringC; - instanceId: t.StringC; - name: t.StringC; - }>, t.PartialC<{ - groupings: t.RecordC; - }>]>; - }>; - violated: t.NumberC; - healthy: t.NumberC; - degrading: t.NumberC; - noData: t.NumberC; - }>; - }>>; -}>; -type FindSLOGroupsParams = t.TypeOf; -type FindSLOGroupsResponse = t.OutputOf; -export { findSLOGroupsParamsSchema, findSLOGroupsResponseSchema, sloGroupWithSummaryResponseSchema, }; -export type { FindSLOGroupsParams, FindSLOGroupsResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_instances.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_instances.d.ts deleted file mode 100644 index 790c4cd9f94f2..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_instances.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as t from 'io-ts'; -declare const findSLOInstancesParamsSchema: t.IntersectionC<[t.TypeC<{ - path: t.TypeC<{ - id: t.StringC; - }>; -}>, t.PartialC<{ - query: t.PartialC<{ - search: t.StringC; - size: t.Type; - searchAfter: t.StringC; - remoteName: t.StringC; - }>; -}>]>; -interface FindSLOInstancesResponse { - results: Array<{ - instanceId: string; - groupings: Record; - }>; - searchAfter?: string; -} -interface FindSLOInstancesParams { - sloId: string; - spaceId: string; - search?: string; - size?: number; - searchAfter?: string; - remoteName?: string; -} -export { findSLOInstancesParamsSchema }; -export type { FindSLOInstancesParams, FindSLOInstancesResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.d.ts deleted file mode 100644 index 3b302123b8838..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.d.ts +++ /dev/null @@ -1,690 +0,0 @@ -import * as t from 'io-ts'; -declare const getSLOQuerySchema: t.PartialC<{ - query: t.PartialC<{ - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - remoteName: t.StringC; - }>; -}>; -declare const getSLOParamsSchema: t.IntersectionC<[t.TypeC<{ - path: t.TypeC<{ - id: t.Type; - }>; -}>, t.PartialC<{ - query: t.PartialC<{ - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - remoteName: t.StringC; - }>; -}>]>; -declare const getSLOResponseSchema: t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{ - id: t.Type; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; -}>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; -}>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; -}>]>, t.TypeC<{ - summary: t.IntersectionC<[t.TypeC<{ - status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; - sliValue: t.NumberC; - errorBudget: t.TypeC<{ - initial: t.NumberC; - consumed: t.NumberC; - remaining: t.NumberC; - isEstimated: t.BooleanC; - }>; - fiveMinuteBurnRate: t.NumberC; - oneHourBurnRate: t.NumberC; - oneDayBurnRate: t.NumberC; - }>, t.PartialC<{ - summaryUpdatedAt: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - groupings: t.RecordC>; - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; -}>, t.PartialC<{ - meta: t.PartialC<{ - synthetics: t.TypeC<{ - monitorId: t.StringC; - locationId: t.StringC; - configId: t.StringC; - }>; - }>; - remote: t.TypeC<{ - remoteName: t.StringC; - kibanaUrl: t.StringC; - }>; -}>]>; -type GetSLOParams = t.TypeOf; -type GetSLOResponse = t.OutputOf; -export { getSLOParamsSchema, getSLOResponseSchema }; -export type { GetSLOParams, GetSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.d.ts deleted file mode 100644 index 12767d5cd237b..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import * as t from 'io-ts'; -declare const getSLOBurnRatesResponseSchema: t.TypeC<{ - burnRates: t.ArrayC>; -}>; -declare const getSLOBurnRatesParamsSchema: t.TypeC<{ - path: t.TypeC<{ - id: t.StringC; - }>; - body: t.IntersectionC<[t.TypeC<{ - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - windows: t.ArrayC; - }>>; - }>, t.PartialC<{ - remoteName: t.StringC; - }>]>; -}>; -type GetSLOBurnRatesResponse = t.OutputOf; -export { getSLOBurnRatesParamsSchema, getSLOBurnRatesResponseSchema }; -export type { GetSLOBurnRatesResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_grouped_stats.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_grouped_stats.d.ts deleted file mode 100644 index 35590a844d0c9..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_grouped_stats.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import * as t from 'io-ts'; -declare const getSLOGroupedStatsParamsSchema: t.TypeC<{ - body: t.IntersectionC<[t.TypeC<{ - /** - * SLO type. - */ - type: t.LiteralC<"apm">; - }>, t.PartialC<{ - /** - * Number of buckets to return. - * If not provided, the query will use elasticsearch default value of 10. - */ - size: t.NumberC; - /** - * List of service names to filter by. - */ - serviceNames: t.ArrayC; - /** - * Environment to filter by. - */ - environment: t.StringC; - /** - * KQL query to filter SLOs. - */ - kqlQuery: t.StringC; - /** - * List of statuses to filter by (e.g. ['VIOLATED', 'DEGRADING']). - */ - statusFilters: t.ArrayC; - }>]>; -}>; -interface GroupedStatsResult { - entity: string; - summary: { - violated: number; - degrading: number; - healthy: number; - noData: number; - }; -} -interface GetSLOGroupedStatsResponse { - results: Array; -} -type GetSLOGroupedStatsParams = t.TypeOf['body']; -export { getSLOGroupedStatsParamsSchema }; -export type { GroupedStatsResult, GetSLOGroupedStatsParams, GetSLOGroupedStatsResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.d.ts deleted file mode 100644 index e8470e2e71d23..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.d.ts +++ /dev/null @@ -1,653 +0,0 @@ -import * as t from 'io-ts'; -declare const getPreviewDataParamsSchema: t.TypeC<{ - body: t.IntersectionC<[t.TypeC<{ - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - range: t.TypeC<{ - from: t.Type; - to: t.Type; - }>; - }>, t.PartialC<{ - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - remoteName: t.StringC; - groupings: t.RecordC>; - groupBy: t.ArrayC; - }>]>; -}>; -declare const previewDataResponseSchema: t.IntersectionC<[t.TypeC<{ - date: t.Type; - sliValue: t.UnionC<[t.NumberC, t.NullC]>; -}>, t.PartialC<{ - events: t.TypeC<{ - good: t.NumberC; - bad: t.NumberC; - total: t.NumberC; - }>; -}>]>; -declare const getPreviewDataResponseSchema: t.IntersectionC<[t.TypeC<{ - results: t.ArrayC; - sliValue: t.UnionC<[t.NumberC, t.NullC]>; - }>, t.PartialC<{ - events: t.TypeC<{ - good: t.NumberC; - bad: t.NumberC; - total: t.NumberC; - }>; - }>]>>; -}>, t.PartialC<{ - groups: t.RecordC; - sliValue: t.UnionC<[t.NumberC, t.NullC]>; - }>, t.PartialC<{ - events: t.TypeC<{ - good: t.NumberC; - bad: t.NumberC; - total: t.NumberC; - }>; - }>]>>>; -}>]>; -type GetPreviewDataParams = t.TypeOf; -type GetPreviewDataResponse = t.OutputOf; -export { getPreviewDataParamsSchema, getPreviewDataResponseSchema, previewDataResponseSchema }; -export type { GetPreviewDataParams, GetPreviewDataResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.d.ts deleted file mode 100644 index 7e88140419c59..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as t from 'io-ts'; -declare const fetchSLOHealthResponseSchema: t.ArrayC; - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - revision: t.NumberC; - name: t.StringC; - health: t.TypeC<{ - isProblematic: t.BooleanC; - rollup: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; - }>, t.PartialC<{ - stateMatches: t.BooleanC; - }>]>; - summary: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; - }>, t.PartialC<{ - stateMatches: t.BooleanC; - }>]>; - }>; -}>>; -declare const fetchSLOHealthParamsSchema: t.TypeC<{ - body: t.TypeC<{ - list: t.ArrayC; - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - }>; -}>; -type FetchSLOHealthResponse = t.OutputOf; -type FetchSLOHealthParams = t.TypeOf; -export { fetchSLOHealthParamsSchema, fetchSLOHealthResponseSchema }; -export type { FetchSLOHealthParams, FetchSLOHealthResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_stats_overview.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_stats_overview.d.ts deleted file mode 100644 index 9523ce11ae1a7..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_stats_overview.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as t from 'io-ts'; -declare const getSLOStatsOverviewParamsSchema: t.PartialC<{ - query: t.PartialC<{ - kqlQuery: t.StringC; - filters: t.StringC; - }>; -}>; -declare const getSLOStatsOverviewResponseSchema: t.TypeC<{ - violated: t.NumberC; - degrading: t.NumberC; - stale: t.NumberC; - healthy: t.NumberC; - noData: t.NumberC; - burnRateRules: t.NumberC; - burnRateActiveAlerts: t.NumberC; - burnRateRecoveredAlerts: t.NumberC; -}>; -type GetSLOStatsOverviewParams = t.TypeOf; -type GetSLOStatsOverviewResponse = t.OutputOf; -export { getSLOStatsOverviewParamsSchema, getSLOStatsOverviewResponseSchema }; -export type { GetSLOStatsOverviewParams, GetSLOStatsOverviewResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.d.ts deleted file mode 100644 index be799bdd28102..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as t from 'io-ts'; -declare const getSLOSuggestionsResponseSchema: t.TypeC<{ - tags: t.ArrayC>; -}>; -type GetSLOSuggestionsResponse = t.OutputOf; -export { getSLOSuggestionsResponseSchema }; -export type { GetSLOSuggestionsResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/health_scan.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/health_scan.d.ts deleted file mode 100644 index 9570bb3fab406..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/health_scan.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import * as t from 'io-ts'; -declare const postHealthScanParamsSchema: t.PartialC<{ - body: t.PartialC<{ - force: t.Type; - }>; -}>; -interface PostHealthScanResponse { - scanId: string; - scheduledAt: string; - status: 'scheduled' | 'pending' | 'completed'; - processed?: number; - problematic?: number; - error?: string; -} -declare const getHealthScanParamsSchema: t.IntersectionC<[t.TypeC<{ - path: t.TypeC<{ - scanId: t.StringC; - }>; -}>, t.PartialC<{ - query: t.PartialC<{ - size: t.Type; - searchAfter: t.StringC; - problematic: t.Type; - allSpaces: t.Type; - }>; -}>]>; -declare const listHealthScanParamsSchema: t.PartialC<{ - query: t.PartialC<{ - size: t.Type; - }>; -}>; -interface HealthScanSummary { - scanId: string; - latestTimestamp: string; - total: number; - problematic: number; - status: 'pending' | 'completed'; -} -interface ListHealthScanResponse { - scans: HealthScanSummary[]; -} -declare const healthScanResultResponseSchema: t.TypeC<{ - '@timestamp': t.BrandC; - scanId: t.StringC; - spaceId: t.StringC; - slo: t.TypeC<{ - id: t.StringC; - name: t.StringC; - revision: t.NumberC; - enabled: t.BooleanC; - }>; - health: t.TypeC<{ - isProblematic: t.BooleanC; - rollup: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; - }>, t.PartialC<{ - stateMatches: t.BooleanC; - }>]>; - summary: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; - }>, t.PartialC<{ - stateMatches: t.BooleanC; - }>]>; - }>; -}>; -type HealthScanResultResponse = t.OutputOf; -interface GetHealthScanResultsResponse { - results: HealthScanResultResponse[]; - scan: HealthScanSummary; - total: number; - searchAfter?: Array; -} -export { getHealthScanParamsSchema, listHealthScanParamsSchema, postHealthScanParamsSchema }; -export type { GetHealthScanResultsResponse, HealthScanResultResponse, HealthScanSummary, ListHealthScanResponse, PostHealthScanResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.d.ts deleted file mode 100644 index 1f0e96adfc3be..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -export * from './create'; -export * from './update'; -export * from './delete'; -export * from './find'; -export * from './find_group'; -export * from './find_definition'; -export * from './get'; -export * from './get_burn_rates'; -export * from './bulk_purge_rollup'; -export * from './purge_instances'; -export * from './get_slo_stats_overview'; -export * from './get_preview_data'; -export * from './reset'; -export * from './manage'; -export * from './delete_instance'; -export * from './fetch_historical_summary'; -export * from './put_settings'; -export * from './get_suggestions'; -export * from './get_slo_health'; -export * from './bulk_delete'; -export * from './find_instances'; -export * from './repair'; -export * from './slo_templates'; -export * from './health_scan'; -export * from './search_slo_definitions'; -export * from './get_grouped_stats'; -export * from './composite_slo/composite_slo_create'; -export * from './composite_slo/composite_slo_get'; -export * from './composite_slo/composite_slo_batch_get'; -export * from './composite_slo/composite_slo_find'; -export * from './composite_slo/composite_slo_update'; -export * from './composite_slo/composite_slo_delete'; -export * from './composite_slo/composite_slo_historical_summary'; -export * from './composite_slo/composite_slo_summary_refresh'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.d.ts deleted file mode 100644 index a458c29a0612d..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as t from 'io-ts'; -declare const manageSLOParamsSchema: t.TypeC<{ - path: t.TypeC<{ - id: t.Type; - }>; -}>; -type ManageSLOParams = t.TypeOf; -export { manageSLOParamsSchema }; -export type { ManageSLOParams }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/purge_instances.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/purge_instances.d.ts deleted file mode 100644 index 6b89b074af21d..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/purge_instances.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as t from 'io-ts'; -declare const purgeInstancesParamsSchema: t.TypeC<{ - body: t.PartialC<{ - list: t.ArrayC>; - staleDuration: t.Type; - force: t.BooleanC; - }>; -}>; -interface PurgeInstancesResponse { - taskId?: string; -} -type PurgeInstancesInput = t.OutputOf; -type PurgeInstancesParams = t.TypeOf; -declare const purgeInstancesStatusParamsSchema: t.TypeC<{ - path: t.TypeC<{ - taskId: t.StringC; - }>; -}>; -interface PurgeInstancesStatusResponse { - completed: boolean; - error?: string; - status?: { - total: number; - deleted: number; - batches: number; - start_time_in_millis: number; - running_time_in_nanos: number; - }; -} -export { purgeInstancesParamsSchema, purgeInstancesStatusParamsSchema }; -export type { PurgeInstancesInput, PurgeInstancesParams, PurgeInstancesResponse, PurgeInstancesStatusResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.d.ts deleted file mode 100644 index 329d92e59b18e..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as t from 'io-ts'; -import { sloSettingsSchema } from '../../schema/settings'; -declare const putSLOSettingsParamsSchema: t.TypeC<{ - body: t.TypeC<{ - useAllRemoteClusters: t.BooleanC; - selectedRemoteClusters: t.ArrayC; - staleThresholdInHours: t.NumberC; - staleInstancesCleanupEnabled: t.BooleanC; - }>; -}>; -declare const putSLOServerlessSettingsParamsSchema: t.TypeC<{ - body: t.TypeC<{ - staleThresholdInHours: t.NumberC; - staleInstancesCleanupEnabled: t.BooleanC; - }>; -}>; -declare const putSLOSettingsResponseSchema: t.TypeC<{ - useAllRemoteClusters: t.BooleanC; - selectedRemoteClusters: t.ArrayC; - staleThresholdInHours: t.NumberC; - staleInstancesCleanupEnabled: t.BooleanC; -}>; -type PutSLOSettingsParams = t.TypeOf; -type PutServerlessSLOSettingsParams = t.TypeOf; -type PutSLOSettingsResponse = t.OutputOf; -type GetSLOSettingsResponse = t.OutputOf; -export { putSLOServerlessSettingsParamsSchema, putSLOSettingsParamsSchema, putSLOSettingsResponseSchema, }; -export type { GetSLOSettingsResponse, PutServerlessSLOSettingsParams, PutSLOSettingsParams, PutSLOSettingsResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/repair.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/repair.d.ts deleted file mode 100644 index aeba9e45a7b8a..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/repair.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as t from 'io-ts'; -declare const repairParamsSchema: t.TypeC<{ - body: t.TypeC<{ - list: t.ArrayC>; - }>; -}>; -type RepairParams = t.TypeOf; -interface RepairAction { - type: 'recreate-transform' | 'start-transform' | 'stop-transform' | 'noop'; - transformType?: 'rollup' | 'summary'; -} -interface RepairActionResult { - action: RepairAction; - status: 'success' | 'failure'; - error?: unknown; -} -interface RepairActionsGroupResult { - id: string; - results: RepairActionResult[]; -} -export { repairParamsSchema }; -export type { RepairParams, RepairAction, RepairActionResult, RepairActionsGroupResult }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.d.ts deleted file mode 100644 index 13b093595b903..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.d.ts +++ /dev/null @@ -1,649 +0,0 @@ -import * as t from 'io-ts'; -declare const resetSLOParamsSchema: t.TypeC<{ - path: t.TypeC<{ - id: t.Type; - }>; -}>; -declare const resetSLOResponseSchema: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ - id: t.Type; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; -}>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; -}>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; -}>]>; -type ResetSLOParams = t.TypeOf; -type ResetSLOResponse = t.OutputOf; -export { resetSLOParamsSchema, resetSLOResponseSchema }; -export type { ResetSLOParams, ResetSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/search_slo_definitions.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/search_slo_definitions.d.ts deleted file mode 100644 index 6a529b2a7b5e4..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/search_slo_definitions.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import * as t from 'io-ts'; -declare const searchSLODefinitionsParamsSchema: t.PartialC<{ - query: t.PartialC<{ - search: t.StringC; - size: t.Type; - searchAfter: t.StringC; - remoteName: t.StringC; - }>; -}>; -type SearchSLODefinitionsParams = t.TypeOf; -interface SearchSLODefinitionItem { - id: string; - name: string; - groupBy: string[]; - remote?: { - remoteName: string; - kibanaUrl: string; - }; -} -interface SearchSLODefinitionResponse { - results: SearchSLODefinitionItem[]; - searchAfter?: string; -} -export { searchSLODefinitionsParamsSchema }; -export type { SearchSLODefinitionsParams, SearchSLODefinitionResponse, SearchSLODefinitionItem }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/slo_templates.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/slo_templates.d.ts deleted file mode 100644 index e070eb3404adc..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/slo_templates.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as t from 'io-ts'; -import type { sloTemplateSchema } from '../../schema'; -declare const getSLOTemplateParamsSchema: t.TypeC<{ - path: t.TypeC<{ - templateId: t.StringC; - }>; -}>; -declare const findSLOTemplatesParamsSchema: t.TypeC<{ - query: t.UnionC<[t.UndefinedC, t.PartialC<{ - search: t.StringC; - tags: t.Type; - page: t.Type; - perPage: t.Type; - }>]>; -}>; -type SLOTemplateResponse = t.OutputOf; -type GetSLOTemplateResponse = SLOTemplateResponse; -interface FindSLOTemplatesResponse { - total: number; - page: number; - perPage: number; - results: SLOTemplateResponse[]; -} -interface FindSLOTemplateTagsResponse { - tags: string[]; -} -export { findSLOTemplatesParamsSchema, getSLOTemplateParamsSchema }; -export type { SLOTemplateResponse, GetSLOTemplateResponse, FindSLOTemplatesResponse, FindSLOTemplateTagsResponse, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.d.ts deleted file mode 100644 index cc5894a68bf31..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.d.ts +++ /dev/null @@ -1,1278 +0,0 @@ -import * as t from 'io-ts'; -declare const updateSLOParamsSchema: t.TypeC<{ - path: t.TypeC<{ - id: t.Type; - }>; - body: t.PartialC<{ - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.PartialC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>; - tags: t.ArrayC; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; - }>; -}>; -declare const updateSLOResponseSchema: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ - id: t.Type; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; -}>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; -}>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; -}>]>; -type UpdateSLOInput = t.OutputOf; -type UpdateSLOParams = t.TypeOf; -type UpdateSLOResponse = t.OutputOf; -export { updateSLOParamsSchema, updateSLOResponseSchema }; -export type { UpdateSLOInput, UpdateSLOParams, UpdateSLOResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.d.ts deleted file mode 100644 index 99da3c7e53698..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.d.ts +++ /dev/null @@ -1,674 +0,0 @@ -import * as t from 'io-ts'; -import type { SLODefinitionResponse } from './routes/find_definition'; -declare const sloWithDataResponseSchema: t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{ - id: t.Type; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; -}>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; -}>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; -}>]>, t.TypeC<{ - summary: t.IntersectionC<[t.TypeC<{ - status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; - sliValue: t.NumberC; - errorBudget: t.TypeC<{ - initial: t.NumberC; - consumed: t.NumberC; - remaining: t.NumberC; - isEstimated: t.BooleanC; - }>; - fiveMinuteBurnRate: t.NumberC; - oneHourBurnRate: t.NumberC; - oneDayBurnRate: t.NumberC; - }>, t.PartialC<{ - summaryUpdatedAt: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - groupings: t.RecordC>; - instanceId: t.UnionC<[t.LiteralC<"*">, t.StringC]>; -}>, t.PartialC<{ - meta: t.PartialC<{ - synthetics: t.TypeC<{ - monitorId: t.StringC; - locationId: t.StringC; - configId: t.StringC; - }>; - }>; - remote: t.TypeC<{ - remoteName: t.StringC; - kibanaUrl: t.StringC; - }>; -}>]>; -type SLOWithSummaryResponse = t.OutputOf; -export { sloWithDataResponseSchema }; -export type { SLODefinitionResponse, SLOWithSummaryResponse }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.d.ts deleted file mode 100644 index f27fcfedb9789..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as t from 'io-ts'; -import { ALL_VALUE } from '../constants'; -declare const allOrAnyString: t.UnionC<[t.LiteralC<"*">, t.StringC]>; -declare const allOrAnyStringOrArray: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; -declare const dateType: t.Type; -declare const errorBudgetSchema: t.TypeC<{ - initial: t.NumberC; - consumed: t.NumberC; - remaining: t.NumberC; - isEstimated: t.BooleanC; -}>; -declare const SLO_STATUS: { - readonly NO_DATA: "NO_DATA"; - readonly HEALTHY: "HEALTHY"; - readonly DEGRADING: "DEGRADING"; - readonly VIOLATED: "VIOLATED"; -}; -declare const statusSchema: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; -declare const summarySchema: t.IntersectionC<[t.TypeC<{ - status: t.UnionC<[t.LiteralC<"NO_DATA">, t.LiteralC<"HEALTHY">, t.LiteralC<"DEGRADING">, t.LiteralC<"VIOLATED">]>; - sliValue: t.NumberC; - errorBudget: t.TypeC<{ - initial: t.NumberC; - consumed: t.NumberC; - remaining: t.NumberC; - isEstimated: t.BooleanC; - }>; - fiveMinuteBurnRate: t.NumberC; - oneHourBurnRate: t.NumberC; - oneDayBurnRate: t.NumberC; -}>, t.PartialC<{ - summaryUpdatedAt: t.UnionC<[t.StringC, t.NullC]>; -}>]>; -declare const groupingsSchema: t.RecordC>; -declare const metaSchema: t.PartialC<{ - synthetics: t.TypeC<{ - monitorId: t.StringC; - locationId: t.StringC; - configId: t.StringC; - }>; -}>; -declare const remoteSchema: t.TypeC<{ - remoteName: t.StringC; - kibanaUrl: t.StringC; -}>; -declare const groupSummarySchema: t.TypeC<{ - total: t.NumberC; - worst: t.TypeC<{ - sliValue: t.NumberC; - status: t.StringC; - slo: t.IntersectionC<[t.TypeC<{ - id: t.StringC; - instanceId: t.StringC; - name: t.StringC; - }>, t.PartialC<{ - groupings: t.RecordC; - }>]>; - }>; - violated: t.NumberC; - healthy: t.NumberC; - degrading: t.NumberC; - noData: t.NumberC; -}>; -declare const dateRangeSchema: t.TypeC<{ - from: t.Type; - to: t.Type; -}>; -export type SLOStatus = t.TypeOf; -export { ALL_VALUE, SLO_STATUS, allOrAnyString, allOrAnyStringOrArray, dateRangeSchema, dateType, errorBudgetSchema, groupingsSchema, statusSchema, summarySchema, metaSchema, groupSummarySchema, remoteSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo.d.ts deleted file mode 100644 index 2ea72a76ac76f..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { z } from '@kbn/zod'; -declare const COMPOSITE_SLO_MIN_MEMBERS = 2; -declare const COMPOSITE_SLO_MAX_MEMBERS = 25; -declare const compositeSloIdSchema: z.ZodString; -declare const compositeTagsSchema: z.ZodArray; -declare const compositeTargetSchema: z.ZodObject<{ - target: z.ZodNumber; -}, z.core.$strip>; -declare const compositeOccurrencesBudgetingMethodSchema: z.ZodLiteral<"occurrences">; -declare const compositeRollingTimeWindowSchema: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; -}, z.core.$strip>; -declare const compositeSloMemberSchema: z.ZodObject<{ - sloId: z.ZodString; - weight: z.ZodNumber; - instanceId: z.ZodOptional; -}, z.core.$strip>; -declare const compositeMethodSchema: z.ZodLiteral<"weightedAverage">; -declare const compositeErrorBudgetSchema: z.ZodObject<{ - initial: z.ZodNumber; - consumed: z.ZodNumber; - remaining: z.ZodNumber; - isEstimated: z.ZodBoolean; -}, z.core.$strip>; -declare const compositeStatusSchema: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; -declare const compositeSloBaseDefinitionSchema: z.ZodObject<{ - id: z.ZodString; - name: z.ZodString; - description: z.ZodString; - compositeMethod: z.ZodLiteral<"weightedAverage">; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - tags: z.ZodArray; - enabled: z.ZodBoolean; - createdAt: z.ZodString; - updatedAt: z.ZodString; - createdBy: z.ZodString; - updatedBy: z.ZodString; - version: z.ZodNumber; -}, z.core.$strip>; -declare const compositeSloDefinitionSchema: z.ZodObject<{ - id: z.ZodString; - name: z.ZodString; - description: z.ZodString; - compositeMethod: z.ZodLiteral<"weightedAverage">; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - tags: z.ZodArray; - enabled: z.ZodBoolean; - createdAt: z.ZodString; - updatedAt: z.ZodString; - createdBy: z.ZodString; - updatedBy: z.ZodString; - version: z.ZodNumber; - members: z.ZodArray; - }, z.core.$strip>>; -}, z.core.$strip>; -declare const storedCompositeSloDefinitionSchema: z.ZodObject<{ - id: z.ZodString; - name: z.ZodString; - description: z.ZodString; - compositeMethod: z.ZodLiteral<"weightedAverage">; - timeWindow: z.ZodObject<{ - duration: z.ZodString; - type: z.ZodLiteral<"rolling">; - }, z.core.$strip>; - budgetingMethod: z.ZodLiteral<"occurrences">; - objective: z.ZodObject<{ - target: z.ZodNumber; - }, z.core.$strip>; - tags: z.ZodArray; - enabled: z.ZodBoolean; - createdAt: z.ZodString; - updatedAt: z.ZodString; - createdBy: z.ZodString; - updatedBy: z.ZodString; - version: z.ZodNumber; - members: z.ZodArray; - }, z.core.$strip>>; -}, z.core.$strip>; -declare const compositeSloMemberSummarySchema: z.ZodObject<{ - id: z.ZodString; - name: z.ZodString; - weight: z.ZodNumber; - normalisedWeight: z.ZodNumber; - sliValue: z.ZodNumber; - status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - errorBudget: z.ZodOptional>; - fiveMinuteBurnRate: z.ZodOptional; - oneHourBurnRate: z.ZodOptional; - oneDayBurnRate: z.ZodOptional; - instanceId: z.ZodOptional; -}, z.core.$strip>; -declare const compositeSloSummarySchema: z.ZodObject<{ - sliValue: z.ZodNumber; - errorBudget: z.ZodObject<{ - initial: z.ZodNumber; - consumed: z.ZodNumber; - remaining: z.ZodNumber; - isEstimated: z.ZodBoolean; - }, z.core.$strip>; - status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - fiveMinuteBurnRate: z.ZodNumber; - oneHourBurnRate: z.ZodNumber; - oneDayBurnRate: z.ZodNumber; -}, z.core.$strip>; -type CompositeSLOMember = z.infer; -type CompositeMethod = z.infer; -type CompositeSLOMemberSummary = z.infer; -type CompositeSLOSummary = z.infer; -export type { CompositeSLOMember, CompositeMethod, CompositeSLOMemberSummary, CompositeSLOSummary }; -export { COMPOSITE_SLO_MIN_MEMBERS, COMPOSITE_SLO_MAX_MEMBERS, compositeSloIdSchema, compositeTagsSchema, compositeTargetSchema, compositeOccurrencesBudgetingMethodSchema, compositeRollingTimeWindowSchema, compositeSloMemberSchema, compositeMethodSchema, compositeErrorBudgetSchema, compositeStatusSchema, compositeSloBaseDefinitionSchema, compositeSloDefinitionSchema, storedCompositeSloDefinitionSchema, compositeSloMemberSummarySchema, compositeSloSummarySchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo_summary_index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo_summary_index.d.ts deleted file mode 100644 index 702366390e2d1..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/composite_slo_summary_index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { z } from '@kbn/zod'; -/** - * Flat summary fields persisted on composite summary index documents (see task `buildSummaryDoc`). - * Other top-level keys (`spaceId`, `summaryUpdatedAt`, `compositeSlo`, …) are ignored by decode. - */ -declare const storedCompositeSloSummarySchema: z.ZodObject<{ - sliValue: z.ZodNumber; - status: z.ZodUnion, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - errorBudgetInitial: z.ZodNumber; - errorBudgetConsumed: z.ZodNumber; - errorBudgetRemaining: z.ZodNumber; - errorBudgetIsEstimated: z.ZodBoolean; - fiveMinuteBurnRate: z.ZodNumber; - oneHourBurnRate: z.ZodNumber; - oneDayBurnRate: z.ZodNumber; - members: z.ZodOptional, z.ZodLiteral<"HEALTHY">, z.ZodLiteral<"DEGRADING">, z.ZodLiteral<"VIOLATED">]>; - errorBudget: z.ZodOptional>; - fiveMinuteBurnRate: z.ZodOptional; - oneHourBurnRate: z.ZodOptional; - oneDayBurnRate: z.ZodOptional; - instanceId: z.ZodOptional; - }, z.core.$strip>>>; -}, z.core.$strip>; -export { storedCompositeSloSummarySchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.d.ts deleted file mode 100644 index d3dc6fe60e322..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as t from 'io-ts'; -import { Duration } from '../models/duration'; -declare const durationType: t.Type; -export { durationType }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.d.ts deleted file mode 100644 index 5dae3bc0b71fe..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import * as t from 'io-ts'; -/** - * IMPORTANT: Any changes to this file must be carefully checked against both usage - * from the SLO definitions API and the SLO Health API, as both depend on these shared types. - * One is a public API, the other is an internal API. - * If types need to diverge, they should be split into separate files. - */ -declare const transformHealthSchema: t.IntersectionC<[t.TypeC<{ - isProblematic: t.BooleanC; - missing: t.BooleanC; - status: t.UnionC<[t.LiteralC<"healthy">, t.LiteralC<"unhealthy">, t.LiteralC<"unavailable">]>; - state: t.UnionC<[t.LiteralC<"stopped">, t.LiteralC<"started">, t.LiteralC<"stopping">, t.LiteralC<"aborting">, t.LiteralC<"failed">, t.LiteralC<"indexing">, t.LiteralC<"unavailable">]>; -}>, t.PartialC<{ - stateMatches: t.BooleanC; -}>]>; -export type TransformHealthResponse = t.OutputOf; -export { transformHealthSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.d.ts deleted file mode 100644 index 39faf074dc8b8..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './common'; -export * from './duration'; -export * from './indicators'; -export * from './time_window'; -export * from './slo'; -export * from './composite_slo'; -export * from './composite_slo_summary_index'; -export * from './settings'; -export * from './health'; -export * from './slo_template'; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.d.ts deleted file mode 100644 index db68345ea76e7..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.d.ts +++ /dev/null @@ -1,1518 +0,0 @@ -import * as t from 'io-ts'; -declare const kqlQuerySchema: t.StringC; -declare const filtersSchema: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; -}>, t.PartialC<{ - $state: t.AnyC; -}>]>>; -declare const kqlWithFiltersSchema: t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; -}>; -declare const querySchema: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; -}>]>; -declare const apmTransactionDurationIndicatorTypeSchema: t.LiteralC<"sli.apm.transactionDuration">; -declare const apmTransactionDurationIndicatorSchema: t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>; -declare const apmTransactionErrorRateIndicatorTypeSchema: t.LiteralC<"sli.apm.transactionErrorRate">; -declare const apmTransactionErrorRateIndicatorSchema: t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>; -declare const kqlCustomIndicatorTypeSchema: t.LiteralC<"sli.kql.custom">; -declare const kqlCustomIndicatorSchema: t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>; -declare const timesliceMetricComparatorMapping: { - GT: string; - GTE: string; - LT: string; - LTE: string; -}; -declare const timesliceMetricBasicMetricWithField: t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.KeyofC<{ - avg: boolean; - max: boolean; - min: boolean; - sum: boolean; - cardinality: boolean; - last_value: boolean; - std_deviation: boolean; - }>; - field: t.StringC; -}>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; -}>]>; -declare const timesliceMetricDocCountMetric: t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; -}>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; -}>]>; -declare const timesliceMetricPercentileMetric: t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; -}>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; -}>]>; -declare const timesliceMetricMetricDef: t.UnionC<[t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.KeyofC<{ - avg: boolean; - max: boolean; - min: boolean; - sum: boolean; - cardinality: boolean; - last_value: boolean; - std_deviation: boolean; - }>; - field: t.StringC; -}>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; -}>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; -}>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; -}>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; -}>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; -}>]>]>; -declare const timesliceMetricIndicatorTypeSchema: t.LiteralC<"sli.metric.timeslice">; -declare const timesliceMetricIndicatorSchema: t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>; -declare const metricCustomDocCountMetric: t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; -}>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; -}>]>; -declare const metricCustomBasicMetric: t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"sum">; - field: t.StringC; -}>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; -}>]>; -declare const metricCustomIndicatorTypeSchema: t.LiteralC<"sli.metric.custom">; -declare const metricCustomIndicatorSchema: t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>; -declare const histogramIndicatorTypeSchema: t.LiteralC<"sli.histogram.custom">; -declare const histogramIndicatorSchema: t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>; -declare const syntheticsAvailabilityIndicatorTypeSchema: t.LiteralC<"sli.synthetics.availability">; -declare const syntheticsAvailabilityIndicatorSchema: t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>; -declare const indicatorTypesSchema: t.UnionC<[t.LiteralC<"sli.apm.transactionDuration">, t.LiteralC<"sli.apm.transactionErrorRate">, t.LiteralC<"sli.synthetics.availability">, t.LiteralC<"sli.kql.custom">, t.LiteralC<"sli.metric.custom">, t.LiteralC<"sli.metric.timeslice">, t.LiteralC<"sli.histogram.custom">]>; -declare const indicatorTypesArraySchema: t.Type; -declare const indicatorSchema: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; -}>]>; -export { kqlQuerySchema, kqlWithFiltersSchema, querySchema, filtersSchema, apmTransactionDurationIndicatorSchema, apmTransactionDurationIndicatorTypeSchema, apmTransactionErrorRateIndicatorSchema, apmTransactionErrorRateIndicatorTypeSchema, syntheticsAvailabilityIndicatorSchema, syntheticsAvailabilityIndicatorTypeSchema, kqlCustomIndicatorSchema, kqlCustomIndicatorTypeSchema, metricCustomIndicatorSchema, metricCustomIndicatorTypeSchema, metricCustomDocCountMetric, metricCustomBasicMetric, timesliceMetricComparatorMapping, timesliceMetricIndicatorSchema, timesliceMetricIndicatorTypeSchema, timesliceMetricMetricDef, timesliceMetricBasicMetricWithField, timesliceMetricDocCountMetric, timesliceMetricPercentileMetric, histogramIndicatorTypeSchema, histogramIndicatorSchema, indicatorSchema, indicatorTypesArraySchema, indicatorTypesSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.d.ts deleted file mode 100644 index 60a23cb3008d6..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as t from 'io-ts'; -declare const storedSloSettingsSchema: t.IntersectionC<[t.TypeC<{ - useAllRemoteClusters: t.BooleanC; - selectedRemoteClusters: t.ArrayC; -}>, t.PartialC<{ - staleThresholdInHours: t.NumberC; - staleInstancesCleanupEnabled: t.BooleanC; -}>]>; -declare const sloSettingsSchema: t.TypeC<{ - useAllRemoteClusters: t.BooleanC; - selectedRemoteClusters: t.ArrayC; - staleThresholdInHours: t.NumberC; - staleInstancesCleanupEnabled: t.BooleanC; -}>; -declare const serverlessSloSettingsSchema: t.TypeC<{ - staleThresholdInHours: t.NumberC; - staleInstancesCleanupEnabled: t.BooleanC; -}>; -export { serverlessSloSettingsSchema, sloSettingsSchema, storedSloSettingsSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.d.ts deleted file mode 100644 index 78433e143ec73..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.d.ts +++ /dev/null @@ -1,1313 +0,0 @@ -import * as t from 'io-ts'; -declare const occurrencesBudgetingMethodSchema: t.LiteralC<"occurrences">; -declare const timeslicesBudgetingMethodSchema: t.LiteralC<"timeslices">; -declare const budgetingMethodSchema: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; -declare const targetSchema: t.TypeC<{ - target: t.NumberC; -}>; -declare const objectiveSchema: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; -}>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; -}>]>; -declare const settingsSchema: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; -}>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; -}>]>; -declare const groupBySchema: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; -declare const optionalSettingsSchema: t.PartialC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - syncField: t.UnionC<[t.StringC, t.NullC]>; -}>; -declare const tagsSchema: t.ArrayC; -declare const sloIdSchema: t.Type; -declare const dashboardsWithIdSchema: t.PartialC<{ - dashboards: t.ArrayC>; -}>; -declare const sloDefinitionSchema: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ - id: t.Type; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; -}>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; -}>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; -}>]>; -declare const storedSloDefinitionSchema: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ - id: t.Type; - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - settings: t.IntersectionC<[t.TypeC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - }>, t.PartialC<{ - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>]>; - revision: t.NumberC; - enabled: t.BooleanC; - tags: t.ArrayC; - createdAt: t.Type; - updatedAt: t.Type; - groupBy: t.UnionC<[t.LiteralC<"*">, t.StringC, t.ArrayC, t.StringC]>>]>; - version: t.NumberC; -}>, t.PartialC<{ - createdBy: t.StringC; - updatedBy: t.StringC; -}>]>, t.PartialC<{ - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; -}>]>; -export { budgetingMethodSchema, dashboardsWithIdSchema, groupBySchema, objectiveSchema, occurrencesBudgetingMethodSchema, optionalSettingsSchema, settingsSchema, sloDefinitionSchema, sloIdSchema, storedSloDefinitionSchema, tagsSchema, targetSchema, timeslicesBudgetingMethodSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo_template.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo_template.d.ts deleted file mode 100644 index a9035699045e8..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo_template.d.ts +++ /dev/null @@ -1,633 +0,0 @@ -import * as t from 'io-ts'; -declare const sloTemplateSchema: t.IntersectionC<[t.TypeC<{ - templateId: t.StringC; -}>, t.PartialC<{ - name: t.StringC; - description: t.StringC; - indicator: t.UnionC<[t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionDuration">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - threshold: t.NumberC; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.apm.transactionErrorRate">; - params: t.IntersectionC<[t.TypeC<{ - environment: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - service: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionType: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - transactionName: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - index: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.synthetics.availability">; - params: t.IntersectionC<[t.TypeC<{ - monitorIds: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - index: t.StringC; - }>, t.PartialC<{ - tags: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - projects: t.ArrayC, t.StringC]>; - label: t.UnionC<[t.LiteralC<"*">, t.StringC]>; - }>>; - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.kql.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - total: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - good: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - total: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.metric.timeslice">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - metric: t.TypeC<{ - metrics: t.ArrayC; - field: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"doc_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - name: t.StringC; - aggregation: t.LiteralC<"percentile">; - field: t.StringC; - percentile: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>>; - equation: t.StringC; - threshold: t.NumberC; - comparator: t.KeyofC<{ - GT: string; - GTE: string; - LT: string; - LTE: string; - }>; - }>; - timestampField: t.StringC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>, t.TypeC<{ - type: t.LiteralC<"sli.histogram.custom">; - params: t.IntersectionC<[t.TypeC<{ - index: t.StringC; - timestampField: t.StringC; - good: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - total: t.UnionC<[t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"value_count">; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>, t.IntersectionC<[t.TypeC<{ - field: t.StringC; - aggregation: t.LiteralC<"range">; - from: t.NumberC; - to: t.NumberC; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - }>]>]>; - }>, t.PartialC<{ - filter: t.UnionC<[t.StringC, t.TypeC<{ - kqlQuery: t.StringC; - filters: t.ArrayC; - disabled: t.BooleanC; - negate: t.BooleanC; - controlledBy: t.StringC; - group: t.StringC; - index: t.StringC; - isMultiIndex: t.BooleanC; - type: t.StringC; - key: t.StringC; - field: t.StringC; - params: t.AnyC; - value: t.StringC; - }>; - query: t.RecordC; - }>, t.PartialC<{ - $state: t.AnyC; - }>]>>; - }>]>; - dataViewId: t.StringC; - }>]>; - }>]>; - budgetingMethod: t.UnionC<[t.LiteralC<"occurrences">, t.LiteralC<"timeslices">]>; - objective: t.IntersectionC<[t.TypeC<{ - target: t.NumberC; - }>, t.PartialC<{ - timesliceTarget: t.NumberC; - timesliceWindow: t.Type; - }>]>; - timeWindow: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; - }>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; - }>]>; - tags: t.ArrayC; - settings: t.PartialC<{ - syncDelay: t.Type; - frequency: t.Type; - preventInitialBackfill: t.BooleanC; - syncField: t.UnionC<[t.StringC, t.NullC]>; - }>; - groupBy: t.ArrayC; - artifacts: t.PartialC<{ - dashboards: t.ArrayC>; - }>; -}>]>; -declare const storedSloTemplateSchema: t.RecordC; -export { sloTemplateSchema, storedSloTemplateSchema }; diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.d.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.d.ts deleted file mode 100644 index 2be63e53a334d..0000000000000 --- a/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as t from 'io-ts'; -declare const rollingTimeWindowTypeSchema: t.LiteralC<"rolling">; -declare const rollingTimeWindowSchema: t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; -}>; -declare const calendarAlignedTimeWindowTypeSchema: t.LiteralC<"calendarAligned">; -declare const calendarAlignedTimeWindowSchema: t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; -}>; -declare const timeWindowTypeSchema: t.UnionC<[t.LiteralC<"rolling">, t.LiteralC<"calendarAligned">]>; -declare const timeWindowSchema: t.UnionC<[t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"rolling">; -}>, t.TypeC<{ - duration: t.Type; - type: t.LiteralC<"calendarAligned">; -}>]>; -export { rollingTimeWindowSchema, rollingTimeWindowTypeSchema, calendarAlignedTimeWindowSchema, calendarAlignedTimeWindowTypeSchema, timeWindowSchema, timeWindowTypeSchema, }; diff --git a/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/index.d.ts b/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/index.d.ts deleted file mode 100644 index be3dab3aec701..0000000000000 --- a/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { UiamApiKeyProvisioningEntityType, UiamApiKeyProvisioningStatus, } from './src/uiam_api_key_provisioning_status'; diff --git a/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/src/uiam_api_key_provisioning_status.d.ts b/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/src/uiam_api_key_provisioning_status.d.ts deleted file mode 100644 index 29a4e1b5e91d8..0000000000000 --- a/x-pack/platform/packages/shared/kbn-uiam-api-keys-provisioning-status/src/uiam_api_key_provisioning_status.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare enum UiamApiKeyProvisioningStatus { - COMPLETED = "completed", - FAILED = "failed", - SKIPPED = "skipped" -} -export declare enum UiamApiKeyProvisioningEntityType { - RULE = "rule", - TASK = "task" -} diff --git a/x-pack/platform/packages/shared/response-ops/scheduling-types/index.d.ts b/x-pack/platform/packages/shared/response-ops/scheduling-types/index.d.ts deleted file mode 100644 index 4abf0357d5867..0000000000000 --- a/x-pack/platform/packages/shared/response-ops/scheduling-types/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { IntervalSchedule, RruleSchedule, Schedule, Rrule, RruleCommon, RruleMonthly, RruleWeekly, RruleDaily, RruleHourly, } from './schedule_types'; diff --git a/x-pack/platform/packages/shared/response-ops/scheduling-types/schedule_types.d.ts b/x-pack/platform/packages/shared/response-ops/scheduling-types/schedule_types.d.ts deleted file mode 100644 index 6b8b37b23197d..0000000000000 --- a/x-pack/platform/packages/shared/response-ops/scheduling-types/schedule_types.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { Frequency } from '@kbn/rrule'; -/** - * Interval-based schedule. Use this or RruleSchedule, never both. - */ -export interface IntervalSchedule { - /** - * An interval string (e.g. '5m', '30s'). If specified, this is a recurring schedule. - */ - interval: string; - rrule?: never; -} -/** - * RRule-based schedule. Use this or IntervalSchedule, never both. - */ -export interface RruleSchedule { - rrule: Rrule; - interval?: never; -} -/** Schedule is either interval-based or rrule-based, never both, never neither. */ -export type Schedule = IntervalSchedule | RruleSchedule; -export type Rrule = RruleMonthly | RruleWeekly | RruleDaily | RruleHourly; -export interface RruleCommon { - dtstart?: string; - freq: Frequency; - interval: number; - tzid: string; -} -export interface RruleMonthly extends RruleCommon { - freq: Frequency.MONTHLY; - bymonthday?: number[]; - byhour?: number[]; - byminute?: number[]; - byweekday?: string[]; -} -export interface RruleWeekly extends RruleCommon { - freq: Frequency.WEEKLY; - byweekday?: string[]; - byhour?: number[]; - byminute?: number[]; - bymonthday?: never; -} -export interface RruleDaily extends RruleCommon { - freq: Frequency.DAILY; - byhour?: number[]; - byminute?: number[]; - byweekday?: string[]; - bymonthday?: never; -} -export interface RruleHourly extends RruleCommon { - freq: Frequency.HOURLY; - byhour?: never; - byminute?: number[]; - byweekday?: never; - bymonthday?: never; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/index.d.ts deleted file mode 100644 index 93a074365bdae..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { AuthenticatedUser, UserRealm, User, AuthenticationProvider, } from './src/authentication'; -export type { QueryRolesRole, QueryRolesResult, RemoteClusterPrivilege, Role, RoleIndexPrivilege, RoleKibanaPrivilege, RoleRemoteIndexPrivilege, RoleRemoteClusterPrivilege, FeaturesPrivileges, RawKibanaFeaturePrivileges, RawKibanaPrivileges, RoleKibanaApplication, RoleTransformError, } from './src/authorization'; -export type { SecurityLicense, SecurityLicenseFeatures, LoginLayout } from './src/licensing'; -export type { UserProfileUserInfo, UserProfileData, UserProfileLabels, UserProfile, UserProfileWithSecurity, UserProfileUserInfoWithSecurity, } from './src/user_profile'; -export type { ApiKey, RestApiKey, CrossClusterApiKey, BaseApiKey, CrossClusterApiKeyAccess, ManagedApiKey, ApiKeyRoleDescriptors, ApiKeyToInvalidate, QueryApiKeyResult, CategorizedApiKey, ApiKeyAggregations, } from './src/api_keys/api_key'; -export { RoleTransformErrorReason } from './src/roles'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/api_keys/api_key.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/api_keys/api_key.d.ts deleted file mode 100644 index f7948b5e588ab..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/api_keys/api_key.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -/** - * Interface representing an API key the way it is returned by Elasticsearch GET endpoint. - */ -export type ApiKey = RestApiKey | CrossClusterApiKey; -/** - * Interface representing a REST API key the way it is returned by Elasticsearch GET endpoint. - * - * TODO: Remove this type when `@elastic/elasticsearch` has been updated. - */ -export interface RestApiKey extends BaseApiKey { - type: 'rest'; -} -/** - * Interface representing a cross-cluster API key the way it is returned by Elasticsearch GET endpoint. - * - * TODO: Remove this type when `@elastic/elasticsearch` has been updated. - */ -export interface CrossClusterApiKey extends BaseApiKey { - type: 'cross_cluster'; - /** - * The access to be granted to this API key. The access is composed of permissions for cross-cluster - * search and cross-cluster replication. At least one of them must be specified. - */ - access: CrossClusterApiKeyAccess; -} -/** - * Fixing up `estypes.SecurityApiKey` type since some fields are marked as optional even though they are guaranteed to be returned. - * - * TODO: Remove this type when `@elastic/elasticsearch` has been updated to make `role_descriptors` required. - */ -export interface BaseApiKey extends estypes.SecurityApiKey { - role_descriptors: Required['role_descriptors']; -} -export interface CrossClusterApiKeyAccess { - /** - * A list of indices permission entries for cross-cluster search. - */ - search?: CrossClusterApiKeySearch[]; - /** - * A list of indices permission entries for cross-cluster replication. - */ - replication?: CrossClusterApiKeyReplication[]; -} -type CrossClusterApiKeySearch = Pick; -type CrossClusterApiKeyReplication = Pick; -export type ApiKeyRoleDescriptors = Record; -export interface ApiKeyToInvalidate { - id: string; - name: string; -} -export interface ApiKeyAggregations { - usernames?: estypes.AggregationsStringTermsAggregate; - types?: estypes.AggregationsStringTermsAggregate; - expired?: estypes.AggregationsFilterAggregateKeys; - managed?: { - buckets: { - metadataBased: estypes.AggregationsFilterAggregateKeys; - namePrefixBased: estypes.AggregationsFilterAggregateKeys; - }; - }; -} -/** - * Response of Kibana Query API keys endpoint. - */ -export type QueryApiKeyResult = SuccessQueryApiKeyResult | ErrorQueryApiKeyResult; -interface SuccessQueryApiKeyResult extends BaseQueryApiKeyResult { - apiKeys: ApiKey[]; - count: number; - total: number; - queryError: never; - /** - * The search_after cursor for the next page of results. - * Use this value in the next request to get the following page. - */ - searchAfter?: estypes.SortResults; -} -interface ErrorQueryApiKeyResult extends BaseQueryApiKeyResult { - queryError: { - name: string; - message: string; - }; - apiKeys: never; - total: never; -} -interface BaseQueryApiKeyResult { - canManageCrossClusterApiKeys: boolean; - canManageApiKeys: boolean; - canManageOwnApiKeys: boolean; - aggregationTotal: number; - aggregations: Record | undefined; -} -/** - * Interface representing a REST API key that is managed by Kibana. - */ -export interface ManagedApiKey extends Omit { - type: estypes.SecurityApiKeyType | 'managed'; -} -/** - * Interface representing an API key the way it is presented in the Kibana UI (with Kibana system - * API keys given its own dedicated `managed` type). - */ -export type CategorizedApiKey = (ApiKey | ManagedApiKey) & { - expired: boolean; -}; -export {}; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authentication/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authentication/index.d.ts deleted file mode 100644 index eac31961aed59..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/authentication/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { User, UserRealm, AuthenticatedUser, AuthenticationProvider, } from '@kbn/core-security-common'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/features_privileges.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/features_privileges.d.ts deleted file mode 100644 index 5f4302b1359ea..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/features_privileges.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface FeaturesPrivileges { - [featureId: string]: string[]; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/index.d.ts deleted file mode 100644 index f17173f32cf9e..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { FeaturesPrivileges } from './features_privileges'; -export type { RawKibanaFeaturePrivileges, RawKibanaPrivileges } from './raw_kibana_privileges'; -export type { QueryRolesRole, QueryRolesResult, RemoteClusterPrivilege, Role, RoleKibanaPrivilege, RoleIndexPrivilege, RoleRemoteIndexPrivilege, RoleRemoteClusterPrivilege, RoleKibanaApplication, RoleTransformError, } from './role'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/raw_kibana_privileges.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/raw_kibana_privileges.d.ts deleted file mode 100644 index 50dfba378673a..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/raw_kibana_privileges.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface RawKibanaFeaturePrivileges { - [featureId: string]: { - [privilegeId: string]: string[]; - }; -} -export interface RawKibanaPrivileges { - global: Record; - features: RawKibanaFeaturePrivileges; - space: Record; - reserved: Record; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/role.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/role.d.ts deleted file mode 100644 index b1e9996574c9e..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/authorization/role.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { FeaturesPrivileges } from './features_privileges'; -export interface RoleIndexPrivilege { - names: string[]; - privileges: string[]; - field_security?: { - grant?: string[]; - except?: string[]; - }; - query?: string; -} -export interface RoleRemoteIndexPrivilege extends RoleIndexPrivilege { - clusters: string[]; -} -export interface RoleKibanaPrivilege { - spaces: string[]; - base: string[]; - feature: FeaturesPrivileges; - _reserved?: string[]; -} -export type RemoteClusterPrivilege = 'monitor_enrich' | 'monitor_stats'; -export interface RoleRemoteClusterPrivilege { - clusters: string | string[]; - privileges: RemoteClusterPrivilege[]; -} -export interface RoleKibanaApplication { - application: string; - privileges: string[]; - resources: string[]; -} -export interface RoleTransformError { - reason: string; - state?: RoleKibanaApplication[]; -} -export interface Role { - name: string; - description?: string; - elasticsearch: { - cluster: string[]; - remote_cluster?: RoleRemoteClusterPrivilege[]; - indices: RoleIndexPrivilege[]; - remote_indices?: RoleRemoteIndexPrivilege[]; - run_as: string[]; - }; - kibana: RoleKibanaPrivilege[]; - metadata?: { - [anyKey: string]: any; - }; - transient_metadata?: { - [anyKey: string]: any; - }; - _transform_error?: RoleTransformError[]; - _unrecognized_applications?: string[]; -} -export type QueryRolesRole = estypes.SecurityQueryRoleQueryRole; -export interface QueryRolesResult { - roles: Role[]; - count: number; - total: number; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/index.d.ts deleted file mode 100644 index 3f2836927c559..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { SecurityLicense } from './license'; -export type { LoginLayout, SecurityLicenseFeatures } from './license_features'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license.d.ts deleted file mode 100644 index dcccfdd6d221d..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { LicenseType } from '@kbn/licensing-types'; -import type { SecurityLicenseFeatures } from './license_features'; -export interface SecurityLicense { - isLicenseAvailable(): boolean; - getLicenseType(): string | undefined; - getUnavailableReason: () => string | undefined; - isEnabled(): boolean; - getFeatures(): SecurityLicenseFeatures; - hasAtLeast(licenseType: LicenseType): boolean | undefined; - features$: Observable; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license_features.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license_features.d.ts deleted file mode 100644 index 9a7c5927e13eb..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/licensing/license_features.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Represents types of login form layouts. - */ -export type LoginLayout = 'form' | 'error-es-unavailable' | 'error-xpack-unavailable'; -/** - * Describes Security plugin features that depend on license. - */ -export interface SecurityLicenseFeatures { - /** - * Indicates whether we show login page or skip it. - */ - readonly showLogin: boolean; - /** - * Indicates whether we allow login or disable it on the login page. - */ - readonly allowLogin: boolean; - /** - * Indicates whether we show security links throughout the kibana app. - */ - readonly showLinks: boolean; - /** - * Indicates whether we show the Role Mappings UI. - */ - readonly showRoleMappingsManagement: boolean; - /** - * Indicates whether we allow users to access agreement UI and acknowledge it. - */ - readonly allowAccessAgreement: boolean; - /** - * Indicates whether we allow logging of audit events. - */ - readonly allowAuditLogging: boolean; - /** - * Indicates whether we allow users to define document level security in roles. - */ - readonly allowRoleDocumentLevelSecurity: boolean; - /** - * Indicates whether we allow users to define field level security in roles. - */ - readonly allowRoleFieldLevelSecurity: boolean; - /** - * Indicates whether we allow users to define remote index privileges in roles. - */ - readonly allowRoleRemoteIndexPrivileges: boolean; - /** - * Indicates whether we allow users to define remote cluster privileges in roles. - */ - readonly allowRemoteClusterPrivileges: boolean; - /** - * Indicates whether we allow Role-based access control (RBAC). - */ - readonly allowRbac: boolean; - /** - * Indicates whether we allow sub-feature privileges. - */ - readonly allowSubFeaturePrivileges: boolean; - /** - * Indicates whether we allow user profile collaboration features (suggest and privileges checks APIs). - */ - readonly allowUserProfileCollaboration: boolean; - /** - * Describes the layout of the login form if it's displayed. - */ - readonly layout?: LoginLayout; - /** - * Indicates whether we allow FIPS mode - */ - readonly allowFips: boolean; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/roles/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/roles/index.d.ts deleted file mode 100644 index 7e8a5a4ea06b1..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/roles/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare enum RoleTransformErrorReason { - RESERVED_PRIVILEGES_MIXED = "reserved_privileges_mixed", - RESERVED_PRIVILEGES_WRONG_APP = "reserved_privileges_wrong_app", - SPACE_PRIVILEGES_GLOBAL = "space_privileges_global", - GLOBAL_PRIVILEGES_SPACE = "global_privileges_space", - BASE_FEATURE_PRIVILEGES_MIXED = "base_feature_privileges_mixed", - GLOBAL_RESOURCE_MIXED = "global_resource_mixed", - INVALID_RESOURCE_FORMAT = "invalid_resource_format", - DUPLICATED_RESOURCES = "duplicated_resources", - FEATURE_REQUIRES_ALL_SPACES = "feature_requires_all_spaces", - DISABLED_FEATURE_PRIVILEGES = "disabled_feature_privileges", - TRANSFORMATION_EXCEPTION = "transformation_exception" -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_common/src/user_profile/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_common/src/user_profile/index.d.ts deleted file mode 100644 index f6dc98d6a0331..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_common/src/user_profile/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { UserProfileUserInfo, UserProfileData, UserProfileLabels, UserProfileUserInfoWithSecurity, UserProfile, UserProfileWithSecurity, } from '@kbn/core-user-profile-common'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/index.d.ts deleted file mode 100644 index 0ea11a90444d8..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type { AuditEvent, AuditHttp, AuditKibana, AuditRequest, AuditServiceSetup, AuditLogger, } from './src/audit'; -export type { AuthenticationServiceStart, NativeAPIKeysType, UpdateAPIKeyParams, UpdateAPIKeyResult, UpdateCrossClusterAPIKeyParams, UpdateRestAPIKeyParams, UpdateRestAPIKeyWithKibanaPrivilegesParams, GrantUiamAPIKeyParams, InvalidateUiamAPIKeyParams, ConvertUiamAPIKeyResult, ConvertUiamAPIKeyResultSuccess, ConvertUiamAPIKeyResultFailed, ConvertUiamAPIKeysResponse, UiamAPIKeysType, ClientAuthentication, } from './src/authentication'; -export type { PrivilegeDeprecationsService, PrivilegeDeprecationsRolesByFeatureIdResponse, PrivilegeDeprecationsRolesByFeatureIdRequest, CheckPrivilegesResponse, CheckPrivilegesWithRequest, CheckSavedObjectsPrivilegesWithRequest, CheckPrivilegesDynamicallyWithRequest, SavedObjectActions, UIActions, CheckPrivilegesPayload, CheckSavedObjectsPrivileges, HasPrivilegesResponse, HasPrivilegesResponseApplication, SpaceActions, Actions, CheckPrivilegesOptions, CheckUserProfilesPrivilegesPayload, CheckUserProfilesPrivilegesResponse, CasesActions, CheckPrivileges, AlertingActions, AppActions, ApiActions, CheckPrivilegesDynamically, CheckUserProfilesPrivileges, AuthorizationMode, AuthorizationServiceSetup, EsSecurityConfig, } from './src/authorization'; -export type { SecurityPluginSetup, SecurityPluginStart } from './src/plugin'; -export type { UserProfileServiceStart, UserProfileSuggestParams, UserProfileGetCurrentParams, UserProfileBulkGetParams, UserProfileRequiredPrivileges, } from './src/user_profile'; -export { getUpdateRestApiKeyWithKibanaPrivilegesSchema, updateRestApiKeySchema, updateCrossClusterApiKeySchema, } from './src/authentication'; -export type { ElasticsearchPrivilegesType, KibanaPrivilegesType, CreateAPIKeyParams, CreateAPIKeyResult, InvalidateAPIKeyResult, InvalidateAPIKeysParams, ValidateAPIKeyParams, CreateRestAPIKeyParams, CreateRestAPIKeyWithKibanaPrivilegesParams, CreateCrossClusterAPIKeyParams, GrantAPIKeyResult, CloneAPIKeyParams, CloneAPIKeyResult, } from '@kbn/core-security-server'; -export { isCreateRestAPIKeyParams } from '@kbn/core-security-server'; -export { restApiKeySchema, crossClusterApiKeySchema, getRestApiKeyWithKibanaPrivilegesSchema, } from './src/authentication'; -export { getKibanaRoleSchema, elasticsearchRoleSchema, GLOBAL_RESOURCE } from './src/authorization'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/audit_service.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/audit_service.d.ts deleted file mode 100644 index 12fc5cb81fb82..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/audit_service.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -import type { AuditLogger } from '@kbn/core-security-server'; -export interface AuditServiceSetup { - /** - * Creates an {@link AuditLogger} scoped to the current request. - * - * This audit logger logs events with all required user and session info and should be used for - * all user-initiated actions. - * - * @example - * ```typescript - * const auditLogger = securitySetup.audit.asScoped(request); - * auditLogger.log(event); - * ``` - */ - asScoped: (request: KibanaRequest) => AuditLogger; - /** - * {@link AuditLogger} for background tasks only. - * - * This audit logger logs events without any user or session info and should never be used to log - * user-initiated actions. - * - * @example - * ```typescript - * securitySetup.audit.withoutRequest.log(event); - * ``` - */ - withoutRequest: AuditLogger; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/index.d.ts deleted file mode 100644 index cdbd2b4cd6808..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/audit/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { AuditServiceSetup } from './audit_service'; -export type { AuditEvent, AuditHttp, AuditKibana, AuditLogger, AuditRequest, } from '@kbn/core-security-server'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/api_keys.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/api_keys.d.ts deleted file mode 100644 index d8a2392b3da8f..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/api_keys.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { getKibanaRoleSchema } from '../../authorization'; -export declare const restApiKeySchema: import("@kbn/config-schema").ObjectType<{ - type: import("@kbn/config-schema").Type<"rest" | undefined>; - name: import("@kbn/config-schema").Type; - expiration: import("@kbn/config-schema").Type; - role_descriptors: import("@kbn/config-schema").Type>>; - metadata: import("@kbn/config-schema").Type | undefined>; -}>; -export declare const getRestApiKeyWithKibanaPrivilegesSchema: (getBasePrivilegeNames: Parameters[0]) => import("@kbn/config-schema").ObjectType<{ - type: import("@kbn/config-schema").Type<"rest" | undefined>; - name: import("@kbn/config-schema").Type; - expiration: import("@kbn/config-schema").Type; - metadata: import("@kbn/config-schema").Type | undefined>; - kibana_role_descriptors: import("@kbn/config-schema").Type | undefined; - } & { - spaces: string[] | "*"[]; - }>[]; - elasticsearch: Readonly<{ - indices?: Readonly<{ - query?: string | undefined; - field_security?: Record<"grant" | "except", string[]> | undefined; - allow_restricted_indices?: boolean | undefined; - } & { - names: string[]; - privileges: string[]; - }>[] | undefined; - cluster?: string[] | undefined; - remote_cluster?: Readonly<{} & { - privileges: string[]; - clusters: string[]; - }>[] | undefined; - remote_indices?: Readonly<{ - query?: string | undefined; - field_security?: Record<"grant" | "except", string[]> | undefined; - allow_restricted_indices?: boolean | undefined; - } & { - names: string[]; - privileges: string[]; - clusters: string[]; - }>[] | undefined; - run_as?: string[] | undefined; - } & {}>; - }>>>; -}>; -export declare const crossClusterApiKeySchema: import("@kbn/config-schema").ObjectType<{ - type: import("@kbn/config-schema").Type<"cross_cluster">; - name: import("@kbn/config-schema").Type; - expiration: import("@kbn/config-schema").Type; - metadata: import("@kbn/config-schema").Type | undefined>; - access: import("@kbn/config-schema").ObjectType<{ - search: import("@kbn/config-schema").Type[] | undefined>; - replication: import("@kbn/config-schema").Type[] | undefined>; - }>; -}>; -export declare const updateRestApiKeySchema: import("@kbn/config-schema").ObjectType<{ - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type<"rest" | undefined>; - expiration: import("@kbn/config-schema").Type; - role_descriptors: import("@kbn/config-schema").Type>>; - metadata: import("@kbn/config-schema").Type | undefined>; -}>; -export declare const updateCrossClusterApiKeySchema: import("@kbn/config-schema").ObjectType<{ - id: import("@kbn/config-schema").Type; - type: import("@kbn/config-schema").Type<"cross_cluster">; - expiration: import("@kbn/config-schema").Type; - metadata: import("@kbn/config-schema").Type | undefined>; - access: import("@kbn/config-schema").ObjectType<{ - search: import("@kbn/config-schema").Type[] | undefined>; - replication: import("@kbn/config-schema").Type[] | undefined>; - }>; -}>; -export declare const getUpdateRestApiKeyWithKibanaPrivilegesSchema: (getBasePrivilegeNames: Parameters[0]) => import("@kbn/config-schema").ObjectType<{ - type: import("@kbn/config-schema").Type<"rest" | undefined>; - expiration: import("@kbn/config-schema").Type; - metadata: import("@kbn/config-schema").Type | undefined>; - id: import("@kbn/config-schema").Type; - kibana_role_descriptors: import("@kbn/config-schema").Type | undefined; - } & { - spaces: string[] | "*"[]; - }>[]; - elasticsearch: Readonly<{ - indices?: Readonly<{ - query?: string | undefined; - field_security?: Record<"grant" | "except", string[]> | undefined; - allow_restricted_indices?: boolean | undefined; - } & { - names: string[]; - privileges: string[]; - }>[] | undefined; - cluster?: string[] | undefined; - remote_cluster?: Readonly<{} & { - privileges: string[]; - clusters: string[]; - }>[] | undefined; - remote_indices?: Readonly<{ - query?: string | undefined; - field_security?: Record<"grant" | "except", string[]> | undefined; - allow_restricted_indices?: boolean | undefined; - } & { - names: string[]; - privileges: string[]; - clusters: string[]; - }>[] | undefined; - run_as?: string[] | undefined; - } & {}>; - }>>>; -}>; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/index.d.ts deleted file mode 100644 index 56f239e1aa59d..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/api_keys/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { crossClusterApiKeySchema, getRestApiKeyWithKibanaPrivilegesSchema, getUpdateRestApiKeyWithKibanaPrivilegesSchema, restApiKeySchema, updateRestApiKeySchema, updateCrossClusterApiKeySchema, } from './api_keys'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/authentication_service.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/authentication_service.d.ts deleted file mode 100644 index f7b7e971b58c9..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/authentication_service.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -import type { NativeAPIKeysType } from '@kbn/core-security-server'; -import type { AuthenticatedUser } from '@kbn/security-plugin-types-common'; -/** - * Authentication services available on the security plugin's start contract. - */ -export interface AuthenticationServiceStart { - apiKeys: NativeAPIKeysType; - getCurrentUser: (request: KibanaRequest) => AuthenticatedUser | null; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/client_authentication.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/client_authentication.d.ts deleted file mode 100644 index 8cdd28086c8dd..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/client_authentication.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Represents client authentication information. Don't confuse with the authentication information which represents an - * authenticated user. For example, if Kibana is making a request to Elasticsearch on behalf of an authenticated user, the - * client authentication information would represent Kibana's own authentication information (e.g. shared secret), not the - * end user's. - */ -export interface ClientAuthentication { - /** - * The authentication scheme. Currently only `SharedSecret` scheme is supported. - */ - readonly scheme: 'SharedSecret' | string; - /** - * The authentication credentials for the scheme. - */ - readonly value: string; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/index.d.ts deleted file mode 100644 index 85965cfbed2aa..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authentication/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { AuthenticationServiceStart } from './authentication_service'; -export type { ClientAuthentication } from './client_authentication'; -export type { NativeAPIKeysType, UpdateAPIKeyParams, UpdateAPIKeyResult, UpdateCrossClusterAPIKeyParams, UpdateRestAPIKeyParams, UpdateRestAPIKeyWithKibanaPrivilegesParams, GrantUiamAPIKeyParams, InvalidateUiamAPIKeyParams, ConvertUiamAPIKeyResult, ConvertUiamAPIKeyResultSuccess, ConvertUiamAPIKeyResultFailed, ConvertUiamAPIKeysResponse, UiamAPIKeysType, } from '@kbn/core-security-server'; -export { crossClusterApiKeySchema, getRestApiKeyWithKibanaPrivilegesSchema, getUpdateRestApiKeyWithKibanaPrivilegesSchema, restApiKeySchema, updateRestApiKeySchema, updateCrossClusterApiKeySchema, } from './api_keys'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/actions.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/actions.d.ts deleted file mode 100644 index 2e0bc157533b1..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/actions.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { AlertingActions } from './alerting'; -import type { ApiActions } from './api'; -import type { AppActions } from './app'; -import type { CasesActions } from './cases'; -import type { SavedObjectActions } from './saved_object'; -import type { SpaceActions } from './space'; -import type { UIActions } from './ui'; -/** Actions are used to create the "actions" that are associated with Elasticsearch's - * application privileges, and are used to perform the authorization checks implemented - * by the various `checkPrivilegesWithRequest` derivatives. - */ -export interface Actions { - readonly api: ApiActions; - readonly app: AppActions; - readonly cases: CasesActions; - readonly login: string; - readonly savedObject: SavedObjectActions; - readonly alerting: AlertingActions; - readonly space: SpaceActions; - readonly ui: UIActions; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/alerting.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/alerting.d.ts deleted file mode 100644 index fe06488098763..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/alerting.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface AlertingActions { - get(ruleTypeId: string, consumer: string, alertingEntity: string, operation: string): string; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/api.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/api.d.ts deleted file mode 100644 index 094ecdd0fce98..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/api.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ApiOperation } from '@kbn/core-security-server'; -export interface ApiActions { - get(operation: ApiOperation, subject: string): string; - /** - * @deprecated use `get(operation: ApiOperation, subject: string)` instead - */ - get(subject: string): string; - actionFromRouteTag(routeTag: string): string; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/app.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/app.d.ts deleted file mode 100644 index 461caed76dcb2..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/app.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface AppActions { - get(operation: string): string; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/cases.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/cases.d.ts deleted file mode 100644 index 40b0e0c84669e..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/cases.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface CasesActions { - get(owner: string, operation: string): string; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/index.d.ts deleted file mode 100644 index e415037fe514e..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type { Actions } from './actions'; -export type { AlertingActions } from './alerting'; -export type { ApiActions } from './api'; -export type { AppActions } from './app'; -export type { CasesActions } from './cases'; -export type { SavedObjectActions } from './saved_object'; -export type { SpaceActions } from './space'; -export type { UIActions } from './ui'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/saved_object.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/saved_object.d.ts deleted file mode 100644 index edc7417fc2dfb..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/saved_object.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface SavedObjectActions { - get(type: string, operation: string): string; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/space.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/space.d.ts deleted file mode 100644 index d288134f51e1a..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/space.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface SpaceActions { - manage: string; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/ui.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/ui.d.ts deleted file mode 100644 index 42567d5341a1d..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/actions/ui.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Capabilities as UICapabilities } from '@kbn/core/server'; -export interface UIActions { - get(featureId: keyof UICapabilities, ...uiCapabilityParts: string[]): string; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/authorization_service.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/authorization_service.d.ts deleted file mode 100644 index 527d040dd0a12..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/authorization_service.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Actions } from './actions'; -import type { CheckPrivilegesWithRequest } from './check_privileges'; -import type { CheckPrivilegesDynamicallyWithRequest } from './check_privileges_dynamically'; -import type { CheckSavedObjectsPrivilegesWithRequest } from './check_saved_objects_privileges'; -import type { AuthorizationMode } from './mode'; -/** - * Authorization services available on the setup contract of the security plugin. - */ -export interface AuthorizationServiceSetup { - /** - * Actions are used to create the "actions" that are associated with Elasticsearch's - * application privileges, and are used to perform the authorization checks implemented - * by the various `checkPrivilegesWithRequest` derivatives. - */ - actions: Actions; - checkPrivilegesWithRequest: CheckPrivilegesWithRequest; - checkPrivilegesDynamicallyWithRequest: CheckPrivilegesDynamicallyWithRequest; - checkSavedObjectsPrivilegesWithRequest: CheckSavedObjectsPrivilegesWithRequest; - mode: AuthorizationMode; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges.d.ts deleted file mode 100644 index b853d6a1b04c0..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -export interface HasPrivilegesResponseApplication { - [resource: string]: { - [privilegeName: string]: boolean; - }; -} -export interface HasPrivilegesResponse { - has_all_requested: boolean; - username: string; - application: { - [applicationName: string]: HasPrivilegesResponseApplication; - }; - cluster?: { - [privilegeName: string]: boolean; - }; - index?: { - [indexName: string]: { - [privilegeName: string]: boolean; - }; - }; -} -/** - * Options to influce the privilege checks. - */ -export interface CheckPrivilegesOptions { - /** - * Whether or not the `login` action should be required (default: true). - * Setting this to false is not advised except for special circumstances, when you do not require - * the request to belong to a user capable of logging into Kibana. - */ - requireLoginAction?: boolean; -} -export interface CheckPrivilegesResponse { - hasAllRequested: boolean; - username: string; - privileges: { - kibana: Array<{ - /** - * If this attribute is undefined, this element is a privilege for the global resource. - */ - resource?: string; - privilege: string; - authorized: boolean; - }>; - elasticsearch: { - cluster: Array<{ - privilege: string; - authorized: boolean; - }>; - index: { - [indexName: string]: Array<{ - privilege: string; - authorized: boolean; - }>; - }; - }; - }; -} -export type CheckPrivilegesWithRequest = (request: KibanaRequest) => CheckPrivileges; -export interface CheckPrivileges { - atSpace(spaceId: string, privileges: CheckPrivilegesPayload, options?: CheckPrivilegesOptions): Promise; - atSpaces(spaceIds: string[], privileges: CheckPrivilegesPayload, options?: CheckPrivilegesOptions): Promise; - globally(privileges: CheckPrivilegesPayload, options?: CheckPrivilegesOptions): Promise; -} -/** - * Privileges that can be checked for the Kibana users. - */ -export interface CheckPrivilegesPayload { - /** - * A list of the Kibana specific privileges (usually generated with `security.authz.actions.*.get(...)`). - */ - kibana?: string | string[]; - /** - * A set of the Elasticsearch cluster and index privileges. - */ - elasticsearch?: { - /** - * A list of Elasticsearch cluster privileges (`manage_security`, `create_snapshot` etc.). - */ - cluster: string[]; - /** - * A map (index name <-> list of privileges) of Elasticsearch index privileges (`view_index_metadata`, `read` etc.). - */ - index: Record; - }; -} -/** - * An interface to check users profiles privileges in a specific context (only a single-space context is supported at - * the moment). - */ -export interface CheckUserProfilesPrivileges { - atSpace(spaceId: string, privileges: CheckUserProfilesPrivilegesPayload): Promise; -} -/** - * Privileges that can be checked for the users profiles (only Kibana specific privileges are supported at the moment). - */ -export interface CheckUserProfilesPrivilegesPayload { - /** - * A list of the Kibana specific privileges (usually generated with `security.authz.actions.*.get(...)`). - */ - kibana: string[]; -} -/** - * Response of the check privileges operation for the users profiles. - */ -export interface CheckUserProfilesPrivilegesResponse { - /** - * The subset of the requested profile IDs of the users that have all the requested privileges. - */ - hasPrivilegeUids: string[]; - /** - * An errors object that may be returned from ES that contains a `count` of UIDs that have errors in the `details` property. - * - * Each entry in `details` will contain an error `type`, e.g 'resource_not_found_exception', and a `reason` message, e.g. 'profile document not found' - */ - errors?: { - count: number; - details: Record; - }; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges_dynamically.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges_dynamically.d.ts deleted file mode 100644 index 6510442623095..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_privileges_dynamically.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -import type { CheckPrivilegesOptions, CheckPrivilegesPayload, CheckPrivilegesResponse } from './check_privileges'; -export type CheckPrivilegesDynamically = (privileges: CheckPrivilegesPayload, options?: CheckPrivilegesOptions) => Promise; -export type CheckPrivilegesDynamicallyWithRequest = (request: KibanaRequest) => CheckPrivilegesDynamically; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_saved_objects_privileges.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_saved_objects_privileges.d.ts deleted file mode 100644 index a03e32e674fb2..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/check_saved_objects_privileges.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -import type { CheckPrivilegesResponse } from './check_privileges'; -export type CheckSavedObjectsPrivilegesWithRequest = (request: KibanaRequest) => CheckSavedObjectsPrivileges; -export type CheckSavedObjectsPrivileges = (actions: string | string[], namespaceOrNamespaces?: string | Array) => Promise; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/constants.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/constants.d.ts deleted file mode 100644 index f437e042715ed..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const GLOBAL_RESOURCE = "*"; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/deprecations.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/deprecations.d.ts deleted file mode 100644 index 369c68a8f9ef7..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/deprecations.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { DeprecationsDetails, GetDeprecationsContext } from '@kbn/core/server'; -import type { Role } from '@kbn/security-plugin-types-common'; -export interface PrivilegeDeprecationsRolesByFeatureIdResponse { - roles?: Role[]; - errors?: DeprecationsDetails[]; -} -export interface PrivilegeDeprecationsRolesByFeatureIdRequest { - context: GetDeprecationsContext; - featureId: string; -} -export interface PrivilegeDeprecationsService { - getKibanaRolesByFeatureId: (args: PrivilegeDeprecationsRolesByFeatureIdRequest) => Promise; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/es_security_config.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/es_security_config.d.ts deleted file mode 100644 index 3e41351290f79..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/es_security_config.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Client } from '@elastic/elasticsearch'; -type XpackUsageResponse = Awaited>; -type XpackUsageSecurity = XpackUsageResponse['security']; -export type EsSecurityConfig = Pick; -export {}; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/index.d.ts deleted file mode 100644 index 673242cb9a8fa..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type { Actions, ApiActions, AppActions, AlertingActions, CasesActions, SavedObjectActions, SpaceActions, UIActions, } from './actions'; -export type { AuthorizationServiceSetup } from './authorization_service'; -export type { CheckPrivilegesOptions, CheckPrivilegesResponse, CheckPrivilegesWithRequest, CheckPrivilegesPayload, CheckPrivileges, HasPrivilegesResponse, HasPrivilegesResponseApplication, CheckUserProfilesPrivilegesPayload, CheckUserProfilesPrivilegesResponse, CheckUserProfilesPrivileges, } from './check_privileges'; -export type { CheckPrivilegesDynamically, CheckPrivilegesDynamicallyWithRequest, } from './check_privileges_dynamically'; -export type { CheckSavedObjectsPrivileges, CheckSavedObjectsPrivilegesWithRequest, } from './check_saved_objects_privileges'; -export type { PrivilegeDeprecationsService, PrivilegeDeprecationsRolesByFeatureIdRequest, PrivilegeDeprecationsRolesByFeatureIdResponse, } from './deprecations'; -export type { AuthorizationMode } from './mode'; -export type { EsSecurityConfig } from './es_security_config'; -export { GLOBAL_RESOURCE } from './constants'; -export { elasticsearchRoleSchema, getKibanaRoleSchema } from './role_schema'; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/mode.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/mode.d.ts deleted file mode 100644 index 9f3884c4dd857..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/mode.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { KibanaRequest } from '@kbn/core/server'; -export interface AuthorizationMode { - useRbacForRequest(request: KibanaRequest): boolean; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/role_schema.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/role_schema.d.ts deleted file mode 100644 index 43acba0e507dd..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/authorization/role_schema.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -/** - * Elasticsearch specific portion of the role definition. - * See more details at https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api.html#security-role-apis. - */ -export declare const elasticsearchRoleSchema: import("@kbn/config-schema").ObjectType<{ - /** - * An optional list of cluster privileges. These privileges define the cluster level actions that - * users with this role are able to execute - */ - cluster: import("@kbn/config-schema").Type; - /** - * An optional list of remote cluster privileges. These privileges define the remote cluster level actions that - * users with this role are able to execute - */ - remote_cluster: import("@kbn/config-schema").Type[] | undefined>; - /** - * An optional list of indices permissions entries. - */ - indices: import("@kbn/config-schema").Type | undefined; - allow_restricted_indices?: boolean | undefined; - } & { - names: string[]; - privileges: string[]; - }>[] | undefined>; - /** - * An optional list of remote indices permissions entries. - */ - remote_indices: import("@kbn/config-schema").Type | undefined; - allow_restricted_indices?: boolean | undefined; - } & { - names: string[]; - privileges: string[]; - clusters: string[]; - }>[] | undefined>; - /** - * An optional list of users that the owners of this role can impersonate. - */ - run_as: import("@kbn/config-schema").Type; -}>; -/** - * Kibana specific portion of the role definition. It's represented as a list of base and/or - * feature Kibana privileges. None of the entries should apply to the same spaces. - */ -export declare const getKibanaRoleSchema: (getBasePrivilegeNames: () => { - global: string[]; - space: string[]; -}) => import("@kbn/config-schema").Type | undefined; -} & { - spaces: string[] | "*"[]; -}>[]>; -export type ElasticsearchPrivilegesType = TypeOf; -export type KibanaPrivilegesType = TypeOf>; diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/plugin.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/plugin.d.ts deleted file mode 100644 index e857afbbc2955..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/plugin.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { SecurityLicense } from '@kbn/security-plugin-types-common'; -import type { AuditServiceSetup } from './audit'; -import type { AuthenticationServiceStart } from './authentication'; -import type { AuthorizationServiceSetup, PrivilegeDeprecationsService } from './authorization'; -import type { UserProfileServiceStart } from './user_profile'; -/** - * Describes public Security plugin contract returned at the `setup` stage. - */ -export interface SecurityPluginSetup { - /** - * Exposes information about the available security features under the current license. - */ - license: SecurityLicense; - /** - * Exposes services for audit logging. - * - * @deprecated in favor of Core's `security` service - */ - audit: AuditServiceSetup; - /** - * Exposes services to access kibana roles per feature id with the GetDeprecationsContext - */ - privilegeDeprecationsService: PrivilegeDeprecationsService; -} -/** - * Describes public Security plugin contract returned at the `start` stage. - */ -export interface SecurityPluginStart { - /** - * Authentication services to confirm the user is who they say they are. - * - * @deprecated in favor of Core's `security` service - */ - authc: AuthenticationServiceStart; - /** - * Authorization services to manage and access the permissions a particular user has. - */ - authz: AuthorizationServiceSetup; - /** - * User profiles services to retrieve user profiles. - * - * @deprecated in favor of Core's `userProfile` service - */ - userProfiles: UserProfileServiceStart; -} diff --git a/x-pack/platform/packages/shared/security/plugin_types_server/src/user_profile/index.d.ts b/x-pack/platform/packages/shared/security/plugin_types_server/src/user_profile/index.d.ts deleted file mode 100644 index 4dd796c70a85a..0000000000000 --- a/x-pack/platform/packages/shared/security/plugin_types_server/src/user_profile/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type { UserProfileServiceStart, UserProfileSuggestParams, UserProfileBulkGetParams, UserProfileRequiredPrivileges, UserProfileGetCurrentParams, } from '@kbn/core-user-profile-server'; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/common/config_schema.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/common/config_schema.d.ts deleted file mode 100644 index 894525e9b4e09..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/common/config_schema.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { type TypeOf } from '@kbn/config-schema'; -/** - * Schema for APM indices - */ -export declare const indicesSchema: import("@kbn/config-schema").ObjectType<{ - transaction: import("@kbn/config-schema").Type; - span: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - metric: import("@kbn/config-schema").Type; - onboarding: import("@kbn/config-schema").Type; - sourcemap: import("@kbn/config-schema").Type; -}>; -/** - * Schema for APM Sources configuration - */ -export declare const configSchema: import("@kbn/config-schema").ObjectType<{ - indices: import("@kbn/config-schema").ObjectType<{ - transaction: import("@kbn/config-schema").Type; - span: import("@kbn/config-schema").Type; - error: import("@kbn/config-schema").Type; - metric: import("@kbn/config-schema").Type; - onboarding: import("@kbn/config-schema").Type; - sourcemap: import("@kbn/config-schema").Type; - }>; -}>; -/** - * Schema for APM Sources configuration - */ -export type APMSourcesAccessConfig = TypeOf; -/** - * Schema for APM indices - */ -export type APMIndices = APMSourcesAccessConfig['indices']; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/public/api.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/public/api.d.ts deleted file mode 100644 index e7c5860b1e844..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/public/api.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import type { APIEndpoint, APIReturnType } from '../server'; -export interface SourcesApiOptions { - body?: unknown; - signal?: AbortSignal; -} -export declare const callSourcesAPI: (http: HttpStart, pathname: T, options?: SourcesApiOptions) => Promise>; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/public/index.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/public/index.d.ts deleted file mode 100644 index d8d0d48e4f645..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/public/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { PluginInitializer } from '@kbn/core/public'; -import { type ApmSourceAccessPluginSetup, type ApmSourceAccessPluginStart } from './plugin'; -export declare const plugin: PluginInitializer; -export type { ApmSourceAccessPluginStart, ApmSourceAccessPluginSetup }; -export type { APMIndices } from '../common/config_schema'; -export { callSourcesAPI, type SourcesApiOptions } from './api'; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/public/plugin.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/public/plugin.d.ts deleted file mode 100644 index e4eba8b2186ca..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/public/plugin.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { Plugin } from '@kbn/core/public'; -/** - * APM Source setup services - */ -export type ApmSourceAccessPluginSetup = ReturnType; -/** - * APM Source start services - */ -export type ApmSourceAccessPluginStart = ReturnType; -export declare class ApmSourceAccessPlugin implements Plugin { - setup(): void; - start(core: CoreStart): { - getApmIndices: (options?: Omit) => Promise>; - getApmIndexSettings: (options?: Omit) => Promise; - saveApmIndices: (options: import("./api").SourcesApiOptions & { - body: Partial>; - }) => Promise>; - }; - stop(): void; -} diff --git a/x-pack/platform/plugins/shared/apm_sources_access/public/register_services.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/public/register_services.d.ts deleted file mode 100644 index db7f6df8dcfa6..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/public/register_services.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import { type SourcesApiOptions } from './api'; -import type { APMIndices } from '../common/config_schema'; -export interface RegisterServicesParams { - http: HttpStart; -} -export declare function registerServices(params: RegisterServicesParams): { - getApmIndices: (options?: Omit) => Promise>; - getApmIndexSettings: (options?: Omit) => Promise; - saveApmIndices: (options: SourcesApiOptions & { - body: Partial>; - }) => Promise>; -}; -export declare function createApmSourcesAccessService({ http }: RegisterServicesParams): { - getApmIndices: (options?: Omit) => Promise>; - getApmIndexSettings: (options?: Omit) => Promise; - saveApmIndices: (options: SourcesApiOptions & { - body: Partial>; - }) => Promise>; -}; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/config.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/config.d.ts deleted file mode 100644 index f80eb4ce740de..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/server/config.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { PluginConfigDescriptor } from '@kbn/core/server'; -import { type APMSourcesAccessConfig } from '../common/config_schema'; -/** - * Plugin configuration for the apm_sources_access. - */ -export declare const config: PluginConfigDescriptor; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/constants.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/constants.d.ts deleted file mode 100644 index 701407785e518..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/server/constants.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const APM_AGENT_CONFIGURATION_INDEX = ".apm-agent-configuration"; -export declare const APM_CUSTOM_LINK_INDEX = ".apm-custom-link"; -export declare const APM_SOURCE_MAP_INDEX = ".apm-source-map"; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/index.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/index.d.ts deleted file mode 100644 index e08fd1b77495b..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/server/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/server'; -import type { ApmSourcesAccessPluginSetup, ApmSourcesAccessPluginStart } from './plugin'; -import { config } from './config'; -import { configSchema, type APMSourcesAccessConfig, type APMIndices } from '../common/config_schema'; -declare const plugin: (initContext: PluginInitializerContext) => Promise; -export { APM_AGENT_CONFIGURATION_INDEX, APM_CUSTOM_LINK_INDEX, APM_SOURCE_MAP_INDEX, } from './constants'; -export type { APIEndpoint, APIReturnType, APMSourcesServerRouteRepository, APIClientRequestParamsOf, } from './routes'; -export type { APMIndices, APMSourcesAccessConfig, ApmSourcesAccessPluginSetup, ApmSourcesAccessPluginStart, }; -export { configSchema, config, plugin }; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/plugin.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/plugin.d.ts deleted file mode 100644 index 301fa074c2722..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/server/plugin.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { PluginInitializerContext, CoreSetup, Plugin, SavedObjectsClientContract, Logger } from '@kbn/core/server'; -import type { APMSourcesAccessConfig } from '../common/config_schema'; -/** - * APM Source setup services - */ -export type ApmSourcesAccessPluginSetup = ReturnType; -/** - * APM Source start services - */ -export type ApmSourcesAccessPluginStart = ReturnType; -export declare class ApmSourcesAccessPlugin implements Plugin { - config: APMSourcesAccessConfig; - logger: Logger; - constructor(initContext: PluginInitializerContext); - getApmIndices: (savedObjectsClient: SavedObjectsClientContract) => Promise<{ - error: string; - onboarding: string; - span: string; - transaction: string; - metric: string; - sourcemap: string; - }>; - /** - * Registers the saved object definition and ui settings - * for APM Sources. - */ - setup(core: CoreSetup): { - apmIndicesFromConfigFile: Readonly<{} & { - span: string; - error: string; - transaction: string; - metric: string; - onboarding: string; - sourcemap: string; - }>; - getApmIndices: (savedObjectsClient: SavedObjectsClientContract) => Promise<{ - error: string; - onboarding: string; - span: string; - transaction: string; - metric: string; - sourcemap: string; - }>; - }; - /** - * Initialises the user value for APM Sources UI settings. - */ - start(): { - getApmIndices: (savedObjectsClient: SavedObjectsClientContract) => Promise<{ - error: string; - onboarding: string; - span: string; - transaction: string; - metric: string; - sourcemap: string; - }>; - }; - stop(): void; -} diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/routes/index.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/routes/index.d.ts deleted file mode 100644 index 444bc195e7b6c..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/server/routes/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import * as t from 'io-ts'; -import { type ReturnOf, type EndpointOf, type ClientRequestParamsOf } from '@kbn/server-route-repository'; -import type { SavedObject } from '@kbn/core/server'; -import { type APMSourcesRouteHandlerResources } from './settings'; -export type APMSourcesServerRouteRepository = typeof apmSourcesSettingsRouteRepository; -export type APIReturnType = ReturnOf; -export type APIEndpoint = EndpointOf; -export type APIClientRequestParamsOf = ClientRequestParamsOf; -export declare const apmSourcesSettingsRouteRepository: { - "POST /internal/apm-sources/settings/apm-indices/save": import("@kbn/server-route-repository").ServerRoute<"POST /internal/apm-sources/settings/apm-indices/save", t.TypeC<{ - body: t.PartialC<{ - error: t.StringC; - onboarding: t.StringC; - span: t.StringC; - transaction: t.StringC; - metric: t.StringC; - sourcemap: t.StringC; - }>; - }>, APMSourcesRouteHandlerResources, SavedObject<{}>, {}>; - "GET /internal/apm-sources/settings/apm-index-settings": import("@kbn/server-route-repository").ServerRoute<"GET /internal/apm-sources/settings/apm-index-settings", undefined, APMSourcesRouteHandlerResources, import("./settings").ApmIndexSettingsResponse, {}>; - "GET /internal/apm-sources/settings/apm-indices": import("@kbn/server-route-repository").ServerRoute<"GET /internal/apm-sources/settings/apm-indices", undefined, APMSourcesRouteHandlerResources, Readonly<{} & { - span: string; - error: string; - transaction: string; - metric: string; - onboarding: string; - sourcemap: string; - }>, {}>; -}; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/routes/settings.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/routes/settings.d.ts deleted file mode 100644 index 6da844b495cff..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/server/routes/settings.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CoreSetup } from '@kbn/core/server'; -import type { DefaultRouteHandlerResources } from '@kbn/server-route-repository'; -import type { ApmSourcesAccessPlugin } from '../plugin'; -import type { APMIndices } from '..'; -export interface APMSourcesRouteHandlerResources extends DefaultRouteHandlerResources { - sources: ReturnType; -} -export interface APMSourcesCore { - setup: CoreSetup; -} -export interface ApmIndexSettingsResponse { - apmIndexSettings: Array<{ - configurationName: keyof APMIndices; - defaultValue: string; - savedValue: string | undefined; - }>; -} -export declare function getApmIndices({ sources, context, }: APMSourcesRouteHandlerResources): Promise; -export declare function getApmIndexSettings({ sources, context, }: APMSourcesRouteHandlerResources): Promise; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/apm_indices.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/apm_indices.d.ts deleted file mode 100644 index 12423fec7e1d1..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/apm_indices.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { SavedObjectsType } from '@kbn/core/server'; -import type { SavedObjectsClientContract } from '@kbn/core/server'; -import type { APMIndices } from '../../common/config_schema'; -export declare const APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE = "apm-indices"; -export declare const APM_INDEX_SETTINGS_SAVED_OBJECT_ID = "apm-indices"; -export interface APMIndicesSavedObjectBody { - apmIndices?: { - error?: string; - onboarding?: string; - span?: string; - transaction?: string; - metric?: string; - sourcemap?: string; - }; - isSpaceAware?: boolean; -} -export declare const apmIndicesSavedObjectDefinition: SavedObjectsType; -export declare function saveApmIndices(savedObjectsClient: SavedObjectsClientContract, apmIndices: Partial): Promise>; -export declare function getApmIndicesSavedObject(savedObjectsClient: SavedObjectsClientContract): Promise<{ - error?: string; - onboarding?: string; - span?: string; - transaction?: string; - metric?: string; - sourcemap?: string; -} | undefined>; diff --git a/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/migrations/update_apm_oss_index_paths.d.ts b/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/migrations/update_apm_oss_index_paths.d.ts deleted file mode 100644 index 7de952dcf0a0c..0000000000000 --- a/x-pack/platform/plugins/shared/apm_sources_access/server/saved_objects/migrations/update_apm_oss_index_paths.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare const apmIndexConfigs: readonly [readonly ["error", "apm_oss.errorIndices"], readonly ["onboarding", "apm_oss.onboardingIndices"], readonly ["span", "apm_oss.spanIndices"], readonly ["transaction", "apm_oss.transactionIndices"], readonly ["metric", "apm_oss.metricsIndices"]]; -type DeprecatedApmIndexConfigPaths = (typeof apmIndexConfigs)[number][1]; -type DeprecatedApmIndicesSavedObjectAttributes = Partial<{ - [Property in DeprecatedApmIndexConfigPaths]: string; -}>; -export declare function updateApmOssIndexPaths(attributes: DeprecatedApmIndicesSavedObjectAttributes): Partial<{ - span: string; - error: string; - transaction: string; - metric: string; - onboarding: string; -}>; -export {}; diff --git a/x-pack/platform/plugins/shared/cloud/common/constants.d.ts b/x-pack/platform/plugins/shared/cloud/common/constants.d.ts deleted file mode 100644 index 77e95fb5103ce..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/common/constants.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare const ELASTIC_SUPPORT_LINK = "https://support.elastic.co/"; -/** - * This is the page for managing your snapshots on Cloud. - */ -export declare const CLOUD_SNAPSHOTS_PATH = "elasticsearch/snapshots/"; -export declare const ELASTICSEARCH_CONFIG_ROUTE = "/api/internal/cloud/elasticsearch_config"; -/** - * Users with this role present are shown the "Billing and subscription" link in the side navigation. - */ -export declare const CLOUD_USER_BILLING_ADMIN_ROLE = "_ec_billing_admin"; diff --git a/x-pack/platform/plugins/shared/cloud/common/decode_cloud_id.d.ts b/x-pack/platform/plugins/shared/cloud/common/decode_cloud_id.d.ts deleted file mode 100644 index 606374727f822..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/common/decode_cloud_id.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Logger } from '@kbn/logging'; -export interface DecodedCloudId { - host: string; - defaultPort: string; - elasticsearchUrl: string; - kibanaUrl: string; -} -export declare function decodeCloudId(cid: string, logger: Logger): DecodedCloudId | undefined; diff --git a/x-pack/platform/plugins/shared/cloud/common/is_cloud_enabled.d.ts b/x-pack/platform/plugins/shared/cloud/common/is_cloud_enabled.d.ts deleted file mode 100644 index 138d52c4a316d..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/common/is_cloud_enabled.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getIsCloudEnabled(cloudId?: string): cloudId is string; diff --git a/x-pack/platform/plugins/shared/cloud/common/parse_deployment_id_from_deployment_url.d.ts b/x-pack/platform/plugins/shared/cloud/common/parse_deployment_id_from_deployment_url.d.ts deleted file mode 100644 index fcd2047d067cf..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/common/parse_deployment_id_from_deployment_url.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function parseDeploymentIdFromDeploymentUrl(deploymentUrl?: string): string | undefined; diff --git a/x-pack/platform/plugins/shared/cloud/common/parse_onboarding_default_solution.d.ts b/x-pack/platform/plugins/shared/cloud/common/parse_onboarding_default_solution.d.ts deleted file mode 100644 index 83896fb51bc03..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/common/parse_onboarding_default_solution.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SolutionId } from '@kbn/core-chrome-browser'; -/** - * Cloud does not type the value of the "use case" that is set during onboarding for a deployment. Any string can - * be passed. This function maps the known values to the Kibana values. - * - * @param value The solution value set by Cloud. - * @returns The default solution value for onboarding that matches Kibana naming. - */ -export declare function parseOnboardingSolution(value?: string): SolutionId | undefined; diff --git a/x-pack/platform/plugins/shared/cloud/common/register_cloud_deployment_id_analytics_context.d.ts b/x-pack/platform/plugins/shared/cloud/common/register_cloud_deployment_id_analytics_context.d.ts deleted file mode 100644 index edabb9af9e740..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/common/register_cloud_deployment_id_analytics_context.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { AnalyticsClient } from '@elastic/ebt/client'; -export interface CloudDeploymentMetadata { - id?: string; - organization_id?: string; - trial_end_date?: string; - is_elastic_staff_owned?: boolean; - deployment_url?: string; - serverless?: { - project_id?: string; - project_type?: string; - product_tier?: string; - orchestrator_target?: string; - in_trial?: boolean; - }; -} -export declare function registerCloudDeploymentMetadataAnalyticsContext(analytics: Pick, cloudMetadata: CloudDeploymentMetadata): void; diff --git a/x-pack/platform/plugins/shared/cloud/common/types.d.ts b/x-pack/platform/plugins/shared/cloud/common/types.d.ts deleted file mode 100644 index a2b829639f344..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/common/types.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export interface ElasticsearchConfigType { - elasticsearch_url?: string; -} -export type SolutionType = 'search' | 'elasticsearch' | 'observability' | 'security'; -export interface CloudDataAttributes { - onboardingData: { - solutionType?: SolutionType; - token: string; - security?: CloudSecurityAnswer; - }; - resourceData?: ResourceData; -} -export interface ResourceData { - project?: { - search?: { - type: 'general' | 'vector' | 'timeseries'; - }; - }; - deployment?: { - id?: string; - name?: string; - }; -} -export interface CloudSecurityAnswer { - useCase: 'siem' | 'cloud' | 'edr' | 'other'; - migration?: { - value: boolean; - type?: 'splunk' | 'other'; - }; -} diff --git a/x-pack/platform/plugins/shared/cloud/common/utils.d.ts b/x-pack/platform/plugins/shared/cloud/common/utils.d.ts deleted file mode 100644 index 56ee51284c41c..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/common/utils.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getFullCloudUrl(baseUrl: string | undefined, dirPath: string | undefined): string; diff --git a/x-pack/platform/plugins/shared/cloud/public/index.d.ts b/x-pack/platform/plugins/shared/cloud/public/index.d.ts deleted file mode 100644 index 65d3f652f0b7a..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/public/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import { CloudPlugin } from './plugin'; -export type { CloudConfigType } from './plugin'; -export type { CloudBasicUrls, CloudPrivilegedUrls, CloudSetup, CloudStart, CloudUrls, } from './types'; -export declare function plugin(initializerContext: PluginInitializerContext): CloudPlugin; diff --git a/x-pack/platform/plugins/shared/cloud/public/plugin.d.ts b/x-pack/platform/plugins/shared/cloud/public/plugin.d.ts deleted file mode 100644 index 00eebe1562836..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/public/plugin.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { KibanaProductTier, KibanaSolution } from '@kbn/projects-solutions-groups'; -import type { CloudSetup, CloudStart } from './types'; -export interface CloudConfigType { - id?: string; - organization_id?: string; - cname?: string; - csp?: string; - base_url?: string; - profile_url?: string; - deployments_url?: string; - deployment_url?: string; - projects_url?: string; - billing_url?: string; - organization_url?: string; - users_and_roles_url?: string; - performance_url?: string; - trial_end_date?: string; - isSaasContainer?: boolean; - is_elastic_staff_owned?: boolean; - managed_otlp?: { - url?: string; - }; - onboarding?: { - default_solution?: string; - }; - serverless?: { - project_id: string; - project_name?: string; - project_type?: KibanaSolution; - product_tier?: KibanaProductTier; - orchestrator_target?: string; - in_trial?: boolean; - }; -} -export declare class CloudPlugin implements Plugin { - private readonly initializerContext; - private readonly config; - private readonly isCloudEnabled; - private readonly isServerlessEnabled; - private readonly contextProviders; - private readonly logger; - private elasticsearchConfig?; - private readonly cloudUrls; - constructor(initializerContext: PluginInitializerContext); - setup(core: CoreSetup): CloudSetup; - start(coreStart: CoreStart): CloudStart; - stop(): void; - private fetchElasticsearchConfig; - private trialDaysLeft; - private isInTrial; -} diff --git a/x-pack/platform/plugins/shared/cloud/public/types.d.ts b/x-pack/platform/plugins/shared/cloud/public/types.d.ts deleted file mode 100644 index 9a0e8369a3095..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/public/types.d.ts +++ /dev/null @@ -1,287 +0,0 @@ -import type { SolutionId } from '@kbn/core-chrome-browser'; -import type { KibanaProductTier, KibanaSolution } from '@kbn/projects-solutions-groups'; -import type { FC, PropsWithChildren } from 'react'; -/** - * Represents basic URLs for the Cloud plugin, that do not require specific user roles to access. - */ -export interface CloudBasicUrls { - /** - * This is the URL of the Cloud interface. - */ - baseUrl?: string; - /** - * The full URL to the Kibana deployment. - */ - kibanaUrl?: string; - /** - * This is the path to the Cloud deployments management page. The value is already prepended with `baseUrl`. - * - * @example `{baseUrl}/deployments` - */ - deploymentsUrl?: string; - /** - * This is the path to the Cloud deployment management page for the deployment to which the Kibana instance belongs. The value is already prepended with `baseUrl`. - * - * @example `{baseUrl}/deployments/bfdad4ef99a24212a06d387593686d63` - */ - deploymentUrl?: string; - /** - * The full URL to the user profile page on Elastic Cloud. Undefined if not running on Cloud. - */ - profileUrl?: string; - /** - * The full URL to the organization management page on Elastic Cloud. Undefined if not running on Cloud. - */ - organizationUrl?: string; - /** - * The full URL to the performance page on Elastic Cloud. Undefined if not running on Cloud. - */ - performanceUrl?: string; - /** - * The full URL to the serverless projects page on Elastic Cloud. Undefined if not running in Serverless. - */ - projectsUrl?: string; - /** - * This is the path to the Snapshots page for the deployment to which the Kibana instance belongs. The value is already prepended with `deploymentUrl`. - * - * @example `{deploymentUrl}/elasticsearch/snapshots` - */ - snapshotsUrl?: string; -} -/** - * Represents privileged URLs that require specific user roles to access. - */ -export interface CloudPrivilegedUrls { - /** - * The full URL to the billing page on Elastic Cloud. - */ - billingUrl?: string; - /** - * The full URL to the users and roles page on Elastic Cloud. Undefined if not running on Cloud, - * or if the user does not have the `manage_security` cluster privilege. - */ - usersAndRolesUrl?: string; -} -export type CloudUrls = CloudBasicUrls & CloudPrivilegedUrls; -export interface CloudStart extends CloudBasicUrls { - /** - * A React component that provides a pre-wired `React.Context` which connects components to Cloud services. - */ - CloudContextProvider: FC>; - /** - * `true` when Kibana is running on Elastic Cloud. - */ - isCloudEnabled: boolean; - /** - * Cloud ID. - */ - cloudId?: string; - /** - * Fetches the full URL to the elasticsearch cluster. - */ - fetchElasticsearchConfig: () => Promise; - /** - * Managed OTLP service configuration. Only present when the deployment is configured to use the - * managed OTLP service (always on observability serverless projects, and feature-flagged on ECH). - */ - managedOtlp?: { - /** - * URL of the managed OTLP endpoint. - */ - url?: string; - }; - /** - * Method to retrieve privileged URLs for the Cloud plugin. - */ - getPrivilegedUrls: () => Promise; - /** - * Method to retrieve basic URLs for the Cloud plugin. - */ - getUrls: () => CloudBasicUrls; - /** - * Method to retrieve if the organization is in trial. - */ - isInTrial: () => boolean; - /** - * Method to retrieve the number of days left in the trial. - * Returns undefined if trial_end_date is not set, or the number of days remaining (0 if expired). - */ - trialDaysLeft: () => number | undefined; - /** - * `true` when running on Serverless Elastic Cloud - * Note that `isCloudEnabled` will always be true when `isServerlessEnabled` is. - */ - isServerlessEnabled: boolean; - /** - * Serverless configuration - */ - serverless: { - /** - * The serverless projectId. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectId?: string; - /** - * The serverless project name. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectName?: string; - /** - * The serverless project type. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectType?: KibanaSolution; - /** - * Whether the serverless project belongs to an organization currently in trial. - */ - organizationInTrial?: boolean; - }; -} -export interface CloudSetup extends CloudBasicUrls { - /** - * Cloud ID. Undefined if not running on Cloud. - */ - cloudId?: string; - /** - * The Elastic Cloud Organization that owns this deployment/project. - */ - organizationId?: string; - /** - * The deployment's ID. Only available when running on Elastic Cloud. - */ - deploymentId?: string; - /** - * This value is the same as `baseUrl` on ESS but can be customized on ECE. - * - * @example `cloud.elastic.co` - */ - cname?: string; - /** - * The cloud service provider identifier. - * - * @note Expected to be one of `aws`, `gcp` or `azure`, but could be something different. - */ - csp?: string; - /** - * Method to retrieve privileged URLs for the Cloud plugin. - */ - getPrivilegedUrls: () => Promise; - /** - * Method to retrieve basic URLs for the Cloud plugin. - */ - getUrls: () => CloudUrls; - /** - * Fetches the full URL to the elasticsearch cluster. - */ - fetchElasticsearchConfig: () => Promise; - /** - * {host} from the deployment url https://.. - */ - cloudHost?: string; - /** - * {port} from the deployment url https://.. - */ - cloudDefaultPort?: string; - /** - * `true` when Kibana is running on Elastic Cloud. - */ - isCloudEnabled: boolean; - /** - * `true` when running on ECE (Elastic Cloud Enterprise). - * `false` or `undefined` on ESS or self-managed. - */ - isEce?: boolean; - /** - * The end date for the Elastic Cloud trial. Only available on Elastic Cloud. - * - * @example `2020-10-14T10:40:22Z` - */ - trialEndDate?: Date; - /** - * `true` if the Elastic Cloud organization that owns this deployment is owned by an Elastician. Only available when running on Elastic Cloud. - */ - isElasticStaffOwned?: boolean; - /** - * Registers CloudServiceProviders so start's `CloudContextProvider` hooks them. - * - * @param contextProvider The React component from the Service Provider. - */ - registerCloudService: (contextProvider: FC) => void; - /** - * Managed OTLP service configuration. Only present when the deployment is configured to use the - * managed OTLP service (always on observability serverless projects, and feature-flagged on ECH). - */ - managedOtlp?: { - /** - * URL of the managed OTLP endpoint. - */ - url?: string; - }; - /** - * Onboarding configuration - */ - onboarding: { - /** - * The default solution selected during onboarding. - */ - defaultSolution?: SolutionId; - }; - /** - * `true` when running on Serverless Elastic Cloud - * Note that `isCloudEnabled` will always be true when `isServerlessEnabled` is. - */ - isServerlessEnabled: boolean; - /** - * Serverless configuration - */ - serverless: { - /** - * The serverless projectId. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectId?: string; - /** - * The serverless project name. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectName?: string; - /** - * The serverless project type. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectType?: KibanaSolution; - /** - * The serverless product tier. - * Only present if the current project type has product tiers defined. - * @remarks This field is only exposed for informational purposes. Use the `core.pricing` when checking if a feature if available for the current product tier. - * @internal - */ - productTier?: KibanaProductTier; - /** - * The serverless orchestrator target. The potential values are `canary` or `non-canary` - * Will always be present if `isServerlessEnabled` is `true` - */ - orchestratorTarget?: string; - /** - * Whether the serverless project belongs to an organization currently in trial. - */ - organizationInTrial?: boolean; - }; - /** - * Method to retrieve if the organization is in trial. - */ - isInTrial: () => boolean; - /** - * Method to retrieve the number of days left in the trial. - * Returns undefined if trial_end_date is not set, or the number of days remaining (0 if expired). - */ - trialDaysLeft: () => number | undefined; -} -export interface PublicElasticsearchConfigType { - /** - * The URL to the Elasticsearch cluster, derived from elasticsearch.publicBaseUrl if populated - * Otherwise this is based on the cloudId - * If neither is populated, this will be undefined - */ - elasticsearchUrl?: string; -} diff --git a/x-pack/platform/plugins/shared/cloud/public/urls.d.ts b/x-pack/platform/plugins/shared/cloud/public/urls.d.ts deleted file mode 100644 index 9b2f585a9ff8d..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/public/urls.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { CoreSetup } from '@kbn/core/public'; -import type { CloudConfigType } from '.'; -import type { CloudBasicUrls, CloudPrivilegedUrls } from './types'; -/** - * Service that manages all URLs for the Cloud plugin. - */ -export declare class CloudUrlsService { - private config?; - private coreSetup?; - private kibanaUrl?; - setup(config: CloudConfigType, coreSetup: CoreSetup, kibanaUrl: string | undefined): void; - /** - * Returns the set of "basic" URLs. No special privileges needed - */ - getUrls(): CloudBasicUrls; - /** - * Returns the set of "privilged" URLs. Each requires a specific privilege to access. - */ - getPrivilegedUrls(): Promise; - private getCoreStart; - /** - * Needed for determining access to privileged URLs, such as billing. - */ - private getCurrentUserRoles; -} diff --git a/x-pack/platform/plugins/shared/cloud/public/utils.d.ts b/x-pack/platform/plugins/shared/cloud/public/utils.d.ts deleted file mode 100644 index 4e73290db117e..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/public/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { CloudConfigType } from './plugin'; -export declare function getSupportUrl(config: CloudConfigType): string; diff --git a/x-pack/platform/plugins/shared/cloud/server/cloud_data/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/cloud_data/index.d.ts deleted file mode 100644 index 9ee0c954446eb..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/cloud_data/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { persistTokenCloudData } from './persist_token'; diff --git a/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.d.ts b/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.d.ts deleted file mode 100644 index 604f93ac82a25..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/cloud_data/persist_token.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; -import type { CloudSecurityAnswer, ResourceData } from '../../common/types'; -export declare const persistTokenCloudData: (savedObjectsClient: SavedObjectsClientContract, { logger, returnError, onboardingToken, solutionType, security, resourceData, }: { - logger?: Logger; - returnError?: boolean; - onboardingToken?: string; - solutionType?: string; - security?: CloudSecurityAnswer; - resourceData?: ResourceData; -}) => Promise; diff --git a/x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.d.ts b/x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.d.ts deleted file mode 100644 index 8a4e5c617cdc2..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -export interface CloudUsageCollectorConfig { - isCloudEnabled: boolean; - trialEndDate: string | undefined; - isElasticStaffOwned: boolean | undefined; - organizationId: string | undefined; - deploymentId: string | undefined; - projectId: string | undefined; - projectType: string | undefined; - productTier: string | undefined; - orchestratorTarget: string | undefined; - organizationInTrial: boolean | undefined; -} -interface CloudUsage { - isCloudEnabled: boolean; - trialEndDate?: string; - inTrial?: boolean; - isElasticStaffOwned?: boolean; - organizationId?: string; - deploymentId?: string; - projectId?: string; - projectType?: string; - productTier?: string; - orchestratorTarget?: string; -} -export declare function createCloudUsageCollector(usageCollection: UsageCollectionSetup, config: CloudUsageCollectorConfig): import("@kbn/usage-collection-plugin/server").Collector; -export declare function registerCloudUsageCollector(usageCollection: UsageCollectionSetup | undefined, config: CloudUsageCollectorConfig): void; -export {}; diff --git a/x-pack/platform/plugins/shared/cloud/server/collectors/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/collectors/index.d.ts deleted file mode 100644 index 107720ba9ce8c..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/collectors/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { registerCloudUsageCollector } from './cloud_usage_collector'; diff --git a/x-pack/platform/plugins/shared/cloud/server/config.d.ts b/x-pack/platform/plugins/shared/cloud/server/config.d.ts deleted file mode 100644 index a28568069a144..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/config.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { Type, TypeOf } from '@kbn/config-schema'; -import type { PluginConfigDescriptor } from '@kbn/core/server'; -declare const configSchema: import("@kbn/config-schema").ObjectType<{ - apm: Type | undefined; - secret_token?: string | undefined; - } & {}> | undefined>; - base_url: Type; - cname: Type; - csp: Type; - deployments_url: Type; - deployment_url: Type; - id: Type; - isSaasContainer: Type; - organization_id: Type; - billing_url: Type; - performance_url: Type; - users_and_roles_url: Type; - organization_url: Type; - profile_url: Type; - projects_url: import("@kbn/config-schema").ConditionalType; - trial_end_date: Type; - is_elastic_staff_owned: Type; - managed_otlp: Type | undefined>; - onboarding: Type | undefined>; - serverless: Type | undefined>; -}>; -export type CloudConfigType = TypeOf; -export declare const config: PluginConfigDescriptor; -export {}; diff --git a/x-pack/platform/plugins/shared/cloud/server/env.d.ts b/x-pack/platform/plugins/shared/cloud/server/env.d.ts deleted file mode 100644 index ba94963755d74..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function readInstanceSizeMb(): undefined | number; diff --git a/x-pack/platform/plugins/shared/cloud/server/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/index.d.ts deleted file mode 100644 index 431e45c17cfdc..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/server'; -export type { CloudSetup, CloudStart } from './plugin'; -export { config } from './config'; -export declare const plugin: (initializerContext: PluginInitializerContext) => Promise; -export { getOnboardingToken } from './saved_objects'; diff --git a/x-pack/platform/plugins/shared/cloud/server/plugin.d.ts b/x-pack/platform/plugins/shared/cloud/server/plugin.d.ts deleted file mode 100644 index c4ea6e3a22d0d..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/plugin.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -import type { CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/server'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import type { SolutionId } from '@kbn/core-chrome-browser'; -import type { KibanaProductTier, KibanaSolution } from '@kbn/projects-solutions-groups'; -interface PluginsSetup { - usageCollection?: UsageCollectionSetup; -} -/** - * Setup contract - */ -export interface CloudSetup { - /** - * This is the ID of the Cloud deployment to which the Kibana instance belongs. - * - * @example `eastus2.azure.elastic-cloud.com:9243$59ef636c6917463db140321484d63cfa$a8b109c08adc43279ef48f29af1a3911` - * - * @note The `cloudId` is a concatenation of the deployment name and a hash. Users can update the deployment name, changing the `cloudId`. However, the changed `cloudId` will not be re-injected into `kibana.yml`. If you need the current `cloudId` the best approach is to split the injected `cloudId` on the semi-colon, and replace the first element with the `persistent.cluster.metadata.display_name` value as provided by a call to `GET _cluster/settings`. - */ - cloudId?: string; - /** - * The cloud service provider identifier. - * - * @note Expected to be one of `aws`, `gcp` or `azure`, but could be something different. - */ - csp?: string; - /** - * The Elastic Cloud Organization that owns this deployment/project. - */ - organizationId?: string; - /** - * The deployment's ID. Only available when running on Elastic Cloud. - */ - deploymentId?: string; - /** - * The full URL to the elasticsearch cluster. - */ - elasticsearchUrl?: string; - /** - * The full URL to the Kibana deployment. - */ - kibanaUrl?: string; - /** - * This is the URL to the "projects" interface on cloud. - * - * @example `https://cloud.elastic.co/projects` - */ - projectsUrl?: string; - /** - * This is the URL of the Cloud interface. - * - * @example `https://cloud.elastic.co` (on the ESS production environment) - */ - baseUrl?: string; - /** - * {host} of the deployment url https://.. - */ - cloudHost?: string; - /** - * {port} of the deployment url https://.. - */ - cloudDefaultPort?: string; - /** - * This is set to `true` for both ESS and ECE deployments. - */ - isCloudEnabled: boolean; - /** - * The size of the instance in which Kibana is running. Only available when running on Elastic Cloud. - */ - instanceSizeMb?: number; - /** - * When the Cloud Trial ends/ended for the organization that owns this deployment. Only available when running on Elastic Cloud. - */ - trialEndDate?: Date; - /** - * `true` if the Elastic Cloud organization that owns this deployment is owned by an Elastician. Only available when running on Elastic Cloud. - */ - isElasticStaffOwned?: boolean; - /** - * APM configuration keys. - */ - apm: { - url?: string; - secretToken?: string; - }; - /** - * Managed OTLP service configuration. Only present when the deployment is configured to use the - * managed OTLP service (always on observability serverless projects, and feature-flagged on ECH). - */ - managedOtlp?: { - /** - * URL of the managed OTLP endpoint. - */ - url?: string; - }; - /** - * Onboarding configuration. - */ - onboarding: { - /** - * The default solution selected during onboarding. - */ - defaultSolution?: SolutionId; - }; - /** - * `true` when running on ECE (Elastic Cloud Enterprise). - * `false` or `undefined` on ESS or self-managed. - */ - isEce?: boolean; - /** - * `true` when running on Serverless Elastic Cloud - * Note that `isCloudEnabled` will always be true when `isServerlessEnabled` is. - */ - isServerlessEnabled: boolean; - /** - * Serverless configuration. - * - * @note We decided to place any cloud URL values at the top level of this object - * even if they contain serverless specific values. All other serverless - * config should live in this object. - */ - serverless: { - /** - * The serverless projectId. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectId?: string; - /** - * The serverless project name. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectName?: string; - /** - * The serverless project type. - * Will always be present if `isServerlessEnabled` is `true` - */ - projectType?: KibanaSolution; - /** - * The serverless product tier. - * Only present if the current project type has product tiers defined. - * @remarks This field is only exposed for informational purposes. Use the `core.pricing` when checking if a feature is available for the current product tier. - * @internal - */ - productTier?: KibanaProductTier; - /** - * The serverless orchestrator target. The potential values are `canary` or `non-canary` - * Will always be present if `isServerlessEnabled` is `true` - */ - orchestratorTarget?: string; - /** - * Whether the serverless project belongs to an organization currently in trial. - */ - organizationInTrial?: boolean; - }; - /** - * Method to retrieve if the organization is in trial. - */ - isInTrial: () => boolean; - /** - * Method to retrieve the number of days left in the trial. - * Returns undefined if trial_end_date is not set, or the number of days remaining (0 if expired). - */ - trialDaysLeft: () => number | undefined; -} -/** - * Start contract - */ -export interface CloudStart { - /** - * This is set to `true` for both ESS and ECE deployments. - */ - isCloudEnabled: boolean; - /** - * This is the URL to the "projects" interface on cloud. - * - * @example `https://cloud.elastic.co/projects` - */ - projectsUrl?: string; - /** - * This is the URL of the Cloud interface. - * - * @example `https://cloud.elastic.co` (on the ESS production environment) - */ - baseUrl?: string; - /** - * Method to retrieve if the organization is in trial. - */ - isInTrial: () => boolean; - /** - * Method to retrieve the number of days left in the trial. - * Returns undefined if trial_end_date is not set, or the number of days remaining (0 if expired). - */ - trialDaysLeft: () => number | undefined; -} -export declare class CloudPlugin implements Plugin { - private readonly context; - private readonly config; - private readonly logger; - private readonly trialEndDate; - constructor(context: PluginInitializerContext); - setup(core: CoreSetup, { usageCollection }: PluginsSetup): CloudSetup; - start(): CloudStart; - private getCloudUrls; - private trialDaysLeft; - private isInTrial; -} -export {}; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/constants.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/constants.d.ts deleted file mode 100644 index 22f8a41a8db4f..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/routes/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const CLOUD_DATA_SAVED_OBJECT_ID = "cloud-data-saved-object-id"; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/elasticsearch_route.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/elasticsearch_route.d.ts deleted file mode 100644 index 2cef5bb458206..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/routes/elasticsearch_route.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IRouter } from '@kbn/core/server'; -import type { Logger } from '@kbn/logging'; -export declare function setElasticsearchRoute({ elasticsearchUrl, logger, router, }: { - elasticsearchUrl?: string; - logger: Logger; - router: IRouter; -}): void; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.d.ts deleted file mode 100644 index 8fdab5bdff172..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/routes/get_cloud_data_route.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { RouteOptions } from '.'; -export declare const setGetCloudSolutionDataRoute: ({ router }: RouteOptions) => void; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/index.d.ts deleted file mode 100644 index 58a70f5a5a6a3..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/routes/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { IRouter } from '@kbn/core/server'; -import type { Logger } from '@kbn/logging'; -import type { CloudRequestHandlerContext } from './types'; -export interface RouteOptions { - logger: Logger; - router: IRouter; - elasticsearchUrl?: string; -} -export declare function defineRoutes(opts: RouteOptions): void; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/set_cloud_data_route.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/set_cloud_data_route.d.ts deleted file mode 100644 index d014e114cb727..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/routes/set_cloud_data_route.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { RouteOptions } from '.'; -export declare const setPostCloudSolutionDataRoute: ({ router }: RouteOptions) => void; diff --git a/x-pack/platform/plugins/shared/cloud/server/routes/types.d.ts b/x-pack/platform/plugins/shared/cloud/server/routes/types.d.ts deleted file mode 100644 index 04f59330be582..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/routes/types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CustomRequestHandlerContext } from '@kbn/core/server'; -/** - * @internal - */ -export type CloudRequestHandlerContext = CustomRequestHandlerContext<{}>; diff --git a/x-pack/platform/plugins/shared/cloud/server/saved_objects/index.d.ts b/x-pack/platform/plugins/shared/cloud/server/saved_objects/index.d.ts deleted file mode 100644 index 8f84495ace44b..0000000000000 --- a/x-pack/platform/plugins/shared/cloud/server/saved_objects/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Logger, SavedObjectsClientContract, SavedObjectsServiceSetup } from '@kbn/core/server'; -export declare const CLOUD_DATA_SAVED_OBJECT_TYPE: "cloud"; -export declare function setupSavedObjects(savedObjects: SavedObjectsServiceSetup, logger: Logger): void; -export declare function getOnboardingToken(savedObjectsClient: SavedObjectsClientContract): Promise; diff --git a/x-pack/platform/plugins/shared/licensing/common/has_license_info_changed.d.ts b/x-pack/platform/plugins/shared/licensing/common/has_license_info_changed.d.ts deleted file mode 100644 index 594d8bc1eb97f..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/common/has_license_info_changed.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ILicense } from '@kbn/licensing-types'; -/** - * Check if 2 potential license instances have changes between them - * @internal - */ -export declare function hasLicenseInfoChanged(currentLicense: ILicense | undefined, newLicense: ILicense): boolean; diff --git a/x-pack/platform/plugins/shared/licensing/common/license.d.ts b/x-pack/platform/plugins/shared/licensing/common/license.d.ts deleted file mode 100644 index 6291d957c93d0..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/common/license.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { LicenseType, ILicense, LicenseStatus, LicenseCheck, PublicLicenseJSON, PublicLicense, PublicFeatures } from '@kbn/licensing-types'; -/** - * @public - */ -export declare class License implements ILicense { - private readonly license?; - private readonly features?; - readonly error?: string; - readonly isActive: boolean; - readonly isAvailable: boolean; - readonly uid?: string; - readonly status?: LicenseStatus; - readonly expiryDateInMillis?: number; - readonly type?: LicenseType; - readonly mode?: LicenseType; - readonly signature: string; - /** - * @internal - * Generate a License instance from json representation. - */ - static fromJSON(json: PublicLicenseJSON): License; - constructor({ license, features, error, signature, }: { - license?: PublicLicense; - features?: PublicFeatures; - error?: string; - signature: string; - }); - toJSON(): { - license: PublicLicense | undefined; - features: PublicFeatures | undefined; - signature: string; - }; - getUnavailableReason(): string | undefined; - hasAtLeast(minimumLicenseRequired: LicenseType): boolean; - check(pluginName: string, minimumLicenseRequired: LicenseType): LicenseCheck; - getFeature(id: string): { - isAvailable: boolean; - isEnabled: boolean; - }; -} diff --git a/x-pack/platform/plugins/shared/licensing/common/license_update.d.ts b/x-pack/platform/plugins/shared/licensing/common/license_update.d.ts deleted file mode 100644 index ea575cc02cbe4..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/common/license_update.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type Observable } from 'rxjs'; -import type { ILicense } from '@kbn/licensing-types'; -export declare function createLicenseUpdate(triggerRefresh$: Observable, stop$: Observable, fetcher: () => Promise, initialValues?: ILicense): { - license$: Observable; - refreshManually(): Promise; -}; diff --git a/x-pack/platform/plugins/shared/licensing/common/register_analytics_context_provider.d.ts b/x-pack/platform/plugins/shared/licensing/common/register_analytics_context_provider.d.ts deleted file mode 100644 index d7f77f6fb3779..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/common/register_analytics_context_provider.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { AnalyticsClient } from '@elastic/ebt/client'; -import type { ILicense } from '@kbn/licensing-types'; -export declare function registerAnalyticsContextProvider(analytics: Pick, license$: Observable): void; diff --git a/x-pack/platform/plugins/shared/licensing/public/expired_banner.d.ts b/x-pack/platform/plugins/shared/licensing/public/expired_banner.d.ts deleted file mode 100644 index cad6cd36af9b4..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/public/expired_banner.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -interface Props { - type: string; - uploadUrl: string; -} -type MountProps = Props & Pick; -export declare const mountExpiredBanner: ({ type, uploadUrl, ...startServices }: MountProps) => import("@kbn/core/public").MountPoint; -export {}; diff --git a/x-pack/platform/plugins/shared/licensing/public/index.d.ts b/x-pack/platform/plugins/shared/licensing/public/index.d.ts deleted file mode 100644 index 680607d9861eb..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/public/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/public'; -import { LicensingPlugin } from './plugin'; -export type { LicensingPluginSetup, LicensingPluginStart } from './types'; -export declare const plugin: (context: PluginInitializerContext) => LicensingPlugin; diff --git a/x-pack/platform/plugins/shared/licensing/public/plugin.d.ts b/x-pack/platform/plugins/shared/licensing/public/plugin.d.ts deleted file mode 100644 index 76178d0e63d03..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/public/plugin.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { ILicense } from '@kbn/licensing-types'; -import type { LicensingPluginSetup, LicensingPluginStart } from './types'; -export declare const licensingSessionStorageKey = "xpack.licensing"; -/** - * @public - * A plugin for fetching, refreshing, and receiving information about the license for the - * current Kibana instance. - */ -export declare class LicensingPlugin implements Plugin { - private readonly storage; - /** - * Used as a flag to halt all other plugin observables. - */ - private stop$; - /** - * A function to execute once the plugin's HTTP interceptor needs to stop listening. - */ - private removeInterceptor?; - private internalSubscription?; - private isLicenseExpirationBannerShown?; - private readonly infoEndpoint; - private coreStart?; - private prevSignature?; - private refresh?; - private license$?; - private featureUsage; - constructor(_context: PluginInitializerContext, storage?: Storage); - /** - * Fetch the objectified license and signature from storage. - */ - private getSaved; - /** - * Store the given license and signature in storage. - */ - private save; - /** - * Clear license and signature information from storage. - */ - private removeSaved; - setup(core: CoreSetup): { - refresh: () => Promise; - license$: Observable; - featureUsage: import("./services").FeatureUsageServiceSetup; - }; - start(core: CoreStart): { - refresh: () => Promise; - getLicense: () => Promise; - license$: Observable; - featureUsage: import("./services").FeatureUsageServiceStart; - }; - stop(): void; - private fetchLicense; - private showExpiredBanner; -} diff --git a/x-pack/platform/plugins/shared/licensing/public/services/feature_usage_service.d.ts b/x-pack/platform/plugins/shared/licensing/public/services/feature_usage_service.d.ts deleted file mode 100644 index 84fe316e17c0f..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/public/services/feature_usage_service.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { HttpStart } from '@kbn/core/public'; -import type { LicenseType } from '@kbn/licensing-types'; -/** @public */ -export interface FeatureUsageServiceSetup { - /** - * Register a feature to be able to notify of it's usages using the {@link FeatureUsageServiceStart | service start contract}. - */ - register(featureId: string, licenseType: LicenseType): void; -} -/** @public */ -export interface FeatureUsageServiceStart { - /** - * Notify of a registered feature usage at given time. - * - * @param featureId - the identifier of the feature to notify usage of - * @param usedAt - Either a `Date` or an unix timestamp with ms. If not specified, it will be set to the current time. - */ - notifyUsage(featureId: string, usedAt?: Date | number): Promise; -} -interface StartDeps { - http: HttpStart; -} -/** - * @internal - */ -export declare class FeatureUsageService { - private readonly registrations; - setup(): FeatureUsageServiceSetup; - start({ http }: StartDeps): FeatureUsageServiceStart; -} -export {}; diff --git a/x-pack/platform/plugins/shared/licensing/public/services/index.d.ts b/x-pack/platform/plugins/shared/licensing/public/services/index.d.ts deleted file mode 100644 index 6af8db8268967..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/public/services/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { FeatureUsageService } from './feature_usage_service'; -export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './feature_usage_service'; diff --git a/x-pack/platform/plugins/shared/licensing/public/types.d.ts b/x-pack/platform/plugins/shared/licensing/public/types.d.ts deleted file mode 100644 index daddf732fd5e5..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/public/types.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { ILicense } from '@kbn/licensing-types'; -import type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; -/** @public */ -export interface LicensingPluginSetup { - /** - * Steam of licensing information {@link ILicense}. - * @deprecated in favour of the counterpart provided from start contract - * @removeBy 8.8.0 - */ - license$: Observable; - /** - * Triggers licensing information re-fetch. - * @deprecated in favour of the counterpart provided from start contract - * @removeBy 8.8.0 - */ - refresh(): Promise; - /** - * APIs to register licensed feature usage. - */ - featureUsage: FeatureUsageServiceSetup; -} -/** @public */ -export interface LicensingPluginStart { - /** - * Steam of licensing information {@link ILicense}. - */ - license$: Observable; - /** - * Retrieves the {@link ILicense | licensing information} - */ - getLicense(): Promise; - /** - * Triggers licensing information re-fetch. - */ - refresh(): Promise; - /** - * APIs to manage licensed feature usage. - */ - featureUsage: FeatureUsageServiceStart; -} diff --git a/x-pack/platform/plugins/shared/licensing/server/index.d.ts b/x-pack/platform/plugins/shared/licensing/server/index.d.ts deleted file mode 100644 index bbb51202ca0f0..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PluginInitializerContext } from '@kbn/core/server'; -export declare const plugin: (context: PluginInitializerContext) => Promise; -export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; -export type { ElasticsearchError, LicensingApiRequestHandlerContext, LicensingPluginSetup, LicensingPluginStart, } from './types'; -export { config } from './licensing_config'; -export type { CheckLicense } from './wrap_route_with_license_check'; -export { wrapRouteWithLicenseCheck } from './wrap_route_with_license_check'; diff --git a/x-pack/platform/plugins/shared/licensing/server/license_fetcher.d.ts b/x-pack/platform/plugins/shared/licensing/server/license_fetcher.d.ts deleted file mode 100644 index f0bc920e1a8c4..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/license_fetcher.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { MaybePromise } from '@kbn/utility-types'; -import type { IClusterClient, Logger } from '@kbn/core/server'; -import type { LicenseFetcher } from './types'; -export declare const getLicenseFetcher: ({ clusterClient, logger, cacheDurationMs, maxRetryDelay, }: { - clusterClient: MaybePromise; - logger: Logger; - cacheDurationMs: number; - maxRetryDelay: number; -}) => LicenseFetcher; diff --git a/x-pack/platform/plugins/shared/licensing/server/licensing_config.d.ts b/x-pack/platform/plugins/shared/licensing/server/licensing_config.d.ts deleted file mode 100644 index 294dbfc289960..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/licensing_config.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -import type { PluginConfigDescriptor } from '@kbn/core/server'; -declare const configSchema: import("@kbn/config-schema").ObjectType<{ - api_polling_frequency: import("@kbn/config-schema").Type; - license_cache_duration: import("@kbn/config-schema").Type; -}>; -export type LicenseConfigType = TypeOf; -export declare const config: PluginConfigDescriptor; -export {}; diff --git a/x-pack/platform/plugins/shared/licensing/server/licensing_route_handler_context.d.ts b/x-pack/platform/plugins/shared/licensing/server/licensing_route_handler_context.d.ts deleted file mode 100644 index 1ffea84ee2eef..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/licensing_route_handler_context.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IContextProvider, StartServicesAccessor } from '@kbn/core/server'; -import type { Observable } from 'rxjs'; -import type { ILicense } from '@kbn/licensing-types'; -import type { LicensingPluginStart, LicensingRequestHandlerContext } from './types'; -/** - * Create a route handler context for access to Kibana license information. - * @param license$ An observable of a License instance. - * @public - */ -export declare function createRouteHandlerContext(license$: Observable, getStartServices: StartServicesAccessor<{}, LicensingPluginStart>): IContextProvider; diff --git a/x-pack/platform/plugins/shared/licensing/server/on_pre_response_handler.d.ts b/x-pack/platform/plugins/shared/licensing/server/on_pre_response_handler.d.ts deleted file mode 100644 index b691c98db78e7..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/on_pre_response_handler.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { OnPreResponseHandler } from '@kbn/core/server'; -import type { ILicense } from '@kbn/licensing-types'; -import type { Observable } from 'rxjs'; -export declare function createOnPreResponseHandler(refresh: () => Promise, license$: Observable): OnPreResponseHandler; diff --git a/x-pack/platform/plugins/shared/licensing/server/plugin.d.ts b/x-pack/platform/plugins/shared/licensing/server/plugin.d.ts deleted file mode 100644 index 72538e58785b2..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/plugin.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { MaybePromise } from '@kbn/utility-types'; -import type { CoreSetup, Plugin, PluginInitializerContext, IClusterClient } from '@kbn/core/server'; -import type { ILicense } from '@kbn/licensing-types'; -import type { LicensingPluginSetup, LicensingPluginStart } from './types'; -/** - * @public - * A plugin for fetching, refreshing, and receiving information about the license for the - * current Kibana instance. - */ -export declare class LicensingPlugin implements Plugin { - private readonly context; - private stop$; - private readonly isElasticsearchAvailable$; - private readonly logger; - private readonly config; - private licenseSubscription?; - private featureUsage; - private refresh?; - private license$?; - constructor(context: PluginInitializerContext); - setup(core: CoreSetup<{}, LicensingPluginStart>): { - refresh: () => Promise; - license$: Observable; - featureUsage: import("./services").FeatureUsageServiceSetup; - }; - private createLicensePoller; - start(): { - refresh: () => Promise; - getLicense: () => Promise; - license$: Observable; - featureUsage: import("./services").FeatureUsageServiceStart; - createLicensePoller: (clusterClient: MaybePromise, pollingFrequency: number) => { - refresh: () => Promise; - license$: Observable; - }; - }; - stop(): void; -} diff --git a/x-pack/platform/plugins/shared/licensing/server/plugin_status.d.ts b/x-pack/platform/plugins/shared/licensing/server/plugin_status.d.ts deleted file mode 100644 index f4a5d285c0e3f..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/plugin_status.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Observable } from 'rxjs'; -import { type ServiceStatus } from '@kbn/core/server'; -import type { ILicense } from '@kbn/licensing-types'; -export declare const getPluginStatus$: (license$: Observable, stop$: Observable) => Observable; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/feature_usage.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/feature_usage.d.ts deleted file mode 100644 index ddfb5d8a122b6..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/routes/feature_usage.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/server'; -import type { LicensingPluginStart } from '../types'; -import type { LicensingRouter } from '../types'; -export declare function registerFeatureUsageRoute(router: LicensingRouter, getStartServices: StartServicesAccessor<{}, LicensingPluginStart>): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/index.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/index.d.ts deleted file mode 100644 index d051650ae4fdd..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/routes/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { StartServicesAccessor } from '@kbn/core/server'; -import type { LicensingPluginStart } from '../types'; -import type { FeatureUsageServiceSetup } from '../services'; -import type { LicensingRouter } from '../types'; -export declare function registerRoutes(router: LicensingRouter, featureUsageSetup: FeatureUsageServiceSetup, getStartServices: StartServicesAccessor<{}, LicensingPluginStart>): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/info.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/info.d.ts deleted file mode 100644 index 42c1c2d4b4c43..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/routes/info.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { LicensingRouter } from '../types'; -export declare function registerInfoRoute(router: LicensingRouter): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/internal/index.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/internal/index.d.ts deleted file mode 100644 index a012c1e9943a9..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/routes/internal/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { registerNotifyFeatureUsageRoute } from './notify_feature_usage'; -export { registerRegisterFeatureRoute } from './register_feature'; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/internal/notify_feature_usage.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/internal/notify_feature_usage.d.ts deleted file mode 100644 index 1e4ae787dfaea..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/routes/internal/notify_feature_usage.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { LicensingRouter } from '../../types'; -export declare function registerNotifyFeatureUsageRoute(router: LicensingRouter): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/routes/internal/register_feature.d.ts b/x-pack/platform/plugins/shared/licensing/server/routes/internal/register_feature.d.ts deleted file mode 100644 index 2e09a41e11d29..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/routes/internal/register_feature.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FeatureUsageServiceSetup } from '../../services'; -import type { LicensingRouter } from '../../types'; -export declare function registerRegisterFeatureRoute(router: LicensingRouter, featureUsageSetup: FeatureUsageServiceSetup): void; diff --git a/x-pack/platform/plugins/shared/licensing/server/services/feature_usage_service.d.ts b/x-pack/platform/plugins/shared/licensing/server/services/feature_usage_service.d.ts deleted file mode 100644 index c8d34793398ff..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/services/feature_usage_service.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { LicenseType } from '@kbn/licensing-types'; -/** @public */ -export interface FeatureUsageServiceSetup { - /** - * Register a feature to be able to notify of it's usages using the {@link FeatureUsageServiceStart | service start contract}. - */ - register(featureId: string, licenseType: LicenseType): void; -} -export interface LastFeatureUsage { - id: string; - lastUsed: Date | null; - licenseType: LicenseType; -} -/** @public */ -export interface FeatureUsageServiceStart { - /** - * Notify of a registered feature usage at given time. - * - * @param featureId - the identifer of the feature to notify usage of - * @param usedAt - Either a `Date` or an unix timestamp with ms. If not specified, it will be set to the current time. - */ - notifyUsage(featureId: string, usedAt?: Date | number): void; - /** - * Return a map containing last usage timestamp for all features. - * Features that were not used yet do not appear in the map. - */ - getLastUsages(): LastFeatureUsage[]; -} -export declare class FeatureUsageService { - private readonly lastUsages; - setup(): FeatureUsageServiceSetup; - start(): FeatureUsageServiceStart; -} diff --git a/x-pack/platform/plugins/shared/licensing/server/services/index.d.ts b/x-pack/platform/plugins/shared/licensing/server/services/index.d.ts deleted file mode 100644 index 6af8db8268967..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/services/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { FeatureUsageService } from './feature_usage_service'; -export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './feature_usage_service'; diff --git a/x-pack/platform/plugins/shared/licensing/server/types.d.ts b/x-pack/platform/plugins/shared/licensing/server/types.d.ts deleted file mode 100644 index b593674a8fa5f..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/types.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { IClusterClient, IRouter, CustomRequestHandlerContext } from '@kbn/core/server'; -import type { ILicense } from '@kbn/licensing-types'; -import type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; -export interface ElasticsearchError extends Error { - status?: number; -} -export type LicenseFetcher = () => Promise; -/** - * Result from remote request fetching raw feature set. - * @internal - */ -export interface RawFeature { - available: boolean; - enabled: boolean; -} -/** - * The APIs exposed on the `licensing` key of {@link RequestHandlerContext} for plugins that depend on licensing. - * @public - */ -export interface LicensingApiRequestHandlerContext { - featureUsage: FeatureUsageServiceStart; - license: ILicense; -} -/** - * @internal - */ -export type LicensingRequestHandlerContext = CustomRequestHandlerContext<{ - licensing: LicensingApiRequestHandlerContext; -}>; -/** - * @internal - */ -export type LicensingRouter = IRouter; -/** @public */ -export interface LicensingPluginSetup { - /** - * Steam of licensing information {@link ILicense}. - * @deprecated in favour of the counterpart provided from start contract - * @removeBy 8.8.0 - */ - license$: Observable; - /** - * Triggers licensing information re-fetch. - * @deprecated in favour of the counterpart provided from start contract - * @removeBy 8.8.0 - */ - refresh(): Promise; - /** - * APIs to register licensed feature usage. - */ - featureUsage: FeatureUsageServiceSetup; -} -/** @public */ -export interface LicensingPluginStart { - /** - * Steam of licensing information {@link ILicense}. - */ - license$: Observable; - /** - * Retrieves the {@link ILicense | licensing information} - */ - getLicense(): Promise; - /** - * Triggers licensing information re-fetch. - */ - refresh(): Promise; - /** - * Creates a license poller to retrieve a license data with. - * Allows a plugin to configure a cluster to retrieve data from at - * given polling frequency. - */ - createLicensePoller: (clusterClient: IClusterClient, pollingFrequency: number) => { - license$: Observable; - refresh(): Promise; - }; - /** - * APIs to manage licensed feature usage. - */ - featureUsage: FeatureUsageServiceStart; -} diff --git a/x-pack/platform/plugins/shared/licensing/server/wrap_route_with_license_check.d.ts b/x-pack/platform/plugins/shared/licensing/server/wrap_route_with_license_check.d.ts deleted file mode 100644 index f71ec338406d9..0000000000000 --- a/x-pack/platform/plugins/shared/licensing/server/wrap_route_with_license_check.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { RequestHandler } from '@kbn/core/server'; -import type { ILicense } from '@kbn/licensing-types'; -import type { LicensingRequestHandlerContext } from './types'; -export type CheckLicense = (license: ILicense) => { - valid: false; - message: string; -} | { - valid: true; - message: null; -}; -export declare function wrapRouteWithLicenseCheck(checkLicense: CheckLicense, handler: RequestHandler): RequestHandler; diff --git a/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/types.d.ts b/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/types.d.ts deleted file mode 100644 index 17b9b881be0ff..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/types.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface LogSource { - indexPattern: string; -} -export interface LogSourcesService { - getLogSources: () => Promise; - getFlattenedLogSources: () => Promise; - setLogSources: (sources: LogSource[]) => Promise; -} diff --git a/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/utils.d.ts b/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/utils.d.ts deleted file mode 100644 index 41b8e0ee53f9e..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/common/services/log_sources_service/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { LogSource } from './types'; -export declare const flattenLogSources: (logSources: LogSource[]) => string; diff --git a/x-pack/platform/plugins/shared/logs_data_access/common/types.d.ts b/x-pack/platform/plugins/shared/logs_data_access/common/types.d.ts deleted file mode 100644 index e7a4e712ffafe..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/common/types.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from './services/log_sources_service/types'; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/components/logs_sources_setting.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/components/logs_sources_setting.d.ts deleted file mode 100644 index 67a413f87d1b7..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/components/logs_sources_setting.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ApplicationStart } from '@kbn/core-application-browser'; -import React from 'react'; -export declare const LogSourcesSettingSynchronisationInfo: React.FC<{ - isLoading: boolean; - logSourcesValue: string; - getUrlForApp: ApplicationStart['getUrlForApp']; - title?: string; -}>; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/hooks/use_log_sources.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/hooks/use_log_sources.d.ts deleted file mode 100644 index 0b79a52d6ebe8..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/hooks/use_log_sources.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { LogSource, LogSourcesService } from '../../common/services/log_sources_service/types'; -export declare const useLogSources: ({ logSourcesService }: { - logSourcesService: LogSourcesService; -}) => { - isUninitialized: boolean; - isLoadingLogSources: boolean; - hasFailedLoadingLogSources: boolean; - logSourcesError: Error | undefined; - logSources: LogSource[]; - combinedIndices: string; -}; -export declare const LogSourcesProvider: import("react").FC>, useLogSourcesContext: () => { - isUninitialized: boolean; - isLoadingLogSources: boolean; - hasFailedLoadingLogSources: boolean; - logSourcesError: Error | undefined; - logSources: LogSource[]; - combinedIndices: string; -}; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/index.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/index.d.ts deleted file mode 100644 index 10aa90c7bc3c6..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PluginInitializer } from '@kbn/core/public'; -import type { LogsDataAccessPluginSetup, LogsDataAccessPluginStart } from './plugin'; -export type { LogsDataAccessPluginSetup, LogsDataAccessPluginStart }; -import type { LogsDataAccessPluginSetupDeps, LogsDataAccessPluginStartDeps } from './types'; -export { LogSourcesProvider, useLogSourcesContext } from './hooks/use_log_sources'; -export { LogSourcesSettingSynchronisationInfo } from './components/logs_sources_setting'; -export declare const plugin: PluginInitializer; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/plugin.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/plugin.d.ts deleted file mode 100644 index a14797aa55fe8..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/plugin.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { CoreStart } from '@kbn/core/public'; -import type { Plugin } from '@kbn/core/public'; -import type { LogsDataAccessPluginSetupDeps, LogsDataAccessPluginStartDeps } from './types'; -export type LogsDataAccessPluginSetup = ReturnType; -export type LogsDataAccessPluginStart = ReturnType; -export declare class LogsDataAccessPlugin implements Plugin { - setup(): void; - start(core: CoreStart, plugins: LogsDataAccessPluginStartDeps): { - services: { - logSourcesService: import("../common/types").LogSourcesService; - logDataService: import("./services/log_data_service").LogDataService; - }; - }; - stop(): void; -} diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/index.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/index.d.ts deleted file mode 100644 index cf0f467687538..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './log_data_service'; -export type * from './types'; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/log_data_service.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/log_data_service.d.ts deleted file mode 100644 index 734b15c3c36ad..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/log_data_service.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { LogSourcesService } from '../../../common/types'; -import type { RegisterServicesParams } from '../register_services'; -import type { LogDataService } from './types'; -export declare function createLogDataService(params: RegisterServicesParams & { - logSourcesService: LogSourcesService; -}): LogDataService; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/types.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/types.d.ts deleted file mode 100644 index a415f829c3c29..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_data_service/types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type LogDataStatus = 'available' | 'empty' | 'missing' | 'unknown'; -export interface LogDataService { - getStatus(opts?: { - excludeIndices?: string[]; - }): Promise<{ - status: LogDataStatus; - hasData: boolean; - }>; -} diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_sources_service/index.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/log_sources_service/index.d.ts deleted file mode 100644 index 1b454d19a3639..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/services/log_sources_service/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { LogSourcesService } from '../../../common/services/log_sources_service/types'; -import type { RegisterServicesParams } from '../register_services'; -export declare function createLogSourcesService(params: RegisterServicesParams): LogSourcesService; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/services/register_services.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/services/register_services.d.ts deleted file mode 100644 index f8efc1cd2d432..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/services/register_services.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; -import type { ISearchStart } from '@kbn/data-plugin/public'; -export interface RegisterServicesParams { - deps: { - uiSettings: IUiSettingsClient; - search: ISearchStart; - }; -} -export declare function registerServices(params: RegisterServicesParams): { - logSourcesService: import("../../common/types").LogSourcesService; - logDataService: import("./log_data_service").LogDataService; -}; diff --git a/x-pack/platform/plugins/shared/logs_data_access/public/types.d.ts b/x-pack/platform/plugins/shared/logs_data_access/public/types.d.ts deleted file mode 100644 index f012cffe9d20b..0000000000000 --- a/x-pack/platform/plugins/shared/logs_data_access/public/types.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -export interface LogsDataAccessPluginSetupDeps { -} -export interface LogsDataAccessPluginStartDeps { - data: DataPublicPluginStart; -} diff --git a/x-pack/platform/plugins/shared/serverless/public/index.d.ts b/x-pack/platform/plugins/shared/serverless/public/index.d.ts deleted file mode 100644 index c95db3d731ac4..0000000000000 --- a/x-pack/platform/plugins/shared/serverless/public/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ServerlessPlugin } from './plugin'; -export declare function plugin(): ServerlessPlugin; -export type { ServerlessPluginSetup, ServerlessPluginStart } from './types'; diff --git a/x-pack/platform/plugins/shared/serverless/public/navigation/index.d.ts b/x-pack/platform/plugins/shared/serverless/public/navigation/index.d.ts deleted file mode 100644 index a16beb8d411c6..0000000000000 --- a/x-pack/platform/plugins/shared/serverless/public/navigation/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { manageOrgMembersNavCardName, generateManageOrgMembersNavCard } from './nav_cards'; diff --git a/x-pack/platform/plugins/shared/serverless/public/navigation/nav_cards.d.ts b/x-pack/platform/plugins/shared/serverless/public/navigation/nav_cards.d.ts deleted file mode 100644 index 059b8d7c9b920..0000000000000 --- a/x-pack/platform/plugins/shared/serverless/public/navigation/nav_cards.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CardNavExtensionDefinition } from '@kbn/management-cards-navigation'; -export declare const manageOrgMembersNavCardName = "organization_members"; -export declare function generateManageOrgMembersNavCard(cloudOrgUrl?: string): CardNavExtensionDefinition; diff --git a/x-pack/platform/plugins/shared/serverless/public/plugin.d.ts b/x-pack/platform/plugins/shared/serverless/public/plugin.d.ts deleted file mode 100644 index aca4cc4f6d9d2..0000000000000 --- a/x-pack/platform/plugins/shared/serverless/public/plugin.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import type { ServerlessPluginSetup, ServerlessPluginSetupDependencies, ServerlessPluginStart, ServerlessPluginStartDependencies } from './types'; -export declare class ServerlessPlugin implements Plugin { - constructor(); - setup(_core: CoreSetup, _dependencies: ServerlessPluginSetupDependencies): ServerlessPluginSetup; - start(core: CoreStart, dependencies: ServerlessPluginStartDependencies): ServerlessPluginStart; - stop(): void; -} diff --git a/x-pack/platform/plugins/shared/serverless/public/types.d.ts b/x-pack/platform/plugins/shared/serverless/public/types.d.ts deleted file mode 100644 index f02d4660d6b0a..0000000000000 --- a/x-pack/platform/plugins/shared/serverless/public/types.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ChromeBreadcrumb, ChromeSetProjectBreadcrumbsParams, NavigationTreeDefinition, SolutionId } from '@kbn/core-chrome-browser'; -import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; -import type { Observable } from 'rxjs'; -import type { CardNavExtensionDefinition } from '@kbn/management-cards-navigation'; -export interface ServerlessPluginSetup { -} -export interface ServerlessPluginStart { - setBreadcrumbs: (breadcrumbs: ChromeBreadcrumb | ChromeBreadcrumb[], params?: Partial) => void; - initNavigation(id: SolutionId, navigationTree$: Observable): void; - getNavigationCards$(roleManagementEnabled?: boolean, extendCardNavDefinitions?: Record): Observable | undefined>; -} -export interface ServerlessPluginSetupDependencies { - cloud: CloudSetup; -} -export interface ServerlessPluginStartDependencies { - cloud: CloudStart; -} diff --git a/x-pack/platform/plugins/shared/task_manager/common/constants.d.ts b/x-pack/platform/plugins/shared/task_manager/common/constants.d.ts deleted file mode 100644 index 05513977072ba..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/common/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare enum TaskErrorSource { - FRAMEWORK = "framework", - USER = "user" -} diff --git a/x-pack/platform/plugins/shared/task_manager/common/index.d.ts b/x-pack/platform/plugins/shared/task_manager/common/index.d.ts deleted file mode 100644 index 1793dc47a3575..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/common/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { TaskErrorSource } from './constants'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/api_key_strategy.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/api_key_strategy.d.ts deleted file mode 100644 index 9389bf2a178b0..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/api_key_strategy.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { Logger, SecurityServiceStart, IBasePath, KibanaRequest, SavedObjectsClientContract } from '@kbn/core/server'; -import type { ApiKeyType } from '../config'; -import type { ConcreteTaskInstance, TaskInstance, TaskUserScope } from '../task'; -export type { ApiKeyType } from '../config'; -export interface ApiKeySOFields { - apiKey: string; - uiamApiKey?: string; - userScope: TaskUserScope; -} -/** Optional flags passed to {@link ApiKeyStrategy.grantApiKeys}. */ -export interface GrantApiKeysOpts { - /** When true, grant only the Elasticsearch API key (skip UIAM). */ - onEsKey?: boolean; -} -export interface InvalidationTarget { - apiKeyId: string; - uiamApiKey?: string; -} -export interface ApiKeyStrategy { - readonly shouldGrantUiam: boolean; - readonly typeToUse: ApiKeyType; - grantApiKeys(taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart, basePath: IBasePath, opts?: GrantApiKeysOpts): Promise>; - getApiKeyForFakeRequest(taskInstance: ConcreteTaskInstance): string | undefined; - getApiKeyIdsForInvalidation(taskInstance: ConcreteTaskInstance): InvalidationTarget[]; - markForInvalidation(targets: InvalidationTarget[], logger: Logger, savedObjectsClient: SavedObjectsClientContract): Promise; -} -export declare const markApiKeysForInvalidation: (targets: InvalidationTarget[], logger: Logger, savedObjectsClient: SavedObjectsClientContract) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/create_api_key_strategy.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/create_api_key_strategy.d.ts deleted file mode 100644 index 61c8cc5146c64..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/create_api_key_strategy.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Logger, SecurityServiceStart } from '@kbn/core/server'; -import type { ApiKeyType } from '../config'; -import type { ApiKeyStrategy } from './api_key_strategy'; -export declare const createApiKeyStrategy: (apiKeyType: ApiKeyType, grantUiamApiKeys: boolean, security: SecurityServiceStart, logger: Logger) => ApiKeyStrategy; diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_and_uiam_api_key_strategy.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_and_uiam_api_key_strategy.d.ts deleted file mode 100644 index 589292d819b9e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_and_uiam_api_key_strategy.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Logger, SecurityServiceStart, IBasePath, KibanaRequest, SavedObjectsClientContract } from '@kbn/core/server'; -import { ApiKeyType } from '../config'; -import type { ConcreteTaskInstance, TaskInstance } from '../task'; -import type { ApiKeySOFields, ApiKeyStrategy, GrantApiKeysOpts, InvalidationTarget } from './api_key_strategy'; -export declare class EsAndUiamApiKeyStrategy implements ApiKeyStrategy { - readonly shouldGrantUiam = true; - readonly typeToUse: ApiKeyType; - private readonly security; - private readonly logger; - constructor(apiKeyType: ApiKeyType, security: SecurityServiceStart, logger: Logger); - grantApiKeys(taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart, basePath: IBasePath, opts?: GrantApiKeysOpts): Promise>; - private grantUiamApiKeys; - getApiKeyForFakeRequest(taskInstance: ConcreteTaskInstance): string | undefined; - getApiKeyIdsForInvalidation(taskInstance: ConcreteTaskInstance): InvalidationTarget[]; - markForInvalidation(targets: InvalidationTarget[], logger: Logger, savedObjectsClient: SavedObjectsClientContract): Promise; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_api_key_strategy.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_api_key_strategy.d.ts deleted file mode 100644 index d544723b6646e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/es_api_key_strategy.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Logger, SecurityServiceStart, IBasePath, KibanaRequest, SavedObjectsClientContract } from '@kbn/core/server'; -import { ApiKeyType } from '../config'; -import type { ConcreteTaskInstance, TaskInstance } from '../task'; -import type { ApiKeySOFields, ApiKeyStrategy, InvalidationTarget } from './api_key_strategy'; -export declare class EsApiKeyStrategy implements ApiKeyStrategy { - readonly shouldGrantUiam = false; - readonly typeToUse = ApiKeyType.ES; - grantApiKeys(taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart, basePath: IBasePath): Promise>; - getApiKeyForFakeRequest(taskInstance: ConcreteTaskInstance): string | undefined; - getApiKeyIdsForInvalidation(taskInstance: ConcreteTaskInstance): InvalidationTarget[]; - markForInvalidation(targets: InvalidationTarget[], logger: Logger, savedObjectsClient: SavedObjectsClientContract): Promise; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/index.d.ts deleted file mode 100644 index b98d235cc05a4..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/api_key_strategy/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type { ApiKeyStrategy, ApiKeySOFields, InvalidationTarget, ApiKeyType, } from './api_key_strategy'; -export { markApiKeysForInvalidation } from './api_key_strategy'; -export { EsApiKeyStrategy } from './es_api_key_strategy'; -export { EsAndUiamApiKeyStrategy } from './es_and_uiam_api_key_strategy'; -export { createApiKeyStrategy } from './create_api_key_strategy'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/buffered_task_store.d.ts b/x-pack/platform/plugins/shared/task_manager/server/buffered_task_store.d.ts deleted file mode 100644 index 4828522d03d1e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/buffered_task_store.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { TaskStore } from './task_store'; -import type { ConcreteTaskInstance, PartialConcreteTaskInstance } from './task'; -import type { Updatable } from './task_running'; -import type { BufferOptions } from './lib/bulk_operation_buffer'; -export declare class BufferedTaskStore implements Updatable { - private readonly taskStore; - private bufferedPartialUpdate; - private bufferedUpdate; - private bufferedRemove; - constructor(taskStore: TaskStore, options: BufferOptions); - update(doc: ConcreteTaskInstance, options: { - validate: boolean; - }): Promise; - partialUpdate(partialDoc: PartialConcreteTaskInstance, options: { - validate: boolean; - doc: ConcreteTaskInstance; - }): Promise; - remove(id: string): Promise; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/config.d.ts b/x-pack/platform/plugins/shared/task_manager/server/config.d.ts deleted file mode 100644 index 172dc2abc06c9..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/config.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -export declare const MAX_WORKERS_LIMIT = 100; -export declare const DEFAULT_CAPACITY = 10; -export declare const MAX_CAPACITY = 50; -export declare const MIN_CAPACITY = 5; -export declare const DEFAULT_MAX_WORKERS = 10; -export declare const DEFAULT_POLL_INTERVAL = 3000; -export declare const MGET_DEFAULT_POLL_INTERVAL = 500; -export declare const DEFAULT_VERSION_CONFLICT_THRESHOLD = 80; -export declare const DEFAULT_MONITORING_REFRESH_RATE: number; -export declare const DEFAULT_MONITORING_STATS_RUNNING_AVERAGE_WINDOW = 50; -export declare const DEFAULT_MONITORING_STATS_WARN_DELAYED_TASK_START_IN_SECONDS = 60; -export declare const DEFAULT_METRICS_RESET_INTERVAL: number; -export declare const DEFAULT_WORKER_UTILIZATION_RUNNING_AVERAGE_WINDOW = 5; -export declare const WORKER_UTILIZATION_RUNNING_AVERAGE_WINDOW_SIZE_MS: number; -export declare const CLAIM_STRATEGY_UPDATE_BY_QUERY = "update_by_query"; -export declare const CLAIM_STRATEGY_MGET = "mget"; -export declare const DEFAULT_DISCOVERY_INTERVAL_MS: number; -export declare const DISCOVERY_INTERVAL_AFTER_BLOCK_EXCEPTION_MS: number; -export declare const DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION = "30s"; -export declare const DEFAULT_KIBANAS_PER_PARTITION = 2; -export declare enum ApiKeyType { - ES = "es", - UIAM = "uiam" -} -export declare const taskExecutionFailureThresholdSchema: import("@kbn/config-schema").ObjectType<{ - error_threshold: import("@kbn/config-schema").Type; - warn_threshold: import("@kbn/config-schema").Type; -}>; -declare const eventLoopDelaySchema: import("@kbn/config-schema").ObjectType<{ - monitor: import("@kbn/config-schema").Type; - warn_threshold: import("@kbn/config-schema").Type; -}>; -declare const requestTimeoutsConfig: import("@kbn/config-schema").ObjectType<{ - update_by_query: import("@kbn/config-schema").Type; -}>; -export declare const configSchema: import("@kbn/config-schema").ObjectType<{ - allow_reading_invalid_state: import("@kbn/config-schema").Type; - api_key_type: import("@kbn/config-schema").Type; - grant_uiam_api_keys: import("@kbn/config-schema").Type; - capacity: import("@kbn/config-schema").Type; - discovery: import("@kbn/config-schema").ObjectType<{ - active_nodes_lookback: import("@kbn/config-schema").Type; - interval: import("@kbn/config-schema").Type; - }>; - ephemeral_tasks: import("@kbn/config-schema").Type; - event_loop_delay: import("@kbn/config-schema").ObjectType<{ - monitor: import("@kbn/config-schema").Type; - warn_threshold: import("@kbn/config-schema").Type; - }>; - invalidate_api_key_task: import("@kbn/config-schema").ObjectType<{ - interval: import("@kbn/config-schema").Type; - removalDelay: import("@kbn/config-schema").Type; - }>; - kibanas_per_partition: import("@kbn/config-schema").Type; - max_attempts: import("@kbn/config-schema").Type; - max_workers: import("@kbn/config-schema").Type; - metrics_reset_interval: import("@kbn/config-schema").Type; - monitored_aggregated_stats_refresh_rate: import("@kbn/config-schema").Type; - monitored_stats_health_verbose_log: import("@kbn/config-schema").ObjectType<{ - enabled: import("@kbn/config-schema").Type; - level: import("@kbn/config-schema").Type<"debug" | "info">; - warn_delayed_task_start_in_seconds: import("@kbn/config-schema").Type; - }>; - monitored_stats_required_freshness: import("@kbn/config-schema").Type; - monitored_stats_running_average_window: import("@kbn/config-schema").Type; - monitored_task_execution_thresholds: import("@kbn/config-schema").ObjectType<{ - custom: import("@kbn/config-schema").Type>>; - default: import("@kbn/config-schema").ObjectType<{ - error_threshold: import("@kbn/config-schema").Type; - warn_threshold: import("@kbn/config-schema").Type; - }>; - }>; - poll_interval: import("@kbn/config-schema").ConditionalType<"mget", number, number>; - request_capacity: import("@kbn/config-schema").Type; - unsafe: import("@kbn/config-schema").ObjectType<{ - authenticate_background_task_utilization: import("@kbn/config-schema").Type; - exclude_task_types: import("@kbn/config-schema").Type; - }>; - version_conflict_threshold: import("@kbn/config-schema").Type; - worker_utilization_running_average_window: import("@kbn/config-schema").Type; - claim_strategy: import("@kbn/config-schema").Type; - request_timeouts: import("@kbn/config-schema").ObjectType<{ - update_by_query: import("@kbn/config-schema").Type; - }>; - auto_calculate_default_ech_capacity: import("@kbn/config-schema").Type; -}>; -export type TaskManagerConfig = TypeOf; -export type TaskExecutionFailureThreshold = TypeOf; -export type EventLoopDelayConfig = TypeOf; -export type RequestTimeoutsConfig = TypeOf; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/constants.d.ts b/x-pack/platform/plugins/shared/task_manager/server/constants.d.ts deleted file mode 100644 index 4163b655479c0..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/constants.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export declare const TASK_MANAGER_INDEX = ".kibana_task_manager"; -export declare const CONCURRENCY_ALLOW_LIST_BY_TASK_TYPE: string[]; -export declare const EVENT_LOG_PROVIDER = "taskManager"; -export declare const EVENT_LOG_ACTIONS: { - taskRun: string; - taskCancel: string; -}; -export declare enum EventLogOutcomes { - success = "success", - failure = "failure" -} -export declare const UIAM_LOGS_GRANT_TAGS: string[]; -export declare const UIAM_LOGS_INVALIDATE_TAGS: string[]; -export declare const UIAM_LOGS_CREDENTIALS_TAGS: string[]; -export declare const UIAM_LOGS_USAGE_TAGS: string[]; diff --git a/x-pack/platform/plugins/shared/task_manager/server/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/index.d.ts deleted file mode 100644 index 15fe772ee0ea0..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import type { TaskManagerConfig } from './config'; -export declare const plugin: (initContext: PluginInitializerContext) => Promise; -export type { TaskInstance, ConcreteTaskInstance, TaskRunCreatorFunction, RunContext, IntervalSchedule, } from './task'; -export { Frequency, Weekday } from '@kbn/rrule'; -export { scheduleRruleSchemaV1, scheduleRruleSchemaV2, scheduleRruleSchemaV3, } from './saved_objects'; -export type { RruleSchedule } from './task'; -export { TaskStatus, TaskPriority, TaskCost, InstanceTaskCost } from './task'; -export type { TaskRegisterDefinition, TaskDefinitionRegistry } from './task_type_dictionary'; -export { asInterval } from './lib/intervals'; -export { isUnrecoverableError, throwUnrecoverableError, throwRetryableError, createTaskRunError, TaskErrorSource, } from './task_running'; -export type { DecoratedError } from './task_running'; -export type { RunNowResult, BulkUpdateTaskResult } from './task_scheduling'; -export { getOldestIdleActionTask } from './queries/oldest_idle_action_task'; -export { IdleTaskWithExpiredRunAt, RunningOrClaimingTaskWithExpiredRetryAt, } from './queries/mark_available_tasks_as_claimed'; -export { aggregateTaskOverduePercentilesForType } from './queries/aggregate_task_overdue_percentiles_for_type'; -export { runInvalidate } from './invalidate_api_keys/lib'; -export type { TaskManagerPlugin as TaskManager, TaskManagerSetupContract, TaskManagerStartContract, } from './plugin'; -export { TaskAlreadyRunningError } from './lib/errors'; -export { EVENT_LOG_ACTIONS, EVENT_LOG_PROVIDER } from './constants'; -export declare const config: PluginConfigDescriptor; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/invalidate_api_keys_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/invalidate_api_keys_task.d.ts deleted file mode 100644 index bac5ab421e0d6..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/invalidate_api_keys_task.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { Logger } from '@kbn/logging'; -import type { CoreStart } from '@kbn/core-lifecycle-server'; -import type { InvalidateAPIKeyResult, InvalidateAPIKeysParams, InvalidateUiamAPIKeyParams } from '@kbn/security-plugin-types-server'; -import type { KibanaRequest } from '@kbn/core/server'; -import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; -import type { TaskScheduling } from '../task_scheduling'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -import type { TaskManagerStartContract } from '..'; -import type { TaskManagerPluginsStart } from '../plugin'; -export declare const TASK_ID = "invalidate_api_keys"; -export type ApiKeyInvalidationFn = (params: InvalidateAPIKeysParams) => Promise | undefined; -export type UiamApiKeyInvalidationFn = (request: KibanaRequest, params: InvalidateUiamAPIKeyParams) => Promise; -export declare function scheduleInvalidateApiKeyTask(logger: Logger, taskScheduling: TaskScheduling, interval: string): Promise; -interface RegisterInvalidateApiKeyTaskOpts { - configInterval: string; - coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>; - getEncryptedSavedObjectsClient: () => EncryptedSavedObjectsClient | undefined; - invalidateApiKeyFn?: ApiKeyInvalidationFn; - invalidateUiamApiKeyFn?: () => UiamApiKeyInvalidationFn | undefined; - logger: Logger; - removalDelay: string; - taskTypeDictionary: TaskTypeDictionary; -} -export declare function registerInvalidateApiKeyTask(opts: RegisterInvalidateApiKeyTaskOpts): void; -type InvalidateApiKeysTaskRunnerOpts = Pick; -interface InvalidateApiKeysTaskState { - missing_api_key_retries?: Record; -} -export declare function taskRunner(opts: InvalidateApiKeysTaskRunnerOpts): ({ taskInstance }: { - taskInstance: { - state: InvalidateApiKeysTaskState; - }; -}) => { - run(): Promise<{ - state: { - missing_api_key_retries: { - [x: string]: number; - }; - }; - schedule: { - interval: string; - }; - }>; -}; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/constants.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/constants.d.ts deleted file mode 100644 index fffb3ce82db5f..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/constants.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const PAGE_SIZE = 100; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_api_key_ids_to_invalidate.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_api_key_ids_to_invalidate.d.ts deleted file mode 100644 index 9f9fae36746a0..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_api_key_ids_to_invalidate.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { SavedObjectsFindResponse, SavedObjectsClientContract } from '@kbn/core/server'; -import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; -import type { ApiKeyToInvalidate } from '../../saved_objects/schemas/api_key_to_invalidate'; -import type { SavedObjectTypesToQuery } from './run_invalidate'; -export interface ApiKeyIdAndSOId { - id: string; - apiKeyId: string; -} -export interface UiamApiKeyAndSOId { - id: string; - apiKeyId: string; - uiamApiKey: string; -} -interface GetApiKeyIdsToInvalidateOpts { - apiKeySOsPendingInvalidation: SavedObjectsFindResponse; - encryptedSavedObjectsClient?: EncryptedSavedObjectsClient; - savedObjectsClient: SavedObjectsClientContract; - savedObjectType: string; - savedObjectTypesToQuery: SavedObjectTypesToQuery[]; -} -interface GetApiKeysToInvalidateResult { - apiKeyIdsToInvalidate: ApiKeyIdAndSOId[]; - uiamApiKeysToInvalidate?: UiamApiKeyAndSOId[]; - apiKeyIdsToExclude: ApiKeyIdAndSOId[]; -} -export declare function getApiKeyIdsToInvalidate({ apiKeySOsPendingInvalidation, encryptedSavedObjectsClient, savedObjectsClient, savedObjectType, savedObjectTypesToQuery, }: GetApiKeyIdsToInvalidateOpts): Promise; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_find_filter.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_find_filter.d.ts deleted file mode 100644 index 26955226f72f8..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/get_find_filter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -interface GetFindFilterOpts { - removalDelay: string; - excludedSOIds?: string[]; - savedObjectType: string; -} -export declare function getFindFilter(opts: GetFindFilterOpts): string; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/index.d.ts deleted file mode 100644 index 39a5ad8dd7e7e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { runInvalidate } from './run_invalidate'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys.d.ts deleted file mode 100644 index 7d35439f7a9d5..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { InvalidateAPIKeysParams, InvalidateAPIKeyResult as SecurityPluginInvalidateAPIKeyResult } from '@kbn/security-plugin-types-server'; -import type { ApiKeyInvalidationFn, UiamApiKeyInvalidationFn } from '../invalidate_api_keys_task'; -export type InvalidateAPIKeyResult = { - apiKeysEnabled: false; -} | { - apiKeysEnabled: true; - result: SecurityPluginInvalidateAPIKeyResult; -}; -export declare function invalidateAPIKeys(params: InvalidateAPIKeysParams, invalidateApiKeyFn?: ApiKeyInvalidationFn): Promise; -export declare function invalidateUiamAPIKeys(params: { - uiamApiKey: string; - apiKeyId: string; -}, invalidateUiamApiKeyFn?: UiamApiKeyInvalidationFn): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys_and_delete_so.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys_and_delete_so.d.ts deleted file mode 100644 index 59643295776a2..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/invalidate_api_keys_and_delete_so.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; -import type { ApiKeyIdAndSOId, UiamApiKeyAndSOId } from './get_api_key_ids_to_invalidate'; -import type { ApiKeyInvalidationFn, UiamApiKeyInvalidationFn } from '../invalidate_api_keys_task'; -interface InvalidateApiKeysAndDeleteSO { - apiKeyIdsToInvalidate: ApiKeyIdAndSOId[]; - uiamApiKeysToInvalidate?: UiamApiKeyAndSOId[]; - invalidateApiKeyFn?: ApiKeyInvalidationFn; - invalidateUiamApiKeyFn?: UiamApiKeyInvalidationFn; - logger: Logger; - missingApiKeyRetries: Record; - savedObjectsClient: SavedObjectsClientContract; - savedObjectType: string; -} -export interface InvalidateApiKeysResult { - totalInvalidated: number; - missingApiKeyRetries: Record; -} -export declare function invalidateApiKeysAndDeletePendingApiKeySavedObject({ apiKeyIdsToInvalidate, uiamApiKeysToInvalidate, invalidateApiKeyFn, invalidateUiamApiKeyFn, logger, missingApiKeyRetries: inputRetries, savedObjectsClient, savedObjectType, }: InvalidateApiKeysAndDeleteSO): Promise; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/query_for_api_keys_in_use.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/query_for_api_keys_in_use.d.ts deleted file mode 100644 index 9bea5636ff580..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/query_for_api_keys_in_use.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { AggregationsStringTermsBucketKeys } from '@elastic/elasticsearch/lib/api/types'; -import type { SavedObjectsClientContract } from '@kbn/core/server'; -import type { SavedObjectTypesToQuery } from './run_invalidate'; -interface QueryForApiKeysInUseOpts { - apiKeyIds: string[]; - savedObjectTypeToQuery: SavedObjectTypesToQuery; - savedObjectsClient: SavedObjectsClientContract; -} -export declare function queryForApiKeysInUse(opts: QueryForApiKeysInUseOpts): Promise; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/run_invalidate.d.ts b/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/run_invalidate.d.ts deleted file mode 100644 index edc7a5722b651..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/invalidate_api_keys/lib/run_invalidate.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; -import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; -import type { ApiKeyInvalidationFn, UiamApiKeyInvalidationFn } from '../invalidate_api_keys_task'; -export interface SavedObjectTypesToQuery { - type: string; - apiKeyAttributePath: string; -} -interface RunInvalidateOpts { - encryptedSavedObjectsClient?: EncryptedSavedObjectsClient; - invalidateApiKeyFn?: ApiKeyInvalidationFn; - invalidateUiamApiKeyFn?: UiamApiKeyInvalidationFn; - logger: Logger; - missingApiKeyRetries?: Record; - removalDelay: string; - savedObjectsClient: SavedObjectsClientContract; - savedObjectType: string; - savedObjectTypesToQuery: SavedObjectTypesToQuery[]; -} -export interface RunInvalidateResult { - totalInvalidated: number; - missingApiKeyRetries: Record; -} -export declare function runInvalidate(opts: RunInvalidateOpts): Promise; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/delete_inactive_nodes_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/delete_inactive_nodes_task.d.ts deleted file mode 100644 index f433127b9dfde..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/delete_inactive_nodes_task.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Logger } from '@kbn/logging'; -import type { CoreStart } from '@kbn/core-lifecycle-server'; -import type { TaskScheduling } from '../task_scheduling'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -import type { TaskManagerStartContract } from '..'; -import type { TaskManagerPluginsStart } from '../plugin'; -export declare const TASK_ID = "delete_inactive_background_task_nodes"; -export declare const CLEANUP_INTERVAL = "1m"; -export declare const CLEANUP_LOOKBACK = "5m"; -export declare function scheduleDeleteInactiveNodesTaskDefinition(logger: Logger, taskScheduling: TaskScheduling): Promise; -export declare function registerDeleteInactiveNodesTaskDefinition(logger: Logger, coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>, taskTypeDictionary: TaskTypeDictionary): void; -export declare function taskRunner(logger: Logger, coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>): () => { - run(): Promise<{ - state: {}; - schedule: { - interval: string; - }; - }>; -}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/index.d.ts deleted file mode 100644 index b1c60a5286a7b..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { KibanaDiscoveryService } from './kibana_discovery_service'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/kibana_discovery_service.d.ts b/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/kibana_discovery_service.d.ts deleted file mode 100644 index 32e106247c67a..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/kibana_discovery_service/kibana_discovery_service.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { ISavedObjectsRepository } from '@kbn/core/server'; -import type { Logger } from '@kbn/core/server'; -import type { TaskManagerConfig } from '../config'; -interface DiscoveryServiceParams { - config: TaskManagerConfig['discovery']; - currentNode: string; - savedObjectsRepository: ISavedObjectsRepository; - logger: Logger; - onNodesCounted?: (numOfNodes: number) => void; -} -export declare const DEFAULT_TIMEOUT = 2000; -export declare class KibanaDiscoveryService { - private readonly activeNodesLookBack; - private readonly discoveryInterval; - private currentNode; - private started; - private savedObjectsRepository; - private logger; - private stopped; - private timer; - private onNodesCounted?; - constructor(opts: DiscoveryServiceParams); - private upsertCurrentNode; - private scheduleUpsertCurrentNode; - isStarted(): boolean; - start(): Promise; - getActiveKibanaNodes(): Promise>[]>; - deleteCurrentNode(): Promise; - stop(): void; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/adhoc_task_counter.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/adhoc_task_counter.d.ts deleted file mode 100644 index 8befb6f4e2e4f..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/adhoc_task_counter.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Keeps track of how many tasks have been created. - * - * @export - * @class AdHocTaskCounter - * - */ -export declare class AdHocTaskCounter { - /** - * Gets the number of created tasks. - */ - get count(): number; - private _count; - constructor(); - increment(by?: number): void; - reset(): void; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/api_key_utils.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/api_key_utils.d.ts deleted file mode 100644 index 2b72f0e5c401f..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/api_key_utils.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { AuthenticatedUser, SecurityServiceStart, IBasePath } from '@kbn/core/server'; -import type { KibanaRequest } from '@kbn/core/server'; -import type { TaskInstance, TaskUserScope } from '../task'; -export interface APIKeyResult { - id: string; - api_key: string; -} -export interface EncodedApiKeyResult { - apiKey: string; - apiKeyId: string; -} -export interface ApiKeyAndUserScope { - apiKey: string; - userScope: TaskUserScope; -} -export declare const isRequestApiKeyType: (user: AuthenticatedUser | null) => boolean; -export declare const requestHasApiKey: (security: SecurityServiceStart, request: KibanaRequest) => boolean; -export declare const getApiKeyFromRequest: (request: KibanaRequest) => { - id: string; - api_key: string; -} | null; -export declare const createApiKey: (taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart) => Promise>; -export declare const getApiKeyAndUserScope: (taskInstances: TaskInstance[], request: KibanaRequest, security: SecurityServiceStart, basePath: IBasePath) => Promise>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/assign_pod_partitions.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/assign_pod_partitions.d.ts deleted file mode 100644 index 143139c32c440..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/assign_pod_partitions.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -interface GetPartitionMapOpts { - kibanasPerPartition: number; - partitions: number[]; - podNames: string[]; -} -export declare function getPartitionMap({ kibanasPerPartition, podNames, partitions, }: GetPartitionMapOpts): Record; -interface AssignPodPartitionsOpts { - kibanasPerPartition: number; - podName: string; - podNames: string[]; - partitions: number[]; -} -export declare function assignPodPartitions({ kibanasPerPartition, podName, podNames, partitions, }: AssignPodPartitionsOpts): number[]; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/bulk_operation_buffer.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/bulk_operation_buffer.d.ts deleted file mode 100644 index 9678dd7ae8d14..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/bulk_operation_buffer.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { estypes } from '@elastic/elasticsearch'; -import type { SavedObjectError } from '@kbn/core-saved-objects-common'; -import type { Result } from './result_type'; -export interface BufferOptions { - bufferMaxDuration?: number; - bufferMaxOperations?: number; - logger?: Logger; -} -export interface Entity { - id: string; -} -export interface ErrorOutput { - type: string; - id: string; - status?: number; - error: SavedObjectError | estypes.ErrorCause; -} -export type OperationResult = Result; -export type Operation = (entity: T) => Promise>; -export type BulkOperation = (entities: T[]) => Promise>>; -export declare function createBuffer(bulkOperation: BulkOperation, { bufferMaxDuration, bufferMaxOperations, logger }: BufferOptions): Operation; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/calculate_health_status.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/calculate_health_status.d.ts deleted file mode 100644 index a01f5dc0ecc9f..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/calculate_health_status.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { RawMonitoringStats } from '../monitoring'; -import { HealthStatus } from '../monitoring'; -import type { TaskManagerConfig } from '../config'; -export declare function calculateHealthStatus(summarizedStats: RawMonitoringStats, config: TaskManagerConfig, shouldRunTasks: boolean, logger: Logger): { - status: HealthStatus; - reason?: string; -}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/correct_deprecated_fields.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/correct_deprecated_fields.d.ts deleted file mode 100644 index ab14b02adfe39..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/correct_deprecated_fields.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { TaskInstance, TaskInstanceWithDeprecatedFields } from '../task'; -export declare function ensureDeprecatedFieldsAreCorrected({ id, taskType, interval, schedule, ...taskInstance }: TaskInstanceWithDeprecatedFields, logger: Logger): TaskInstance; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/create_managed_configuration.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/create_managed_configuration.d.ts deleted file mode 100644 index 30d4cebb0af31..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/create_managed_configuration.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { TaskManagerConfig } from '../config'; -export declare const ADJUST_THROUGHPUT_INTERVAL: number; -export declare const PREFERRED_MAX_POLL_INTERVAL: number; -export declare const INTERVAL_AFTER_BLOCK_EXCEPTION: number; -export declare const MIN_COST: number; -export declare const MIN_WORKERS = 1; -interface ErrorScanResult { - count: number; - isBlockException: boolean; -} -export declare function createCapacityScan(config: TaskManagerConfig, logger: Logger, startingCapacity: number): import("rxjs").OperatorFunction; -export declare function createPollIntervalScan(logger: Logger, startingPollInterval: number, claimStrategy: string, tmUtilizationQueue: (value?: number | undefined) => number[]): import("rxjs").OperatorFunction<[{ - count: any; - isBlockException: any; -}, any], number>; -export declare function countErrors(errors$: Observable, countInterval: number): Observable; -export declare function calculateStartingCapacity(config: TaskManagerConfig, logger: Logger, defaultCapacity: number): number; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/bulk_update_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/bulk_update_error.d.ts deleted file mode 100644 index 344cb33dc110a..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/bulk_update_error.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export declare class BulkUpdateError extends Error { - private _statusCode; - private _type; - constructor({ statusCode, message, type, }: { - statusCode: number; - message?: string; - type: string; - }); - get statusCode(): number; - get type(): string; -} -export declare function getBulkUpdateStatusCode(error: Error | BulkUpdateError): number | undefined; -export declare function getBulkUpdateErrorType(error: Error | BulkUpdateError): string | undefined; -export declare function isClusterBlockException(error: Error | BulkUpdateError): boolean; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/index.d.ts deleted file mode 100644 index 88026566b5493..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { BulkUpdateError, getBulkUpdateStatusCode, isClusterBlockException, } from './bulk_update_error'; -export { MsearchError, getMsearchStatusCode } from './msearch_error'; -export { TaskAlreadyRunningError } from './task_already_running_error'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/msearch_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/msearch_error.d.ts deleted file mode 100644 index 2f699760be51e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/msearch_error.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare class MsearchError extends Error { - private _statusCode?; - constructor(statusCode?: number); - get statusCode(): number | undefined; -} -export declare function getMsearchStatusCode(error: Error | MsearchError): number | undefined; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/task_already_running_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/errors/task_already_running_error.d.ts deleted file mode 100644 index 83cb17a28a5ba..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/errors/task_already_running_error.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare class TaskAlreadyRunningError extends Error { - constructor(id: string, noForce?: boolean); -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/execution_context.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/execution_context.d.ts deleted file mode 100644 index f5012843bc448..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/execution_context.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; -import type { ExecutionContextSetup } from '@kbn/core/server'; -export interface CreateExecutionContextArgs { - contextSetup: ExecutionContextSetup; - baseContext: KibanaExecutionContext; -} -export interface ExecutionContextRunner { - run(fn: () => Promise, context?: KibanaExecutionContext): Promise; -} -export declare class ExecutionContextRunnerImpl implements ExecutionContextRunner { - private contextSetup; - private baseContext; - constructor(args: CreateExecutionContextArgs); - run(fn: () => Promise, context?: KibanaExecutionContext): Promise; -} -export declare function getExecutionContextRunner(contextSetup: ExecutionContextSetup, baseContext?: KibanaExecutionContext): ExecutionContextRunner; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/fill_pool.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/fill_pool.d.ts deleted file mode 100644 index 61eb5caf96012..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/fill_pool.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { ClaimOwnershipResult } from '../queries/task_claiming'; -import type { ConcreteTaskInstance } from '../task'; -import type { WithTaskTiming } from '../task_events'; -import { TaskPoolRunResult } from '../task_pool'; -import type { TaskManagerRunner } from '../task_running'; -import type { Result } from './result_type'; -export declare enum FillPoolResult { - Failed = "Failed", - NoAvailableWorkers = "NoAvailableWorkers", - NoTasksClaimed = "NoTasksClaimed", - RunningAtCapacity = "RunningAtCapacity", - RanOutOfCapacity = "RanOutOfCapacity", - PoolFilled = "PoolFilled" -} -export type ClaimAndFillPoolResult = Partial> & { - result: FillPoolResult; -}; -export type TimedFillPoolResult = WithTaskTiming; -/** - * Given a function that runs a batch of tasks (e.g. taskPool.run), a function - * that fetches task records (e.g. store.fetchAvailableTasks), and a function - * that converts task records to the appropriate task runner, this function - * fills the pool with work. - * - * This is annoyingly general in order to simplify testing. - * - * @param run - a function that runs a batch of tasks (e.g. taskPool.run) - * @param fetchAvailableTasks - a function that fetches task records (e.g. store.fetchAvailableTasks) - * @param converter - a function that converts task records to the appropriate task runner - */ -export declare function fillPool(fetchAvailableTasks: () => Promise>, converter: (taskInstance: ConcreteTaskInstance) => TaskManagerRunner, run: (tasks: TaskManagerRunner[]) => Promise): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_default_capacity.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_default_capacity.d.ts deleted file mode 100644 index 193a3a9fa1eed..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/get_default_capacity.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -interface GetDefaultCapacityOpts { - autoCalculateDefaultEchCapacity: boolean; - claimStrategy?: string; - heapSizeLimit: number; - isCloud: boolean; - isServerless: boolean; - isBackgroundTaskNodeOnly: boolean; -} -export declare function getDefaultCapacity({ autoCalculateDefaultEchCapacity, claimStrategy, heapSizeLimit: heapSizeLimitInBytes, isCloud, isServerless, isBackgroundTaskNodeOnly, }: GetDefaultCapacityOpts): number; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_es_and_so_availability.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_es_and_so_availability.d.ts deleted file mode 100644 index 920156493394c..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/get_es_and_so_availability.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger, CoreStatus, IClusterClient } from '@kbn/core/server'; -export interface GetElasticsearchAndSOAvailabilityOpts { - core$: Observable; - isServerless: boolean; - logger: Logger; - getClusterClient: () => Promise; -} -export declare function getElasticsearchAndSOAvailability({ core$, isServerless, logger, getClusterClient, }: GetElasticsearchAndSOAvailabilityOpts): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_execution_id.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_execution_id.d.ts deleted file mode 100644 index 2d91f4a7281d2..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/get_execution_id.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getExecutionId(executionId: string): string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_first_run_at.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_first_run_at.d.ts deleted file mode 100644 index ec72f239c0c7f..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/get_first_run_at.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { TaskInstance } from '../task'; -export declare function getFirstRunAt({ taskInstance, logger, }: { - taskInstance: TaskInstance; - logger: Logger; -}): string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_next_run_at.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_next_run_at.d.ts deleted file mode 100644 index 702d160f87f33..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/get_next_run_at.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { ConcreteTaskInstance, IntervalSchedule, RruleSchedule } from '../task'; -export declare function getNextRunAt({ runAt, startedAt, schedule }: Pick, taskDelayThresholdForPreciseScheduling: number | undefined, logger: Logger): Date; -export declare function calculateNextRunAtFromSchedule({ schedule, startDate, }: { - schedule?: IntervalSchedule | RruleSchedule; - startDate: Date; -}): number; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/get_retry_at.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/get_retry_at.d.ts deleted file mode 100644 index e73f07359f6f4..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/get_retry_at.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ConcreteTaskInstance, TaskDefinition } from '../task'; -export declare function getRetryAt(task: ConcreteTaskInstance, taskDefinition: TaskDefinition | undefined): Date | undefined; -export declare function getRetryDate({ error, attempts, addDuration, }: { - error: Error; - attempts: number; - addDuration?: string; -}): Date | undefined; -export declare function calculateDelayBasedOnAttempts(attempts: number): number; -export declare function getTimeout(task: ConcreteTaskInstance, taskDefinition: TaskDefinition | undefined): string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/identify_es_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/identify_es_error.d.ts deleted file mode 100644 index ae220caed8147..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/identify_es_error.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface ESErrorCausedBy { - type?: string; - reason?: string; - caused_by?: ESErrorCausedBy; -} -export interface ESError { - root_cause?: ESErrorCausedBy[]; - caused_by?: ESErrorCausedBy; -} -export interface ESErrorBody { - error?: ESError; - status?: number; -} -export interface ESErrorMeta { - body?: ESErrorBody; - statusCode?: number; -} -export interface ElasticsearchResponseError { - name?: string; - meta?: ESErrorMeta; -} -/** - * Identified causes for ES Error - * - * @param err Object Error thrown by ES JS client - * @return ES error cause - */ -export declare function identifyEsError(err: ElasticsearchResponseError): string[]; -export declare function isEsCannotExecuteScriptError(err: ElasticsearchResponseError): boolean; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/intervals.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/intervals.d.ts deleted file mode 100644 index c523588911788..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/intervals.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -export declare enum IntervalCadence { - Minute = "m", - Second = "s", - Hour = "h", - Day = "d" -} -export type Interval = string; -export declare function isInterval(interval: Interval | string): interval is Interval; -export declare function asInterval(ms: number): Interval; -/** - * Returns a date that is the specified interval from now. Currently, - * only minute-intervals and second-intervals are supported. - * - * @param {Interval} interval - An interval of the form `Nm` such as `5m` - */ -export declare function intervalFromNow(interval?: Interval): Date | undefined; -/** - * Returns a date that is the specified interval from given date. Currently, - * only minute-intervals and second-intervals are supported. - * - * @param {Date} date - The date to add interval to - * @param {Interval} interval - An interval of the form `Nm` such as `5m` - */ -export declare function intervalFromDate(date: Date, interval?: Interval): Date | undefined; -export declare function maxIntervalFromDate(date: Date, ...intervals: Array): Date | undefined; -/** - * Returns a date that is secs seconds from now. - * - * @param secs The number of seconds from now - */ -export declare function secondsFromNow(secs: number): Date; -/** - * Returns a date that is secs seconds from given date. - * - * @param date The date to add seconds to - * @param secs The number of seconds from given date - */ -export declare function secondsFromDate(date: Date, secs: number): Date; -/** - * Verifies that the specified interval matches our expected format. - * - * @param {Interval} interval - An interval such as `5m` or `10s` - * @returns {number} The interval as seconds - */ -export declare const parseIntervalAsSecond: ((interval: Interval) => number) & import("lodash").MemoizedFunction; -export declare const parseIntervalAsMillisecond: ((interval: Interval) => number) & import("lodash").MemoizedFunction; -export declare const timePeriodBeforeDate: (date: Date, timePeriod: string) => Date; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/is_task_not_found_error.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/is_task_not_found_error.d.ts deleted file mode 100644 index 3340bb5544ff0..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/is_task_not_found_error.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function isTaskSavedObjectNotFoundError(err: Error, taskId: string): boolean; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/log_health_metrics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/log_health_metrics.d.ts deleted file mode 100644 index 7bcce0608c2f5..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/log_health_metrics.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger, DocLinksServiceSetup } from '@kbn/core/server'; -import type { TaskManagerConfig } from '../config'; -import type { MonitoredHealth } from '../routes/health'; -export declare function resetLastLogLevel(): void; -export declare function setupIntervalLogging(monitoredHealth$: Observable, logger: Logger, minutes: number): void; -export declare function logHealthMetrics(monitoredHealth: MonitoredHealth, logger: Logger, config: TaskManagerConfig, shouldRunTasks: boolean, docLinks: DocLinksServiceSetup): void; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/middleware.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/middleware.d.ts deleted file mode 100644 index f9b845d414b3e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/middleware.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { RunContext, TaskInstance } from '../task'; -type Mapper = (params: T) => Promise; -interface BeforeSaveContext { - taskInstance: TaskInstance; -} -export type BeforeRunContext = Omit; -export type BeforeSaveContextFunction = Mapper; -export type BeforeRunContextFunction = Mapper; -export interface Middleware { - beforeSave: BeforeSaveContextFunction; - beforeRun: BeforeRunContextFunction; - beforeMarkRunning: BeforeRunContextFunction; -} -export declare function addMiddlewareToChain(prev: Middleware, next: Partial): { - beforeSave: BeforeSaveContextFunction; - beforeRun: BeforeRunContextFunction; - beforeMarkRunning: BeforeRunContextFunction; -}; -export declare function createInitialMiddleware(): Middleware; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/millis_to_nanos.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/millis_to_nanos.d.ts deleted file mode 100644 index 784b3115a9487..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/millis_to_nanos.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function millisToNanos(millis: number): string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/remove_if_exists.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/remove_if_exists.d.ts deleted file mode 100644 index 183295ad24296..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/remove_if_exists.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { TaskStore } from '../task_store'; -/** - * Removes a task from the store, ignoring a not found error - * Other errors are re-thrown - * - * @param taskStore - * @param taskId - */ -export declare function removeIfExists(taskStore: TaskStore, taskId: string): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/result_type.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/result_type.d.ts deleted file mode 100644 index 6ef6d38f653c2..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/result_type.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface Ok { - tag: 'ok'; - value: T; -} -export interface Err { - tag: 'err'; - error: E; -} -export type Result = Ok | Err; -export declare function asOk(value: T): Ok; -export declare function asErr(error: T): Err; -export declare function isOk(result: Result): result is Ok; -export declare function isErr(result: Result): result is Err; -export declare function tryAsResult(fn: () => T): Result; -export declare function promiseResult(future: Promise): Promise>; -export declare function unwrapPromise(future: Promise>): Promise; -export declare function unwrap(result: Result): T | E; -export declare function either(result: Result, onOk: (value: T) => void, onErr: (error: E) => void): Result; -export declare function eitherAsync(result: Result, onOk: (value: T) => Promise, onErr: (error: E) => Promise): Promise | void>; -export declare function map(result: Result, onOk: (value: T) => Resolution, onErr: (error: E) => Resolution): Resolution; -export declare const mapR: (...args: any[]) => any; -export declare const mapOk: (...args: any[]) => any; -export declare const mapErr: (...args: any[]) => any; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/retryable_bulk_update.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/retryable_bulk_update.d.ts deleted file mode 100644 index a8ce769f21dba..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/retryable_bulk_update.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ApiKeyOptions, ConcreteTaskInstance } from '../task'; -import type { TaskStore, BulkGetResult } from '../task_store'; -import type { BulkUpdateTaskResult } from '../task_scheduling'; -export declare const MAX_RETRIES = 2; -export interface RetryableBulkUpdateOpts { - taskIds: string[]; - getTasks: (taskIds: string[]) => Promise; - filter: (task: ConcreteTaskInstance) => boolean; - map: (task: ConcreteTaskInstance, i: number, arr: ConcreteTaskInstance[]) => ConcreteTaskInstance; - store: TaskStore; - validate: boolean; - mergeAttributes?: boolean; - options?: ApiKeyOptions; -} -export declare function retryableBulkUpdate({ taskIds, getTasks, filter, map, store, validate, mergeAttributes, options, }: RetryableBulkUpdateOpts): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/runtime_statistics_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/runtime_statistics_aggregator.d.ts deleted file mode 100644 index c452b3b2613e5..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/runtime_statistics_aggregator.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { JsonValue } from '@kbn/utility-types'; -export interface AggregatedStat { - key: string; - value: Stat; -} -export type AggregatedStatProvider = Observable>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/task_partitioner.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/task_partitioner.d.ts deleted file mode 100644 index aeee83ce39813..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/task_partitioner.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Logger } from 'elastic-apm-node'; -import type { KibanaDiscoveryService } from '../kibana_discovery_service'; -export declare const MAX_PARTITIONS = 256; -export declare const CACHE_INTERVAL = 10000; -export interface TaskPartitionerConstructorOpts { - kibanaDiscoveryService: KibanaDiscoveryService; - kibanasPerPartition: number; - podName: string; - logger: Logger; -} -export declare class TaskPartitioner { - private readonly allPartitions; - private readonly podName; - private readonly kibanasPerPartition; - private readonly logger; - private kibanaDiscoveryService; - private podPartitions; - private podPartitionsLastUpdated; - constructor(opts: TaskPartitionerConstructorOpts); - getAllPartitions(): number[]; - getPodName(): string; - getPodPartitions(): number[]; - getPartitions(): Promise; - private getAllPodNames; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/lib/wrapped_logger.d.ts b/x-pack/platform/plugins/shared/task_manager/server/lib/wrapped_logger.d.ts deleted file mode 100644 index 2f1c92df6ab4a..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/lib/wrapped_logger.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -interface WrappedLoggerOpts { - logger: Logger; - tags: string[]; -} -export declare function createWrappedLogger(opts: WrappedLoggerOpts): Logger; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/license_subscriber.d.ts b/x-pack/platform/plugins/shared/task_manager/server/license_subscriber.d.ts deleted file mode 100644 index c09dc3c4a916d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/license_subscriber.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ILicense } from '@kbn/licensing-types'; -import type { Observable } from 'rxjs'; -export declare class LicenseSubscriber { - private subscription; - private licenseState?; - constructor(license: Observable); - private updateState; - getIsSecurityEnabled(): boolean; - cleanup(): void; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/create_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/create_aggregator.d.ts deleted file mode 100644 index 283c84bb6fd8d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/create_aggregator.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { JsonValue } from '@kbn/utility-types'; -import type { Logger } from '@kbn/core/server'; -import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; -import type { TaskManagerConfig } from '../config'; -import type { ITaskMetricsAggregator } from './types'; -import type { TaskLifecycleEvent } from '../polling_lifecycle'; -export interface CreateMetricsAggregatorOpts { - key: string; - config: TaskManagerConfig; - logger?: Logger; - reset$?: Observable; - events$: Observable; - eventFilter: (event: TaskLifecycleEvent) => boolean; - metricsAggregator: ITaskMetricsAggregator; -} -export declare function createAggregator({ key, config, reset$, logger, events$, eventFilter, metricsAggregator, }: CreateMetricsAggregatorOpts): AggregatedStatProvider; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/index.d.ts deleted file mode 100644 index e3bb2f713d4f1..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { TaskManagerConfig } from '../config'; -import type { Metrics } from './metrics_stream'; -import type { TaskPollingLifecycle } from '../polling_lifecycle'; -import type { TaskManagerMetricsCollector } from './task_metrics_collector'; -export type { Metrics } from './metrics_stream'; -interface MetricsStreamOpts { - config: TaskManagerConfig; - logger: Logger; - reset$: Observable; - taskPollingLifecycle?: TaskPollingLifecycle; - taskManagerMetricsCollector?: TaskManagerMetricsCollector; -} -export declare function metricsStream({ config, reset$, logger, taskPollingLifecycle, taskManagerMetricsCollector, }: MetricsStreamOpts): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/counter.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/counter.d.ts deleted file mode 100644 index b89c2b63d13b9..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/counter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare class Counter { - private count; - initialCount(): number; - get(): number; - increment(): void; - reset(): void; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/get_task_type_group.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/get_task_type_group.d.ts deleted file mode 100644 index bdc068b150f0d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/get_task_type_group.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getTaskTypeGroup(taskType: string): string | undefined; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/index.d.ts deleted file mode 100644 index 66846113b2cfc..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { Counter } from './counter'; -export { getTaskTypeGroup } from './get_task_type_group'; -export { MetricCounterService } from './metric_counter_service'; -export { type SerializedHistogram, SimpleHistogram } from './simple_histogram'; -export { unflattenObject } from './unflatten_object'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/metric_counter_service.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/metric_counter_service.d.ts deleted file mode 100644 index 9b0437c27c0f5..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/metric_counter_service.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -export declare class MetricCounterService { - private readonly counters; - private readonly keys; - constructor(keys: string[], initialNamespace?: string); - initialMetrics(): T; - reset(): void; - increment(key: string, namespace?: string): void; - collect(): T; - private initializeCountersForNamespace; - private buildCounterKey; - private toJson; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/simple_histogram.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/simple_histogram.d.ts deleted file mode 100644 index da0af7619bffd..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/simple_histogram.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -export interface SerializedHistogram extends JsonObject { - counts: number[]; - values: number[]; -} -export declare class SimpleHistogram { - private maxValue; - private bucketSize; - private histogramBuckets; - private allValues; - constructor(max: number, bucketSize: number); - reset(): void; - record(value: number, increment?: number): void; - get(truncate?: boolean): { - count: number; - value: number; - }[]; - getAllValues(truncate?: boolean): number[]; - serialize(): SerializedHistogram; - private initializeBuckets; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/unflatten_object.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/unflatten_object.d.ts deleted file mode 100644 index 34522720ae025..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/lib/unflatten_object.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -interface GenericObject { - [key: string]: unknown; -} -export declare const unflattenObject: (object: object) => T; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/metrics_stream.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/metrics_stream.d.ts deleted file mode 100644 index 0da485892403f..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/metrics_stream.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { TaskPollingLifecycle } from '../polling_lifecycle'; -import type { TaskManagerConfig } from '../config'; -import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; -import type { TaskClaimMetric } from './task_claim_metrics_aggregator'; -import type { TaskRunMetric } from './task_run_metrics_aggregator'; -import type { TaskOverdueMetric } from './task_overdue_metrics_aggregator'; -import type { TaskManagerMetricsCollector } from './task_metrics_collector'; -export interface Metrics { - last_update: string; - metrics: { - task_claim?: Metric; - task_run?: Metric; - task_overdue?: Metric; - }; -} -export interface Metric { - timestamp: string; - value: T; -} -interface CreateMetricsAggregatorsOpts { - config: TaskManagerConfig; - logger: Logger; - reset$: Observable; - taskPollingLifecycle?: TaskPollingLifecycle; - taskManagerMetricsCollector?: TaskManagerMetricsCollector; -} -export declare function createMetricsAggregators({ config, reset$, logger, taskPollingLifecycle, taskManagerMetricsCollector, }: CreateMetricsAggregatorsOpts): AggregatedStatProvider; -export declare function createMetricsStream(provider$: AggregatedStatProvider): Observable; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_claim_metrics_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_claim_metrics_aggregator.d.ts deleted file mode 100644 index 3b185aa906bf3..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_claim_metrics_aggregator.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -import type { TaskLifecycleEvent } from '../polling_lifecycle'; -import { type SerializedHistogram } from './lib'; -import type { ITaskMetricsAggregator } from './types'; -declare enum TaskClaimKeys { - SUCCESS = "success", - TOTAL = "total", - TOTAL_ERRORS = "total_errors" -} -interface TaskClaimCounts extends JsonObject { - [TaskClaimKeys.SUCCESS]: number; - [TaskClaimKeys.TOTAL]: number; -} -export type TaskClaimMetric = TaskClaimCounts & { - duration: SerializedHistogram; - duration_values: number[]; -}; -export declare class TaskClaimMetricsAggregator implements ITaskMetricsAggregator { - private counter; - private durationHistogram; - initialMetric(): TaskClaimMetric; - collect(): TaskClaimMetric; - reset(): void; - processTaskLifecycleEvent(taskEvent: TaskLifecycleEvent): void; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_metrics_collector.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_metrics_collector.d.ts deleted file mode 100644 index 46376d44537b0..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_metrics_collector.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { AggregationsStringTermsBucketKeys } from '@elastic/elasticsearch/lib/api/types'; -import type { Observable } from 'rxjs'; -import type { TaskStore } from '../task_store'; -import type { ITaskEventEmitter, TaskLifecycleEvent } from '../polling_lifecycle'; -interface ConstructorOpts { - logger: Logger; - store: TaskStore; - pollInterval?: number; - taskTypes: Set; - excludedTypes: Set; -} -export interface TaskManagerMetrics { - numOverdueTasks: { - total: AggregationsStringTermsBucketKeys[]; - [key: string]: AggregationsStringTermsBucketKeys[]; - }; -} -export declare class TaskManagerMetricsCollector implements ITaskEventEmitter { - private store; - private logger; - private readonly pollInterval; - private readonly taskTypes; - private readonly excludedTypes; - private running; - private metrics$; - constructor({ logger, store, pollInterval, taskTypes, excludedTypes }: ConstructorOpts); - get events(): Observable; - private start; - private runCollectionCycle; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_overdue_metrics_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_overdue_metrics_aggregator.d.ts deleted file mode 100644 index eca07c51d7705..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_overdue_metrics_aggregator.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -import type { TaskLifecycleEvent } from '../polling_lifecycle'; -import { type SerializedHistogram } from './lib'; -import type { ITaskMetricsAggregator } from './types'; -declare const OVERDUE_BY_KEY = "overdue_by"; -declare const OVERDUE_BY_VALUES_KEY = "overdue_by_values"; -declare enum TaskOverdueMetricKeys { - OVERALL = "overall", - BY_TYPE = "by_type" -} -interface TaskOverdueHistogram extends JsonObject { - [OVERDUE_BY_KEY]: SerializedHistogram; - [OVERDUE_BY_VALUES_KEY]: number[]; -} -export interface TaskOverdueMetric extends JsonObject { - [TaskOverdueMetricKeys.OVERALL]: TaskOverdueHistogram; - [TaskOverdueMetricKeys.BY_TYPE]: { - [key: string]: TaskOverdueHistogram; - }; -} -export declare class TaskOverdueMetricsAggregator implements ITaskMetricsAggregator { - private histograms; - initialMetric(): TaskOverdueMetric; - collect(): TaskOverdueMetric; - reset(): void; - processTaskLifecycleEvent(taskEvent: TaskLifecycleEvent): void; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_run_metrics_aggregator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/task_run_metrics_aggregator.d.ts deleted file mode 100644 index 50a2803423d9b..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/task_run_metrics_aggregator.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -import type { Logger } from '@kbn/core/server'; -import type { TaskLifecycleEvent } from '../polling_lifecycle'; -import type { SerializedHistogram } from './lib'; -import type { ITaskMetricsAggregator } from './types'; -declare enum TaskRunKeys { - SUCCESS = "success", - NOT_TIMED_OUT = "not_timed_out", - TOTAL = "total", - TOTAL_ERRORS = "total_errors", - RESCHEDULED_FAILURES = "rescheduled_failures", - USER_ERRORS = "user_errors", - FRAMEWORK_ERRORS = "framework_errors" -} -declare enum TaskRunMetricKeys { - OVERALL = "overall", - BY_TYPE = "by_type" -} -interface TaskRunCounts extends JsonObject { - [TaskRunKeys.SUCCESS]: number; - [TaskRunKeys.NOT_TIMED_OUT]: number; - [TaskRunKeys.TOTAL]: number; - [TaskRunKeys.USER_ERRORS]: number; - [TaskRunKeys.FRAMEWORK_ERRORS]: number; - [TaskRunKeys.RESCHEDULED_FAILURES]: number; -} -export interface TaskRunMetrics extends JsonObject { - [TaskRunMetricKeys.OVERALL]: TaskRunCounts; - [TaskRunMetricKeys.BY_TYPE]: { - [key: string]: TaskRunCounts; - }; -} -export interface TaskRunMetric extends JsonObject { - overall: TaskRunMetrics['overall'] & { - delay: SerializedHistogram; - delay_values: number[]; - }; - by_type: TaskRunMetrics['by_type']; -} -export declare class TaskRunMetricsAggregator implements ITaskMetricsAggregator { - private logger; - private counter; - private delayHistogram; - constructor(logger: Logger); - initialMetric(): TaskRunMetric; - collect(): TaskRunMetric; - reset(): void; - processTaskLifecycleEvent(taskEvent: TaskLifecycleEvent): void; - private processTaskRunEvent; - private processTaskManagerStatEvent; - private incrementCounters; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/metrics/types.d.ts b/x-pack/platform/plugins/shared/task_manager/server/metrics/types.d.ts deleted file mode 100644 index ea133fba019a1..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/metrics/types.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { TaskLifecycleEvent } from '../polling_lifecycle'; -export interface ITaskMetricsAggregator { - initialMetric: () => T; - collect: () => T; - reset: () => void; - processTaskLifecycleEvent: (event: TaskLifecycleEvent) => void; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/background_task_utilization_statistics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/background_task_utilization_statistics.d.ts deleted file mode 100644 index 119167f321360..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/background_task_utilization_statistics.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -import type { AdHocTaskCounter } from '../lib/adhoc_task_counter'; -import type { TaskPollingLifecycle } from '../polling_lifecycle'; -import type { MonitoredStat } from './monitoring_stats_stream'; -import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; -export interface PublicBackgroundTaskUtilizationStat extends JsonObject { - load: number; -} -export interface BackgroundTaskUtilizationStat extends PublicBackgroundTaskUtilizationStat { - adhoc: AdhocTaskStat; - recurring: TaskStat; -} -interface TaskStat extends JsonObject { - ran: { - service_time: { - actual: number; - adjusted: number; - task_counter: number; - }; - }; -} -interface AdhocTaskStat extends TaskStat { - created: { - counter: number; - }; -} -export declare function createBackgroundTaskUtilizationAggregator(taskPollingLifecycle: TaskPollingLifecycle, adHocTaskCounter: AdHocTaskCounter, pollInterval: number, workerUtilizationRunningAverageWindowSize?: number): AggregatedStatProvider; -interface SummarizeUtilizationStatsOpts { - lastUpdate: string; - monitoredStats: MonitoredStat | undefined; - isInternal: boolean; -} -interface SummarizeUtilizationStatsResult { - last_update: string; - stats: MonitoredStat | MonitoredStat | null; -} -export declare function summarizeUtilizationStats({ lastUpdate, monitoredStats, isInternal, }: SummarizeUtilizationStatsOpts): SummarizeUtilizationStatsResult; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.d.ts deleted file mode 100644 index 3267d5275dec2..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -import type { Logger } from '@kbn/core/server'; -import type { RawMonitoringStats, RawMonitoredStat } from './monitoring_stats_stream'; -export interface CapacityEstimationStat extends JsonObject { - observed: { - observed_kibana_instances: number; - max_throughput_per_minute: number; - max_throughput_per_minute_per_kibana: number; - minutes_to_drain_overdue: number; - avg_required_throughput_per_minute: number; - avg_required_throughput_per_minute_per_kibana: number; - avg_recurring_required_throughput_per_minute: number; - avg_recurring_required_throughput_per_minute_per_kibana: number; - }; - proposed: { - provisioned_kibana: number; - min_required_kibana: number; - avg_recurring_required_throughput_per_minute_per_kibana: number; - avg_required_throughput_per_minute_per_kibana: number; - }; -} -export type CapacityEstimationParams = Omit, 'capacity_estimation'>; -export declare function estimateCapacity(logger: Logger, capacityStats: CapacityEstimationParams, assumedKibanaInstances: number): RawMonitoredStat; -export declare function withCapacityEstimate(logger: Logger, monitoredStats: RawMonitoringStats['stats'], assumedKibanaInstances: number): RawMonitoringStats['stats']; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/configuration_statistics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/configuration_statistics.d.ts deleted file mode 100644 index 03b248afcea6b..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/configuration_statistics.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; -import type { TaskManagerConfig } from '../config'; -import type { TaskPollingLifecycle } from '../polling_lifecycle'; -declare const CONFIG_FIELDS_TO_EXPOSE: readonly ["request_capacity", "monitored_aggregated_stats_refresh_rate", "monitored_stats_running_average_window", "monitored_task_execution_thresholds"]; -interface CapacityConfig extends JsonObject { - capacity: { - config: number; - as_workers: number; - as_cost: number; - }; -} -export type ConfigStat = Pick & CapacityConfig; -export declare function createConfigurationAggregator(config: TaskManagerConfig, startingCapacity: number, taskPollingLifecycle?: TaskPollingLifecycle): AggregatedStatProvider; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/index.d.ts deleted file mode 100644 index aaf0b44f03e37..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { Observable } from 'rxjs'; -import type { TaskManagerConfig } from '../config'; -import type { MonitoringStats } from './monitoring_stats_stream'; -import type { TaskStore } from '../task_store'; -import type { TaskPollingLifecycle } from '../polling_lifecycle'; -import type { AdHocTaskCounter } from '../lib/adhoc_task_counter'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -export type { MonitoringStats, RawMonitoringStats } from './monitoring_stats_stream'; -export { HealthStatus, summarizeMonitoringStats, createAggregators, createMonitoringStatsStream, } from './monitoring_stats_stream'; -export interface CreateMonitoringStatsOpts { - taskStore: TaskStore; - elasticsearchAndSOAvailability$: Observable; - config: TaskManagerConfig; - logger: Logger; - adHocTaskCounter: AdHocTaskCounter; - taskDefinitions: TaskTypeDictionary; - startingCapacity: number; - taskPollingLifecycle?: TaskPollingLifecycle; -} -export declare function createMonitoringStats(opts: CreateMonitoringStatsOpts): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/monitoring_stats_stream.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/monitoring_stats_stream.d.ts deleted file mode 100644 index f96e44e89c0db..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/monitoring_stats_stream.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { JsonObject } from '@kbn/utility-types'; -import type { SummarizedWorkloadStat, WorkloadStat } from './workload_statistics'; -import type { TaskRunStat, SummarizedTaskRunStat } from './task_run_statistics'; -import type { BackgroundTaskUtilizationStat } from './background_task_utilization_statistics'; -import type { ConfigStat } from './configuration_statistics'; -import type { TaskManagerConfig } from '../config'; -import type { CapacityEstimationStat } from './capacity_estimation'; -import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; -import type { CreateMonitoringStatsOpts } from '.'; -export interface MonitoringStats { - last_update: string; - stats: { - configuration?: MonitoredStat; - workload?: MonitoredStat; - runtime?: MonitoredStat; - utilization?: MonitoredStat; - }; -} -export declare enum HealthStatus { - Uninitialized = "uninitialized", - OK = "OK", - Warning = "warn", - Error = "error" -} -export interface MonitoredStat { - timestamp: string; - value: T; -} -export type RawMonitoredStat = MonitoredStat & { - status: HealthStatus; - reason?: string; -}; -export interface RawMonitoringStats { - last_update: string; - stats: { - configuration?: RawMonitoredStat; - workload?: RawMonitoredStat; - runtime?: RawMonitoredStat; - capacity_estimation?: RawMonitoredStat; - }; -} -export declare function createAggregators({ taskStore, elasticsearchAndSOAvailability$, config, logger, taskDefinitions, adHocTaskCounter, startingCapacity, taskPollingLifecycle, }: CreateMonitoringStatsOpts): AggregatedStatProvider; -export declare function createMonitoringStatsStream(provider$: AggregatedStatProvider): Observable; -export declare function summarizeMonitoringStats(logger: Logger, { last_update, stats: { runtime, workload, configuration, utilization } }: MonitoringStats, config: TaskManagerConfig, assumedKibanaInstances: number): RawMonitoringStats; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_calculators.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_calculators.d.ts deleted file mode 100644 index 76d898544d827..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_calculators.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { JsonObject } from '@kbn/utility-types'; -export interface AveragedStat extends JsonObject { - p50: number; - p90: number; - p95: number; - p99: number; -} -export declare function calculateRunningAverage(values: number[]): AveragedStat; -/** - * Calculate the frequency of each term in a list of terms. - * @param values - */ -export declare function calculateFrequency(values: T[]): JsonObject; -/** - * Utility to keep track of a bounded array of values which changes over time - * dropping older values as they slide out of the window we wish to track - */ -export declare function createRunningAveragedStat(runningAverageWindowSize: number): (value?: T) => T[]; -export declare function createMapOfRunningAveragedStats(runningAverageWindowSize: number): (key?: string, value?: T) => { - [x: string]: T[]; -}; -export declare function filterOutliers(values: number[]): number[]; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_statistics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_statistics.d.ts deleted file mode 100644 index d8556f8088831..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/task_run_statistics.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type { JsonObject, JsonValue } from '@kbn/utility-types'; -import type { Logger } from '@kbn/core/server'; -import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; -import { TaskPersistence } from '../task_events'; -import { TaskRunResult } from '../task_running'; -import { FillPoolResult } from '../lib/fill_pool'; -import type { AveragedStat } from './task_run_calculators'; -import { HealthStatus } from './monitoring_stats_stream'; -import type { TaskPollingLifecycle } from '../polling_lifecycle'; -import type { TaskManagerConfig } from '../config'; -interface FillPoolStat extends JsonObject { - duration: number[]; - claim_duration: number[]; - claim_conflicts: number[]; - claim_mismatches: number[]; - claim_stale_tasks: number[]; - result_frequency_percent_as_number: FillPoolResult[]; - persistence: TaskPersistence[]; -} -interface OptionalFillPoolStat extends JsonObject { - last_successful_poll: string; - last_polling_delay: string; -} -interface ExecutionStat extends JsonObject { - duration: Record; - duration_by_persistence: Record; - result_frequency_percent_as_number: Record; - persistence: TaskPersistence[]; -} -export interface TaskRunStat extends JsonObject { - drift: number[]; - drift_by_type: Record; - load: number[]; - execution: ExecutionStat; - polling: FillPoolStat & Partial; -} -interface FillPoolRawStat extends JsonObject { - last_successful_poll: string; - last_polling_delay: string; - result_frequency_percent_as_number: { - [FillPoolResult.Failed]: number; - [FillPoolResult.NoAvailableWorkers]: number; - [FillPoolResult.NoTasksClaimed]: number; - [FillPoolResult.RanOutOfCapacity]: number; - [FillPoolResult.RunningAtCapacity]: number; - [FillPoolResult.PoolFilled]: number; - }; - persistence: TaskPersistenceTypes; -} -interface ResultFrequency extends JsonObject { - [TaskRunResult.Success]: number; - [TaskRunResult.SuccessRescheduled]: number; - [TaskRunResult.RetryScheduled]: number; - [TaskRunResult.Failed]: number; -} -export interface TaskPersistenceTypes extends JsonObject { - [TaskPersistence.Recurring]: T; - [TaskPersistence.NonRecurring]: T; -} -type ResultFrequencySummary = ResultFrequency & { - status: HealthStatus; -}; -export interface SummarizedTaskRunStat extends JsonObject { - drift: AveragedStat; - drift_by_type: { - [alertType: string]: AveragedStat; - }; - load: AveragedStat; - execution: { - duration: Record; - duration_by_persistence: Record; - result_frequency_percent_as_number: Record; - persistence: TaskPersistenceTypes; - }; - polling: FillPoolRawStat | Omit; -} -export declare function createTaskRunAggregator(taskPollingLifecycle: TaskPollingLifecycle, runningAverageWindowSize: number): AggregatedStatProvider; -export declare function summarizeTaskRunStat(logger: Logger, { polling: { last_successful_poll, last_polling_delay, duration: pollingDuration, claim_duration, result_frequency_percent_as_number: pollingResultFrequency, claim_conflicts: claimConflicts, claim_mismatches: claimMismatches, claim_stale_tasks: claimStaleTasks, persistence: pollingPersistence, }, drift, drift_by_type, load, execution: { duration, duration_by_persistence: durationByPersistence, persistence, result_frequency_percent_as_number: executionResultFrequency, }, }: TaskRunStat, config: TaskManagerConfig): { - value: SummarizedTaskRunStat; - status: HealthStatus; -}; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.d.ts deleted file mode 100644 index 1a61b58644300..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.d.ts +++ /dev/null @@ -1,202 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { JsonObject } from '@kbn/utility-types'; -import type { estypes } from '@elastic/elasticsearch'; -import type { AggregationResultOf } from '@kbn/es-types'; -import type { AggregatedStatProvider } from '../lib/runtime_statistics_aggregator'; -import { HealthStatus } from './monitoring_stats_stream'; -import type { TaskStore } from '../task_store'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -interface StatusStat extends JsonObject { - [status: string]: number; -} -interface TaskTypeStat extends JsonObject { - [taskType: string]: { - count: number; - cost: number; - status: StatusStat; - }; -} -interface RawWorkloadStat extends JsonObject { - count: number; - cost: number; - task_types: TaskTypeStat; - schedule: Array<[string, number]>; - non_recurring: number; - non_recurring_cost: number; - overdue: number; - overdue_cost: number; - overdue_non_recurring: number; - estimated_schedule_density: number[]; - capacity_requirements: CapacityRequirements; -} -export type WorkloadStat = RawWorkloadStat; -export type SummarizedWorkloadStat = RawWorkloadStat; -export interface CapacityRequirements extends JsonObject { - per_minute: number; - per_hour: number; - per_day: number; -} -export interface WorkloadAggregation { - aggs: { - taskType: { - terms: { - field: string; - }; - aggs: { - status: { - terms: { - field: string; - }; - }; - }; - }; - schedule: { - terms: { - field: string; - size: number; - }; - }; - idleTasks: { - filter: { - term: { - 'task.status': string; - }; - }; - aggs: { - scheduleDensity: { - range: { - field: string; - ranges: [{ - from: string; - to: string; - }]; - }; - aggs: { - histogram: { - date_histogram: { - field: string; - fixed_interval: string; - }; - aggs: { - interval: { - terms: { - field: string; - }; - }; - }; - }; - }; - }; - overdue: { - filter: { - range: { - 'task.runAt': { - lt: string; - }; - }; - }; - }; - }; - }; - }; -} -type ScheduleDensityResult = AggregationResultOf['buckets'][0]; -export interface CreateWorkloadAggregatorOpts { - taskStore: TaskStore; - elasticsearchAndSOAvailability$: Observable; - refreshInterval: number; - pollInterval: number; - logger: Logger; - taskDefinitions: TaskTypeDictionary; -} -export declare function createWorkloadAggregator({ taskStore, elasticsearchAndSOAvailability$, refreshInterval, pollInterval, logger, taskDefinitions, }: CreateWorkloadAggregatorOpts): AggregatedStatProvider; -interface IntervalTaskCountTouple { - nonRecurring?: number; - recurring?: Array<[number, string]>; - key: number; -} -export declare function padBuckets(scheduleDensityBuckets: number, pollInterval: number, scheduleDensity: ScheduleDensityResult): number[]; -export declare function estimateRecurringTaskScheduling(scheduleDensity: IntervalTaskCountTouple[], pollInterval: number): number[]; -export declare function summarizeWorkloadStat(workloadStats: WorkloadStat): { - value: SummarizedWorkloadStat; - status: HealthStatus; -}; -export interface WorkloadAggregationResponse { - taskType: TaskTypeAggregation; - schedule: ScheduleAggregation; - idleTasks: IdleTasksAggregation; - nonRecurringTasks: { - doc_count: number; - taskType: TaskTypeAggregation; - }; - [otherAggs: string]: estypes.AggregationsAggregate; -} -export type TaskTypeWithStatusBucket = TaskTypeBucket & { - status: { - buckets: Array<{ - doc_count: number; - key: string | number; - }>; - doc_count_error_upper_bound?: number | undefined; - sum_other_doc_count?: number | undefined; - }; -}; -export interface TaskTypeBucket { - doc_count: number; - key: string | number; -} -export interface TaskTypeAggregation extends estypes.AggregationsFiltersAggregate { - buckets: Array; - doc_count_error_upper_bound?: number | undefined; - sum_other_doc_count?: number | undefined; -} -export interface ScheduleAggregation extends estypes.AggregationsFiltersAggregate { - buckets: Array<{ - doc_count: number; - key: string; - }>; - doc_count_error_upper_bound?: number | undefined; - sum_other_doc_count?: number | undefined; -} -export type ScheduleDensityHistogram = DateRangeBucket & { - histogram: { - buckets: Array; - doc_count_error_upper_bound?: number | undefined; - sum_other_doc_count?: number | undefined; - }; - }>; - }; -}; -export interface IdleTasksAggregation extends estypes.AggregationsFiltersAggregate { - doc_count: number; - scheduleDensity: { - buckets: ScheduleDensityHistogram[]; - }; - overdue: { - doc_count: number; - nonRecurring: { - doc_count: number; - }; - taskTypes: TaskTypeAggregation; - }; -} -interface DateHistogramBucket { - doc_count: number; - key: number; - key_as_string: string; -} -interface DateRangeBucket { - key: string; - to?: number; - from?: number; - to_as_string?: string; - from_as_string?: string; - doc_count: number; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/plugin.d.ts b/x-pack/platform/plugins/shared/task_manager/server/plugin.d.ts deleted file mode 100644 index 5fed518e1843e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/plugin.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { UsageCollectionSetup, UsageCollectionStart } from '@kbn/usage-collection-plugin/server'; -import type { PluginInitializerContext, Plugin, CoreSetup, CoreStart } from '@kbn/core/server'; -import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/server'; -import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; -import type { LicensingPluginStart } from '@kbn/licensing-plugin/server'; -import type { Middleware } from './lib/middleware'; -import type { TaskDefinitionRegistry } from './task_type_dictionary'; -import { TaskStore } from './task_store'; -import { TaskScheduling } from './task_scheduling'; -import type { TaskEventLogger } from './task'; -import type { ApiKeyInvalidationFn, UiamApiKeyInvalidationFn } from './invalidate_api_keys/invalidate_api_keys_task'; -export interface TaskManagerSetupContract { - /** - * @deprecated - */ - index: string; - addMiddleware: (middleware: Middleware) => void; - /** - * Method for allowing consumers to register task definitions into the system. - * @param taskDefinitions - The Kibana task definitions dictionary - */ - registerTaskDefinitions: (taskDefinitions: TaskDefinitionRegistry) => void; - registerCanEncryptedSavedObjects: (canEncrypt: boolean) => void; - registerTaskEventLogger: (logger: TaskEventLogger) => void; -} -export type TaskManagerStartContract = Pick & Pick & { - removeIfExists: TaskStore['remove']; -} & { - getRegisteredTypes: () => string[]; - registerEncryptedSavedObjectsClient: (client: EncryptedSavedObjectsClient) => void; - registerApiKeyInvalidateFn: (fn?: ApiKeyInvalidationFn) => void; - registerUiamApiKeyInvalidateFn: (fn?: UiamApiKeyInvalidationFn) => void; -}; -export interface TaskManagerPluginsStart { - licensing: LicensingPluginStart; - cloud?: CloudStart; - usageCollection?: UsageCollectionStart; -} -export interface TaskManagerPluginsSetup { - cloud?: CloudSetup; - usageCollection?: UsageCollectionSetup; -} -export declare class TaskManagerPlugin implements Plugin { - private readonly initContext; - private taskPollingLifecycle?; - private taskManagerId?; - private usageCounter?; - private config; - private logger; - private definitions; - private middleware; - private elasticsearchAndSOAvailability$?; - private monitoringStats$; - private metrics$; - private resetMetrics$; - private shouldRunBackgroundTasks; - private readonly kibanaVersion; - private adHocTaskCounter; - private taskManagerMetricsCollector?; - private nodeRoles; - private kibanaDiscoveryService?; - private heapSizeLimit; - private numOfKibanaInstances$; - private canEncryptSavedObjects; - private licenseSubscriber?; - private invalidateApiKeyFn?; - private taskEventLogger?; - private invalidateUiamApiKeyFn?; - private taskStore?; - private startContract?; - private uiamApiKeyProvisioningTask?; - constructor(initContext: PluginInitializerContext); - isNodeBackgroundTasksOnly(): boolean; - private invalidateApiKey; - private get invalidateUiamApiKey(); - setup(core: CoreSetup, plugins: TaskManagerPluginsSetup): TaskManagerSetupContract; - start(core: CoreStart, { cloud, licensing }: TaskManagerPluginsStart): TaskManagerStartContract; - stop(): Promise; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/polling/delay_on_claim_conflicts.d.ts b/x-pack/platform/plugins/shared/task_manager/server/polling/delay_on_claim_conflicts.d.ts deleted file mode 100644 index a47b0f35a140e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/polling/delay_on_claim_conflicts.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { TaskLifecycleEvent } from '../polling_lifecycle'; -/** - * Emits a delay amount in ms to apply to polling whenever the task store exceeds a threshold of claim claimClashes - */ -export declare function delayOnClaimConflicts(capacityConfiguration$: Observable, pollIntervalConfiguration$: Observable, taskLifecycleEvents$: Observable, claimClashesPercentageThreshold: number, runningAverageWindowSize: number): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/polling/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/polling/index.d.ts deleted file mode 100644 index 08014d3f68933..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/polling/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { createTaskPoller, PollingError, PollingErrorType } from './task_poller'; -export { delayOnClaimConflicts } from './delay_on_claim_conflicts'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/polling/task_poller.d.ts b/x-pack/platform/plugins/shared/task_manager/server/polling/task_poller.d.ts deleted file mode 100644 index 130d86395cd21..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/polling/task_poller.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Option } from 'fp-ts/Option'; -import type { Logger } from '@kbn/core/server'; -import { TaskErrorSource } from '../task_running'; -import type { Result } from '../lib/result_type'; -type WorkFn = () => Promise; -interface Opts { - logger: Logger; - initialPollInterval: number; - pollInterval$: Observable; - pollIntervalDelay$?: Observable; - getCapacity: () => number; - work: WorkFn; -} -export interface TaskPoller { - start: () => void; - stop: () => void; - events$: Observable>>; -} -/** - * constructs a new TaskPoller stream, which emits events on demand and on a scheduled interval, waiting for capacity to be available before emitting more events. - * - * @param opts - * @prop {number} pollInterval - How often, in milliseconds, we will an event be emnitted, assuming there's capacity to do so - * @prop {() => number} getCapacity - A function specifying whether there is capacity to emit new events - * @prop {() => Promise} work - The worker we wish to execute in order to `poll` - * - * @returns {Observable>} - An observable which emits an event whenever a polling event is due to take place, providing access to a singleton Set representing a queue - * of unique request argumets of type T. - */ -export declare function createTaskPoller({ logger, initialPollInterval, pollInterval$, pollIntervalDelay$, getCapacity, work, }: Opts): TaskPoller; -export declare enum PollingErrorType { - WorkError = 0, - WorkTimeout = 1, - RequestCapacityReached = 2, - PollerError = 3 -} -export declare class PollingError extends Error { - readonly type: PollingErrorType; - readonly data: Option; - readonly source: TaskErrorSource; - constructor(message: string, type: PollingErrorType, data: Option, cause?: Error); -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/polling_lifecycle.d.ts b/x-pack/platform/plugins/shared/task_manager/server/polling_lifecycle.d.ts deleted file mode 100644 index b9bee8528e408..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/polling_lifecycle.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; -import type { Logger, ExecutionContextStart, IBasePath } from '@kbn/core/server'; -import type { Result } from './lib/result_type'; -import type { TaskManagerConfig } from './config'; -import type { TaskMarkRunning, TaskRun, TaskClaim, TaskRunRequest, TaskPollingCycle, TaskManagerStat, TaskManagerMetric } from './task_events'; -import { FillPoolResult } from './lib/fill_pool'; -import type { Middleware } from './lib/middleware'; -import type { TaskEventLogger } from './task'; -import { TaskPool } from './task_pool'; -import type { TaskStore } from './task_store'; -import type { ApiKeyStrategy } from './api_key_strategy'; -import type { TaskTypeDictionary } from './task_type_dictionary'; -import { TaskClaiming } from './queries/task_claiming'; -import type { ClaimOwnershipResult } from './task_claimers'; -import type { TaskPartitioner } from './lib/task_partitioner'; -export interface ITaskEventEmitter { - get events(): Observable; -} -export interface TaskPollingLifecycleOpts { - basePathService: IBasePath; - logger: Logger; - definitions: TaskTypeDictionary; - taskStore: TaskStore; - config: TaskManagerConfig; - middleware: Middleware; - elasticsearchAndSOAvailability$: Observable; - executionContext: ExecutionContextStart; - usageCounter?: UsageCounter; - taskPartitioner: TaskPartitioner; - startingCapacity: number; - apiKeyStrategy: ApiKeyStrategy; - eventLogger: TaskEventLogger; -} -export type TaskLifecycleEvent = TaskMarkRunning | TaskRun | TaskClaim | TaskRunRequest | TaskPollingCycle | TaskManagerStat | TaskManagerMetric; -/** - * The public interface into the task manager system. - */ -export declare class TaskPollingLifecycle implements ITaskEventEmitter { - private definitions; - private store; - private taskClaiming; - private bufferedStore; - private readonly basePathService; - private readonly executionContext; - private logger; - private poller; - private started; - pool: TaskPool; - capacityConfiguration$: Observable; - pollIntervalConfiguration$: Observable; - private events$; - private middleware; - private usageCounter?; - private config; - private currentPollInterval; - private apiKeyStrategy; - private currentTmUtilization$; - private eventLogger; - /** - * Initializes the task manager, preventing any further addition of middleware, - * enabling the task manipulation methods, and beginning the background polling - * mechanism. - */ - constructor({ basePathService, logger, middleware, config, elasticsearchAndSOAvailability$, taskStore, definitions, executionContext, usageCounter, taskPartitioner, startingCapacity, apiKeyStrategy, eventLogger, }: TaskPollingLifecycleOpts); - get events(): Observable; - stop(): void; - getCurrentTasksInPool(): string[]; - private emitEvent; - private createTaskRunnerForTask; - private pollForWork; - private subscribeToPoller; -} -export declare function claimAvailableTasks(taskClaiming: TaskClaiming, logger: Logger): Promise>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.d.ts deleted file mode 100644 index f3610d04d6703..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AggregationsAggregationContainer, QueryDslQueryContainer, MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/types'; -export declare function aggregateTaskOverduePercentilesForType(type: string): { - aggs: Record; - query: QueryDslQueryContainer; - runtime_mappings: MappingRuntimeFields; -}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/mark_available_tasks_as_claimed.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/mark_available_tasks_as_claimed.d.ts deleted file mode 100644 index 4f0971e812469..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/queries/mark_available_tasks_as_claimed.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -import type { ConcreteTaskInstance } from '../task'; -import type { ScriptClause, MustCondition, MustNotCondition } from './query_clauses'; -export declare function tasksOfType(taskTypes: string[]): estypes.QueryDslQueryContainer; -export declare function tasksClaimedByOwner(taskManagerId: string, ...taskFilters: estypes.QueryDslQueryContainer[]): { - bool: { - must: estypes.QueryDslQueryContainer[]; - }; -}; -export declare const IdleTaskWithExpiredRunAt: MustCondition; -export declare const InactiveTasks: MustNotCondition; -export declare const EnabledTask: MustCondition; -export declare const RecognizedTask: MustNotCondition; -export declare const RunningOrClaimingTaskWithExpiredRetryAt: MustCondition; -export declare const SortByRunAtAndRetryAt: estypes.SortCombinations; -export declare function getClaimSort(definitions: TaskTypeDictionary): estypes.SortCombinations[]; -export declare function claimSort(definitions: TaskTypeDictionary, tasks: ConcreteTaskInstance[]): ConcreteTaskInstance[]; -export interface UpdateFieldsAndMarkAsFailedOpts { - fieldUpdates: { - [field: string]: string | number | Date; - }; - claimableTaskTypes: string[]; - skippedTaskTypes: string[]; - taskMaxAttempts: { - [field: string]: number; - }; -} -export declare const updateFieldsAndMarkAsFailed: ({ fieldUpdates, claimableTaskTypes, skippedTaskTypes, taskMaxAttempts, }: UpdateFieldsAndMarkAsFailedOpts) => ScriptClause; -export declare const OneOfTaskTypes: (field: string, types: string[]) => MustCondition; -export declare function tasksWithPartitions(partitions: number[]): estypes.QueryDslQueryContainer; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/oldest_idle_action_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/oldest_idle_action_task.d.ts deleted file mode 100644 index 0aea298ee9791..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/queries/oldest_idle_action_task.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ElasticsearchClient } from '@kbn/core/server'; -/** - * Returns the millisecond timestamp of the oldest action task that may still be executed (with a 24 hour delay). - * Useful for cleaning up related objects that may no longer be needed. - * @internal - */ -export declare const getOldestIdleActionTask: (client: Pick, taskManagerIndex: string) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/query_clauses.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/query_clauses.d.ts deleted file mode 100644 index ef547891b51aa..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/queries/query_clauses.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -export interface MustCondition { - bool: Pick; -} -export interface MustNotCondition { - bool: Pick; -} -export interface ScriptBasedSortClause { - _script: { - type: string; - order: string; - script: ScriptClause; - }; -} -export interface ScriptClause { - source: string; - lang: estypes.ScriptLanguage; - params?: { - [field: string]: string | number | Date | string[] | { - [field: string]: string | number | Date; - }; - }; -} -export type PinnedQuery = Pick, 'pinned'>; -type BoolClause = Pick, 'bool'>; -export declare function matchesClauses(...clauses: Array): BoolClause; -export declare function shouldBeOneOf(...should: estypes.QueryDslQueryContainer[]): { - bool: { - should: estypes.QueryDslQueryContainer[]; - }; -}; -export declare function mustBeAllOf(...must: estypes.QueryDslQueryContainer[]): { - bool: { - must: estypes.QueryDslQueryContainer[]; - }; -}; -export declare function filterDownBy(...filter: estypes.QueryDslQueryContainer[]): { - bool: { - filter: estypes.QueryDslQueryContainer[]; - }; -}; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/queries/task_claiming.d.ts b/x-pack/platform/plugins/shared/task_manager/server/queries/task_claiming.d.ts deleted file mode 100644 index 5e7d904bff785..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/queries/task_claiming.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import type { Observable } from 'rxjs'; -import { Subject } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { Result } from '../lib/result_type'; -import type { ConcreteTaskInstance } from '../task'; -import type { TaskClaim } from '../task_events'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -import type { TaskStore, UpdateByQueryResult } from '../task_store'; -import { FillPoolResult } from '../lib/fill_pool'; -import type { ClaimOwnershipResult } from '../task_claimers'; -import type { TaskPartitioner } from '../lib/task_partitioner'; -export type { ClaimOwnershipResult } from '../task_claimers'; -export interface TaskClaimingOpts { - logger: Logger; - strategy: string; - definitions: TaskTypeDictionary; - taskStore: TaskStore; - maxAttempts: number; - excludedTaskTypes: string[]; - getAvailableCapacity: (taskType?: string) => number; - taskPartitioner: TaskPartitioner; -} -export interface OwnershipClaimingOpts { - claimOwnershipUntil: Date; - size: number; - taskTypes: Set; -} -export type IncrementalOwnershipClaimingOpts = OwnershipClaimingOpts & { - precedingQueryResult: UpdateByQueryResult; -}; -export type IncrementalOwnershipClaimingReduction = (opts: IncrementalOwnershipClaimingOpts) => Promise; -export interface FetchResult { - docs: ConcreteTaskInstance[]; -} -export declare function isClaimOwnershipResult(result: unknown): result is ClaimOwnershipResult; -export declare enum BatchConcurrency { - Unlimited = 0, - Limited = 1 -} -export type TaskClaimingBatches = Array; -export interface TaskClaimingBatch { - concurrency: Concurrency; - tasksTypes: TaskType; -} -export type UnlimitedBatch = TaskClaimingBatch>; -export type LimitedBatch = TaskClaimingBatch; -export declare const TASK_MANAGER_MARK_AS_CLAIMED = "mark-available-tasks-as-claimed"; -export declare class TaskClaiming { - readonly errors$: Subject; - readonly maxAttempts: number; - private definitions; - private events$; - private taskStore; - private getAvailableCapacity; - private logger; - private readonly taskClaimingBatchesByType; - private readonly taskMaxAttempts; - private readonly excludedTaskTypes; - private readonly taskClaimer; - private readonly taskPartitioner; - /** - * Constructs a new TaskStore. - * @param {TaskClaimingOpts} opts - * @prop {number} maxAttempts - The maximum number of attempts before a task will be abandoned - * @prop {TaskDefinition} definition - The definition of the task being run - */ - constructor(opts: TaskClaimingOpts); - private partitionIntoClaimingBatches; - private normalizeMaxAttempts; - private claimingBatchIndex; - private getClaimingBatches; - get events(): Observable; - claimAvailableTasksIfCapacityIsAvailable(claimingOptions: Omit): Promise>; -} -export declare function isLimited(batch: TaskClaimingBatch): batch is LimitedBatch; -export declare function asLimited(tasksType: string): LimitedBatch; -export declare function asUnlimited(tasksTypes: Set): UnlimitedBatch; diff --git a/x-pack/platform/plugins/shared/task_manager/server/removed_tasks/mark_removed_tasks_as_unrecognized.d.ts b/x-pack/platform/plugins/shared/task_manager/server/removed_tasks/mark_removed_tasks_as_unrecognized.d.ts deleted file mode 100644 index 0f614c74331c7..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/removed_tasks/mark_removed_tasks_as_unrecognized.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Logger } from '@kbn/logging'; -import type { CoreStart } from '@kbn/core-lifecycle-server'; -import type { TaskScheduling } from '../task_scheduling'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -import type { TaskManagerStartContract } from '..'; -import type { TaskManagerPluginsStart } from '../plugin'; -export declare const TASK_ID = "mark_removed_tasks_as_unrecognized"; -export declare const SCHEDULE_INTERVAL = "1h"; -export declare function scheduleMarkRemovedTasksAsUnrecognizedDefinition(logger: Logger, taskScheduling: TaskScheduling): Promise; -export declare function registerMarkRemovedTasksAsUnrecognizedDefinition(logger: Logger, coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>, taskTypeDictionary: TaskTypeDictionary): void; -export declare function taskRunner(logger: Logger, coreStartServices: () => Promise<[CoreStart, TaskManagerPluginsStart, TaskManagerStartContract]>): () => { - run(): Promise<{ - state: {}; - schedule: { - interval: string; - }; - }>; -}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/routes/background_task_utilization.d.ts b/x-pack/platform/plugins/shared/task_manager/server/routes/background_task_utilization.d.ts deleted file mode 100644 index e048a1a8862cd..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/routes/background_task_utilization.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { IRouter, Logger } from '@kbn/core/server'; -import type { IClusterClient } from '@kbn/core/server'; -import type { Observable } from 'rxjs'; -import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; -import type { MonitoringStats } from '../monitoring'; -import type { TaskManagerConfig } from '../config'; -import type { BackgroundTaskUtilizationStat, PublicBackgroundTaskUtilizationStat } from '../monitoring/background_task_utilization_statistics'; -import type { MonitoredStat } from '../monitoring/monitoring_stats_stream'; -export interface MonitoredUtilization { - process_uuid: string; - timestamp: string; - last_update: string; - stats: MonitoredStat | MonitoredStat | null; -} -export interface BackgroundTaskUtilRouteParams { - router: IRouter; - monitoringStats$: Observable; - logger: Logger; - taskManagerId: string; - config: TaskManagerConfig; - kibanaVersion: string; - kibanaIndexName: string; - getClusterClient: () => Promise; - usageCounter?: UsageCounter; -} -export declare function backgroundTaskUtilizationRoute(params: BackgroundTaskUtilRouteParams): Observable; diff --git a/x-pack/platform/plugins/shared/task_manager/server/routes/health.d.ts b/x-pack/platform/plugins/shared/task_manager/server/routes/health.d.ts deleted file mode 100644 index 60f8aff9f0a6d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/routes/health.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { IRouter } from '@kbn/core/server'; -import type { IClusterClient, DocLinksServiceSetup } from '@kbn/core/server'; -import type { Observable } from 'rxjs'; -import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; -import type { Logger, ServiceStatus } from '@kbn/core/server'; -import type { MonitoringStats, RawMonitoringStats } from '../monitoring'; -import { HealthStatus } from '../monitoring'; -import type { TaskManagerConfig } from '../config'; -export type MonitoredHealth = RawMonitoringStats & { - id: string; - reason?: string; - status: HealthStatus; - timestamp: string; -}; -/** - * We enforce a `meta` of `never` because this meta gets duplicated into *every dependant plugin*, and - * this will then get logged out when logging is set to Verbose. - * We used to pass in the the entire MonitoredHealth into this `meta` field, but this means that the - * whole MonitoredHealth JSON (which can be quite big) was duplicated dozens of times and when we - * try to view logs in Discover, it fails to render as this JSON was often dozens of levels deep. - */ -type TaskManagerServiceStatus = ServiceStatus; -export interface HealthRouteParams { - router: IRouter; - monitoringStats$: Observable; - logger: Logger; - taskManagerId: string; - config: TaskManagerConfig; - kibanaVersion: string; - kibanaIndexName: string; - shouldRunTasks: boolean; - getClusterClient: () => Promise; - usageCounter?: UsageCounter; - docLinks: DocLinksServiceSetup; - numOfKibanaInstances$: Observable; -} -export declare function healthRoute(params: HealthRouteParams): { - serviceStatus$: Observable; - monitoredHealth$: Observable; -}; -export declare function withServiceStatus(monitoredHealth: MonitoredHealth): [MonitoredHealth, TaskManagerServiceStatus]; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/routes/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/routes/index.d.ts deleted file mode 100644 index a9aa57ded2a55..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/routes/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { healthRoute } from './health'; -export { backgroundTaskUtilizationRoute } from './background_task_utilization'; -export { metricsRoute } from './metrics'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/routes/metrics.d.ts b/x-pack/platform/plugins/shared/task_manager/server/routes/metrics.d.ts deleted file mode 100644 index e4412ad7ac0b6..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/routes/metrics.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { IRouter, Logger } from '@kbn/core/server'; -import type { Observable, Subject } from 'rxjs'; -import type { Metrics } from '../metrics'; -export interface NodeMetrics { - process_uuid: string; - timestamp: string; - last_update: string; - metrics: Metrics['metrics'] | null; -} -export interface MetricsRouteParams { - router: IRouter; - logger: Logger; - metrics$: Observable; - resetMetrics$: Subject; - taskManagerId: string; -} -export declare function metricsRoute(params: MetricsRouteParams): void; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/index.d.ts deleted file mode 100644 index ffa16424e0c64..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SavedObjectsServiceSetup } from '@kbn/core/server'; -export { scheduleRruleSchemaV1, scheduleRruleSchemaV2, scheduleRruleSchemaV3, } from './schemas/rrule'; -export declare const TASK_SO_NAME = "task"; -export declare const BACKGROUND_TASK_NODE_SO_NAME = "background-task-node"; -export declare const INVALIDATE_API_KEY_SO_NAME = "api_key_to_invalidate"; -export declare function setupSavedObjects(savedObjects: SavedObjectsServiceSetup): void; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/mappings.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/mappings.d.ts deleted file mode 100644 index cbb3d168a9ba5..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/mappings.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { SavedObjectsTypeMappingDefinition } from '@kbn/core/server'; -export declare const taskMappings: SavedObjectsTypeMappingDefinition; -export declare const backgroundTaskNodeMapping: SavedObjectsTypeMappingDefinition; -export declare const apiKeyToInvalidateMappings: SavedObjectsTypeMappingDefinition; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/migrations.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/migrations.d.ts deleted file mode 100644 index f36b740932d2c..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/migrations.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObjectMigrationMap } from '@kbn/core/server'; -export declare function getMigrations(): SavedObjectMigrationMap; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/api_key_to_invalidate_model_versions.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/api_key_to_invalidate_model_versions.d.ts deleted file mode 100644 index 1352ebf8f583c..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/api_key_to_invalidate_model_versions.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; -export declare const apiKeyToInvalidateModelVersions: SavedObjectsModelVersionMap; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/background_task_node_model_versions.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/background_task_node_model_versions.d.ts deleted file mode 100644 index 248276a69be4d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/background_task_node_model_versions.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; -export declare const backgroundTaskNodeModelVersions: SavedObjectsModelVersionMap; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/index.d.ts deleted file mode 100644 index 057b09fc7a88b..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { taskModelVersions } from './task_model_versions'; -export { backgroundTaskNodeModelVersions } from './background_task_node_model_versions'; -export { apiKeyToInvalidateModelVersions } from './api_key_to_invalidate_model_versions'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/task_model_versions.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/task_model_versions.d.ts deleted file mode 100644 index ef9e65d4a8323..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/model_versions/task_model_versions.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; -export declare const taskModelVersions: SavedObjectsModelVersionMap; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/api_key_to_invalidate.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/api_key_to_invalidate.d.ts deleted file mode 100644 index 5271179d6112d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/api_key_to_invalidate.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -export declare const apiKeyToInvalidateSchemaV1: import("@kbn/config-schema").ObjectType<{ - apiKeyId: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; -}>; -export declare const apiKeyToInvalidateSchemaV2: import("@kbn/config-schema").ObjectType<{ - apiKeyId: import("@kbn/config-schema").Type; - createdAt: import("@kbn/config-schema").Type; - uiamApiKey: import("@kbn/config-schema").Type; -}>; -export type ApiKeyToInvalidate = TypeOf; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/background_task_node.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/background_task_node.d.ts deleted file mode 100644 index 52d496eb0f39d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/background_task_node.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -export declare const backgroundTaskNodeSchemaV1: import("@kbn/config-schema").ObjectType<{ - id: import("@kbn/config-schema").Type; - last_seen: import("@kbn/config-schema").Type; -}>; -export type BackgroundTaskNode = TypeOf; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/index.d.ts deleted file mode 100644 index 520d91b42865f..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { rruleSchedule as rruleScheduleV1, scheduleRruleSchema as scheduleRruleSchemaV1, } from './v1'; -export { rruleSchedule as rruleScheduleV2, scheduleRruleSchema as scheduleRruleSchemaV2, } from './v2'; -export { rruleSchedule as rruleScheduleV3, scheduleRruleSchema as scheduleRruleSchemaV3, } from './v3'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v1.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v1.d.ts deleted file mode 100644 index e4a3099f9c9ed..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v1.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { Frequency } from '@kbn/rrule'; -export declare function validateTimezone(timezone: string): string | undefined; -export declare const rruleCommon: import("@kbn/config-schema").ObjectType<{ - freq: import("@kbn/config-schema").Type<0 | 2 | 1 | 3 | 5 | 4 | 6>; - interval: import("@kbn/config-schema").Type; - tzid: import("@kbn/config-schema").Type; -}>; -export declare const byminute: import("@kbn/config-schema").Type; -export declare const byhour: import("@kbn/config-schema").Type; -export declare const byweekday: import("@kbn/config-schema").Type; -export declare const bymonthday: import("@kbn/config-schema").Type; -export declare const rruleSchedule: import("@kbn/config-schema").Type | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; -} & { - interval: number; - bymonthday: never; - freq: Frequency.WEEKLY; - tzid: string; -}> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; -} & { - interval: number; - bymonthday: never; - freq: Frequency.DAILY; - tzid: string; -}>>; -export declare const scheduleRruleSchema: import("@kbn/config-schema").ObjectType<{ - rrule: import("@kbn/config-schema").Type | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: Frequency.DAILY; - tzid: string; - }>>; -}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v2.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v2.d.ts deleted file mode 100644 index 9e0ef3c04824a..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v2.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { Frequency } from '@kbn/rrule'; -export declare const rruleCommon: import("@kbn/config-schema").ObjectType; - interval: import("@kbn/config-schema").Type; - tzid: import("@kbn/config-schema").Type; -}, "dtstart"> & { - dtstart: import("@kbn/config-schema").Type; -}>; -export declare const rruleMonthly: import("@kbn/config-schema").ObjectType; - interval: import("@kbn/config-schema").Type; - tzid: import("@kbn/config-schema").Type; -}, "dtstart"> & { - dtstart: import("@kbn/config-schema").Type; -}, "bymonthday" | "byweekday" | "byhour" | "byminute" | "freq"> & { - bymonthday: import("@kbn/config-schema").Type; - byweekday: import("@kbn/config-schema").Type; - byhour: import("@kbn/config-schema").Type; - byminute: import("@kbn/config-schema").Type; - freq: import("@kbn/config-schema").Type; -}>; -export declare const rruleWeekly: import("@kbn/config-schema").ObjectType; - interval: import("@kbn/config-schema").Type; - tzid: import("@kbn/config-schema").Type; -}, "dtstart"> & { - dtstart: import("@kbn/config-schema").Type; -}, "bymonthday" | "byweekday" | "byhour" | "byminute" | "freq"> & { - bymonthday: import("@kbn/config-schema").Type; - byweekday: import("@kbn/config-schema").Type; - byhour: import("@kbn/config-schema").Type; - byminute: import("@kbn/config-schema").Type; - freq: import("@kbn/config-schema").Type; -}>; -export declare const rruleDaily: import("@kbn/config-schema").ObjectType; - interval: import("@kbn/config-schema").Type; - tzid: import("@kbn/config-schema").Type; -}, "dtstart"> & { - dtstart: import("@kbn/config-schema").Type; -}, "bymonthday" | "byweekday" | "byhour" | "byminute" | "freq"> & { - bymonthday: import("@kbn/config-schema").Type; - byweekday: import("@kbn/config-schema").Type; - byhour: import("@kbn/config-schema").Type; - byminute: import("@kbn/config-schema").Type; - freq: import("@kbn/config-schema").Type; -}>; -export declare const rruleSchedule: import("@kbn/config-schema").Type | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; -} & { - interval: number; - bymonthday: never; - freq: Frequency.WEEKLY; - tzid: string; -}> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; -} & { - interval: number; - bymonthday: never; - freq: Frequency.DAILY; - tzid: string; -}>>; -export declare const scheduleRruleSchema: import("@kbn/config-schema").ObjectType<{ - rrule: import("@kbn/config-schema").Type | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: Frequency.DAILY; - tzid: string; - }>>; -}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v3.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v3.d.ts deleted file mode 100644 index 3489287c50d12..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/rrule/v3.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { Frequency } from '@kbn/rrule'; -export declare const rruleSchedule: import("@kbn/config-schema").Type | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; -} & { - interval: number; - bymonthday: never; - freq: Frequency.WEEKLY; - tzid: string; -}> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; -} & { - interval: number; - bymonthday: never; - freq: Frequency.DAILY; - tzid: string; -}> | Readonly<{ - byminute?: number[] | undefined; - dtstart?: string | undefined; -} & { - interval: number; - bymonthday: never; - byweekday: never; - byhour: never; - freq: Frequency.HOURLY; - tzid: string; -}>>; -export declare const scheduleRruleSchema: import("@kbn/config-schema").ObjectType<{ - rrule: import("@kbn/config-schema").Type | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: Frequency.DAILY; - tzid: string; - }> | Readonly<{ - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - byweekday: never; - byhour: never; - freq: Frequency.HOURLY; - tzid: string; - }>>; -}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/task.d.ts deleted file mode 100644 index 37a637b543f4f..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/saved_objects/schemas/task.d.ts +++ /dev/null @@ -1,895 +0,0 @@ -export declare function validateDuration(duration: string): string | undefined; -export declare const taskSchemaV1: import("@kbn/config-schema").ObjectType<{ - taskType: import("@kbn/config-schema").Type; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}>; -export declare const taskSchemaV2: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}>; -export declare const taskSchemaV3: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}, "priority"> & { - priority: import("@kbn/config-schema").Type; -}>; -export declare const scheduleIntervalSchema: import("@kbn/config-schema").ObjectType<{ - interval: import("@kbn/config-schema").Type; -}>; -export declare const taskSchemaV4: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}, "priority"> & { - priority: import("@kbn/config-schema").Type; -}, "userScope" | "apiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - apiKey: import("@kbn/config-schema").Type; -}>; -export declare const taskSchemaV5: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}, "priority"> & { - priority: import("@kbn/config-schema").Type; -}, "userScope" | "apiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - apiKey: import("@kbn/config-schema").Type; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}>; -export declare const taskSchemaV6: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}, "priority"> & { - priority: import("@kbn/config-schema").Type; -}, "userScope" | "apiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - apiKey: import("@kbn/config-schema").Type; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}>; -export declare const taskSchemaV7: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}, "priority"> & { - priority: import("@kbn/config-schema").Type; -}, "userScope" | "apiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - apiKey: import("@kbn/config-schema").Type; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }> | Readonly<{ - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - byweekday: never; - byhour: never; - freq: import("@kbn/rrule").Frequency.HOURLY; - tzid: string; - }>; - }> | undefined>; -}>; -export declare const taskSchemaV8: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}, "priority"> & { - priority: import("@kbn/config-schema").Type; -}, "userScope" | "apiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - apiKey: import("@kbn/config-schema").Type; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }> | Readonly<{ - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - byweekday: never; - byhour: never; - freq: import("@kbn/rrule").Frequency.HOURLY; - tzid: string; - }>; - }> | undefined>; -}, "cost"> & { - cost: import("@kbn/config-schema").Type<"normal" | "tiny" | "extralarge" | undefined>; -}>; -export declare const taskSchemaV9: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}, "priority"> & { - priority: import("@kbn/config-schema").Type; -}, "userScope" | "apiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - apiKey: import("@kbn/config-schema").Type; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }> | Readonly<{ - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - byweekday: never; - byhour: never; - freq: import("@kbn/rrule").Frequency.HOURLY; - tzid: string; - }>; - }> | undefined>; -}, "cost"> & { - cost: import("@kbn/config-schema").Type<"normal" | "tiny" | "extralarge" | undefined>; -}, "userScope" | "uiamApiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - uiamApiKey: import("@kbn/config-schema").Type; -}>; -export declare const taskSchemaV10: import("@kbn/config-schema").ObjectType; - scheduledAt: import("@kbn/config-schema").Type; - startedAt: import("@kbn/config-schema").Type; - retryAt: import("@kbn/config-schema").Type; - runAt: import("@kbn/config-schema").Type; - schedule: import("@kbn/config-schema").Type | undefined>; - params: import("@kbn/config-schema").Type; - state: import("@kbn/config-schema").Type; - stateVersion: import("@kbn/config-schema").Type; - traceparent: import("@kbn/config-schema").Type; - user: import("@kbn/config-schema").Type; - scope: import("@kbn/config-schema").Type; - ownerId: import("@kbn/config-schema").Type; - enabled: import("@kbn/config-schema").Type; - timeoutOverride: import("@kbn/config-schema").Type; - attempts: import("@kbn/config-schema").Type; - status: import("@kbn/config-schema").Type<"failed" | "claiming" | "idle" | "running" | "unrecognized" | "dead_letter">; - version: import("@kbn/config-schema").Type; -}, "partition"> & { - partition: import("@kbn/config-schema").Type; -}, "priority"> & { - priority: import("@kbn/config-schema").Type; -}, "userScope" | "apiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - apiKey: import("@kbn/config-schema").Type; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }>; - }> | undefined>; -}, "schedule"> & { - schedule: import("@kbn/config-schema").Type | Readonly<{} & { - rrule: Readonly<{ - bymonthday?: number[] | undefined; - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - freq: import("@kbn/rrule").Frequency.MONTHLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.WEEKLY; - tzid: string; - }> | Readonly<{ - byweekday?: string[] | undefined; - byhour?: number[] | undefined; - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - freq: import("@kbn/rrule").Frequency.DAILY; - tzid: string; - }> | Readonly<{ - byminute?: number[] | undefined; - dtstart?: string | undefined; - } & { - interval: number; - bymonthday: never; - byweekday: never; - byhour: never; - freq: import("@kbn/rrule").Frequency.HOURLY; - tzid: string; - }>; - }> | undefined>; -}, "cost"> & { - cost: import("@kbn/config-schema").Type<"normal" | "tiny" | "extralarge" | undefined>; -}, "userScope" | "uiamApiKey"> & { - userScope: import("@kbn/config-schema").Type | undefined>; - uiamApiKey: import("@kbn/config-schema").Type; -}, "cost"> & { - cost: import("@kbn/config-schema").Type; -}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task.d.ts deleted file mode 100644 index cc69d4e118623..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task.d.ts +++ /dev/null @@ -1,414 +0,0 @@ -import type { ObjectType, TypeOf } from '@kbn/config-schema'; -import type { KibanaRequest } from '@kbn/core/server'; -import type { IntervalSchedule, RruleSchedule } from '@kbn/response-ops-scheduling-types'; -import type { DecoratedError } from './task_running'; -export declare const DEFAULT_TIMEOUT = "5m"; -export declare enum TaskPriority { - Low = 1, - NormalLongRunning = 40, - Normal = 50 -} -export declare enum TaskCost { - Tiny = 1, - Normal = 2, - ExtraLarge = 10 -} -/** - * String values for task cost as stored in the task schema (e.g. in saved objects). - * Use these when reading cost from task params or instance attributes. - */ -export declare enum InstanceTaskCost { - Tiny = "tiny", - Normal = "normal", - ExtraLarge = "extralarge" -} -/** - * Translates cost string from task params/instance (e.g. 'extralarge') to the - * corresponding TaskCost integer. Returns undefined if the string is invalid or null. - */ -export declare const getTaskCostFromInstance: (cost?: InstanceTaskCost) => number | undefined; -/** - * Require - * @desc Create a Subtype of type T `T` such that the property under key `P` becomes required - * @example - * type TaskInstance = { - * id?: string; - * name: string; - * }; - * - * // This type is now defined as { id: string; name: string; } - * type TaskInstanceWithId = Require; - */ -type Require = Omit & Required>; -/** - * The run context is passed into a task's run function as its sole argument. - */ -export interface RunContext { - /** - * The document describing the task instance, its params, state, id, etc. - */ - taskInstance: ConcreteTaskInstance; - /** - * If an API key is associated with the task, a fake KibanaRequest object - * is generated using the API key and passed as part of the run context. - */ - fakeRequest?: KibanaRequest; - abortController: AbortController; -} -/** - * The return value of a task's run function should be a promise of RunResult. - */ -export type SuccessfulRunResult = { - /** - * The state which will be passed to the next run of this task (if this is a - * recurring task). See the RunContext type definition for more details. - */ - state: Record; - taskRunError?: DecoratedError; - shouldValidate?: boolean; - shouldDeleteTask?: boolean; - shouldDisableTask?: boolean; -} & (// ensure a SuccessfulRunResult can either specify a new `runAt` or a new `schedule`, but not both -{ - /** - * Specifies the next run date / time for this task. If unspecified, this is - * treated as a single-run task, and will not be rescheduled after - * completion. - */ - runAt?: Date; - schedule?: never; -} | { - /** - * Specifies a new schedule for this tasks. If unspecified, the task will - * continue to use which ever schedule it already has, and if no there is - * no previous schedule then it will be treated as a single-run task. - */ - schedule?: IntervalSchedule | RruleSchedule; - runAt?: never; -}); -export type FailedRunResult = SuccessfulRunResult & { - /** - * If specified, indicates that the task failed to accomplish its work. This is - * logged out as a warning, and the task will be reattempted after a delay. - */ - error: DecoratedError; -}; -export type RunResult = FailedRunResult | SuccessfulRunResult; -export declare const getDeleteTaskRunResult: () => { - state: {}; - shouldDeleteTask: boolean; -}; -export declare const isFailedRunResult: (result: unknown) => result is FailedRunResult; -export interface FailedTaskResult { - status: TaskStatus.Failed | TaskStatus.DeadLetter; -} -export type AnyRunResult = RunResult | undefined | void; -export type RunFunction = () => Promise; -export type CancelFunction = () => Promise; -export interface CancellableTask { - run: RunFunction; - cancel?: CancelFunction; - cleanup?: () => Promise; -} -export type TaskRunCreatorFunction = (context: RunContext) => CancellableTask; -export declare const taskDefinitionSchema: ObjectType<{ - /** - * A unique identifier for the type of task being defined. - */ - type: import("@kbn/config-schema").Type; - /** - * A brief, human-friendly title for this task. - */ - title: import("@kbn/config-schema").Type; - /** - * Priority of this task type. Defaults to "NORMAL" if not defined - */ - priority: import("@kbn/config-schema").Type; - /** - * Cost to run this task type. Defaults to "Normal". - */ - cost: import("@kbn/config-schema").Type; - /** - * An optional more detailed description of what this task does. - */ - description: import("@kbn/config-schema").Type; - /** - * How long, in minutes or seconds, the system should wait for the task to complete - * before it is considered to be timed out. (e.g. '5m', the default). If - * the task takes longer than this, Kibana will send it a kill command and - * the task will be re-attempted. - */ - timeout: import("@kbn/config-schema").Type; - /** - * Up to how many times the task should retry when it fails to run. This will - * default to the global variable. - */ - maxAttempts: import("@kbn/config-schema").Type; - /** - * The maximum number tasks of this type that can be run concurrently per Kibana instance. - * Setting this value will force Task Manager to poll for this task type seperatly from other task types - * which can add significant load to the ES cluster, so please use this configuration only when absolutly necesery. - */ - maxConcurrency: import("@kbn/config-schema").Type; - stateSchemaByVersion: import("@kbn/config-schema").Type> | undefined>; - paramsSchema: import("@kbn/config-schema").Type; -}>; -/** - * Defines a task which can be scheduled and run by the Kibana - * task manager. - */ -export type TaskDefinition = Omit, 'paramsSchema'> & { - /** - * Creates an object that has a run function which performs the task's work, - * and an optional cancel function which cancels the task. - */ - createTaskRunner: TaskRunCreatorFunction; - stateSchemaByVersion?: Record) => Record; - }>; - paramsSchema?: ObjectType; -}; -export declare enum TaskStatus { - Idle = "idle", - Claiming = "claiming", - Running = "running", - Failed = "failed", - ShouldDelete = "should_delete", - Unrecognized = "unrecognized", - DeadLetter = "dead_letter" -} -export declare enum TaskLifecycleResult { - NotFound = "notFound" -} -export type TaskLifecycle = TaskStatus | TaskLifecycleResult; -export type { IntervalSchedule, Rrule, RruleSchedule } from '@kbn/response-ops-scheduling-types'; -export interface TaskUserScope { - apiKeyId: string; - uiamApiKeyId?: string; - spaceId?: string; - apiKeyCreatedByUser: boolean; -} -export interface TaskInstance { - /** - * Optional ID that can be passed by the caller. When ID is undefined, ES - * will auto-generate a unique id. Otherwise, ID will be used to either - * create a new document, or update existing document - */ - id?: string; - /** - * The task definition type whose run function will execute this instance. - */ - taskType: string; - /** - * The date and time that this task was originally scheduled. This is used - * for convenience to task run functions, and for troubleshooting. - */ - scheduledAt?: Date; - /** - * The date and time that this task started execution. This is used to determine - * the "real" runAt that ended up running the task. This value is only set - * when status is set to "running". - */ - startedAt?: Date | null; - /** - * The date and time that this task should re-execute if stuck in "running" / timeout - * status. This value is only set when status is set to "running". - */ - retryAt?: Date | null; - /** - * The date and time that this task is scheduled to be run. It is not - * guaranteed to run at this time, but it is guaranteed not to run earlier - * than this. Defaults to immediately. - */ - runAt?: Date; - /** - * A TaskSchedule string, which specifies this as a recurring task. - * - * Currently, this supports a single format: an interval in minutes or seconds (e.g. '5m', '30s'). - */ - schedule?: IntervalSchedule | RruleSchedule; - /** - * A task-specific set of parameters, used by the task's run function to tailor - * its work. This is generally user-input, such as { sms: '333-444-2222' }. - */ - params: Record; - /** - * The state passed into the task's run function, and returned by the previous - * run. If there was no previous run, or if the previous run did not return - * any state, this will be the empy object: {} - */ - state: Record; - stateVersion?: number; - /** - * The serialized traceparent string of the current APM transaction or span. - */ - traceparent?: string; - /** - * The id of the user who scheduled this task. - */ - user?: string; - /** - * Used to group tasks for querying. So, reporting might schedule tasks with a scope of 'reporting', - * and then query such tasks to provide a glimpse at only reporting tasks, rather than at all tasks. - */ - scope?: string[]; - /** - * The random uuid of the Kibana instance which claimed ownership of the task last - */ - ownerId?: string | null; - /** - * Indicates whether the task is currently enabled. Disabled tasks will not be claimed. - */ - enabled?: boolean; - timeoutOverride?: string; - partition?: number; - /** - * Used to allow tasks to be scoped to a user via their ES API key - */ - apiKey?: string; - /** - * Used to allow tasks to be scoped to a user via their UIAM API key - */ - uiamApiKey?: string; - /** - * Meta data related to the API key associated with this task - */ - userScope?: TaskUserScope; - priority?: TaskPriority; - /** - * Optional cost for this task instance, overriding the task type's default cost. - * When set, must be one of the InstanceTaskCost enum values ('tiny', 'normal', 'extralarge'). - * Used by the task selector and capacity logic to limit concurrent work. - * Use getTaskCostFromInstance() to translate to the integer TaskCost. - */ - cost?: InstanceTaskCost; -} -/** - * Support for the depracated interval field, this should be removed in version 8.0.0 - * and marked as a breaking change, ideally nutil then all usage of `interval` will be - * replaced with use of `schedule` - */ -export interface TaskInstanceWithDeprecatedFields extends TaskInstance { - /** - * An interval in minutes (e.g. '5m'). If specified, this is a recurring task. - * */ - interval?: string; - /** - * Indicates the number of skipped executions. - */ - numSkippedRuns?: number; -} -/** - * A task instance that has an id. - */ -export type TaskInstanceWithId = Require; -/** - * A task instance that has an id and is ready for storage. - */ -export interface ConcreteTaskInstance extends TaskInstance { - /** - * The id of the Elastic document that stores this instance's data. This can - * be passed by the caller when scheduling the task. - */ - id: string; - /** - * @deprecated This field has been moved under schedule (deprecated) with version 7.6.0 - */ - interval?: string; - /** - * @deprecated removed with version 8.14.0 - */ - numSkippedRuns?: number; - /** - * The saved object version from the Elasticsearch document. - */ - version?: string; - /** - * The date and time that this task was originally scheduled. This is used - * for convenience to task run functions, and for troubleshooting. - */ - scheduledAt: Date; - /** - * The number of unsuccessful attempts since the last successful run. This - * will be zeroed out after a successful run. - */ - attempts: number; - /** - * Indicates whether or not the task is currently running. - */ - status: TaskStatus; - /** - * The date and time that this task is scheduled to be run. It is not guaranteed - * to run at this time, but it is guaranteed not to run earlier than this. - */ - runAt: Date; - /** - * The date and time that this task started execution. This is used to determine - * the "real" runAt that ended up running the task. This value is only set - * when status is set to "running". - */ - startedAt: Date | null; - /** - * The date and time that this task should re-execute if stuck in "running" / timeout - * status. This value is only set when status is set to "running". - */ - retryAt: Date | null; - /** - * The state passed into the task's run function, and returned by the previous - * run. If there was no previous run, or if the previous run did not return - * any state, this will be the empy object: {} - */ - state: Record; - /** - * The random uuid of the Kibana instance which claimed ownership of the task last - */ - ownerId: string | null; - partition?: number; -} -export type PartialConcreteTaskInstance = Partial & { - id: ConcreteTaskInstance['id']; -}; -export interface ConcreteTaskInstanceVersion { - /** The _id of the the document (not the SO id) */ - esId: string; - /** The _seq_no of the document when using seq_no_primary_term on fetch */ - seqNo?: number; - /** The _primary_term of the document when using seq_no_primary_term on fetch */ - primaryTerm?: number; - /** The error found if trying to resolve the version info for this esId */ - error?: string; -} -export type SerializedConcreteTaskInstance = Omit & { - state: string; - params: string; - traceparent: string; - scheduledAt: string; - startedAt: string | null; - retryAt: string | null; - runAt: string; - partition?: number; - apiKey?: string; - uiamApiKey?: string; - userScope?: TaskUserScope; -}; -export type PartialSerializedConcreteTaskInstance = Partial & { - id: SerializedConcreteTaskInstance['id']; -}; -export interface ApiKeyOptions { - request?: KibanaRequest; - regenerateApiKey?: boolean; - /** - * When true with a request, grant only the Elasticsearch API key (skip UIAM). Intended for - * tests and narrow internal flows (e.g. exercising UIAM provisioning on tasks that have ES - * credentials only). - */ - onEsKey?: boolean; -} -export type ScheduleOptions = Record & ApiKeyOptions; -export interface TaskEventLogger { - logEvent(properties: object, id?: string): void; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/index.d.ts deleted file mode 100644 index e2d73ea9ea44c..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { Subject } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { TaskStore } from '../task_store'; -import type { TaskClaim, TaskTiming } from '../task_events'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -import type { TaskClaimingBatches } from '../queries/task_claiming'; -import type { ConcreteTaskInstance } from '../task'; -import type { TaskPartitioner } from '../lib/task_partitioner'; -export interface TaskClaimerOpts { - getCapacity: (taskType?: string | undefined) => number; - claimOwnershipUntil: Date; - batches: TaskClaimingBatches; - events$: Subject; - taskStore: TaskStore; - definitions: TaskTypeDictionary; - excludedTaskTypes: string[]; - taskMaxAttempts: Record; - logger: Logger; - taskPartitioner: TaskPartitioner; -} -export interface ClaimOwnershipResult { - stats: { - tasksUpdated: number; - tasksConflicted: number; - tasksClaimed: number; - tasksLeftUnclaimed?: number; - tasksErrors?: number; - staleTasks?: number; - }; - docs: ConcreteTaskInstance[]; - timing?: TaskTiming; -} -export type TaskClaimerFn = (opts: TaskClaimerOpts) => Promise; -export declare function getTaskClaimer(logger: Logger, strategy: string): TaskClaimerFn; -export declare function getEmptyClaimOwnershipResult(): ClaimOwnershipResult; -export declare function isTaskTypeExcluded(excludedTaskTypePatterns: string[], taskType: string): boolean; -export declare function getExcludedTaskTypes(definitions: TaskTypeDictionary, excludedTaskTypePatterns: string[]): string[]; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/get_task_cost.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/get_task_cost.d.ts deleted file mode 100644 index 2195c746d5a51..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/get_task_cost.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ConcreteTaskInstance } from '../../task'; -import type { TaskTypeDictionary } from '../../task_type_dictionary'; -export declare function getTaskCost(task: ConcreteTaskInstance, definitions: TaskTypeDictionary): number; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/task_selector_by_capacity.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/task_selector_by_capacity.d.ts deleted file mode 100644 index 6fc6916b003c2..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/lib/task_selector_by_capacity.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ConcreteTaskInstance } from '../../task'; -import type { TaskClaimingBatches } from '../../queries/task_claiming'; -import { type TaskTypeDictionary } from '../../task_type_dictionary'; -interface SelectTasksByCapacityOpts { - definitions: TaskTypeDictionary; - tasks: ConcreteTaskInstance[]; - batches: TaskClaimingBatches; -} -export declare function selectTasksByCapacity({ definitions, tasks, batches, }: SelectTasksByCapacityOpts): ConcreteTaskInstance[]; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.d.ts deleted file mode 100644 index 12615fb3e4ebd..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TaskClaimerOpts, ClaimOwnershipResult } from '.'; -export declare function claimAvailableTasksMget(opts: TaskClaimerOpts): Promise; -export declare const NO_ASSIGNED_PARTITIONS_WARNING_INTERVAL = 60000; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_update_by_query.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_update_by_query.d.ts deleted file mode 100644 index 9d25a1c267c68..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_update_by_query.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TaskClaimerOpts, ClaimOwnershipResult } from '.'; -export declare function claimAvailableTasksUpdateByQuery(opts: TaskClaimerOpts): Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_events.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_events.d.ts deleted file mode 100644 index 988f713485269..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_events.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { ConcreteTaskInstance } from './task'; -import type { Result, Err } from './lib/result_type'; -import type { ClaimAndFillPoolResult } from './lib/fill_pool'; -import type { PollingError } from './polling'; -import type { DecoratedError, TaskRunResult } from './task_running'; -import type { EventLoopDelayConfig } from './config'; -import type { TaskManagerMetrics } from './metrics/task_metrics_collector'; -export declare enum TaskPersistence { - Recurring = "recurring", - NonRecurring = "non_recurring" -} -export declare enum TaskEventType { - TASK_CLAIM = "TASK_CLAIM", - TASK_MARK_RUNNING = "TASK_MARK_RUNNING", - TASK_RUN = "TASK_RUN", - TASK_RUN_REQUEST = "TASK_RUN_REQUEST", - TASK_POLLING_CYCLE = "TASK_POLLING_CYCLE", - TASK_MANAGER_METRIC = "TASK_MANAGER_METRIC", - TASK_MANAGER_STAT = "TASK_MANAGER_STAT" -} -export interface TaskTiming { - start: number; - stop: number; - eventLoopBlockMs?: number; -} -export type WithTaskTiming = T & { - timing: TaskTiming; -}; -export declare function startTaskTimer(): () => TaskTiming; -export declare function startTaskTimerWithEventLoopMonitoring(eventLoopDelayConfig: EventLoopDelayConfig): () => TaskTiming; -export interface TaskEvent { - id?: ID; - timing?: TaskTiming; - type: TaskEventType; - event: Result; -} -export interface RanTask { - task: ConcreteTaskInstance; - persistence: TaskPersistence; - result: TaskRunResult; - isExpired: boolean; -} -export type ErroredTask = RanTask & { - error: DecoratedError; -}; -export type TaskMarkRunning = TaskEvent; -export type TaskRun = TaskEvent; -export type TaskClaim = TaskEvent; -export type TaskRunRequest = TaskEvent; -export type TaskPollingCycle = TaskEvent>; -export type TaskManagerMetric = TaskEvent; -export type TaskManagerStats = 'load' | 'pollingDelay' | 'claimDuration' | 'workerUtilization' | 'runDelay'; -export type TaskManagerStat = TaskEvent; -export type OkResultOf = EventType extends TaskEvent ? OkResult : never; -export type ErrResultOf = EventType extends TaskEvent ? ErrorResult : never; -export declare function asTaskMarkRunningEvent(id: string, event: Result, timing?: TaskTiming): TaskMarkRunning; -export declare function asTaskRunEvent(id: string, event: Result, timing?: TaskTiming): TaskRun; -export declare function asTaskClaimEvent(id: string, event: Result, timing?: TaskTiming): TaskClaim; -export declare function asTaskRunRequestEvent(id: string, event: Err, timing?: TaskTiming): TaskRunRequest; -export declare function asTaskPollingCycleEvent(event: Result>, timing?: TaskTiming): TaskPollingCycle; -export declare function asTaskManagerStatEvent(id: TaskManagerStats, event: Result): TaskManagerStat; -export declare function asTaskManagerMetricEvent(event: Result): TaskManagerMetric; -export declare function isTaskMarkRunningEvent(taskEvent: TaskEvent): taskEvent is TaskMarkRunning; -export declare function isTaskRunEvent(taskEvent: TaskEvent): taskEvent is TaskRun; -export declare function isTaskClaimEvent(taskEvent: TaskEvent): taskEvent is TaskClaim; -export declare function isTaskRunRequestEvent(taskEvent: TaskEvent): taskEvent is TaskRunRequest; -export declare function isTaskPollingCycleEvent(taskEvent: TaskEvent): taskEvent is TaskPollingCycle; -export declare function isTaskManagerStatEvent(taskEvent: TaskEvent): taskEvent is TaskManagerStat; -export declare function isTaskManagerWorkerUtilizationStatEvent(taskEvent: TaskEvent): taskEvent is TaskManagerStat; -export declare function isTaskManagerMetricEvent(taskEvent: TaskEvent): taskEvent is TaskManagerStat; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.d.ts deleted file mode 100644 index a35c4f44d14c1..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { TaskDefinition } from '../task'; -import type { TaskRunner } from '../task_running'; -import type { CapacityOpts, ICapacity } from './types'; -export declare class CostCapacity implements ICapacity { - private maxAllowedCost; - private logger; - constructor(opts: CapacityOpts); - get capacity(): number; - /** - * Gets how much capacity is currently in use. - */ - usedCapacity(tasksInPool: Map): number; - /** - * Gets % of capacity in use - */ - usedCapacityPercentage(tasksInPool: Map): number; - /** - * Gets how much capacity is currently in use by each type. - */ - getUsedCapacityByType(tasksInPool: TaskRunner[], type: string): number; - availableCapacity(tasksInPool: Map, taskDefinition?: TaskDefinition | null): number; - determineTasksToRunBasedOnCapacity(tasks: TaskRunner[], availableCapacity: number): [TaskRunner[], TaskRunner[]]; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/index.d.ts deleted file mode 100644 index d98ce792a786a..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_pool/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { TaskPool, TaskPoolRunResult } from './task_pool'; -export { getCapacityInCost, getCapacityInWorkers } from './utils'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/task_pool.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/task_pool.d.ts deleted file mode 100644 index 411e6d53f5166..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_pool/task_pool.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { TaskRunner } from '../task_running'; -import type { TaskManagerStat } from '../task_events'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -interface TaskPoolOpts { - capacity$: Observable; - definitions: TaskTypeDictionary; - logger: Logger; - strategy: string; -} -export declare enum TaskPoolRunResult { - NoTaskWereRan = "NoTaskWereRan", - RunningAllClaimedTasks = "RunningAllClaimedTasks", - RunningAtCapacity = "RunningAtCapacity", - RanOutOfCapacity = "RanOutOfCapacity" -} -/** - * Runs tasks in batches, taking costs into account. - */ -export declare class TaskPool { - private tasksInPool; - private logger; - private load$; - private definitions; - private capacityCalculator; - /** - * Creates an instance of TaskPool. - * - * @param {Opts} opts - * @prop {number} capacity - The total capacity available - * (e.g. capacity is 4, then 2 tasks of cost 2 can run at a time, or 4 tasks of cost 1) - * @prop {Logger} logger - The task manager logger. - */ - constructor(opts: TaskPoolOpts); - get load(): Observable; - /** - * Gets the IDs of current tasks in pool - */ - getCurrentTasksInPool(): string[]; - /** - * Gets how much capacity is currently in use. - */ - get usedCapacity(): number; - /** - * Gets how much capacity is currently in use as a percentage - */ - get usedCapacityPercentage(): number; - /** - * Gets how much capacity is currently available. - */ - availableCapacity(taskType?: string): number; - /** - * Gets how much capacity is currently in use by each type. - */ - getUsedCapacityByType(type: string): number; - /** - * Attempts to run the specified list of tasks. Returns true if it was able - * to start every task in the list, false if there was not enough capacity - * to run every task. - * - * @param {TaskRunner[]} tasks - * @returns {Promise} - */ - run(tasks: TaskRunner[]): Promise; - cancelRunningTasks(): void; - private handleMarkAsRunning; - private handleFailureOfMarkAsRunning; - private cancelExpiredTasks; - private cancelTask; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/types.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/types.d.ts deleted file mode 100644 index 69e00af352bff..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_pool/types.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { Logger } from '@kbn/core/server'; -import type { TaskRunner } from '../task_running'; -import type { TaskDefinition } from '../task'; -export interface ICapacity { - get capacity(): number; - availableCapacity(tasksInPool: Map, taskDefinition?: TaskDefinition | null): number; - usedCapacity(tasksInPool: Map): number; - usedCapacityPercentage(tasksInPool: Map): number; - getUsedCapacityByType(tasksInPool: TaskRunner[], type: string): number; - determineTasksToRunBasedOnCapacity(tasks: TaskRunner[], availableCapacity: number): [TaskRunner[], TaskRunner[]]; -} -export interface CapacityOpts { - capacity$: Observable; - logger: Logger; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/utils.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/utils.d.ts deleted file mode 100644 index 975efdd1cd6c6..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_pool/utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const getCapacityInWorkers: (capacity: number) => number; -export declare const getCapacityInCost: (capacity: number) => number; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.d.ts deleted file mode 100644 index dccf30627a3bf..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { TaskRunner } from '../task_running'; -import type { CapacityOpts, ICapacity } from './types'; -import type { TaskDefinition } from '../task'; -export declare class WorkerCapacity implements ICapacity { - private workers; - private logger; - constructor(opts: CapacityOpts); - get capacity(): number; - /** - * Gets how many workers are currently in use. - */ - usedCapacity(tasksInPool: Map): number; - /** - * Gets % of workers in use - */ - usedCapacityPercentage(tasksInPool: Map): number; - /** - * Gets how many workers are currently in use by each type. - */ - getUsedCapacityByType(tasksInPool: TaskRunner[], type: string): number; - availableCapacity(tasksInPool: Map, taskDefinition?: TaskDefinition | null): number; - determineTasksToRunBasedOnCapacity(tasks: TaskRunner[], availableCapacity: number): [TaskRunner[], TaskRunner[]]; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_running/errors.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_running/errors.d.ts deleted file mode 100644 index 41adec3a11025..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_running/errors.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TaskErrorSource } from '../../common'; -export { TaskErrorSource }; -declare const code: unique symbol; -declare const retry: unique symbol; -declare const source: unique symbol; -export interface DecoratedError extends Error { - [code]?: string; - [retry]?: Date | boolean; - [source]?: TaskErrorSource; -} -export declare function isUnrecoverableError(error: Error | DecoratedError): boolean; -export declare function throwUnrecoverableError(error: Error): void; -export declare function isRetryableError(error: Error | DecoratedError): boolean | Date | null | undefined; -export declare function createRetryableError(error: Error, shouldRetry: Date | boolean): DecoratedError; -export declare function throwRetryableError(error: Error, shouldRetry: Date | boolean): void; -export declare function createTaskRunError(error: Error, errorSource?: TaskErrorSource): DecoratedError; -export declare function getErrorSource(error: Error | DecoratedError): TaskErrorSource | undefined; -export declare function isUserError(error: Error | DecoratedError): boolean; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_running/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_running/index.d.ts deleted file mode 100644 index 77ea5f704c34e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_running/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './task_runner'; -export * from './errors'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_running/task_runner.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_running/task_runner.d.ts deleted file mode 100644 index 96340d2e44adf..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_running/task_runner.d.ts +++ /dev/null @@ -1,219 +0,0 @@ -import type { ExecutionContextStart, IBasePath, Logger } from '@kbn/core/server'; -import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; -import type { Middleware } from '../lib/middleware'; -import type { Result } from '../lib/result_type'; -import type { TaskMarkRunning, TaskRun, TaskManagerStat } from '../task_events'; -import type { CancelFunction, ConcreteTaskInstance, FailedRunResult, PartialConcreteTaskInstance, SuccessfulRunResult, TaskDefinition, TaskEventLogger } from '../task'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -import { type TaskManagerConfig } from '../config'; -import type { ApiKeyStrategy } from '../api_key_strategy'; -export declare const EMPTY_RUN_RESULT: SuccessfulRunResult; -export declare const TASK_MANAGER_RUN_TRANSACTION_TYPE = "task-run"; -export declare const TASK_MANAGER_TRANSACTION_TYPE = "task-manager"; -export declare const TASK_MANAGER_TRANSACTION_TYPE_MARK_AS_RUNNING = "mark-task-as-running"; -export interface TaskRunner { - isExpired: boolean; - expiration: Date; - startedAt: Date | null; - definition: TaskDefinition | undefined; - /** Effective cost for this task (instance override, then definition, then Normal). */ - cost: number; - cancel: CancelFunction; - markTaskAsRunning: () => Promise; - run: () => Promise>; - id: string; - taskExecutionId: string; - stage: string; - toString: () => string; - isSameTask: (executionId: string) => boolean; - isAdHocTaskAndOutOfAttempts: boolean; - removeTask: () => Promise; -} -export declare enum TaskRunningStage { - PENDING = "PENDING", - READY_TO_RUN = "READY_TO_RUN", - RAN = "RAN" -} -export interface TaskRunning { - timestamp: Date; - stage: Stage; - task: Instance; -} -export interface Updatable { - update(doc: ConcreteTaskInstance, options: { - validate: boolean; - }): Promise; - partialUpdate(partialDoc: PartialConcreteTaskInstance, options: { - validate: boolean; - doc: ConcreteTaskInstance; - }): Promise; - remove(id: string): Promise; -} -type Opts = { - basePathService: IBasePath; - logger: Logger; - definitions: TaskTypeDictionary; - instance: ConcreteTaskInstance; - store: Updatable; - onTaskEvent?: (event: TaskRun | TaskMarkRunning | TaskManagerStat) => void; - defaultMaxAttempts: number; - executionContext: ExecutionContextStart; - usageCounter?: UsageCounter; - config: TaskManagerConfig; - allowReadingInvalidState: boolean; - strategy: string; - getPollInterval: () => number; - apiKeyStrategy: ApiKeyStrategy; - eventLogger: TaskEventLogger; -} & Pick; -export declare enum TaskRunResult { - Success = "Success", - SuccessRescheduled = "Success", - RetryScheduled = "RetryScheduled", - Failed = "Failed", - Deleted = "Deleted" -} -export type ConcreteTaskInstanceWithStartedAt = ConcreteTaskInstance & { - startedAt: Date; -}; -export type PendingTask = TaskRunning; -export type ReadyToRunTask = TaskRunning; -export type RanTask = TaskRunning; -export type TaskRunningInstance = PendingTask | ReadyToRunTask | RanTask; -/** - * Runs a background task, ensures that errors are properly handled, - * allows for cancellation. - * - * @export - * @class TaskManagerRunner - * @implements {TaskRunner} - */ -export declare class TaskManagerRunner implements TaskRunner { - private task?; - private instance; - private definitions; - private logger; - private bufferedTaskStore; - private beforeRun; - private beforeMarkRunning; - private onTaskEvent; - private defaultMaxAttempts; - private uuid; - private readonly basePathService; - private readonly executionContext; - private usageCounter?; - private config; - private readonly taskValidator; - private readonly claimStrategy; - private getPollInterval; - private apiKeyStrategy; - private eventLogger; - private isCancelled; - /** - * Creates an instance of TaskManagerRunner. - * @param {Opts} opts - * @prop {Logger} logger - The task manager logger - * @prop {TaskDefinition} definition - The definition of the task being run - * @prop {ConcreteTaskInstance} instance - The record describing this particular task instance - * @prop {Updatable} store - The store used to read / write tasks instance info - * @prop {BeforeRunFunction} beforeRun - A function that adjusts the run context prior to running the task - * @memberof TaskManagerRunner - */ - constructor({ basePathService, instance, definitions, logger, store, beforeRun, beforeMarkRunning, defaultMaxAttempts, onTaskEvent, executionContext, usageCounter, config, allowReadingInvalidState, strategy, getPollInterval, apiKeyStrategy, eventLogger, }: Opts); - /** - * Gets the id of this task instance. - */ - get id(): string; - /** - * Gets the execution id of this task instance. - */ - get taskExecutionId(): string; - /** - * Test whether given execution ID identifies a different execution of this same task - * @param id - */ - isSameTask(executionId: string): boolean; - /** - * Gets the task type of this task instance. - */ - get taskType(): string; - /** - * Get the stage this TaskRunner is at - */ - get stage(): TaskRunningStage; - /** - * Gets the task defintion from the dictionary. - */ - get definition(): TaskDefinition | undefined; - /** - * Effective cost for this task (instance override, then definition, then Normal). - */ - get cost(): number; - /** - * Gets the time at which this task will expire. - */ - get expiration(): Date; - get timeout(): string; - /** - * Gets the duration of the current task run - */ - get startedAt(): Date | null; - /** - * Gets whether or not this task has run longer than its expiration setting allows. - */ - get isExpired(): boolean; - /** - * Returns true whenever the task is ad hoc and has ran out of attempts. When true before - * running a task, the task should be deleted instead of ran. - */ - get isAdHocTaskAndOutOfAttempts(): boolean; - /** - * Returns a log-friendly representation of this task. - */ - toString(): string; - /** - * Runs the task, handling the task result, errors, etc, rescheduling if need - * be. NOTE: the time of applying the middleware's beforeRun is incorporated - * into the total timeout time the task in configured with. We may decide to - * start the timer after beforeRun resolves - * - * @returns {Promise>} - */ - run(): Promise>; - private validateTaskState; - removeTask(): Promise; - /** - * Attempts to claim exclusive rights to run the task. If the attempt fails - * with a 409 (http conflict), we assume another Kibana instance beat us to the punch. - * - * @returns {Promise} - */ - markTaskAsRunning(): Promise; - /** - * Attempts to cancel the task. - * - * @returns {Promise} - */ - cancel(): Promise; - private validateResult; - private releaseClaimAndIncrementAttempts; - private shouldTryToScheduleRetry; - private shouldUpdateExpiredTask; - private rescheduleFailedRun; - private processResultForRecurringTask; - private processResultWhenDone; - private processResult; - private getMaxAttempts; - private getFakeKibanaRequest; - private updateRetryAtOnIntervalForLongRunningTasks; - private logTaskRunEvent; - private logTaskCancelEvent; -} -type InstanceOf = T extends TaskRunning ? I : never; -export declare function isPending(taskRunning: TaskRunningInstance): taskRunning is PendingTask; -export declare function asPending(task: InstanceOf): PendingTask; -export declare function isReadyToRun(taskRunning: TaskRunningInstance): taskRunning is ReadyToRunTask; -export declare function asReadyToRun(task: InstanceOf): ReadyToRunTask; -export declare function asRan(task: InstanceOf): RanTask; -export declare function getTaskDelayInSeconds(scheduledAt: Date): number; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_scheduling.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_scheduling.d.ts deleted file mode 100644 index da9e44d9add07..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_scheduling.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { Middleware } from './lib/middleware'; -import { type ApiKeyOptions, type ConcreteTaskInstance, type IntervalSchedule, type RruleSchedule, type ScheduleOptions, type TaskInstanceWithDeprecatedFields, type TaskInstanceWithId } from './task'; -import type { TaskStore } from './task_store'; -import type { ErrorOutput } from './lib/bulk_operation_buffer'; -import type { TaskPollingLifecycle } from './polling_lifecycle'; -export interface TaskSchedulingOpts { - logger: Logger; - taskStore: TaskStore; - middleware: Middleware; - taskManagerId: string; - taskPollingLifecycle?: TaskPollingLifecycle; -} -/** - * return type of TaskScheduling.bulkUpdateSchedules method - */ -export interface BulkUpdateTaskResult { - /** - * list of successfully updated tasks - */ - tasks: ConcreteTaskInstance[]; - /** - * list of failed tasks and errors caused failure - */ - errors: ErrorOutput[]; -} -export interface RunSoonResult { - id: ConcreteTaskInstance['id']; - forced: boolean; -} -export interface RunNowResult { - id: ConcreteTaskInstance['id']; - state?: ConcreteTaskInstance['state']; -} -export declare class TaskScheduling { - private store; - private logger; - private middleware; - private readonly taskPolling; - /** - * Initializes the task manager, preventing any further addition of middleware, - * enabling the task manipulation methods, and beginning the background polling - * mechanism. - */ - constructor(opts: TaskSchedulingOpts); - /** - * Schedules a task. - * - * @param task - The task being scheduled. - * @returns {Promise} - */ - schedule(taskInstance: TaskInstanceWithDeprecatedFields, options?: ScheduleOptions): Promise; - /** - * Bulk schedules a task. - * - * @param tasks - The tasks being scheduled. - * @returns {Promise} - */ - bulkSchedule(taskInstances: TaskInstanceWithDeprecatedFields[], options?: ScheduleOptions): Promise; - bulkDisable(taskIds: string[], clearStateIdsOrBoolean?: string[] | boolean, options?: ApiKeyOptions): Promise; - bulkEnable(taskIds: string[], runSoon?: boolean, options?: ApiKeyOptions): Promise; - bulkUpdateState(taskIds: string[], stateMapFn: (s: ConcreteTaskInstance['state'], id: string) => ConcreteTaskInstance['state'], options?: ApiKeyOptions): Promise; - /** - * Bulk updates schedules for tasks by ids. - * Only tasks with `idle` status will be updated, as for the tasks which have `running` status, - * `schedule` and `runAt` will be recalculated after task run finishes - * - * @param {string[]} taskIds - list of task ids - * @param {IntervalSchedule | RruleSchedule} schedule - new schedule - * @returns {Promise} - */ - bulkUpdateSchedules(taskIds: string[], schedule: IntervalSchedule | RruleSchedule, options?: ApiKeyOptions): Promise; - private bulkGetTasksHelper; - /** - * Run task. - * - * @param taskId - The task being scheduled. - * @returns {Promise} - */ - runSoon(taskId: string, force?: boolean): Promise; - /** - * Schedules a task with an Id - * - * @param task - The task being scheduled. - * @returns {Promise} - */ - ensureScheduled(taskInstance: TaskInstanceWithId, options?: ScheduleOptions): Promise; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_store.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_store.d.ts deleted file mode 100644 index 546f13147c578..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_store.d.ts +++ /dev/null @@ -1,251 +0,0 @@ -import { Subject } from 'rxjs'; -import type { SavedObjectError } from '@kbn/core-saved-objects-common'; -import type { estypes } from '@elastic/elasticsearch'; -import type { SavedObjectsBulkDeleteResponse, Logger, SavedObjectsServiceStart, SecurityServiceStart, SavedObject, ISavedObjectsSerializer, ISavedObjectsRepository, ElasticsearchClient } from '@kbn/core/server'; -import type { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-shared'; -import type { IBasePath, ExecutionContextStart } from '@kbn/core/server'; -import type { RequestTimeoutsConfig } from './config'; -import type { Result } from './lib/result_type'; -import type { ConcreteTaskInstance, ConcreteTaskInstanceVersion, TaskInstance, TaskLifecycle, SerializedConcreteTaskInstance, PartialConcreteTaskInstance, PartialSerializedConcreteTaskInstance, ApiKeyOptions } from './task'; -import type { TaskTypeDictionary } from './task_type_dictionary'; -import type { AdHocTaskCounter } from './lib/adhoc_task_counter'; -import { TaskValidator } from './task_validator'; -import type { ErrorOutput } from './lib/bulk_operation_buffer'; -import type { ApiKeyStrategy } from './api_key_strategy'; -export interface StoreOpts { - esClient: ElasticsearchClient; - index: string; - taskManagerId: string; - definitions: TaskTypeDictionary; - savedObjectsRepository: ISavedObjectsRepository; - savedObjectsService: SavedObjectsServiceStart; - serializer: ISavedObjectsSerializer; - adHocTaskCounter: AdHocTaskCounter; - allowReadingInvalidState: boolean; - logger: Logger; - requestTimeouts: RequestTimeoutsConfig; - security: SecurityServiceStart; - canEncryptSavedObjects?: boolean; - esoClient?: EncryptedSavedObjectsClient; - getIsSecurityEnabled: () => boolean; - basePath: IBasePath; - executionContext: ExecutionContextStart; - apiKeyStrategy: ApiKeyStrategy; -} -export interface SearchOpts { - search_after?: Array; - size?: number; - sort?: estypes.Sort; - query?: estypes.QueryDslQueryContainer; - seq_no_primary_term?: boolean; -} -export interface AggregationOpts { - aggs: Record; - query?: estypes.QueryDslQueryContainer; - runtime_mappings?: estypes.MappingRuntimeFields; - size?: number; -} -export interface UpdateByQuerySearchOpts extends SearchOpts { - script?: estypes.Script; -} -export interface UpdateByQueryOpts extends SearchOpts { - max_docs?: number; -} -export interface FetchResult { - docs: ConcreteTaskInstance[]; - versionMap: Map; -} -export interface BulkUpdateOpts { - validate: boolean; - mergeAttributes?: boolean; - options?: ApiKeyOptions; -} -export type BulkUpdateResult = Result; -export type PartialBulkUpdateResult = Result; -export type BulkGetResult = Array>; -export interface UpdateByQueryResult { - updated: number; - version_conflicts: number; - total: number; -} -/** - * Wraps an elasticsearch connection and provides a task manager-specific - * interface into the index. - */ -export declare class TaskStore { - readonly index: string; - readonly taskManagerId: string; - readonly errors$: Subject; - readonly taskValidator: TaskValidator; - private esClient; - private esoClient?; - private definitions; - private savedObjectsRepository; - private savedObjectsService; - private _invalidationSoClient?; - private serializer; - private adHocTaskCounter; - private requestTimeouts; - private security; - private canEncryptSavedObjects?; - private getIsSecurityEnabled; - private logger; - private basePath; - private executionContextRunner; - private apiKeyStrategy; - private get invalidationSoClient(); - /** - * Constructs a new TaskStore. - * @param {StoreOpts} opts - * @prop {esClient} esClient - An elasticsearch client - * @prop {string} index - The name of the task manager index - * @prop {TaskDefinition} definition - The definition of the task being run - * @prop {serializer} - The saved object serializer - * @prop {savedObjectsRepository} - An instance to the saved objects repository - */ - constructor(opts: StoreOpts); - registerEncryptedSavedObjectsClient(client: EncryptedSavedObjectsClient): void; - getEncryptedSavedObjectsClient(): EncryptedSavedObjectsClient | undefined; - private canEncryptSo; - private validateCanEncryptSavedObjects; - private getSoClientForCreate; - private regenerateApiKeyFromRequest; - private getSoClientForUpdate; - private grantApiKeysFromRequest; - private bulkGetDecryptedTaskApiKeys; - private getDecryptedApiKeys; - private bulkGetAndMergeTasksWithDecryptedApiKey; - /** - * Convert ConcreteTaskInstance Ids to match their SavedObject format as serialized - * in Elasticsearch - * @param tasks - The task being scheduled. - */ - convertToSavedObjectIds(taskIds: Array): Array; - /** - * Schedules a task. - * - * @param task - The task being scheduled. - */ - schedule(taskInstance: TaskInstance, options?: ApiKeyOptions): Promise; - private _schedule; - /** - * Bulk schedules a task. - * - * @param tasks - The tasks being scheduled. - */ - bulkSchedule(taskInstances: TaskInstance[], options?: ApiKeyOptions): Promise; - private _bulkSchedule; - /** - * Fetches a list of scheduled tasks with default sorting. - * - * @param opts - The query options used to filter tasks - * @param limitResponse - Whether to exclude the task state and params from the source for a smaller respose payload - */ - fetch({ sort, ...opts }?: SearchOpts, limitResponse?: boolean): Promise; - /** - * Updates the specified doc in the index, returning the doc - * with its version up to date. - * - * @param {TaskDoc} doc - * @returns {Promise} - */ - update(doc: ConcreteTaskInstance, options: { - validate: boolean; - }): Promise; - private _update; - /** - * Updates the specified docs in the index, returning the docs - * with their versions up to date. - * - * @param {Array} docs - * @returns {Promise>} - */ - bulkUpdate(docs: ConcreteTaskInstance[], options: BulkUpdateOpts): Promise; - private _bulkUpdate; - bulkPartialUpdate(docs: PartialConcreteTaskInstance[]): Promise; - private _bulkPartialUpdate; - /** - * Removes the specified task from the index. - * - * @param {string} id - * @returns {Promise} - */ - remove(id: string): Promise; - private _remove; - /** - * Bulk removes the specified tasks from the index. - * - * @param {SavedObjectsBulkDeleteObject[]} savedObjectsToDelete - * @returns {Promise} - */ - bulkRemove(taskIds: string[]): Promise; - private _bulkRemove; - /** - * Gets a task by id - * - * @param {string} id - * @returns {Promise} - */ - get(id: string): Promise; - private _get; - /** - * Gets tasks by ids - * - * @param {Array} ids - * @returns {Promise} - */ - bulkGet(ids: string[]): Promise; - private _bulkGet; - /** - * Gets task version info by ids - * - * @param {Array} esIds - * @returns {Promise} - */ - bulkGetVersions(ids: string[]): Promise; - private _bulkGetVersions; - /** - * Gets task lifecycle step by id - * - * @param {string} id - * @returns {Promise} - */ - getLifecycle(id: string): Promise; - msearch(opts?: SearchOpts[]): Promise; - private _msearch; - search(opts?: SearchOpts, limitResponse?: boolean): Promise; - private _search; - private filterTasks; - private addTasksToVersionMap; - private createVersionMap; - aggregate({ aggs, query, runtime_mappings, size, }: TSearchRequest): Promise>; - private _aggregate; - updateByQuery(opts?: UpdateByQuerySearchOpts, updateByQueryOpts?: UpdateByQueryOpts): Promise; - private _updateByQuery; - getDocVersions(esIds: string[]): Promise>; - private _getDocVersions; -} -/** - * When we run updateByQuery with conflicts='proceed', it's possible for the `version_conflicts` - * to count against the specified `max_docs`, as per https://github.com/elastic/elasticsearch/issues/63671 - * In order to correct for that happening, we only count `version_conflicts` if we haven't updated as - * many docs as we could have. - * This is still no more than an estimation, as there might have been less docuemnt to update that the - * `max_docs`, but we bias in favour of over zealous `version_conflicts` as that's the best indicator we - * have for an unhealthy cluster distribution of Task Manager polling intervals - */ -export declare function correctVersionConflictsForContinuation(updated: estypes.ReindexResponse['updated'], versionConflicts: estypes.ReindexResponse['version_conflicts'], maxDocs?: number): number; -/** - * Returns true when a task document holds an encrypted API key credential - * (either an ES API key or a UIAM API key) together with the `userScope` - * metadata required to process it. Must be kept in sync with every credential - * field registered for ESO encryption on the `task` saved object type. - */ -export declare function docHasEncryptedApiKey(doc: Pick): boolean; -export declare function taskInstanceToAttributes(doc: TaskInstance, id: string): SerializedConcreteTaskInstance; -export declare function partialTaskInstanceToAttributes(doc: PartialConcreteTaskInstance): PartialSerializedConcreteTaskInstance; -export declare function savedObjectToConcreteTaskInstance(savedObject: Omit, 'references'>): ConcreteTaskInstance; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_type_dictionary.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_type_dictionary.d.ts deleted file mode 100644 index ef3160a780fdf..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_type_dictionary.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -import type { ObjectType } from '@kbn/config-schema'; -import type { Logger } from '@kbn/core/server'; -import type { TaskDefinition, TaskRunCreatorFunction, TaskPriority, TaskCost } from './task'; -/** - * Types that are no longer registered and will be marked as unregistered - */ -export declare const REMOVED_TYPES: string[]; -export declare const SHARED_CONCURRENCY_TASKS: string[][]; -/** - * Defines a task which can be scheduled and run by the Kibana - * task manager. - */ -export interface TaskRegisterDefinition { - /** - * A brief, human-friendly title for this task. - */ - title?: string; - /** - * How long, in minutes or seconds, the system should wait for the task to complete - * before it is considered to be timed out. (e.g. '5m', the default). If - * the task takes longer than this, Kibana will send it a kill command and - * the task will be re-attempted. - */ - timeout?: string; - /** - * An optional definition of task priority. Tasks will be sorted by priority prior to claiming - * so high priority tasks will always be claimed before normal priority, which will always be - * claimed before low priority - */ - priority?: TaskPriority; - /** - * An optional definition of the cost associated with running the task. - */ - cost?: TaskCost; - /** - * An optional more detailed description of what this task does. - */ - description?: string; - /** - * Creates an object that has a run function which performs the task's work, - * and an optional cancel function which cancels the task. - */ - createTaskRunner: TaskRunCreatorFunction; - /** - * Up to how many times the task should retry when it fails to run. This will - * default to the global variable. The default value, if not specified, is 1. - */ - maxAttempts?: number; - /** - * The maximum number tasks of this type that can be run concurrently per Kibana instance. - * Setting this value will force Task Manager to poll for this task type separately from other task types - * which can add significant load to the ES cluster, so please use this configuration only when absolutely necessary. - * The default value, if not given, is 0. - */ - maxConcurrency?: number; - stateSchemaByVersion?: Record) => Record; - }>; - paramsSchema?: ObjectType; -} -/** - * A mapping of task type id to the task definition. - */ -export type TaskDefinitionRegistry = Record; -export declare class TaskTypeDictionary { - private definitions; - private logger; - constructor(logger: Logger); - [Symbol.iterator](): MapIterator<[string, TaskDefinition]>; - getAllTypes(): string[]; - getAllDefinitions(): TaskDefinition[]; - has(type: string): boolean; - size(): number; - get(type: string): TaskDefinition | undefined; - ensureHas(type: string): void; - /** - * Method for allowing consumers to register task definitions into the system. - * @param taskDefinitions - The Kibana task definitions dictionary - */ - registerTaskDefinitions(taskDefinitions: TaskDefinitionRegistry): void; - private verifySharedConcurrencyAndCost; -} -/** - * Sanitizes the system's task definitions. Task definitions have optional properties, and - * this ensures they all are given a reasonable default. - * - * @param taskDefinitions - The Kibana task definitions dictionary - */ -export declare function sanitizeTaskDefinitions(taskDefinitions: TaskDefinitionRegistry): TaskDefinition[]; -export declare function sharedConcurrencyTaskTypes(taskType: string): string[] | undefined; diff --git a/x-pack/platform/plugins/shared/task_manager/server/task_validator.d.ts b/x-pack/platform/plugins/shared/task_manager/server/task_validator.d.ts deleted file mode 100644 index c5cd20649b735..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/task_validator.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Logger } from '@kbn/core/server'; -import type { TaskTypeDictionary } from './task_type_dictionary'; -import type { TaskInstance } from './task'; -interface TaskValidatorOpts { - allowReadingInvalidState: boolean; - definitions: TaskTypeDictionary; - logger: Logger; -} -export declare class TaskValidator { - private readonly logger; - private readonly definitions; - private readonly allowReadingInvalidState; - private readonly cachedGetLatestStateSchema; - private readonly cachedExtendSchema; - constructor({ definitions, allowReadingInvalidState, logger }: TaskValidatorOpts); - getValidatedTaskInstanceFromReading(task: T, options?: { - validate: boolean; - }): T; - getValidatedTaskInstanceForUpdating(task: T, options?: { - validate: boolean; - }): T; - validateTimeoutOverride(task: T): T; - validateInterval(task: T): T; - validateRrule(task: T): T; - private migrateTaskState; - private getValidatedStateSchema; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/constants.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/constants.d.ts deleted file mode 100644 index 8bb13760b9589..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/constants.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { IntervalSchedule } from '../task'; -export declare const PROVISION_UIAM_API_KEYS_FLAG = "taskManager.provisionUiamApiKeys"; -export declare const TASK_ID = "uiam_api_key_provisioning"; -export declare const TASK_TYPE = "task_manager:uiam_api_key_provisioning"; -export declare const UIAM_PROVISIONING_TASK_TITLE = "UIAM API key provisioning for task manager tasks"; -export declare const SCHEDULE_INTERVAL: IntervalSchedule; -export declare const TASK_TIMEOUT = "5m"; -/** - * Lower bound for `task.runAt` in the UIAM provisioning fetch query (Elasticsearch date math). - * Keeps eligible tasks from being claimed for execution imminently; evaluated as `now` on the cluster. - */ -export declare const UIAM_PROVISIONING_FETCH_RUN_AT_GT = "now+30s"; -/** When there are more tasks to convert, run again after this many ms (10m) to process the next batch. */ -export declare const RUN_AT_INTERVAL_MS = 600000; -/** Max number of task docs to fetch per run (same as referenced alerting provisioning task). */ -export declare const FETCH_BATCH_SIZE = 500; -/** - * Page size when listing final UIAM provisioning status SOs (matches Alerting `GET_STATUS_BATCH_SIZE`). - */ -export declare const GET_STATUS_BATCH_SIZE = 500; -/** - * UIAM convert error code returned when the Elasticsearch API key creator is not a Cloud user. - * Source: https://github.com/elastic/uiam/blob/main/modules/domain/src/main/java/co/elastic/cloud/uiam/domain/errors/ErrorCode.java - */ -export declare const NON_CLOUD_USER_API_KEY_CREATOR_ERROR_CODE = "0x357391"; -export declare const TAGS: string[]; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/event_based_telemetry.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/event_based_telemetry.d.ts deleted file mode 100644 index 011cdb3776224..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/event_based_telemetry.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { EventTypeOpts } from '@kbn/core/server'; -export interface TaskManagerUiamProvisioningRunEventData { - total: number; - completed: number; - failed: number; - skipped: number; - has_more_to_provision: boolean; - has_error: boolean; - run_number: number; -} -export declare const TASK_MANAGER_UIAM_PROVISIONING_RUN_EVENT: EventTypeOpts; -export declare const taskManagerUiamProvisioningEvents: Array>>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/index.d.ts deleted file mode 100644 index f5f169ea7d338..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { UiamApiKeyProvisioningTask } from './uiam_api_key_provisioning_task'; -export { TASK_TYPE, PROVISION_UIAM_API_KEYS_FLAG } from './constants'; -export { UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE } from './uiam_api_keys_provisioning_status_saved_object'; -export { TASK_MANAGER_UIAM_PROVISIONING_RUN_EVENT, taskManagerUiamProvisioningEvents, } from './event_based_telemetry'; -export type { TaskManagerUiamProvisioningRunEventData } from './event_based_telemetry'; -export type { ApiKeyToConvert, TaskApiKeyToConvertAttributes, TaskManagerUiamProvisioningRunContext, UiamKeyResult, UiamConvertResponse, UiamConvertSuccessResult, UiamConvertFailedResult, } from './types'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_provisioning_run_telemetry.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_provisioning_run_telemetry.d.ts deleted file mode 100644 index 57b12a97c78a6..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_provisioning_run_telemetry.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { TaskManagerUiamProvisioningRunEventData } from '../event_based_telemetry'; -export declare const failedProvisioningRunTelemetry: () => TaskManagerUiamProvisioningRunEventData; -/** - * Shapes run telemetry like Alerting's `UiamProvisioningRunEventData` - * (`completed` + `failed` + `skipped` = `total`, `has_more_to_provision` from batching). - */ -export declare const buildSuccessProvisioningRunTelemetry: ({ completed, failed, skipped, hasMoreToProvision, nextRunNumber, }: { - completed: number; - failed: number; - skipped: number; - hasMoreToProvision: boolean; - nextRunNumber: number; -}) => TaskManagerUiamProvisioningRunEventData; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_saved_object_bulk_updates_for_uiam.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_saved_object_bulk_updates_for_uiam.d.ts deleted file mode 100644 index 334bdc1a7f73a..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/build_saved_object_bulk_updates_for_uiam.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { SavedObjectsBulkUpdateObject } from '@kbn/core/server'; -import type { InvalidationTarget } from '../../api_key_strategy'; -import type { TaskUserScope } from '../../task'; -import type { UiamKeyResult } from '../types'; -/** Shape of attributes sent in a UIAM provisioning partial bulkUpdate. */ -interface UiamBulkUpdateAttrs { - uiamApiKey: string; - userScope: TaskUserScope; - /** - * `taskType` is in the Task ESO `attributesToIncludeInAAD` set, so it must be - * included on every partial encrypt-update — otherwise `uiamApiKey` is encrypted - * with a mismatched AAD and decrypt fails on subsequent reads (and ESO strips - * `apiKey` along with it). See `task_manager_dependencies/server/plugin.ts`. - */ - taskType: string; -} -/** - * {@link markApiKeysForInvalidation} targets from task SO bulk updates built by - * {@link buildSavedObjectBulkUpdatesForUiamKeys} (attributes carry UIAM id + secret). - */ -export declare const invalidationTargetsFromUiamTaskBulkUpdates: (updates: Array>) => InvalidationTarget[]; -/** - * Saved-object bulk update operations for successful UIAM converts. - * Callers only enqueue tasks that passed {@link classifyTaskForUiamProvisioning} with usable - * `userScope` / `apiKeyId`, so one update is built per converted result. - */ -export declare const buildSavedObjectBulkUpdatesForUiamKeys: (converted: UiamKeyResult[]) => Array>; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/classify_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/classify_task.d.ts deleted file mode 100644 index 084ed1393b65c..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/classify_task.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { ConcreteTaskInstance } from '../../task'; -import type { ApiKeyToConvert } from '../types'; -import { type TaskUiamProvisioningStatusDoc } from './task_uiam_provisioning_observability_status'; -/** - * Task document for UIAM provisioning classification - * (mirrors {@link RuleForClassification} in `alerting/.../fetch_first_batch.ts`). - */ -export type TaskForClassification = ConcreteTaskInstance; -export type ClassifyTaskResult = { - action: 'skip'; - status: TaskUiamProvisioningStatusDoc; -} | { - action: 'convert'; - task: ApiKeyToConvert; -}; -/** - * Classifies a task as either skip (with status doc) or convert (with API key payload + instance for merge). - * Skip: no API key, already has UIAM key, user-created key, or unusable userScope. - * Convert: system-generated API key, no UIAM key yet, usable userScope. - */ -export declare const classifyTaskForUiamProvisioning: (task: TaskForClassification) => ClassifyTaskResult; -export interface ClassifyTasksResult { - provisioningStatusForSkippedTasks: TaskUiamProvisioningStatusDoc[]; - apiKeysToConvert: ApiKeyToConvert[]; -} -/** - * Classifies a batch of tasks into skipped (with status docs) and to-convert payloads. - * Mirrors `classifyRulesForUiamProvisioning` in `alerting/.../classify_rule.ts`. - */ -export declare const classifyTasksForUiamProvisioning: (tasks: TaskForClassification[]) => ClassifyTasksResult; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_provisioning_run_context.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_provisioning_run_context.d.ts deleted file mode 100644 index 19e1516763491..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_provisioning_run_context.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CoreSetup } from '@kbn/core/server'; -import type { TaskManagerPluginsStart, TaskManagerStartContract } from '../../plugin'; -import type { TaskManagerUiamProvisioningRunContext } from '../types'; -/** - * Builds the shared context for a Task Manager UIAM provisioning run - * (mirrors {@link createProvisioningRunContext} in - * `alerting/server/provisioning/lib/create_provisioning_run_context.ts`). - */ -export declare const createProvisioningRunContext: (core: CoreSetup) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_uiam_provisioning_task_runner.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_uiam_provisioning_task_runner.d.ts deleted file mode 100644 index 81bd026784553..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/create_uiam_provisioning_task_runner.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { CoreSetup } from '@kbn/core/server'; -import type { TaskManagerStartContract } from '../..'; -import type { ConcreteTaskInstance } from '../../task'; -import type { TaskManagerPluginsStart } from '../../plugin'; -import type { TaskManagerUiamProvisioningRunEventData } from '../event_based_telemetry'; -export interface UiamProvisioningRunTaskOutcome { - state: { - runs: number; - }; - runAt?: Date; - telemetry: TaskManagerUiamProvisioningRunEventData; -} -export interface UiamProvisioningTaskRunnerDeps { - runTask: (taskInstance: ConcreteTaskInstance, coreSetup: CoreSetup) => Promise; - reportProvisioningRunEvent: (telemetry: TaskManagerUiamProvisioningRunEventData) => void; -} -export declare const createUiamProvisioningTaskRunner: (coreSetup: CoreSetup, deps: UiamProvisioningTaskRunnerDeps) => ({ taskInstance }: { - taskInstance: ConcreteTaskInstance; -}) => { - run: () => Promise<{ - state: { - runs: number; - }; - runAt?: Date; - }>; - cancel: () => Promise; -}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/deferred_non_running_tasks_query.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/deferred_non_running_tasks_query.d.ts deleted file mode 100644 index c0d3734a0e296..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/deferred_non_running_tasks_query.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { estypes } from '@elastic/elasticsearch'; -/** - * Tasks eligible for UIAM API key background conversion: - * - Not in `running` status, and - * - Either `runAt` is after `UIAM_PROVISIONING_FETCH_RUN_AT_GT` (Elasticsearch `now+30s`, so an - * enabled task will not be claimed for execution imminently), or the task is **disabled** (Task - * Manager does not claim disabled tasks, so there is no race with execution regardless of - * `runAt`). - * - * Optional `excludeTaskEntityIdsWithFinalStatus`: Kibana task document `_id` values are `task:`. - * Excluding by `ids` prevents re-fetching tasks that already have a SKIPPED or COMPLETED - * UIAM provisioning status document (see `getExcludeTasksFilter`). - */ -export declare const buildUiamProvisioningFetchQuery: (options?: { - excludeTaskEntityIdsWithFinalStatus?: string[]; -}) => estypes.QueryDslQueryContainer; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/error_utils.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/error_utils.d.ts deleted file mode 100644 index e23f6e8fd2f6e..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/error_utils.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** Same as `alerting/server/provisioning/lib/error_utils.ts` for log message parity. */ -export declare const getErrorMessage: (error: unknown) => string; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/fetch_first_batch_of_tasks_to_convert.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/fetch_first_batch_of_tasks_to_convert.d.ts deleted file mode 100644 index ea2682d5f3fe4..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/fetch_first_batch_of_tasks_to_convert.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { TaskManagerStartContract } from '../..'; -import type { TaskForClassification } from './classify_task'; -export interface FetchFirstBatchOfTasksOptions { - /** - * Task `entityId`s that already have final UIAM provisioning status - * (return value of {@link getExcludeTasksFilter}). - */ - excludeTaskEntityIdsWithFinalStatus: string[]; - /** Defaults to {@link FETCH_BATCH_SIZE}. */ - perPage?: number; -} -/** - * Fetches the first page of task docs for UIAM conversion - * (mirrors `fetchFirstBatchOfRulesToConvert` in Alerting’s provisioning layer). - */ -export declare const fetchFirstBatchOfTasksToConvert: (taskManager: TaskManagerStartContract, options: FetchFirstBatchOfTasksOptions) => Promise<{ - tasks: TaskForClassification[]; - hasMore: boolean; -}>; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/get_exclude_tasks_filter.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/get_exclude_tasks_filter.d.ts deleted file mode 100644 index 25eb2e113b26b..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/get_exclude_tasks_filter.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ISavedObjectsRepository } from '@kbn/core/server'; -/** - * Returns task `entityId`s that already have a final UIAM provisioning status - * (completed, skipped, or failed due to non-Cloud user API key creator code) so - * the provisioning fetch can exclude them. - * - * Mirrors {@link getExcludeRulesFilter} in - * `x-pack/.../alerting/server/provisioning/lib/get_exclude_rules_filter.ts`. - */ -export declare const getExcludeTasksFilter: (savedObjectsClient: ISavedObjectsRepository) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/map_uiam_convert_response_to_key_results.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/map_uiam_convert_response_to_key_results.d.ts deleted file mode 100644 index 1f0ad2214d8bb..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/map_uiam_convert_response_to_key_results.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ConvertUiamAPIKeysResponse } from '@kbn/core-security-server'; -import type { ApiKeyToConvert, ConvertApiKeysResult } from '../types'; -/** - * Maps the UIAM convert API response and input tasks into result rows and failed-conversion status docs. - * Caller must ensure `convertResponse.results.length === apiKeysToConvert.length`. - */ -export declare const mapUiamConvertResponseToKeyResults: (apiKeysToConvert: ApiKeyToConvert[], convertResponse: ConvertUiamAPIKeysResponse) => ConvertApiKeysResult; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_status_and_orphaned_keys_from_bulk_update.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_status_and_orphaned_keys_from_bulk_update.d.ts deleted file mode 100644 index 5eab164a6984d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_status_and_orphaned_keys_from_bulk_update.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { InvalidationTarget } from '../../api_key_strategy'; -import type { UiamKeyResult } from '../types'; -import { type TaskUiamProvisioningStatusDoc } from './task_uiam_provisioning_observability_status'; -/** - * Result item from a bulkUpdate call (has id and optional error). - * Mirrors `BulkUpdateResultItem` in alerting's `provisioning_status.ts`. - */ -export interface TaskBulkUpdateResultItem { - id: string; - error?: { - message?: string; - }; -} -/** - * Builds status docs from bulk update results and collects invalidation targets for tasks - * that failed to update (orphaned), shaped like {@link InvalidationTarget} in `api_key_strategy` - * and Alerting’s notion of “orphan” UIAM material to queue for the invalidate pipeline. - */ -export declare const statusDocsAndOrphanedUiamKeysFromTaskBulkUpdate: (savedObjects: Array, uiamKeyByTaskId: Map) => { - provisioningStatusForCompletedTasks: TaskUiamProvisioningStatusDoc[]; - provisioningStatusForFailedTasks: TaskUiamProvisioningStatusDoc[]; - orphanedInvalidationTargets: InvalidationTarget[]; -}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_uiam_provisioning_observability_status.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_uiam_provisioning_observability_status.d.ts deleted file mode 100644 index 19eb118a4ccb7..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/task_uiam_provisioning_observability_status.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; -import { UiamApiKeyProvisioningEntityType, UiamApiKeyProvisioningStatus } from '@kbn/uiam-api-keys-provisioning-status'; -import { UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE } from '../uiam_api_keys_provisioning_status_saved_object'; -export interface TaskUiamProvisioningStatusDoc { - type: typeof UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE; - id: string; - attributes: { - '@timestamp': string; - entityId: string; - entityType: typeof UiamApiKeyProvisioningEntityType.TASK; - status: typeof UiamApiKeyProvisioningStatus.SKIPPED | typeof UiamApiKeyProvisioningStatus.FAILED | typeof UiamApiKeyProvisioningStatus.COMPLETED; - message?: string; - errorCode?: string; - }; -} -export declare const createSkippedTaskProvisioningStatus: (taskId: string, message: string) => TaskUiamProvisioningStatusDoc; -export declare const createFailedConversionTaskProvisioningStatus: (taskId: string, message: string, errorCode?: string) => TaskUiamProvisioningStatusDoc; -export declare const createTaskProvisioningStatusFromBulkUpdateResult: (so: { - id: string; - error?: { - message?: string; - }; -}) => TaskUiamProvisioningStatusDoc; -export interface TaskUiamProvisioningObservabilityStatusPayload { - skipped: TaskUiamProvisioningStatusDoc[]; - failedConversions: TaskUiamProvisioningStatusDoc[]; - completed: TaskUiamProvisioningStatusDoc[]; - failed: TaskUiamProvisioningStatusDoc[]; -} -/** - * Same shape as Alerting's `ProvisioningStatusWritePayload` for `uiam_api_keys_provisioning_status`. - */ -export type TaskProvisioningStatusWritePayload = TaskUiamProvisioningObservabilityStatusPayload; -export interface TaskProvisioningStatusCounts { - skipped: number; - failedConversions: number; - completed: number; - failed: number; - total: number; -} -/** - * Builds the flat docs array and counts for a provisioning status write (mirrors - * `prepareProvisioningStatusWrite` in `alerting/server/provisioning/lib/provisioning_status.ts`). - */ -export declare const prepareTaskProvisioningStatusWrite: (payload: TaskProvisioningStatusWritePayload) => { - docs: TaskUiamProvisioningStatusDoc[]; - counts: TaskProvisioningStatusCounts; -}; -/** - * Persists provisioning status docs for monitoring only. Swallows errors so execution is unchanged. - */ -export declare const writeTaskUiamProvisioningObservabilityStatus: (savedObjectsClient: ISavedObjectsRepository, logger: Logger, payload: TaskUiamProvisioningObservabilityStatusPayload) => Promise; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/uiam_provisioning_feature_flag_scheduler.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/uiam_provisioning_feature_flag_scheduler.d.ts deleted file mode 100644 index 1ef870cb43f0a..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/lib/uiam_provisioning_feature_flag_scheduler.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { CoreStart, Logger } from '@kbn/core/server'; -import type { TaskScheduling } from '../../task_scheduling'; -import type { IntervalSchedule } from '../../task'; -export declare class UiamProvisioningFeatureFlagScheduler { - private readonly logger; - private featureFlagSubscription; - private appliedFlagValue; - constructor(logger: Logger); - start({ core, taskScheduling, removeIfExists, schedule, }: { - core: CoreStart; - taskScheduling: TaskScheduling; - removeIfExists: (id: string) => Promise; - schedule: IntervalSchedule; - }): void; - stop(): void; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/task_state.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/task_state.d.ts deleted file mode 100644 index 2721c09600154..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/task_state.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { TypeOf } from '@kbn/config-schema'; -/** - * WARNING: Do not modify the existing versioned schema(s) below, instead define a new version (ex: 2, 3, 4). - * This is required to support zero-downtime upgrades and rollbacks. See https://github.com/elastic/kibana/issues/155764. - * - * As you add a new schema version, don't forget to change latestTaskStateSchema variable to reference the latest schema. - * For example, changing stateSchemaByVersion[1].schema to stateSchemaByVersion[2].schema. - */ -export declare const stateSchemaByVersion: { - 1: { - up: (state: Record) => { - runs: {}; - }; - schema: import("@kbn/config-schema").ObjectType<{ - runs: import("@kbn/config-schema").Type; - }>; - }; -}; -declare const latestTaskStateSchema: import("@kbn/config-schema").ObjectType<{ - runs: import("@kbn/config-schema").Type; -}>; -export type LatestTaskStateSchema = TypeOf; -export declare const emptyState: LatestTaskStateSchema; -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/types.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/types.d.ts deleted file mode 100644 index 39e118409afbd..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/types.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -import type { CoreStart, ISavedObjectsRepository } from '@kbn/core/server'; -import type { ConvertUiamAPIKeysResponse } from '@kbn/core-security-server'; -import type { TaskUiamProvisioningStatusDoc } from './lib/task_uiam_provisioning_observability_status'; -import type { TaskUserScope } from '../task'; -import type { TaskManagerStartContract } from '../plugin'; -/** Success result from UIAM convert API */ -export interface UiamConvertSuccessResult { - status: 'success'; - id: string; - key: string; - organization_id: string; - description: string; - internal: boolean; - role_assignments: Record; - creation_date: string; -} -/** Failed result from UIAM convert API */ -export interface UiamConvertFailedResult { - status: 'failed'; - message: string; - type: string; - resource: string; - code: string; -} -/** Response from core.security.authc.apiKeys.uiam.convert */ -export interface UiamConvertResponse { - results: Array; -} -/** Task document fields required for convert + ESO/SO merge (mirrors Alerting's full `RawRule` on `ApiKeyToConvert`) */ -export interface TaskApiKeyToConvertAttributes { - /** System API key string to send to UIAM convert (mirrors `apiKey` on the rule) */ - apiKey: string; - /** - * Required so the partial `bulkUpdate` payload includes `taskType` and ESO can - * compute the same AAD that was used when the doc was originally encrypted. - * The Task ESO type lists `taskType` in `attributesToIncludeInAAD` (see - * `task_manager_dependencies/server/plugin.ts`); omitting it would corrupt - * `uiamApiKey` (and silently strip `apiKey` on subsequent reads). - */ - taskType: string; - userScope: TaskUserScope; -} -/** - * Runtime dependencies for a UIAM task provisioning run - * (mirrors Alerting's `ProvisioningRunContext` in `alerting/server/provisioning/types.ts`). - */ -export interface TaskManagerUiamProvisioningRunContext { - coreStart: CoreStart; - taskManager: TaskManagerStartContract; - savedObjectsClient: ISavedObjectsRepository; - uiamConvert: (keys: string[]) => Promise; -} -/** Task doc queued for UIAM convert + SO update (mirrors Alerting's `ApiKeyToConvert`) */ -export interface ApiKeyToConvert { - taskId: string; - attributes: TaskApiKeyToConvertAttributes; - /** Task SO version for `bulkUpdate` (mirrors rule `version` on `ApiKeyToConvert`) */ - version?: string; -} -/** - * One successfully converted task with material for SO update - * (mirrors `UiamApiKeyByRuleId` in `alerting/server/provisioning/types.ts`). - */ -export interface UiamKeyResult { - taskId: string; - uiamApiKey: string; - uiamApiKeyId: string; - /** Decrypted task fields for merge; required for ESO/SO `bulkUpdate` */ - attributes: TaskApiKeyToConvertAttributes; - /** Task SO version for `bulkUpdate` (optimistic concurrency) */ - version?: string; -} -/** - * Result of the first provisioning step (mirrors Alerting's `GetApiKeysToConvertResult`). - */ -export interface GetApiKeysToConvertResult { - apiKeysToConvert: ApiKeyToConvert[]; - provisioningStatusForSkippedTasks: TaskUiamProvisioningStatusDoc[]; - /** True when the fetch batch is full, so more tasks may be provisioned on a later run */ - hasMoreToProvision: boolean; -} -/** - * Result of the convert step (mirrors Alerting's `ConvertApiKeysResult`). - */ -export interface ConvertApiKeysResult { - converted: UiamKeyResult[]; - provisioningStatusForFailedConversions: TaskUiamProvisioningStatusDoc[]; -} -/** - * Result of the bulk task update step (mirrors completed/failed status from Alerting's `updateRules`). - */ -export interface UpdateTasksResult { - provisioningStatusForCompletedTasks: TaskUiamProvisioningStatusDoc[]; - provisioningStatusForFailedTasks: TaskUiamProvisioningStatusDoc[]; -} diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_key_provisioning_task.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_key_provisioning_task.d.ts deleted file mode 100644 index 2d20a2f1c827c..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_key_provisioning_task.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { AnalyticsServiceSetup, Logger } from '@kbn/core/server'; -import type { CoreSetup, CoreStart } from '@kbn/core/server'; -import type { TaskManagerStartContract } from '..'; -import type { TaskScheduling } from '../task_scheduling'; -import type { TaskTypeDictionary } from '../task_type_dictionary'; -import type { TaskManagerPluginsStart } from '../plugin'; -interface RegisterUiamApiKeyProvisioningTaskOpts { - coreSetup: CoreSetup; - taskTypeDictionary: TaskTypeDictionary; -} -export declare class UiamApiKeyProvisioningTask { - private readonly logger; - private readonly isServerless; - private readonly analytics; - private readonly featureFlagScheduler; - constructor({ logger, isServerless, analytics, }: { - logger: Logger; - isServerless: boolean; - analytics: AnalyticsServiceSetup; - }); - register(opts: RegisterUiamApiKeyProvisioningTaskOpts): void; - start({ core, taskScheduling, removeIfExists, }: { - core: CoreStart; - taskScheduling: TaskScheduling; - removeIfExists: (id: string) => Promise; - }): Promise; - stop(): void; - private runTask; - private reportProvisioningRunEvent; - private getApiKeysToConvert; - private convertApiKeys; - private updateTasks; - private updateProvisioningStatus; -} -export {}; diff --git a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_keys_provisioning_status_saved_object.d.ts b/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_keys_provisioning_status_saved_object.d.ts deleted file mode 100644 index 8bdcaf9857ffa..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/uiam_api_key_provisioning/uiam_api_keys_provisioning_status_saved_object.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Saved object type id for UIAM API key provisioning status documents. - * - * This string intentionally matches Alerting's - * `UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE` in - * `x-pack/platform/plugins/shared/alerting/server/saved_objects/index.ts`. Task Manager cannot - * import that constant - * because `alerting` already depends on `taskManager`; importing alerting from Task Manager - * would introduce an undesirable plugin/module dependency cycle. - * - * The type is registered by Alerting (`setupSavedObjects`) on `ALERTING_CASES_SAVED_OBJECT_INDEX`. - * Task Manager only writes `entityType: 'task'` rows for observability; these writes do not - * participate in Task Manager execution logic. - * - * Note: `UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE` is treated as a transitional - * saved object type and is expected to be removed once a migration path to a longer-term - * storage or telemetry strategy is completed. - */ -export declare const UIAM_API_KEYS_PROVISIONING_STATUS_SAVED_OBJECT_TYPE = "uiam_api_keys_provisioning_status"; diff --git a/x-pack/platform/plugins/shared/task_manager/server/usage/index.d.ts b/x-pack/platform/plugins/shared/task_manager/server/usage/index.d.ts deleted file mode 100644 index 9250de9f32d22..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/usage/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { registerTaskManagerUsageCollector } from './task_manager_usage_collector'; diff --git a/x-pack/platform/plugins/shared/task_manager/server/usage/task_manager_usage_collector.d.ts b/x-pack/platform/plugins/shared/task_manager/server/usage/task_manager_usage_collector.d.ts deleted file mode 100644 index 8c0c147e8779d..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/usage/task_manager_usage_collector.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Observable } from 'rxjs'; -import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import type { MonitoredHealth } from '../routes/health'; -import type { TaskManagerUsage } from './types'; -import type { MonitoredUtilization } from '../routes/background_task_utilization'; -export declare function createTaskManagerUsageCollector(usageCollection: UsageCollectionSetup, monitoringStats$: Observable, monitoredUtilization$: Observable, excludeTaskTypes: string[]): import("@kbn/usage-collection-plugin/server").Collector; -export declare function registerTaskManagerUsageCollector(usageCollection: UsageCollectionSetup, monitoringStats$: Observable, monitoredUtilization$: Observable, excludeTaskTypes: string[]): void; diff --git a/x-pack/platform/plugins/shared/task_manager/server/usage/types.d.ts b/x-pack/platform/plugins/shared/task_manager/server/usage/types.d.ts deleted file mode 100644 index 7decc8cb22e26..0000000000000 --- a/x-pack/platform/plugins/shared/task_manager/server/usage/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface TaskManagerUsage { - task_type_exclusion: string[]; - failed_tasks: number; - recurring_tasks: { - actual_service_time: number; - adjusted_service_time: number; - }; - adhoc_tasks: { - actual_service_time: number; - adjusted_service_time: number; - }; - capacity: number; -} From 972b83f060370a52a62931c1f231f997dbcd7aeb Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Thu, 28 May 2026 11:10:05 +0200 Subject: [PATCH 18/21] clean dependencies --- src/platform/plugins/shared/field_formats/moon.yml | 2 -- src/platform/plugins/shared/field_formats/tsconfig.json | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/platform/plugins/shared/field_formats/moon.yml b/src/platform/plugins/shared/field_formats/moon.yml index 5f118b5e856a6..3ec20c71c55ca 100644 --- a/src/platform/plugins/shared/field_formats/moon.yml +++ b/src/platform/plugins/shared/field_formats/moon.yml @@ -23,8 +23,6 @@ dependsOn: - '@kbn/utility-types' - '@kbn/i18n' - '@kbn/config-schema' - - '@kbn/discover-utils' - - '@kbn/esql-utils' tags: - plugin - prod diff --git a/src/platform/plugins/shared/field_formats/tsconfig.json b/src/platform/plugins/shared/field_formats/tsconfig.json index 44e054ea849aa..486f7a12b3756 100644 --- a/src/platform/plugins/shared/field_formats/tsconfig.json +++ b/src/platform/plugins/shared/field_formats/tsconfig.json @@ -18,8 +18,6 @@ "@kbn/utility-types", "@kbn/i18n", "@kbn/config-schema", - "@kbn/discover-utils", - "@kbn/esql-utils", ], "exclude": [ "target/**/*", From 01284d06b55f26ed3c89eddbb3a78c5fcf2f92ff Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Thu, 28 May 2026 11:13:16 +0200 Subject: [PATCH 19/21] add test --- .../src/utils/format_hit.test.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.test.ts b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.test.ts index 61d68a3ebf80c..dac3d8f2f2278 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.test.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/utils/format_hit.test.ts @@ -85,6 +85,31 @@ describe('formatHitReact', () => { ]); }); + it('orders inline highlights first', () => { + const highlightHit = buildDataTableRecord( + { + ...hit, + inline_highlights: { message: { preTag: '', postTag: '' } }, + }, + dataViewMock + ); + const formatted = formatHitReact( + highlightHit, + dataViewMock, + (fieldName) => ['_index', 'message', 'extension', 'object.value'].includes(fieldName), + 220, + fieldFormatsMock, + undefined + ); + expect(formatted.map(([fieldName]) => fieldName)).toEqual([ + 'message', + 'extension', + 'object.value', + '_index', + '_score', + ]); + }); + it('only limits count of pairs based on advanced setting', () => { const formatted = formatHitReact( row, From 88f8892dd659638897d3846eff2605d0b14f2f3d Mon Sep 17 00:00:00 2001 From: elasticmachine Date: Fri, 29 May 2026 10:22:42 +0200 Subject: [PATCH 20/21] Address feedback --- .../packages/shared/kbn-discover-utils/src/types.ts | 4 ++-- src/platform/packages/shared/kbn-esql-utils/index.ts | 2 +- src/platform/packages/shared/kbn-esql-utils/moon.yml | 1 - src/platform/packages/shared/kbn-esql-utils/src/index.ts | 2 +- .../src/utils/get_columns_with_highlights.ts | 8 ++++---- .../src/utils/query_parsing_helpers.test.ts | 2 +- src/platform/packages/shared/kbn-esql-utils/tsconfig.json | 1 - .../public/application/main/data_fetching/fetch_esql.ts | 4 ++-- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/platform/packages/shared/kbn-discover-utils/src/types.ts b/src/platform/packages/shared/kbn-discover-utils/src/types.ts index 1553652405cd3..ee1ed895d7cb8 100644 --- a/src/platform/packages/shared/kbn-discover-utils/src/types.ts +++ b/src/platform/packages/shared/kbn-discover-utils/src/types.ts @@ -8,7 +8,7 @@ */ import type { SearchHit } from '@elastic/elasticsearch/lib/api/types'; -import type { EsqlColumnsWithHighlights } from '@kbn/esql-utils'; +import type { ESQLColumnsWithHighlights } from '@kbn/esql-utils'; import type { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; export type { IgnoredReason, ShouldShowFieldInTableHandler } from './utils'; @@ -31,7 +31,7 @@ export interface EsHitRecord extends Omit; +export type ESQLColumnsWithHighlights = Record; /** * Returns columns built using a highlighting algorithm, @@ -64,8 +64,8 @@ export type EsqlColumnsWithHighlights = Record; * }, * } */ -export function getColumnsWithHighlights(query: string): EsqlColumnsWithHighlights { - const columnsWithHighlights: EsqlColumnsWithHighlights = {}; +export function getColumnsWithHighlights(query: string): ESQLColumnsWithHighlights { + const columnsWithHighlights: ESQLColumnsWithHighlights = {}; const { root } = Parser.parse(query); const highlightFunctionsCandidates = Walker.findAll( diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts index 5ababa8f1b5ba..acc0d623e51dc 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ import type { DatatableColumn } from '@kbn/expressions-plugin/common'; -import type { monaco } from '@kbn/code-editor'; +import type { monaco } from '@kbn/monaco'; import type { ESQLColumn } from '@elastic/esql/types'; import { Parser, walk } from '@elastic/esql'; import { ESQLVariableType, type ESQLControlVariable } from '@kbn/esql-types'; diff --git a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json index f96d31a7d8103..ae962c5e0cfb8 100644 --- a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json +++ b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json @@ -35,6 +35,5 @@ "@kbn/controls-constants", "@kbn/presentation-publishing", "@kbn/controls-schemas", - "@kbn/code-editor", ] } diff --git a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts index 4a5cd547505d7..9c73e1069a2fe 100644 --- a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts +++ b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_esql.ts @@ -28,7 +28,7 @@ import { textBasedQueryStateToAstWithValidation } from '@kbn/data-plugin/common' import { getDocId, type DataTableRecord } from '@kbn/discover-utils'; import type { SearchResponseWarning } from '@kbn/search-response-warnings'; import moment from 'moment'; -import type { EsqlColumnsWithHighlights } from '@kbn/esql-utils'; +import type { ESQLColumnsWithHighlights } from '@kbn/esql-utils'; import { getColumnsWithHighlights } from '@kbn/esql-utils'; import type { RecordsFetchResponse } from '../../types'; import type { ScopedProfilesManager } from '../../../context_awareness'; @@ -115,7 +115,7 @@ export function fetchEsql({ const responseTime = moment().format('YYYY-MM-DD_HH_mm_ss'); esqlQueryColumns = table?.columns ?? undefined; esqlHeaderWarning = table.warning ?? undefined; - let inlineHighlights: EsqlColumnsWithHighlights | undefined; + let inlineHighlights: ESQLColumnsWithHighlights | undefined; if (isOfAggregateQueryType(query)) { try { inlineHighlights = getColumnsWithHighlights(query.esql); From 81c07035009221220b7994cbae1b77505674dd5a Mon Sep 17 00:00:00 2001 From: Sebastian Delle Donne Date: Fri, 29 May 2026 10:56:45 +0200 Subject: [PATCH 21/21] Update comment --- .../kbn-esql-utils/src/utils/get_columns_with_highlights.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts index 1ba6cf4cce668..7a8a14103c8f5 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/get_columns_with_highlights.ts @@ -141,7 +141,7 @@ const getHighlightTagName = (optionsMap: ESQLMap, optionName: string): string | * This function has an heuristic part, some combination of function could remove the highlighting tokens from the result. * But it assumes that if the user used highlight:true, it's not interested in removing them. * Doing a 100% accurate check would involve knowing the semantics of every invoked function. - * In the worst case of having a false positive, + * In the worst case of having a false positive, a value without highlighting tags will run through the highlighitng code. */ const getHighlightedColumnName = ( root: ESQLAstQueryExpression,

, searchSessionIndicatorUiConfig?: SearchSessionIndicatorUiConfig): void; + /** + * If the current app explicitly called {@link enableStorage} and provided all configuration needed + * for storing its search sessions + */ + isSessionStorageReady(): boolean; + getSearchSessionIndicatorUiConfig(): SearchSessionIndicatorUiConfig; + private refreshSearchSessionSavedObject; +} +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_client.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_client.d.ts new file mode 100644 index 0000000000000..572924d043d63 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_client.d.ts @@ -0,0 +1,31 @@ +import type { PublicContract } from '@kbn/utility-types'; +import type { HttpSetup } from '@kbn/core/public'; +import type { SavedObject, SavedObjectsUpdateResponse, SavedObjectsFindOptions } from '@kbn/core/server'; +import type { SearchSessionSavedObjectAttributes, SearchSessionsFindResponse, SearchSessionStatusesResponse } from '../../../common'; +export type SearchSessionSavedObject = SavedObject; +export type ISessionsClient = PublicContract; +export interface SessionsClientDeps { + http: HttpSetup; +} +/** + * CRUD Search Session SO + */ +export declare class SessionsClient { + private readonly http; + constructor(deps: SessionsClientDeps); + get(sessionId: string): Promise; + create({ name, appId, locatorId, initialState, restoreState, sessionId, }: { + name: string; + appId: string; + locatorId: string; + initialState: Record; + restoreState: Record; + sessionId: string; + }): Promise; + find(opts: Omit): Promise; + update(sessionId: string, attributes: unknown): Promise>; + rename(sessionId: string, newName: string): Promise; + extend(sessionId: string, expires: string): Promise; + delete(sessionId: string): Promise; + status(sessionIds: string[]): Promise; +} diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/index.d.ts new file mode 100644 index 0000000000000..48888ae261740 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/index.d.ts @@ -0,0 +1,15 @@ +import type { CoreSetup } from '@kbn/core/public'; +import type { ManagementAppMountParams } from '@kbn/management-plugin/public'; +import type { IManagementSectionsPluginsSetup, IManagementSectionsPluginsStart } from '..'; +import { renderApp } from './render'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; +export declare class SearchSessionsMgmtApp { + private coreSetup; + private setupDeps; + private config; + private kibanaVersion; + private params; + constructor(coreSetup: CoreSetup, setupDeps: IManagementSectionsPluginsSetup, config: SearchSessionsConfigSchema, kibanaVersion: string, params: ManagementAppMountParams); + mountManagementSection(): Promise<() => void>; +} +export { renderApp }; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/render.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/render.d.ts new file mode 100644 index 0000000000000..89b48d5660e90 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/application/render.d.ts @@ -0,0 +1,2 @@ +import type { AppDependencies } from '..'; +export declare const renderApp: (elem: HTMLElement | null, { uiSettings, ...homeDeps }: AppDependencies) => () => void; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/index.d.ts new file mode 100644 index 0000000000000..a5218450cbe00 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/index.d.ts @@ -0,0 +1,11 @@ +import type { EuiTextProps } from '@elastic/eui'; +import React from 'react'; +export type { OnActionComplete } from './table/actions'; +export { PopoverActionsMenu } from './table/actions'; +export declare const TableText: ({ children, ...props }: EuiTextProps) => React.JSX.Element; +export interface StatusDef { + textColor?: EuiTextProps['color']; + icon?: React.ReactElement; + label: React.ReactElement; + toolTipContent: string; +} diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/index.d.ts new file mode 100644 index 0000000000000..fa41bb68e9eb6 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/index.d.ts @@ -0,0 +1 @@ +export { InspectFlyout } from './inspect_flyout'; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/inspect_flyout.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/inspect_flyout.d.ts new file mode 100644 index 0000000000000..24d8ce94faa69 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/inspect_flyout/inspect_flyout.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { UISession } from '../../types'; +interface InspectFlyoutProps { + searchSession: UISession; +} +export declare const InspectFlyout: React.FC; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/main.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/main.d.ts new file mode 100644 index 0000000000000..9bb4eeec3563b --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/main.d.ts @@ -0,0 +1,20 @@ +import React from 'react'; +import type { CoreStart, HttpStart } from '@kbn/core/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { SearchSessionsMgmtAPI } from '../lib/api'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; +import type { SearchUsageCollector } from '../../../collectors'; +import type { ISearchSessionEBTManager } from '../../ebt_manager'; +interface Props { + core: CoreStart; + api: SearchSessionsMgmtAPI; + http: HttpStart; + timezone: string; + config: SearchSessionsConfigSchema; + kibanaVersion: string; + share: SharePluginStart; + searchUsageCollector: SearchUsageCollector; + searchSessionEBTManager: ISearchSessionEBTManager; +} +export declare function SearchSessionsMgmtMain({ share, ...tableProps }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/status.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/status.d.ts new file mode 100644 index 0000000000000..5c313076f7c88 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/status.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; +import type { UISession } from '../types'; +export declare const getStatusText: (statusType: string) => string; +interface StatusIndicatorProps { + now?: string; + session: UISession; + timezone: string; +} +export declare const StatusIndicator: (props: StatusIndicatorProps) => React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/delete_button.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/delete_button.d.ts new file mode 100644 index 0000000000000..25e3e106edac4 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/delete_button.d.ts @@ -0,0 +1,5 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { SearchSessionsMgmtAPI } from '../../../lib/api'; +import type { IClickActionDescriptor } from './types'; +import type { UISession } from '../../../types'; +export declare const createDeleteActionDescriptor: (api: SearchSessionsMgmtAPI, uiSession: UISession, core: CoreStart) => IClickActionDescriptor; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/extend_button.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/extend_button.d.ts new file mode 100644 index 0000000000000..afa9387a3430c --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/extend_button.d.ts @@ -0,0 +1,5 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { SearchSessionsMgmtAPI } from '../../../lib/api'; +import type { IClickActionDescriptor } from './types'; +import type { UISession } from '../../../types'; +export declare const createExtendActionDescriptor: (api: SearchSessionsMgmtAPI, uiSession: UISession, core: CoreStart) => IClickActionDescriptor; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/get_action.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/get_action.d.ts new file mode 100644 index 0000000000000..3fd6227944a77 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/get_action.d.ts @@ -0,0 +1,6 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { IClickActionDescriptor } from './types'; +import type { SearchSessionsMgmtAPI } from '../../../lib/api'; +import type { UISession } from '../../../types'; +import { ACTION } from '../../../types'; +export declare const getAction: (api: SearchSessionsMgmtAPI, actionType: ACTION, uiSession: UISession, core: CoreStart, isWithinFlyout?: boolean) => IClickActionDescriptor | null; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/index.d.ts new file mode 100644 index 0000000000000..9304ffbbbbcbf --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/index.d.ts @@ -0,0 +1,2 @@ +export { PopoverActionsMenu } from './popover_actions'; +export type * from './types'; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/inspect_button.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/inspect_button.d.ts new file mode 100644 index 0000000000000..102847c336e67 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/inspect_button.d.ts @@ -0,0 +1,5 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { UISession } from '../../../types'; +import type { IClickActionDescriptor } from './types'; +import type { SearchSessionsMgmtAPI } from '../../../lib/api'; +export declare const createInspectActionDescriptor: (api: SearchSessionsMgmtAPI, uiSession: UISession, core: CoreStart, isWithinFlyout?: boolean) => IClickActionDescriptor; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/popover_actions.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/popover_actions.d.ts new file mode 100644 index 0000000000000..4985271184750 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/popover_actions.d.ts @@ -0,0 +1,15 @@ +import type { CoreStart } from '@kbn/core/public'; +import React from 'react'; +import type { SearchSessionsMgmtAPI } from '../../../lib/api'; +import type { UISession } from '../../../types'; +import type { OnActionComplete } from './types'; +interface PopoverActionItemsProps { + session: UISession; + api: SearchSessionsMgmtAPI; + onActionComplete: OnActionComplete; + core: CoreStart; + allowedActions?: UISession['actions']; + isWithinFlyout?: boolean; +} +export declare const PopoverActionsMenu: ({ api, onActionComplete, session, core, allowedActions, isWithinFlyout, }: PopoverActionItemsProps) => React.JSX.Element | null; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.d.ts new file mode 100644 index 0000000000000..7d1c7fc9b1c0c --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.d.ts @@ -0,0 +1,5 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { SearchSessionsMgmtAPI } from '../../../lib/api'; +import type { IClickActionDescriptor } from './types'; +import type { UISession } from '../../../types'; +export declare const createRenameActionDescriptor: (api: SearchSessionsMgmtAPI, uiSession: UISession, core: CoreStart) => IClickActionDescriptor; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/types.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/types.d.ts new file mode 100644 index 0000000000000..cb86b668656cd --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/types.d.ts @@ -0,0 +1,8 @@ +import type { IconType } from '@elastic/eui'; +export type OnActionComplete = () => void; +export type OnActionDismiss = () => void; +export interface IClickActionDescriptor { + label: React.ReactNode; + iconType: IconType; + onClick: () => Promise | void; +} diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/actions.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/actions.d.ts new file mode 100644 index 0000000000000..9599bfc3b9807 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/actions.d.ts @@ -0,0 +1,12 @@ +import type { EuiBasicTableColumn } from '@elastic/eui'; +import type { CoreStart } from '@kbn/core/public'; +import type { UISession } from '../../../types'; +import type { OnActionComplete } from '../actions'; +import type { SearchSessionsMgmtAPI } from '../../../lib/api'; +export declare const actionsColumn: ({ api, core, onActionComplete, allowedActions, isWithinFlyout, }: { + core: CoreStart; + api: SearchSessionsMgmtAPI; + onActionComplete: OnActionComplete; + allowedActions?: UISession["actions"]; + isWithinFlyout?: boolean; +}) => EuiBasicTableColumn; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/app_id.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/app_id.d.ts new file mode 100644 index 0000000000000..b16aea940171a --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/app_id.d.ts @@ -0,0 +1,3 @@ +import type { EuiBasicTableColumn } from '@elastic/eui'; +import type { UISession } from '../../../types'; +export declare const appIdColumn: EuiBasicTableColumn; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/get_columns.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/get_columns.d.ts new file mode 100644 index 0000000000000..649ce2106bf0b --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/get_columns.d.ts @@ -0,0 +1,16 @@ +import type { EuiBasicTableColumn } from '@elastic/eui'; +import type { CoreStart } from '@kbn/core/public'; +import type { OnActionComplete } from '../..'; +import type { SearchSessionsMgmtAPI } from '../../../lib/api'; +import type { UISession } from '../../../types'; +import type { SearchUsageCollector } from '../../../../../collectors'; +import type { SearchSessionsConfigSchema } from '../../../../../../../server/config'; +export declare const getColumns: ({ core, api, config, timezone, onActionComplete, kibanaVersion, searchUsageCollector, }: { + core: CoreStart; + api: SearchSessionsMgmtAPI; + config: SearchSessionsConfigSchema; + timezone: string; + onActionComplete: OnActionComplete; + kibanaVersion: string; + searchUsageCollector: SearchUsageCollector; +}) => Array>; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/index.d.ts new file mode 100644 index 0000000000000..9a453606a43a5 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/index.d.ts @@ -0,0 +1,4 @@ +export * from './app_id'; +export * from './name'; +export * from './actions'; +export * from './status'; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/name.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/name.d.ts new file mode 100644 index 0000000000000..66cd0a4af850c --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/name.d.ts @@ -0,0 +1,10 @@ +import type { EuiBasicTableColumn } from '@elastic/eui'; +import type { CoreStart } from '@kbn/core/public'; +import type { SearchUsageCollector } from '../../../../../collectors'; +import type { BackgroundSearchOpenedHandler, UISession } from '../../../types'; +export declare const nameColumn: ({ core, searchUsageCollector, kibanaVersion, onBackgroundSearchOpened, }: { + core: CoreStart; + searchUsageCollector: SearchUsageCollector; + kibanaVersion: string; + onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; +}) => EuiBasicTableColumn; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/status.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/status.d.ts new file mode 100644 index 0000000000000..4b3f89e5ab212 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/columns/status.d.ts @@ -0,0 +1,3 @@ +import type { EuiBasicTableColumn } from '@elastic/eui'; +import type { UISession } from '../../../types'; +export declare const statusColumn: (timezone: string) => EuiBasicTableColumn; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/index.d.ts new file mode 100644 index 0000000000000..6cb67c17806ba --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/index.d.ts @@ -0,0 +1,2 @@ +export * as columns from './columns'; +export { SearchSessionsMgmtTable } from './table'; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/table.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/table.d.ts new file mode 100644 index 0000000000000..41ae628a04cf5 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/table.d.ts @@ -0,0 +1,39 @@ +import type { EuiBasicTableColumn } from '@elastic/eui'; +import type { CoreStart } from '@kbn/core/public'; +import React from 'react'; +import type { SearchSessionsMgmtAPI } from '../../lib/api'; +import type { BackgroundSearchOpenedHandler, LocatorsStart, UISession } from '../../types'; +import type { OnActionComplete } from './actions'; +import type { SearchUsageCollector } from '../../../../collectors'; +import type { SearchSessionsConfigSchema } from '../../../../../../server/config'; +import type { ISearchSessionEBTManager } from '../../../ebt_manager'; +interface Props { + core: CoreStart; + locators: LocatorsStart; + api: SearchSessionsMgmtAPI; + searchSessionEBTManager: ISearchSessionEBTManager; + timezone: string; + config: SearchSessionsConfigSchema; + kibanaVersion: string; + searchUsageCollector: SearchUsageCollector; + hideRefreshButton?: boolean; + appId?: string; + onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; + getColumns?: (params: { + core: CoreStart; + api: SearchSessionsMgmtAPI; + config: SearchSessionsConfigSchema; + timezone: string; + kibanaVersion: string; + searchUsageCollector: SearchUsageCollector; + onActionComplete: OnActionComplete; + onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; + }) => Array>; + trackingProps: { + openedFrom: string; + renderedIn: string; + }; +} +export type GetColumnsFn = Props['getColumns']; +export declare function SearchSessionsMgmtTable({ core, locators, api, timezone, config, searchSessionEBTManager, kibanaVersion, searchUsageCollector, hideRefreshButton, getColumns, appId, onBackgroundSearchOpened, trackingProps, ...props }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_actions.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_actions.d.ts new file mode 100644 index 0000000000000..6fc16a46cb058 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_actions.d.ts @@ -0,0 +1,3 @@ +import type { UISearchSessionState } from '../../../types'; +import { ACTION } from '../../../types'; +export declare function getActions(status: UISearchSessionState): ACTION[]; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_app_filter.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_app_filter.d.ts new file mode 100644 index 0000000000000..91d1173f16b81 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_app_filter.d.ts @@ -0,0 +1,3 @@ +import type { SearchFilterConfig } from '@elastic/eui'; +import type { UISession } from '../../../types'; +export declare const getAppFilter: (tableData: UISession[]) => SearchFilterConfig; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_status_filter.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_status_filter.d.ts new file mode 100644 index 0000000000000..4f640fce61c56 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/get_status_filter.d.ts @@ -0,0 +1,3 @@ +import type { SearchFilterConfig } from '@elastic/eui'; +import type { UISession } from '../../../types'; +export declare const getStatusFilter: (tableData: UISession[]) => SearchFilterConfig; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/map_to_ui_session.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/map_to_ui_session.d.ts new file mode 100644 index 0000000000000..f1cb04485bc7f --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/utils/map_to_ui_session.d.ts @@ -0,0 +1,8 @@ +import type { SearchSessionsFindResponse } from '../../../../../../../common'; +import type { ACTION, LocatorsStart, SearchSessionSavedObject, UISession } from '../../../types'; +export declare const mapToUISession: ({ savedObject, locators, sessionStatuses, actions: filteredActions, }: { + savedObject: SearchSessionSavedObject; + locators: LocatorsStart; + sessionStatuses: SearchSessionsFindResponse["statuses"]; + actions?: ACTION[]; +}) => UISession; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/constants.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/constants.d.ts new file mode 100644 index 0000000000000..f6506c7b047cc --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/constants.d.ts @@ -0,0 +1 @@ +export declare const FLYOUT_WIDTH = "33vw"; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/flyout.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/flyout.d.ts new file mode 100644 index 0000000000000..42da47d980628 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/flyout.d.ts @@ -0,0 +1,22 @@ +import React from 'react'; +import type { CoreStart } from '@kbn/core/public'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; +import type { SearchSessionsMgmtAPI } from '../lib/api'; +import type { SearchUsageCollector } from '../../../collectors'; +import type { BackgroundSearchOpenedHandler, LocatorsStart } from '../types'; +import type { ISearchSessionEBTManager } from '../../ebt_manager'; +export declare const Flyout: ({ api, coreStart, usageCollector, ebtManager, config, kibanaVersion, locators, appId, trackingProps, onBackgroundSearchOpened, onClose, }: { + api: SearchSessionsMgmtAPI; + coreStart: CoreStart; + usageCollector: SearchUsageCollector; + ebtManager: ISearchSessionEBTManager; + config: SearchSessionsConfigSchema; + kibanaVersion: string; + locators: LocatorsStart; + appId?: string; + trackingProps: { + openedFrom: string; + }; + onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; + onClose: () => void; +}) => React.JSX.Element; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_columns.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_columns.d.ts new file mode 100644 index 0000000000000..8e0d58b90e854 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_columns.d.ts @@ -0,0 +1,4 @@ +import type { SearchSessionsMgmtTable } from '../components/table'; +type GetColumnsFn = React.ComponentProps['getColumns']; +export declare const getColumns: GetColumnsFn; +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_flyout.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_flyout.d.ts new file mode 100644 index 0000000000000..c518955f4ff28 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/flyout/get_flyout.d.ts @@ -0,0 +1,25 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { ISessionsClient } from '../../../..'; +import type { SearchUsageCollector } from '../../../collectors'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; +import type { BackgroundSearchOpenedHandler } from '../types'; +import type { ISearchSessionEBTManager } from '../../ebt_manager'; +export declare function openSearchSessionsFlyout({ coreStart, kibanaVersion, usageCollector, ebtManager, config, sessionsClient, share, }: { + coreStart: CoreStart; + kibanaVersion: string; + usageCollector: SearchUsageCollector; + ebtManager: ISearchSessionEBTManager; + config: SearchSessionsConfigSchema; + sessionsClient: ISessionsClient; + share: SharePluginStart; +}): (attrs: { + appId: string; + trackingProps: { + openedFrom: string; + }; + onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; + onClose?: () => void; +}) => { + flyout: import("@kbn/core/public").OverlayRef; +}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/index.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/index.d.ts new file mode 100644 index 0000000000000..35c76c7b4011f --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/index.d.ts @@ -0,0 +1,36 @@ +import type { CoreStart, HttpStart, I18nStart, IUiSettingsClient } from '@kbn/core/public'; +import type { CoreSetup } from '@kbn/core/public'; +import type { ManagementSetup } from '@kbn/management-plugin/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { ISessionsClient, SearchUsageCollector } from '../../..'; +import type { SearchSessionsMgmtAPI } from './lib/api'; +import type { SearchSessionsConfigSchema } from '../../../../server/config'; +import type { ISearchSessionEBTManager } from '../ebt_manager'; +export { openSearchSessionsFlyout } from './flyout/get_flyout'; +export type { BackgroundSearchOpenedHandler } from './types'; +export interface IManagementSectionsPluginsSetup { + management: ManagementSetup; + searchUsageCollector: SearchUsageCollector; + sessionsClient: ISessionsClient; + searchSessionEBTManager: ISearchSessionEBTManager; +} +export interface IManagementSectionsPluginsStart { + share: SharePluginStart; +} +export interface AppDependencies { + share: SharePluginStart; + uiSettings: IUiSettingsClient; + core: CoreStart; + api: SearchSessionsMgmtAPI; + http: HttpStart; + i18n: I18nStart; + config: SearchSessionsConfigSchema; + kibanaVersion: string; + searchUsageCollector: SearchUsageCollector; + searchSessionEBTManager: ISearchSessionEBTManager; +} +export declare const APP: { + id: string; + getI18nName: () => string; +}; +export declare function registerSearchSessionsMgmt(coreSetup: CoreSetup, deps: IManagementSectionsPluginsSetup, config: SearchSessionsConfigSchema, kibanaVersion: string): import("@kbn/management-plugin/public").ManagementApp; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.d.ts new file mode 100644 index 0000000000000..b65e25e485563 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.d.ts @@ -0,0 +1,31 @@ +import type { ApplicationStart, FeatureFlagsStart, NotificationsStart } from '@kbn/core/public'; +import moment from 'moment'; +import type { SearchSessionStatusResponse } from '../../../../../common'; +import type { SearchSessionSavedObject } from '../types'; +import type { ISessionsClient } from '../../sessions_client'; +import type { SearchUsageCollector } from '../../../collectors'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; +interface SearchSessionManagementDeps { + notifications: NotificationsStart; + application: ApplicationStart; + usageCollector?: SearchUsageCollector; + featureFlags: FeatureFlagsStart; +} +interface FetchReturn { + savedObjects: SearchSessionSavedObject[]; + statuses: Record; +} +export declare class SearchSessionsMgmtAPI { + private sessionsClient; + private config; + private deps; + constructor(sessionsClient: ISessionsClient, config: SearchSessionsConfigSchema, deps: SearchSessionManagementDeps); + fetchTableData({ appId }?: { + appId?: string; + }): Promise; + getExtendByDuration(): moment.Duration; + sendDelete(id: string): Promise; + sendExtend(id: string, expires: string): Promise; + sendRename(id: string, newName: string): Promise; +} +export {}; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/date_string.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/date_string.d.ts new file mode 100644 index 0000000000000..c47e68d1be065 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/date_string.d.ts @@ -0,0 +1 @@ +export declare const dateString: (inputString: string, tz: string) => string; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/get_expiration_status.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/get_expiration_status.d.ts new file mode 100644 index 0000000000000..117eab062de45 --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/get_expiration_status.d.ts @@ -0,0 +1,5 @@ +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; +export declare const getExpirationStatus: (config: SearchSessionsConfigSchema, expires: string | null) => { + toolTipContent: string; + statusContent: string; +} | undefined; diff --git a/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/types.d.ts b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/types.d.ts new file mode 100644 index 0000000000000..de03e663bec8c --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/session/sessions_mgmt/types.d.ts @@ -0,0 +1,41 @@ +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { SearchSessionSavedObjectAttributes, SearchSessionStatus } from '../../../../common'; +export declare const DATE_STRING_FORMAT = "D MMM, YYYY, HH:mm:ss"; +/** + * Some properties are optional for a non-persisted Search Session. + * This interface makes them mandatory, because management only shows persisted search sessions. + */ +export type PersistedSearchSessionSavedObjectAttributes = SearchSessionSavedObjectAttributes & Required>; +export type UISearchSessionState = SearchSessionStatus; +export declare enum ACTION { + INSPECT = "inspect", + EXTEND = "extend", + DELETE = "delete", + RENAME = "rename" +} +export interface UISession { + id: string; + name: string; + appId: string; + created: string; + expires: string | null; + status: UISearchSessionState; + idMapping: SearchSessionSavedObjectAttributes['idMapping']; + numSearches: number; + actions?: ACTION[]; + reloadUrl: string; + restoreUrl: string; + initialState: Record; + restoreState: Record; + version: string; + errors?: string[]; +} +export type LocatorsStart = SharePluginStart['url']['locators']; +export interface SearchSessionSavedObject { + id: string; + attributes: PersistedSearchSessionSavedObjectAttributes; +} +export type BackgroundSearchOpenedHandler = (attrs: { + session: UISession; + event: React.MouseEvent; +}) => void; diff --git a/src/platform/plugins/shared/data/public/search/types.d.ts b/src/platform/plugins/shared/data/public/search/types.d.ts new file mode 100644 index 0000000000000..3053606d182cb --- /dev/null +++ b/src/platform/plugins/shared/data/public/search/types.d.ts @@ -0,0 +1,100 @@ +import type { PackageInfo } from '@kbn/core/server'; +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; +import type { RequestAdapter } from '@kbn/inspector-plugin/public'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import type { WarningHandlerCallback } from '@kbn/search-response-warnings'; +import type { ISearchGeneric } from '@kbn/search-types'; +import type { ISearchStartSearchSource } from '../../common/search'; +import type { AggsSetup, AggsSetupDependencies, AggsStart, AggsStartDependencies } from './aggs'; +import type { SearchUsageCollector } from './collectors'; +import type { ISessionsClient, ISessionService } from './session'; +import type { BackgroundSearchOpenedHandler } from './session/sessions_mgmt'; +export { SEARCH_EVENT_TYPE } from './collectors'; +export type { ISearchStartSearchSource, SearchUsageCollector }; +/** + * The setup contract exposed by the Search plugin exposes the search strategy extension + * point. + */ +export interface ISearchSetup { + aggs: AggsSetup; + usageCollector?: SearchUsageCollector; + /** + * Current session management + * {@link ISessionService} + */ + session: ISessionService; + /** + * Search sessions SO CRUD + * {@link ISessionsClient} + */ + sessionsClient: ISessionsClient; +} +/** + * search service + * @public + */ +export interface ISearchStart { + /** + * agg config sub service + * {@link AggsStart} + * + */ + aggs: AggsStart; + /** + * low level search + * {@link ISearchGeneric} + */ + search: ISearchGeneric; + /** + * Show toast for caught error + * @param e Error + */ + showError: (e: Error) => void; + /** + * Show warnings, or customize how they're shown + * @param inspector IInspectorInfo - an inspector object with requests internally collected + * @param cb WarningHandlerCallback - optional callback to intercept warnings + */ + showWarnings: (adapter: RequestAdapter, cb?: WarningHandlerCallback) => void; + /** + * Shows a flyout with a table to manage search sessions. + */ + showSearchSessionsFlyout: (attrs: { + appId: string; + trackingProps: { + openedFrom: string; + }; + onBackgroundSearchOpened?: BackgroundSearchOpenedHandler; + onClose?: () => void; + }) => void; + /** + * Feature flag value to make it easier to use in different plugins + */ + isBackgroundSearchEnabled: boolean; + /** + * high level search + * {@link ISearchStartSearchSource} + */ + searchSource: ISearchStartSearchSource; + /** + * Current session management + * {@link ISessionService} + */ + session: ISessionService; + /** + * Search sessions SO CRUD + * {@link ISessionsClient} + */ + sessionsClient: ISessionsClient; +} +/** @internal */ +export interface SearchServiceSetupDependencies { + packageInfo: PackageInfo; + registerFunction: AggsSetupDependencies['registerFunction']; + usageCollection?: UsageCollectionSetup; +} +/** @internal */ +export interface SearchServiceStartDependencies { + fieldFormats: AggsStartDependencies['fieldFormats']; + indexPatterns: DataViewsContract; +} diff --git a/src/platform/plugins/shared/data/public/services.d.ts b/src/platform/plugins/shared/data/public/services.d.ts new file mode 100644 index 0000000000000..5b0b24166a8c2 --- /dev/null +++ b/src/platform/plugins/shared/data/public/services.d.ts @@ -0,0 +1,7 @@ +import type { DataViewsContract } from '@kbn/data-views-plugin/common'; +export declare const getUiSettings: import("@kbn/kibana-utils-plugin/public").Get, setUiSettings: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getOverlays: import("@kbn/kibana-utils-plugin/public").Get, setOverlays: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getIndexPatterns: import("@kbn/kibana-utils-plugin/public").Get, setIndexPatterns: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getHttp: import("@kbn/kibana-utils-plugin/public").Get, setHttp: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getSearchService: import("@kbn/kibana-utils-plugin/public").Get, setSearchService: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getTheme: import("@kbn/kibana-utils-plugin/public").Get, setTheme: import("@kbn/kibana-utils-plugin/public").Set; diff --git a/src/platform/plugins/shared/data/public/types.d.ts b/src/platform/plugins/shared/data/public/types.d.ts new file mode 100644 index 0000000000000..817048ec7b32a --- /dev/null +++ b/src/platform/plugins/shared/data/public/types.d.ts @@ -0,0 +1,83 @@ +import type { ExpressionsSetup } from '@kbn/expressions-plugin/public'; +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; +import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import type { FieldFormatsSetup, FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import type { Setup as InspectorSetup, Start as InspectorStartContract } from '@kbn/inspector-plugin/public'; +import type { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { ManagementSetup } from '@kbn/management-plugin/public'; +import type { Filter } from '@kbn/es-query'; +import type { DataViewsContract } from '@kbn/data-views-plugin/public'; +import type { CPSPluginStart } from '@kbn/cps/public'; +import type { DatatableUtilitiesService } from '../common'; +import type { ISearchSetup, ISearchStart } from './search'; +import type { QuerySetup, QueryStart } from './query'; +import type { NowProviderPublicContract } from './now_provider'; +import type { MultiValueClickDataContext, RangeSelectDataContext, ValueClickDataContext } from './actions/filters'; +export interface DataSetupDependencies { + expressions: ExpressionsSetup; + uiActions: UiActionsSetup; + inspector: InspectorSetup; + usageCollection?: UsageCollectionSetup; + fieldFormats: FieldFormatsSetup; + management: ManagementSetup; +} +export interface DataStartDependencies { + uiActions: UiActionsStart; + fieldFormats: FieldFormatsStart; + dataViews: DataViewsPublicPluginStart; + inspector: InspectorStartContract; + screenshotMode: ScreenshotModePluginStart; + share: SharePluginStart; + cps?: CPSPluginStart; +} +/** + * Data plugin public Setup contract + */ +export interface DataPublicPluginSetup { + search: ISearchSetup; + query: QuerySetup; +} +/** + * utilities to generate filters from action context + */ +export interface DataPublicPluginStartActions { + createFiltersFromValueClickAction: (context: ValueClickDataContext) => Promise; + createFiltersFromRangeSelectAction: (event: RangeSelectDataContext) => Promise; + createFiltersFromMultiValueClickAction: (context: MultiValueClickDataContext) => Promise; +} +/** + * Data plugin public Start contract + */ +export interface DataPublicPluginStart { + /** + * filter creation utilities + * {@link DataPublicPluginStartActions} + */ + actions: DataPublicPluginStartActions; + /** + * data views service + * {@link DataViewsContract} + */ + dataViews: DataViewsContract; + /** + * Datatable type utility functions. + */ + datatableUtilities: DatatableUtilitiesService; + /** + * search service + * {@link ISearchStart} + */ + search: ISearchStart; + /** + * @deprecated Use fieldFormats plugin instead + */ + fieldFormats: FieldFormatsStart; + /** + * query service + * {@link QueryStart} + */ + query: QueryStart; + nowProvider: NowProviderPublicContract; +} diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.d.ts new file mode 100644 index 0000000000000..5f038a01dbf39 --- /dev/null +++ b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { Datatable, DatatableColumn, DatatableRow } from '@kbn/expressions-plugin/public'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import { type EuiTablePersistInjectedProps } from '@kbn/shared-ux-table-persist/src'; +interface DataTableFormatProps { + data: Datatable; + uiSettings: IUiSettingsClient; + fieldFormats: FieldFormatsStart; + uiActions: UiActionsStart; + isFilterable: (column: DatatableColumn) => boolean; +} +export declare const DataTableFormat: React.FC, "euiTablePersist">>>; +export {}; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table_selector.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table_selector.d.ts new file mode 100644 index 0000000000000..f85e861981f9f --- /dev/null +++ b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table_selector.d.ts @@ -0,0 +1,20 @@ +import React, { Component } from 'react'; +import type { Datatable } from '@kbn/expressions-plugin/public'; +interface TableSelectorState { + isPopoverOpen: boolean; +} +interface TableSelectorProps { + tables: Datatable[]; + selectedTable: Datatable; + onTableChanged: (table: Datatable) => void; +} +export declare class TableSelector extends Component { + state: { + isPopoverOpen: boolean; + }; + togglePopover: () => void; + closePopover: () => void; + renderTableDropdownItem: (table: Datatable, index: number) => React.JSX.Element; + render(): React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view.d.ts new file mode 100644 index 0000000000000..69553805bf4a6 --- /dev/null +++ b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view.d.ts @@ -0,0 +1,33 @@ +import React, { Component } from 'react'; +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { InspectorViewProps, Adapters } from '@kbn/inspector-plugin/public'; +import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { TablesAdapter, Datatable, DatatableColumn } from '@kbn/expressions-plugin/public'; +interface DataViewComponentState { + datatable: Datatable; + adapters: Adapters; +} +interface DataViewComponentProps extends InspectorViewProps { + uiSettings: IUiSettingsClient; + uiActions: UiActionsStart; + fieldFormats: FieldFormatsStart; + isFilterable: (column: DatatableColumn) => boolean; + options: { + fileName?: string; + }; +} +declare class DataViewComponent extends Component { + state: DataViewComponentState; + static getDerivedStateFromProps(nextProps: Readonly, state: DataViewComponentState): { + adapters: Adapters; + datatable: any; + } | null; + onUpdateData: (tables: TablesAdapter["tables"]) => void; + selectTable: (datatable: Datatable) => void; + componentDidMount(): void; + componentWillUnmount(): void; + static renderNoData(): React.JSX.Element; + render(): React.JSX.Element; +} +export default DataViewComponent; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view_wrapper.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view_wrapper.d.ts new file mode 100644 index 0000000000000..9b3dcac961d57 --- /dev/null +++ b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_view_wrapper.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { DatatableColumn } from '@kbn/expressions-plugin/common/expression_types/specs'; +export declare const getDataViewComponentWrapper: (getStartServices: () => { + uiActions: UiActionsStart; + fieldFormats: FieldFormatsStart; + uiSettings: IUiSettingsClient; + isFilterable: (column: DatatableColumn) => boolean; +}) => (props: any) => React.JSX.Element; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/download_options.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/download_options.d.ts new file mode 100644 index 0000000000000..9ea04aab94895 --- /dev/null +++ b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/download_options.d.ts @@ -0,0 +1,27 @@ +import React, { Component } from 'react'; +import type { Datatable } from '@kbn/expressions-plugin/common'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { IUiSettingsClient } from '@kbn/core/public'; +interface DataDownloadOptionsState { + isPopoverOpen: boolean; +} +interface DataDownloadOptionsProps { + title: string; + datatables: Datatable[]; + uiSettings: IUiSettingsClient; + isFormatted?: boolean; + fieldFormats: FieldFormatsStart; +} +declare class DataDownloadOptions extends Component { + state: { + isPopoverOpen: boolean; + }; + onTogglePopover: () => void; + closePopover: () => void; + exportCsv: (isFormatted?: boolean) => void; + exportFormattedCsv: () => void; + exportFormattedAsRawCsv: () => void; + renderFormattedDownloads(): React.JSX.Element; + render(): React.JSX.Element; +} +export { DataDownloadOptions }; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/index.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/index.d.ts new file mode 100644 index 0000000000000..71e5098a759bf --- /dev/null +++ b/src/platform/plugins/shared/data/public/utils/table_inspector_view/index.d.ts @@ -0,0 +1,11 @@ +import type { IUiSettingsClient } from '@kbn/core/public'; +import type { InspectorViewDescription } from '@kbn/inspector-plugin/public'; +import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { DatatableColumn } from '@kbn/expressions-plugin/common/expression_types/specs'; +export declare const getTableViewDescription: (getStartServices: () => { + uiActions: UiActionsStart; + fieldFormats: FieldFormatsStart; + isFilterable: (column: DatatableColumn) => boolean; + uiSettings: IUiSettingsClient; +}) => InspectorViewDescription; diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/types.d.ts b/src/platform/plugins/shared/data/public/utils/table_inspector_view/types.d.ts new file mode 100644 index 0000000000000..5ff4c9369eb7d --- /dev/null +++ b/src/platform/plugins/shared/data/public/utils/table_inspector_view/types.d.ts @@ -0,0 +1,15 @@ +import type React from 'react'; +import type { Datatable, DatatableColumn, DatatableRow } from '@kbn/expressions-plugin/common'; +type DataViewColumnRender = (value: string, _item: DatatableRow) => React.ReactNode | string; +export interface DataViewColumn { + originalColumn: () => DatatableColumn; + name: string; + field: string; + sortable: boolean | ((item: DatatableRow) => string | number); + render: DataViewColumnRender; +} +export type DataViewRow = DatatableRow; +export interface TableInspectorAdapter { + [key: string]: Datatable; +} +export {}; diff --git a/src/platform/plugins/shared/data/server/config.d.ts b/src/platform/plugins/shared/data/server/config.d.ts new file mode 100644 index 0000000000000..da5e908b90ffb --- /dev/null +++ b/src/platform/plugins/shared/data/server/config.d.ts @@ -0,0 +1,211 @@ +import type { TypeOf } from '@kbn/config-schema'; +export declare const searchSessionsConfigSchema: import("@kbn/config-schema").ObjectType<{ + /** + * Turns the feature on \ off (incl. removing indicator and management screens) + */ + enabled: import("@kbn/config-schema").Type; + /** + * notTouchedTimeout controls how long user can save a session after all searches completed. + * The client continues to poll searches to keep the alive until this timeout hits + */ + notTouchedTimeout: import("@kbn/config-schema").Type; + /** + * maxUpdateRetries controls how many retries we perform while attempting to save a search session + */ + maxUpdateRetries: import("@kbn/config-schema").Type; + /** + * defaultExpiration controls how long search sessions are valid for, until they are expired. + */ + defaultExpiration: import("@kbn/config-schema").Type; + management: import("@kbn/config-schema").ObjectType<{ + /** + * maxSessions controls how many saved search sessions we load on the management screen. + */ + maxSessions: import("@kbn/config-schema").Type; + /** + * refreshInterval controls how often we refresh the management screen. 0s as duration means that auto-refresh is turned off. + */ + refreshInterval: import("@kbn/config-schema").Type; + /** + * refreshTimeout controls the timeout for loading search sessions on mgmt screen + */ + refreshTimeout: import("@kbn/config-schema").Type; + expiresSoonWarning: import("@kbn/config-schema").Type; + }>; +}>; +export declare const searchConfigSchema: import("@kbn/config-schema").ObjectType<{ + /** + * Config for search strategies that use async search based API underneath + */ + asyncSearch: import("@kbn/config-schema").ObjectType<{ + /** + * Block and wait until the search is completed up to the timeout (see es async_search's `wait_for_completion_timeout`) + */ + waitForCompletion: import("@kbn/config-schema").Type; + /** + * How long the async search needs to be available after each search poll. Ongoing async searches and any saved search results are deleted after this period. + * (see es async_search's `keep_alive`) + * Note: This is applicable to the searches before the search session is saved. + * After search session is saved `keep_alive` is extended using `data.search.sessions.defaultExpiration` config + */ + keepAlive: import("@kbn/config-schema").Type; + /** + * Affects how often partial results become available, which happens whenever shard results are reduced (see es async_search's `batched_reduce_size`) + */ + batchedReduceSize: import("@kbn/config-schema").Type; + /** + * How long to wait before polling the async_search after the previous poll response. + * If not provided, defaults to zero. + */ + pollInterval: import("@kbn/config-schema").Type; + /** + * How long to wait for results before initiating a new poll request. + * Accepts duration format (e.g., "30s", "100ms"). If not provided, + * defaults to protocol-specific behavior (30s for HTTP/2 or HTTP/3). + */ + pollLength: import("@kbn/config-schema").Type; + }>; + aggs: import("@kbn/config-schema").ObjectType<{ + shardDelay: import("@kbn/config-schema").ObjectType<{ + enabled: import("@kbn/config-schema").Type; + }>; + }>; + sessions: import("@kbn/config-schema").ObjectType<{ + /** + * Turns the feature on \ off (incl. removing indicator and management screens) + */ + enabled: import("@kbn/config-schema").Type; + /** + * notTouchedTimeout controls how long user can save a session after all searches completed. + * The client continues to poll searches to keep the alive until this timeout hits + */ + notTouchedTimeout: import("@kbn/config-schema").Type; + /** + * maxUpdateRetries controls how many retries we perform while attempting to save a search session + */ + maxUpdateRetries: import("@kbn/config-schema").Type; + /** + * defaultExpiration controls how long search sessions are valid for, until they are expired. + */ + defaultExpiration: import("@kbn/config-schema").Type; + management: import("@kbn/config-schema").ObjectType<{ + /** + * maxSessions controls how many saved search sessions we load on the management screen. + */ + maxSessions: import("@kbn/config-schema").Type; + /** + * refreshInterval controls how often we refresh the management screen. 0s as duration means that auto-refresh is turned off. + */ + refreshInterval: import("@kbn/config-schema").Type; + /** + * refreshTimeout controls the timeout for loading search sessions on mgmt screen + */ + refreshTimeout: import("@kbn/config-schema").Type; + expiresSoonWarning: import("@kbn/config-schema").Type; + }>; + }>; +}>; +export declare const queryConfigSchema: import("@kbn/config-schema").ObjectType<{ + /** + * Config for timefilter + */ + timefilter: import("@kbn/config-schema").ObjectType<{ + /** + * Lower limit of refresh interval (in milliseconds) + */ + minRefreshInterval: import("@kbn/config-schema").ConditionalType; + }>; +}>; +export declare const configSchema: import("@kbn/config-schema").ObjectType<{ + query: import("@kbn/config-schema").ObjectType<{ + /** + * Config for timefilter + */ + timefilter: import("@kbn/config-schema").ObjectType<{ + /** + * Lower limit of refresh interval (in milliseconds) + */ + minRefreshInterval: import("@kbn/config-schema").ConditionalType; + }>; + }>; + search: import("@kbn/config-schema").ObjectType<{ + /** + * Config for search strategies that use async search based API underneath + */ + asyncSearch: import("@kbn/config-schema").ObjectType<{ + /** + * Block and wait until the search is completed up to the timeout (see es async_search's `wait_for_completion_timeout`) + */ + waitForCompletion: import("@kbn/config-schema").Type; + /** + * How long the async search needs to be available after each search poll. Ongoing async searches and any saved search results are deleted after this period. + * (see es async_search's `keep_alive`) + * Note: This is applicable to the searches before the search session is saved. + * After search session is saved `keep_alive` is extended using `data.search.sessions.defaultExpiration` config + */ + keepAlive: import("@kbn/config-schema").Type; + /** + * Affects how often partial results become available, which happens whenever shard results are reduced (see es async_search's `batched_reduce_size`) + */ + batchedReduceSize: import("@kbn/config-schema").Type; + /** + * How long to wait before polling the async_search after the previous poll response. + * If not provided, defaults to zero. + */ + pollInterval: import("@kbn/config-schema").Type; + /** + * How long to wait for results before initiating a new poll request. + * Accepts duration format (e.g., "30s", "100ms"). If not provided, + * defaults to protocol-specific behavior (30s for HTTP/2 or HTTP/3). + */ + pollLength: import("@kbn/config-schema").Type; + }>; + aggs: import("@kbn/config-schema").ObjectType<{ + shardDelay: import("@kbn/config-schema").ObjectType<{ + enabled: import("@kbn/config-schema").Type; + }>; + }>; + sessions: import("@kbn/config-schema").ObjectType<{ + /** + * Turns the feature on \ off (incl. removing indicator and management screens) + */ + enabled: import("@kbn/config-schema").Type; + /** + * notTouchedTimeout controls how long user can save a session after all searches completed. + * The client continues to poll searches to keep the alive until this timeout hits + */ + notTouchedTimeout: import("@kbn/config-schema").Type; + /** + * maxUpdateRetries controls how many retries we perform while attempting to save a search session + */ + maxUpdateRetries: import("@kbn/config-schema").Type; + /** + * defaultExpiration controls how long search sessions are valid for, until they are expired. + */ + defaultExpiration: import("@kbn/config-schema").Type; + management: import("@kbn/config-schema").ObjectType<{ + /** + * maxSessions controls how many saved search sessions we load on the management screen. + */ + maxSessions: import("@kbn/config-schema").Type; + /** + * refreshInterval controls how often we refresh the management screen. 0s as duration means that auto-refresh is turned off. + */ + refreshInterval: import("@kbn/config-schema").Type; + /** + * refreshTimeout controls the timeout for loading search sessions on mgmt screen + */ + refreshTimeout: import("@kbn/config-schema").Type; + expiresSoonWarning: import("@kbn/config-schema").Type; + }>; + }>; + }>; + /** + * Turns on/off limit validations for the registered uiSettings. + */ + enableUiSettingsValidations: import("@kbn/config-schema").Type; +}>; +export type ConfigSchema = TypeOf; +export type SearchConfigSchema = TypeOf; +export type QueryConfigSchema = TypeOf; +export type SearchSessionsConfigSchema = TypeOf; diff --git a/src/platform/plugins/shared/data_views/common/constants.d.ts b/src/platform/plugins/shared/data_views/common/constants.d.ts new file mode 100644 index 0000000000000..5d62821242e48 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/constants.d.ts @@ -0,0 +1,62 @@ +/** + * All runtime field types. + * @public + */ +export declare const RUNTIME_FIELD_COMPOSITE_TYPE: "composite"; +export type RuntimeFieldCompositeType = typeof RUNTIME_FIELD_COMPOSITE_TYPE; +export declare const PRIMITIVE_RUNTIME_FIELD_TYPES: readonly ["keyword", "long", "double", "date", "ip", "boolean", "geo_point"]; +export type PrimitiveRuntimeFieldTypes = typeof PRIMITIVE_RUNTIME_FIELD_TYPES; +export declare const RUNTIME_FIELD_TYPES: readonly ["keyword", "long", "double", "date", "ip", "boolean", "geo_point", "composite"]; +/** + * Used to optimize on-boarding experience to determine if the instance has some user created data views or data indices/streams by filtering data sources + * that are created by default by elastic in ese. + * We should somehow prevent creating initial data for the users without their explicit action + * instead of relying on these hardcoded assets + */ +export declare const DEFAULT_ASSETS_TO_IGNORE: { + DATA_STREAMS_TO_IGNORE: string[]; +}; +/** + * UiSettings key for metaFields list. + * @public + */ +export declare const META_FIELDS = "metaFields"; +/** + * Data view saved object type. + * @public + */ +export declare const DATA_VIEW_SAVED_OBJECT_TYPE = "index-pattern"; +/** + * Data views plugin name. + * @public + */ +export declare const PLUGIN_NAME = "DataViews"; +/** + * Max length for the custom field description + */ +export declare const MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH = 300; +/** + * Fields for wildcard path. + * @public + */ +export declare const FIELDS_FOR_WILDCARD_PATH = "/internal/data_views/_fields_for_wildcard"; +/** + * Fields path. Like fields for wildcard but GET only + * @public + */ +export declare const FIELDS_PATH = "/internal/data_views/fields"; +/** + * Existing indices path + * @public + */ +export declare const EXISTING_INDICES_PATH = "/internal/data_views/_existing_indices"; +export declare const DATA_VIEWS_FIELDS_EXCLUDED_TIERS = "data_views:fields_excluded_data_tiers"; +export declare const DEFAULT_DATA_VIEW_ID = "defaultIndex"; +/** + * Valid `failureReason` attribute values for `has_es_data` API error responses + */ +export declare enum HasEsDataFailureReason { + localDataTimeout = "local_data_timeout", + remoteDataTimeout = "remote_data_timeout", + unknown = "unknown" +} diff --git a/src/platform/plugins/shared/data_views/common/content_management/index.d.ts b/src/platform/plugins/shared/data_views/common/content_management/index.d.ts new file mode 100644 index 0000000000000..5b98253d935b4 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/content_management/index.d.ts @@ -0,0 +1 @@ +export * from './v1'; diff --git a/src/platform/plugins/shared/data_views/common/content_management/v1/constants.d.ts b/src/platform/plugins/shared/data_views/common/content_management/v1/constants.d.ts new file mode 100644 index 0000000000000..dec84ca66ea0e --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/content_management/v1/constants.d.ts @@ -0,0 +1,7 @@ +import { DATA_VIEW_SAVED_OBJECT_TYPE as DataViewSOType } from '../..'; +export { DataViewSOType }; +/** + * Data view saved object version. + */ +export declare const LATEST_VERSION = 1; +export type DataViewContentType = typeof DataViewSOType; diff --git a/src/platform/plugins/shared/data_views/common/content_management/v1/index.d.ts b/src/platform/plugins/shared/data_views/common/content_management/v1/index.d.ts new file mode 100644 index 0000000000000..5acacc3176506 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/content_management/v1/index.d.ts @@ -0,0 +1,4 @@ +export { LATEST_VERSION } from './constants'; +export type { DataViewCrudTypes } from './types'; +export type { DataViewContentType } from './constants'; +export { DataViewSOType } from './constants'; diff --git a/src/platform/plugins/shared/data_views/common/content_management/v1/types.d.ts b/src/platform/plugins/shared/data_views/common/content_management/v1/types.d.ts new file mode 100644 index 0000000000000..9856fc54e841a --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/content_management/v1/types.d.ts @@ -0,0 +1,20 @@ +import type { ContentManagementCrudTypes, SavedObjectCreateOptions, SavedObjectSearchOptions, SavedObjectUpdateOptions } from '@kbn/content-management-utils'; +import type { DataViewAttributes } from '../../types'; +import type { DataViewContentType } from './constants'; +interface DataViewCreateOptions { + id?: SavedObjectCreateOptions['id']; + initialNamespaces?: SavedObjectCreateOptions['initialNamespaces']; + overwrite?: SavedObjectCreateOptions['overwrite']; + managed?: SavedObjectCreateOptions['managed']; +} +interface DataViewUpdateOptions { + version?: SavedObjectUpdateOptions['version']; + refresh?: SavedObjectUpdateOptions['refresh']; + retryOnConflict?: SavedObjectUpdateOptions['retryOnConflict']; +} +interface DataViewSearchOptions { + searchFields?: SavedObjectSearchOptions['searchFields']; + fields?: SavedObjectSearchOptions['fields']; +} +export type DataViewCrudTypes = ContentManagementCrudTypes; +export {}; diff --git a/src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.d.ts b/src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.d.ts new file mode 100644 index 0000000000000..dc378944b5a96 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.d.ts @@ -0,0 +1,242 @@ +import type { FieldFormat, FieldFormatsStartCommon, SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; +import type { DataViewFieldBase } from '@kbn/es-query'; +import type { DataViewSpec, FieldSpec, FieldFormatMap, RuntimeFieldSpec, SourceFilter, TypeMeta, RuntimeField } from '../types'; +import type { DataViewAttributes, FieldAttrs, FieldAttrSet } from '..'; +import type { DataViewField } from '../fields'; +interface SavedObjectBody { + fieldAttrs?: string; + title?: string; + timeFieldName?: string; + fields?: string; + sourceFilters?: string; + fieldFormatMap?: string; + typeMeta?: string; + type?: string; +} +interface AbstractDataViewDeps { + spec?: DataViewSpec; + fieldFormats: FieldFormatsStartCommon; + shortDotsEnable?: boolean; + metaFields?: string[]; +} +type DataViewFieldBaseSpecMap = Record; +export declare abstract class AbstractDataView { + /** + * Saved object id + */ + id?: string; + /** + * Title of data view + * @deprecated use getIndexPattern instead + */ + title: string; + /** + * Map of field formats by field name + */ + fieldFormatMap: FieldFormatMap; + /** + * Only used by rollup indices, used by rollup specific endpoint to load field list. + */ + typeMeta?: TypeMeta; + /** + * Timestamp field name + */ + timeFieldName: string | undefined; + /** + * Type is used to identify rollup index patterns or ES|QL data views. + */ + type: string | undefined; + /** + * List of meta fields by name + */ + metaFields: string[]; + /** + * SavedObject version + */ + version: string | undefined; + /** + * Array of filters - hides fields in discover + */ + sourceFilters?: SourceFilter[]; + /** + * Array of namespace ids + */ + namespaces: string[]; + /** + * Original saved object body. Used to check for saved object changes. + */ + protected originalSavedObjectBody: SavedObjectBody; + /** + * Returns true if short dot notation is enabled + */ + protected shortDotsEnable: boolean; + /** + * FieldFormats service interface + */ + protected fieldFormats: FieldFormatsStartCommon; + /** + * Map of field attributes by field name. Currently count and customLabel. + */ + protected fieldAttrs: FieldAttrs; + /** + * Map of runtime field definitions by field name + */ + protected runtimeFieldMap: Record; + /** + * Prevents errors when index pattern exists before indices + */ + readonly allowNoIndex: boolean; + /** + * Name of the data view. Human readable name used to differentiate data view. + */ + name: string; + matchedIndices: string[]; + /** + * Whether the data view is managed by the application. + */ + managed: boolean; + protected scriptedFieldsMap: DataViewFieldBaseSpecMap; + private allowHidden; + constructor(config: AbstractDataViewDeps); + getAllowHidden: () => boolean; + setAllowHidden: (allowHidden: boolean) => boolean; + /** + * Get name of Data View + */ + getName: () => string; + /** + * Get index pattern + * @returns index pattern string + */ + getIndexPattern: () => string; + /** + * Set index pattern + * @param string index pattern string + */ + setIndexPattern: (indexPattern: string) => void; + /** + * Get last saved saved object fields + */ + getOriginalSavedObjectBody: () => { + fieldAttrs?: string; + title?: string; + timeFieldName?: string; + fields?: string; + sourceFilters?: string; + fieldFormatMap?: string; + typeMeta?: string; + type?: string; + }; + /** + * Reset last saved saved object fields. Used after saving. + */ + resetOriginalSavedObjectBody: () => void; + /** + * Returns true if the data view is persisted, and false if the dataview is adhoc. + */ + isPersisted(): boolean; + /** + * Get the source filtering configuration for that index. + */ + getSourceFiltering(): { + excludes: string[]; + }; + /** + * Get aggregation restrictions. Rollup fields can only perform a subset of aggregations. + */ + getAggregationRestrictions(): Record | undefined; + /** + * Provide a field, get its formatter + * @param field field to get formatter for + */ + getFormatterForField(field: DataViewField | DataViewField['spec']): FieldFormat; + /** + * Get formatter for a given field name. Return undefined if none exists. + * @param fieldname name of field to get formatter for + */ + getFormatterForFieldNoDefault(fieldname: string): FieldFormat | undefined; + /** + * Set field attribute + * @param fieldName name of field to set attribute on + * @param attrName name of attribute to set + * @param value value of attribute + */ + protected setFieldAttrs(fieldName: string, attrName: K, value: FieldAttrSet[K]): void; + /** + * Set field custom label + * @param fieldName name of field to set custom label on + * @param customLabel custom label value. If undefined, custom label is removed + */ + protected setFieldCustomLabelInternal(fieldName: string, customLabel: string | undefined | null): void; + /** + * Set field count + * @param fieldName name of field to set count on + * @param count count value. If undefined, count is removed + */ + protected setFieldCountInternal(fieldName: string, count: number | undefined | null): void; + /** + * Set field custom description + * @param fieldName name of field to set custom description on + * @param customDescription custom description value. If undefined, custom description is removed + */ + protected setFieldCustomDescriptionInternal(fieldName: string, customDescription: string | undefined | null): void; + /** + * Set field formatter + * @param fieldName name of field to set format on + * @param format field format in serialized form + */ + readonly setFieldFormat: (fieldName: string, format: SerializedFieldFormat) => void; + /** + * Remove field format from the field format map. + * @param fieldName field name associated with the format for removal + */ + readonly deleteFieldFormat: (fieldName: string) => void; + /** + * Returns index pattern as saved object body for saving + */ + getAsSavedObjectBody(): DataViewAttributes; + protected toSpecShared(includeFields?: boolean): DataViewSpec; + protected upsertScriptedFieldInternal: (field: FieldSpec) => void; + protected deleteScriptedFieldInternal: (fieldName: string) => void; + replaceAllScriptedFields(newFields: Record): void; + removeScriptedField(name: string): void; + upsertScriptedField(field: FieldSpec): void; + /** + * Only used by search source to process sorting of scripted fields + * @param name field name + * @returns DataViewFieldBase + */ + getScriptedField(name: string): DataViewFieldBase | undefined; + /** + * Checks if runtime field exists + * @param name field name + */ + hasRuntimeField(name: string): boolean; + /** + * Returns runtime field if exists + * @param name Runtime field name + */ + getRuntimeField(name: string): RuntimeField | null; + /** + * Get all runtime field definitions. + * NOTE: this does not strip out runtime fields that match mapped field names + * @returns map of runtime field definitions by field name + */ + getAllRuntimeFields(): Record; + /** + * Replaces all existing runtime fields with new fields. + * @param newFields Map of runtime field definitions by field name + */ + replaceAllRuntimeFields(newFields: Record): void; + removeRuntimeField(name: string): void; + addRuntimeField(name: string, runtimeField: RuntimeField): void; + protected removeRuntimeFieldInteral(name: string): void; + protected addRuntimeFieldInteral(name: string, runtimeField: RuntimeField): void; + getFieldAttrs: () => Map; + /** + * Checks if there are any matched indices. + * @returns True if there are matched indices, false otherwise. + */ + hasMatchedIndices(): boolean; +} +export {}; diff --git a/src/platform/plugins/shared/data_views/common/data_views/data_view.d.ts b/src/platform/plugins/shared/data_views/common/data_views/data_view.d.ts new file mode 100644 index 0000000000000..b53bb86fe281a --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/data_view.d.ts @@ -0,0 +1,160 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; +import type { DataViewBase } from '@kbn/es-query'; +import type { DataViewField, IIndexPatternFieldList } from '../fields'; +import type { DataViewFieldMap, DataViewSpec, RuntimeField, FieldSpec } from '../types'; +import { AbstractDataView } from './abstract_data_views'; +interface DataViewDeps { + spec?: DataViewSpec; + fieldFormats: FieldFormatsStartCommon; + shortDotsEnable?: boolean; + metaFields?: string[]; +} +/** + * An interface representing a data view that is time based. + */ +export interface TimeBasedDataView extends DataView { + /** + * The timestamp field name. + */ + timeFieldName: NonNullable; + /** + * The timestamp field. + */ + getTimeField: () => DataViewField; +} +/** + * Data view class. Central kibana abstraction around multiple indices. + */ +export declare class DataView extends AbstractDataView implements DataViewBase { + /** + * Field list, in extended array format + */ + fields: IIndexPatternFieldList & { + toSpec: () => DataViewFieldMap; + }; + /** + * @deprecated Use `flattenHit` utility method exported from data plugin instead. + */ + flattenHit: (hit: Record, deep?: boolean) => Record; + private etag; + /** + * constructor + * @param config - config data and dependencies + */ + constructor(config: DataViewDeps); + getScriptedFieldsForQuery(): Record; + getEtag: () => string | undefined; + setEtag: (etag: string | undefined) => string | undefined; + /** + * Returns scripted fields + */ + getComputedFields(): { + scriptFields: Record; + docvalueFields: { + field: string; + format: string; + }[]; + runtimeFields: estypes.MappingRuntimeFields; + }; + /** + * Creates static representation of the data view. + * @param includeFields Whether or not to include the `fields` list as part of this spec. If not included, the list + * will be fetched from Elasticsearch when instantiating a new Data View with this spec. + */ + toSpec(includeFields?: boolean): DataViewSpec; + /** + * Creates a minimal static representation of the data view. Fields and popularity scores will be omitted. + */ + toMinimalSpec(params?: { + keepFieldAttrs?: Array<'customLabel' | 'customDescription'>; + }): Omit; + /** + * Removes scripted field from field list. + * @param fieldName name of scripted field to remove + * @deprecated use runtime field instead + */ + removeScriptedField(fieldName: string): void; + /** + * + * @deprecated Will be removed when scripted fields are removed. + */ + getNonScriptedFields(): DataViewField[]; + /** + * + * @deprecated Use runtime field instead. + */ + getScriptedFields(): DataViewField[]; + /** + * returns true if dataview contains TSDB fields + */ + isTSDBMode(): boolean; + /** + * Does the data view have a timestamp field? + */ + isTimeBased(): this is TimeBasedDataView; + /** + * Does the data view have a timestamp field and is it a date nanos field? + */ + isTimeNanosBased(): this is TimeBasedDataView; + /** + * Get timestamp field as DataViewField or return undefined + */ + getTimeField(): DataViewField | undefined; + /** + * Get field by name. + * @param name field name + */ + getFieldByName(name: string): DataViewField | undefined; + /** + * Add a runtime field - Appended to existing mapped field or a new field is + * created as appropriate. + * @param name Field name + * @param runtimeField Runtime field definition + */ + addRuntimeField(name: string, runtimeField: RuntimeField): DataViewField[]; + /** + * Returns data view fields backed by runtime fields. + * @param name runtime field name + * @returns map of DataViewFields (that are runtime fields) by field name + */ + getFieldsByRuntimeFieldName(name: string): Record | undefined; + /** + * Remove a runtime field - removed from mapped field or removed unmapped + * field as appropriate. Doesn't clear associated field attributes. + * @param name - Field name to remove + */ + removeRuntimeField(name: string): void; + /** + * Return the "runtime_mappings" section of the ES search query. + */ + getRuntimeMappings(): estypes.MappingRuntimeFields; + /** + * Set field custom label + * @param fieldName name of field to set custom label on + * @param customLabel custom label value. If undefined, custom label is removed + */ + setFieldCustomLabel(fieldName: string, customLabel: string | undefined | null): void; + /** + * Set field custom description + * @param fieldName name of field to set custom label on + * @param customDescription custom description value. If undefined, custom description is removed + */ + setFieldCustomDescription(fieldName: string, customDescription: string | undefined | null): void; + /** + * Set field count + * @param fieldName name of field to set count on + * @param count count value. If undefined, count is removed + */ + setFieldCount(fieldName: string, count: number | undefined | null): void; + /** + * Add composite runtime field and all subfields. + * @param name field name + * @param runtimeField runtime field definition + * @returns data view field instance + */ + private addCompositeRuntimeField; + private updateOrAddRuntimeField; + upsertScriptedField: (field: FieldSpec) => void; +} +export {}; diff --git a/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy.d.ts b/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy.d.ts new file mode 100644 index 0000000000000..675553e1b4a1d --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy.d.ts @@ -0,0 +1,104 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; +import { AbstractDataView } from './abstract_data_views'; +import { DataViewField } from '../fields'; +import type { DataViewSpec, RuntimeField, FieldSpec, IDataViewsApiClient } from '../types'; +interface DataViewDeps { + spec?: DataViewSpec; + fieldFormats: FieldFormatsStartCommon; + shortDotsEnable?: boolean; + metaFields?: string[]; + apiClient: IDataViewsApiClient; + scriptedFieldsEnabled: boolean; +} +interface GetFieldsParams { + indexFilter?: QueryDslQueryContainer; + unmapped?: boolean; + fieldName: string[]; + mapped?: boolean; + scripted?: boolean; + runtime?: boolean; + forceRefresh?: boolean; + metaFields?: boolean; + fieldTypes?: string[]; +} +type DataViewFieldMap = Record; +export declare class DataViewLazy extends AbstractDataView { + private apiClient; + private fieldCache; + /** + * Returns true if scripted fields are enabled + */ + protected scriptedFieldsEnabled: boolean; + constructor(config: DataViewDeps); + getFields({ mapped, scripted, runtime, fieldName, forceRefresh, unmapped, indexFilter, metaFields, }: GetFieldsParams): Promise<{ + getFieldMap: () => DataViewFieldMap; + getFieldMapSorted: () => Record; + }>; + getRuntimeFields: ({ fieldName }: Pick) => DataViewFieldMap; + /** + * Add a runtime field - Appended to existing mapped field or a new field is + * created as appropriate. + * @param name Field name + * @param runtimeField Runtime field definition + */ + addRuntimeField(name: string, runtimeField: RuntimeField): Promise; + private addCompositeRuntimeField; + /** + * Remove a runtime field - removed from mapped field or removed unmapped + * field as appropriate. Doesn't clear associated field attributes. + * @param name - Field name to remove + */ + removeRuntimeField(name: string): void; + private getFieldsByRuntimeFieldName; + private updateOrAddRuntimeField; + private getRuntimeFieldSpecMap; + getScriptedFields({ fieldName }: Pick): Record; + private getMappedFields; + getScriptedFieldsForQuery(): Record; + getComputedFields({ fieldName }: { + fieldName: string[]; + }): Promise<{ + scriptFields: Record; + docvalueFields: { + field: string; + format: string; + }[]; + runtimeFields: estypes.MappingRuntimeFields; + }>; + getRuntimeMappings(): estypes.MappingRuntimeFields; + /** + * Creates static representation of the data view. + * @param includeFields Whether or not to include the `fields` list as part of this spec. If not included, the list + * will be fetched from Elasticsearch when instantiating a new Data View with this spec. + */ + toSpec(params?: { + fieldParams?: GetFieldsParams; + }): Promise; + /** + * Creates a minimal static representation of the data view. Fields and popularity scores will be omitted. + */ + toMinimalSpec(params?: { + keepFieldAttrs?: Array<'customLabel' | 'customDescription'>; + }): Omit; + /** + * returns true if dataview contains TSDB fields + */ + isTSDBMode(): Promise; + removeScriptedField(fieldName: string): void; + upsertScriptedField(field: FieldSpec): void; + isTimeBased: () => Promise; + isTimeNanosBased(): Promise; + getTimeField: () => Promise | undefined; + getFieldByName(name: string, forceRefresh?: boolean): Promise; + /** + * Set field custom label + * @param fieldName name of field to set custom label on + * @param customLabel custom label value. If undefined, custom label is removed + */ + setFieldCustomLabel(fieldName: string, customLabel: string | undefined | null): void; + setFieldCount(fieldName: string, count: number | undefined | null): void; + setFieldCustomDescription(fieldName: string, customDescription: string | undefined | null): void; +} +export {}; diff --git a/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy_util.d.ts b/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy_util.d.ts new file mode 100644 index 0000000000000..24b91938efa18 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/data_view_lazy_util.d.ts @@ -0,0 +1,2 @@ +export declare const fieldMatchesFieldsRequested: (fieldName: string, fieldsRequested: string[]) => boolean; +export declare const fieldsMatchFieldsRequested: (fieldName: string[], fieldsRequested: string[]) => string[]; diff --git a/src/platform/plugins/shared/data_views/common/data_views/data_views.d.ts b/src/platform/plugins/shared/data_views/common/data_views/data_views.d.ts new file mode 100644 index 0000000000000..7182f3fefaf27 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/data_views.d.ts @@ -0,0 +1,511 @@ +import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { FieldFormatsStartCommon } from '@kbn/field-formats-plugin/common'; +import type { PersistenceAPI } from '../types'; +import { DataViewLazy } from './data_view_lazy'; +import type { AbstractDataView } from './abstract_data_views'; +import { DataView } from './data_view'; +import type { OnNotification, OnError, UiSettingsCommon, IDataViewsApiClient, GetFieldsOptions, DataViewSpec, DataViewAttributes, FieldAttrsAsObject, FieldSpec, DataViewFieldMap, TypeMeta } from '../types'; +import type { SavedObject } from '..'; +export type DataViewSavedObjectAttrs = Pick; +/** + * Result from data view search - summary data. + */ +export interface DataViewListItem { + /** + * Saved object id (or generated id if in-memory only) + */ + id: string; + /** + * Namespace ids + */ + namespaces?: string[]; + /** + * Data view title + */ + title: string; + /** + * Data view type + */ + type?: string; + /** + * Data view type meta + */ + typeMeta?: TypeMeta; + /** + * Human-readable name + */ + name?: string; + /** + * Time field name if applicable + */ + timeFieldName?: string; + /** + * Whether the data view is managed by the application. + */ + managed?: boolean; +} +/** + * Data views API service dependencies + */ +export interface DataViewsServiceDeps { + /** + * UiSettings service instance wrapped in a common interface + */ + uiSettings: UiSettingsCommon; + /** + * Saved objects client interface wrapped in a common interface + */ + savedObjectsClient: PersistenceAPI; + /** + * Wrapper around http call functionality so it can be used on client or server + */ + apiClient: IDataViewsApiClient; + /** + * Field formats service + */ + fieldFormats: FieldFormatsStartCommon; + /** + * Handler for service notifications + */ + onNotification: OnNotification; + /** + * Handler for service errors + */ + onError: OnError; + /** + * Redirects when there's no data view. only used on client + */ + onRedirectNoIndexPattern?: () => void; + /** + * Determines whether the user can save data views + */ + getCanSave: () => Promise; + /** + * Determines whether the user can save advancedSettings (used for defaultIndex) + */ + getCanSaveAdvancedSettings: () => Promise; + scriptedFieldsEnabled: boolean; +} +/** + * Data views API service methods + * @public + */ +export interface DataViewsServicePublicMethods { + /** + * Clear the cache of data view saved objects. + */ + clearCache: () => void; + /** + * Clear the cache of data view instances. + */ + clearInstanceCache: (id?: string) => void; + /** + * Clear the cache of lazy data view instances. + */ + clearDataViewLazyCache: (id: string) => void; + /** + * Create data view based on the provided spec. + * @param spec - Data view spec. + * @param skipFetchFields - If true, do not fetch fields. + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + create: (spec: DataViewSpec, skipFetchFields?: boolean, displayErrors?: boolean) => Promise; + /** + * Create and save data view based on provided spec. + * @param spec - Data view spec. + * @param override - If true, save over existing data view + * @param skipFetchFields - If true, do not fetch fields. + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + createAndSave: (spec: DataViewSpec, override?: boolean, skipFetchFields?: boolean, displayErrors?: boolean) => Promise; + /** + * Save data view + * @param dataView - Data view or data view lazy instance to save. + * @param override - If true, save over existing data view + */ + createSavedObject: (indexPattern: AbstractDataView, overwrite?: boolean) => Promise; + /** + * Delete data view + * @param indexPatternId - Id of the data view to delete. + */ + delete: (indexPatternId: string) => Promise; + /** + * Takes field array and field attributes and returns field map by name. + * @param fields - Array of fieldspecs + * @params fieldAttrs - Field attributes, map by name + * @returns Field map by name + */ + fieldArrayToMap: (fields: FieldSpec[], fieldAttrs?: FieldAttrsAsObject) => DataViewFieldMap; + /** + * Search for data views based on title + * @param search - Search string + * @param size - Number of results to return + */ + find: (search: string, size?: number) => Promise; + /** + * Find and load lazy data views by title. + * @param search - Search string + * @param size - Number of results to return + */ + findLazy: (search: string, size?: number) => Promise; + /** + * Get data view by id. + * @param id - Id of the data view to get. + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + get: (id: string, displayErrors?: boolean, refreshFields?: boolean) => Promise; + /** + * Get populated data view saved object cache. + */ + getCache: () => Promise> | null | undefined>; + /** + * If user can save data view, return true. + */ + getCanSave: () => Promise; + /** + * Get default data view as data view instance. + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + getDefault: (displayErrors?: boolean) => Promise; + /** + * Get default data view id. + */ + getDefaultId: () => Promise; + /** + * Get default data view, if it doesn't exist, choose and save new default data view and return it. + * @param {Object} options + * @param {boolean} options.refreshFields - If true, will refresh the fields of the default data view + * @param {boolean} [options.displayErrors=true] - If set false, API consumer is responsible for displaying and handling errors. + */ + getDefaultDataView: (options?: { + refreshFields?: boolean; + displayErrors?: boolean; + }) => Promise; + /** + * Get fields for data view + * @param dataView - Data view instance or spec + * @param options - Options for getting fields + * @returns FieldSpec array + */ + getFieldsForIndexPattern: (indexPattern: DataView | DataViewSpec, options?: Omit) => Promise; + /** + * Get fields for index pattern string + * @param options - options for getting fields + */ + getFieldsForWildcard: (options: GetFieldsOptions) => Promise; + /** + * Get list of data view ids. + * @param refresh - clear cache and fetch from server + */ + getIds: (refresh?: boolean) => Promise; + /** + * Get list of data view ids and title (and more) for each data view. + * @param refresh - clear cache and fetch from server + */ + getIdsWithTitle: (refresh?: boolean) => Promise; + /** + * Get list of data view ids and title (and more) for each data view. + * @param refresh - clear cache and fetch from server + */ + getTitles: (refresh?: boolean) => Promise; + /** + * Returns true if user has access to view a data view. + */ + hasUserDataView: () => Promise; + /** + * Refresh fields for data view instance + * @params dataView - Data view instance + */ + refreshFields: (indexPattern: DataView, displayErrors?: boolean, forceRefresh?: boolean) => Promise; + /** + * Converts data view saved object to spec + * @params savedObject - Data view saved object + */ + savedObjectToSpec: (savedObject: SavedObject) => DataViewSpec; + /** + * Set default data view. + * @param id - Id of the data view to set as default. + * @param force - Overwrite if true + */ + setDefault: (id: string | null, force?: boolean) => Promise; + /** + * Save saved object + * @param indexPattern - data view instance + * @param saveAttempts - number of times to try saving + * @oaram ignoreErrors - if true, do not throw error on failure + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + updateSavedObject: (indexPattern: AbstractDataView, saveAttempts?: number, ignoreErrors?: boolean, displayErrors?: boolean) => Promise; + /** + * Returns whether a default data view exists. + */ + defaultDataViewExists: () => Promise; + getMetaFields: () => Promise; + getShortDotsEnable: () => Promise; + toDataView: (toDataView: DataViewLazy) => Promise; + toDataViewLazy: (dataView: DataView) => Promise; + getAllDataViewLazy: () => Promise; + getDataViewLazy: (id: string) => Promise; + getDataViewLazyFromCache: (id: string) => Promise; + createDataViewLazy: (spec: DataViewSpec) => Promise; + createAndSaveDataViewLazy: (spec: DataViewSpec, override?: boolean) => Promise; + getDefaultDataViewLazy: () => Promise; +} +/** + * Data views service, providing CRUD operations for data views. + * @public + */ +export declare class DataViewsService { + private config; + private savedObjectsClient; + private savedObjectsCache?; + private apiClient; + private fieldFormats; + /** + * Handler for service notifications + * @param toastInputFields notification content in toast format + * @param key used to indicate uniqueness of the notification + */ + private onNotification; + private onError; + private dataViewCache; + private dataViewLazyCache; + /** + * Can the user save advanced settings? + */ + private getCanSaveAdvancedSettings; + /** + * Can the user save data views? + */ + getCanSave: () => Promise; + readonly scriptedFieldsEnabled: boolean; + /** + * DataViewsService constructor + * @param deps Service dependencies + */ + constructor(deps: DataViewsServiceDeps); + /** + * Refresh cache of index pattern ids and titles. + */ + private refreshSavedObjectsCache; + /** + * Gets list of index pattern ids. + * @param refresh Force refresh of index pattern list + */ + getIds: (refresh?: boolean) => Promise; + /** + * Gets list of index pattern titles. + * @param refresh Force refresh of index pattern list + */ + getTitles: (refresh?: boolean) => Promise; + /** + * Find and load index patterns by title. + * @param search Search string + * @param size Number of data views to return + * @returns DataView[] + */ + find: (search: string, size?: number) => Promise; + /** + * Find and load lazy data views by title. + * @param search Search string + * @param size Number of data views to return + * @returns DataViewLazy[] + */ + findLazy: (search: string, size?: number) => Promise; + /** + * Gets list of index pattern ids with titles. + * @param refresh Force refresh of index pattern list + */ + getIdsWithTitle: (refresh?: boolean) => Promise; + getAllDataViewLazy: (refresh?: boolean) => Promise; + /** + * Clear index pattern saved objects cache. + */ + clearCache: () => void; + /** + * Clear index pattern instance cache + */ + clearInstanceCache: (id?: string) => void; + /** + * Clear instance in data view lazy cache + */ + clearDataViewLazyCache: (id: string) => void; + /** + * Get cache, contains data view saved objects. + */ + getCache: () => Promise[] | null | undefined>; + /** + * Get default index pattern + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + getDefault: (displayErrors?: boolean) => Promise; + /** + * Get default index pattern id + */ + getDefaultId: () => Promise; + /** + * Optionally set default index pattern, unless force = true + * @param id data view id + * @param force set default data view even if there's an existing default + */ + setDefault: (id: string | null, force?: boolean) => Promise; + /** + * Checks if current user has a user created index pattern ignoring fleet's server default index patterns. + */ + hasUserDataView(): Promise; + getMetaFields: () => Promise; + getShortDotsEnable: () => Promise; + /** + * Get field list by providing { pattern }. + * @param options options for getting field list + * @returns FieldSpec[] + */ + getFieldsForWildcard: (options: GetFieldsOptions) => Promise; + /** + * Get field list by providing an index pattern (or spec). + * @param options options for getting field list + * @returns FieldSpec[] + */ + getFieldsForIndexPattern: (indexPattern: DataView | DataViewSpec, options?: Omit) => Promise; + private getFieldsAndIndicesForDataView; + private getFieldsAndIndicesForWildcard; + private refreshFieldsFn; + /** + * Refresh field list for a given data view. + * @param dataView + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + refreshFields: (dataView: DataView, displayErrors?: boolean, forceRefresh?: boolean) => Promise; + /** + * Refreshes a field list from a spec before an index pattern instance is created. + * @param fields + * @param id + * @param title + * @param options + * @returns Record + */ + private refreshFieldSpecMap; + /** + * Converts field array to map. + * @param fields: FieldSpec[] + * @param fieldAttrs: FieldAttrs + * @returns Record + */ + fieldArrayToMap: (fields: FieldSpec[], fieldAttrs?: FieldAttrsAsObject) => DataViewFieldMap; + /** + * Converts data view saved object to data view spec. + * @param savedObject + * @returns DataViewSpec + */ + savedObjectToSpec: (savedObject: SavedObject) => DataViewSpec; + private getSavedObjectAndInit; + private initFromSavedObjectLoadFields; + private initFromSavedObject; + private getRuntimeFields; + getDataViewLazy: (id: string) => Promise; + getDataViewLazyFromCache: (id: string) => Promise; + /** + * Get an index pattern by id, cache optimized. + * @param id + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + * @param refreshFields - If set true, will fetch fields from the index pattern + */ + get: (id: string, displayErrors?: boolean, refreshFields?: boolean) => Promise; + /** + * Create a new data view instance. + * @param spec data view spec + * @param skipFetchFields if true, will not fetch fields + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + * @returns DataView + */ + private createFromSpec; + /** + * Create data view instance. + * @param spec data view spec + * @param skipFetchFields if true, will not fetch fields + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + * @returns DataView + */ + create(spec: DataViewSpec, skipFetchFields?: boolean, displayErrors?: boolean): Promise; + /** + * Create a new data view instance. + * @param spec data view spec + * @returns DataViewLazy + */ + private createFromSpecLazy; + /** + * Create data view lazy instance. + * @param spec data view spec + * @returns DataViewLazy + */ + createDataViewLazy(spec: DataViewSpec): Promise; + /** + * Create a new data view lazy and save it right away. + * @param spec data view spec + * @param override Overwrite if existing index pattern exists. + */ + createAndSaveDataViewLazy(spec: DataViewSpec, overwrite?: boolean): Promise; + /** + * Create a new data view and save it right away. + * @param spec data view spec + * @param override Overwrite if existing index pattern exists. + * @param skipFetchFields Whether to skip field refresh step. + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + createAndSave(spec: DataViewSpec, overwrite?: boolean, skipFetchFields?: boolean, displayErrors?: boolean): Promise; + /** + * Save a new data view. + * @param dataView data view instance + * @param override Overwrite if existing index pattern exists + */ + createSavedObject(dataView: AbstractDataView, overwrite?: boolean): Promise; + /** + * Save existing data view. Will attempt to merge differences if there are conflicts. + * @param indexPattern + * @param saveAttempts + * @param ignoreErrors + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + */ + updateSavedObject(indexPattern: AbstractDataView, saveAttempts?: number, ignoreErrors?: boolean, displayErrors?: boolean): Promise; + /** + * Deletes an index pattern from .kibana index. + * @param indexPatternId: Id of kibana Index Pattern to delete + */ + delete(indexPatternId: string): Promise; + private getDefaultDataViewId; + /** + * Returns whether a default data view exists. + */ + defaultDataViewExists(): Promise; + /** + * Returns the default data view as a DataViewLazy. + * If no default is found, or it is missing + * another data view is selected as default and returned. + * If no possible data view found to become a default returns null. + * + * @returns default data view lazy + */ + getDefaultDataViewLazy(): Promise; + /** + * Returns the default data view as an object. + * If no default is found, or it is missing + * another data view is selected as default and returned. + * If no possible data view found to become a default returns null. + * + * @param {Object} options + * @param {boolean} options.refreshFields - If true, will refresh the fields of the default data view + * @param {boolean} [options.displayErrors=true] - If set false, API consumer is responsible for displaying and handling errors. + * @returns default data view + */ + getDefaultDataView(options?: { + displayErrors?: boolean; + refreshFields?: boolean; + }): Promise; + toDataView(dataViewLazy: DataViewLazy): Promise; + toDataViewLazy(dataView: DataView): Promise; +} +/** + * Data views service interface + * @public + */ +export type DataViewsContract = PublicMethodsOf; diff --git a/src/platform/plugins/shared/data_views/common/data_views/flatten_hit.d.ts b/src/platform/plugins/shared/data_views/common/data_views/flatten_hit.d.ts new file mode 100644 index 0000000000000..e696dc21c24d5 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/flatten_hit.d.ts @@ -0,0 +1,8 @@ +import type { DataView } from './data_view'; +/** + * This is wrapped by `createFlattenHitWrapper` in order to provide a single cache to be + * shared across all uses of this function. It is only exported here for use in mocks. + * + * @internal + */ +export declare function flattenHitWrapper(dataView: DataView, metaFields?: {}, cache?: WeakMap): (hit: Record, deep?: boolean) => Record; diff --git a/src/platform/plugins/shared/data_views/common/data_views/index.d.ts b/src/platform/plugins/shared/data_views/common/data_views/index.d.ts new file mode 100644 index 0000000000000..5965bb04c96a7 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/index.d.ts @@ -0,0 +1,6 @@ +export * from './flatten_hit'; +export * from './data_view'; +export * from './data_views'; +export * from './data_view_lazy'; +export * from './abstract_data_views'; +export { DataViewPersistableStateService } from './persistable_state'; diff --git a/src/platform/plugins/shared/data_views/common/data_views/meta_units_to_formatter.d.ts b/src/platform/plugins/shared/data_views/common/data_views/meta_units_to_formatter.d.ts new file mode 100644 index 0000000000000..86f1473ad8bc8 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/meta_units_to_formatter.d.ts @@ -0,0 +1,5 @@ +import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; +export declare const metaUnitsToFormatter: Record; diff --git a/src/platform/plugins/shared/data_views/common/data_views/persistable_state.d.ts b/src/platform/plugins/shared/data_views/common/data_views/persistable_state.d.ts new file mode 100644 index 0000000000000..fdcfa03b7f0ab --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/persistable_state.d.ts @@ -0,0 +1,3 @@ +import type { PersistableStateService } from '@kbn/kibana-utils-plugin/common'; +import type { DataViewSpec } from '../types'; +export declare const DataViewPersistableStateService: PersistableStateService; diff --git a/src/platform/plugins/shared/data_views/common/data_views/utils.d.ts b/src/platform/plugins/shared/data_views/common/data_views/utils.d.ts new file mode 100644 index 0000000000000..aa06f01ebdd93 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/data_views/utils.d.ts @@ -0,0 +1,8 @@ +import type { Observable } from 'rxjs'; +import type { RuntimeField, RuntimeFieldSpec } from '../types'; +export declare const removeFieldAttrs: (runtimeField: RuntimeField) => RuntimeFieldSpec; +/** + * Helper function to run forkJoin + * with restrictions on how many input observables can be subscribed to concurrently + */ +export declare function rateLimitingForkJoin(observables: Array>, maxConcurrentRequests: number | undefined, failValue: T): Observable; diff --git a/src/platform/plugins/shared/data_views/common/errors/data_view_saved_object_conflict.d.ts b/src/platform/plugins/shared/data_views/common/errors/data_view_saved_object_conflict.d.ts new file mode 100644 index 0000000000000..d53bba1c95b9e --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/errors/data_view_saved_object_conflict.d.ts @@ -0,0 +1,10 @@ +/** + * Error thrown when saved object has been changed when attempting to save. + */ +export declare class DataViewSavedObjectConflictError extends Error { + /** + * constructor + * @param savedObjectId saved object id with conflict + */ + constructor(savedObjectId: string); +} diff --git a/src/platform/plugins/shared/data_views/common/errors/duplicate_index_pattern.d.ts b/src/platform/plugins/shared/data_views/common/errors/duplicate_index_pattern.d.ts new file mode 100644 index 0000000000000..d8c67ff92db45 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/errors/duplicate_index_pattern.d.ts @@ -0,0 +1,11 @@ +/** + * Error thrown when attempting to create duplicate index pattern based on title. + * @public + */ +export declare class DuplicateDataViewError extends Error { + /** + * constructor + * @param message - Error message + */ + constructor(message: string); +} diff --git a/src/platform/plugins/shared/data_views/common/errors/index.d.ts b/src/platform/plugins/shared/data_views/common/errors/index.d.ts new file mode 100644 index 0000000000000..5135e73eacc40 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/errors/index.d.ts @@ -0,0 +1,3 @@ +export * from './duplicate_index_pattern'; +export * from './data_view_saved_object_conflict'; +export * from './insufficient_access'; diff --git a/src/platform/plugins/shared/data_views/common/errors/insufficient_access.d.ts b/src/platform/plugins/shared/data_views/common/errors/insufficient_access.d.ts new file mode 100644 index 0000000000000..887c0d9248114 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/errors/insufficient_access.d.ts @@ -0,0 +1,12 @@ +/** + * Error thrown when action attempted without sufficient access. + * @constructor + * @param {string} message - Saved object id of data view for display in error message + */ +export declare class DataViewInsufficientAccessError extends Error { + /** + * constructor + * @param {string} message - Saved object id of data view for display in error message + */ + constructor(savedObjectId?: string); +} diff --git a/src/platform/plugins/shared/data_views/common/expressions/index.d.ts b/src/platform/plugins/shared/data_views/common/expressions/index.d.ts new file mode 100644 index 0000000000000..47d43af8a29e1 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/expressions/index.d.ts @@ -0,0 +1 @@ +export * from './load_index_pattern'; diff --git a/src/platform/plugins/shared/data_views/common/expressions/load_index_pattern.d.ts b/src/platform/plugins/shared/data_views/common/expressions/load_index_pattern.d.ts new file mode 100644 index 0000000000000..62bc1155d47a1 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/expressions/load_index_pattern.d.ts @@ -0,0 +1,32 @@ +import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import type { DataViewsContract } from '../data_views'; +import type { DataViewSpec } from '..'; +declare const name = "indexPatternLoad"; +declare const type = "index_pattern"; +/** + * Index pattern expression interface + * @public + */ +export interface IndexPatternExpressionType { + /** + * Expression type + */ + type: typeof type; + /** + * Value - DataViewSpec + */ + value: DataViewSpec; +} +type Input = null; +type Output = Promise; +interface Arguments { + id: string; + includeFields?: boolean; +} +/** @internal */ +export interface IndexPatternLoadStartDependencies { + indexPatterns: DataViewsContract; +} +export type IndexPatternLoadExpressionFunctionDefinition = ExpressionFunctionDefinition; +export declare const getIndexPatternLoadMeta: () => Omit; +export {}; diff --git a/src/platform/plugins/shared/data_views/common/fields/data_view_field.d.ts b/src/platform/plugins/shared/data_views/common/fields/data_view_field.d.ts new file mode 100644 index 0000000000000..4f50641441796 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/fields/data_view_field.d.ts @@ -0,0 +1,228 @@ +import type { DataViewFieldBase } from '@kbn/es-query'; +import type { RuntimeFieldSpec } from '../types'; +import type { FieldSpec, DataView } from '..'; +/** + * Optional format getter when serializing a field + * @public + */ +export interface ToSpecConfig { + /** + * Field format getter + */ + getFormatterForField?: DataView['getFormatterForField']; +} +/** + * Data view field class + * @public + */ +export declare class DataViewField implements DataViewFieldBase { + readonly spec: FieldSpec; + /** + * Kbn field type, used mainly for formattering. + */ + private readonly kbnFieldType; + /** + * DataView constructor + * @constructor + * @param spec Configuration for the field + */ + constructor(spec: FieldSpec); + /** + * Count is used for field popularity in discover. + */ + get count(): number; + /** + * Set count, which is used for field popularity in discover. + * @param count count number + */ + set count(count: number); + get defaultFormatter(): string | undefined; + /** + * Returns runtime field definition or undefined if field is not runtime field. + */ + get runtimeField(): RuntimeFieldSpec | undefined; + /** + * Sets runtime field definition or unsets if undefined is provided. + * @param runtimeField runtime field definition + */ + set runtimeField(runtimeField: RuntimeFieldSpec | undefined); + /** + * Script field code + */ + get script(): string | undefined; + /** + * Sets scripted field painless code + * @param script Painless code + */ + set script(script: string | undefined); + /** + * Script field language + */ + get lang(): string | undefined; + /** + * Sets scripted field langauge. + * @param lang Scripted field language + */ + set lang(lang: string | undefined); + /** + * Returns custom label if set, otherwise undefined. + */ + get customLabel(): string | undefined; + /** + * Sets custom label for field, or unsets if passed undefined. + * @param customLabel custom label value + */ + set customLabel(customLabel: string | undefined); + /** + * Returns custom description if set, otherwise undefined. + */ + get customDescription(): string | undefined; + /** + * Sets custom description for field, or unsets if passed undefined. + * @param customDescription custom label value + */ + set customDescription(customDescription: string | undefined); + /** + * Description of field type conflicts across different indices in the same index pattern. + */ + get conflictDescriptions(): Record | undefined; + /** + * Sets conflict descriptions for field. + * @param conflictDescriptions conflict descriptions + */ + set conflictDescriptions(conflictDescriptions: Record | undefined); + /** + * Get field name + */ + get name(): string; + /** + * Gets display name, calcualted based on name, custom label and shortDotsEnable. + */ + get displayName(): string; + /** + * Gets field type + */ + get type(): string; + /** + * Gets ES types as string array + */ + get esTypes(): string[] | undefined; + /** + * Returns true if scripted field + */ + get scripted(): boolean; + /** + * Returns true if field is searchable + */ + get searchable(): boolean; + /** + * Returns true if field is aggregatable + */ + get aggregatable(): boolean; + /** + * returns true if field is a TSDB dimension field + */ + get timeSeriesDimension(): boolean; + /** + * returns type of TSDB metric or undefined + */ + get timeSeriesMetric(): import("@elastic/elasticsearch/lib/api/types").MappingTimeSeriesMetricType | undefined; + /** + * returns list of alloeed fixed intervals + */ + get fixedInterval(): string[] | undefined; + /** + * returns true if the field is of rolled up type + */ + get isRolledUpField(): boolean | undefined; + /** + * return list of allowed time zones + */ + get timeZone(): string[] | undefined; + /** + * Returns true if field is available via doc values + */ + get readFromDocValues(): boolean; + /** + * Returns field subtype, multi, nested, or undefined if neither + */ + get subType(): import("@kbn/es-query").IFieldSubType | undefined; + /** + * Is the field part of the index mapping? + */ + get isMapped(): boolean | undefined; + /** + * Returns true if runtime field defined on data view + */ + get isRuntimeField(): boolean; + /** + * Returns true if field is sortable + */ + get sortable(): boolean; + /** + * Returns true if field is filterable + */ + get filterable(): boolean; + /** + * Returns true if field is visualizable + */ + get visualizable(): boolean; + /** + * Returns true if field is Empty + */ + get isNull(): boolean; + /** + * Returns true if the field is not part of the index and is a computed column + */ + get isComputedColumn(): boolean; + /** + * Returns true if field is subtype nested + */ + isSubtypeNested(): boolean; + /** + * Returns true if field is subtype multi + */ + isSubtypeMulti(): boolean; + /** + * Returns subtype nested data if exists + */ + getSubtypeNested(): import("@kbn/es-query").IFieldSubTypeNested | undefined; + /** + * Returns subtype multi data if exists + */ + getSubtypeMulti(): import("@kbn/es-query").IFieldSubTypeMulti | undefined; + /** + * Deletes count value. Popularity as used by discover + */ + deleteCount(): void; + /** + * JSON version of field + */ + toJSON(): { + count: number; + script: string | undefined; + lang: string | undefined; + conflictDescriptions: Record | undefined; + name: string; + type: string; + esTypes: string[] | undefined; + scripted: boolean; + searchable: boolean; + aggregatable: boolean; + readFromDocValues: boolean; + subType: import("@kbn/es-query").IFieldSubType | undefined; + customLabel: string | undefined; + customDescription: string | undefined; + defaultFormatter: string | undefined; + }; + /** + * Get field in serialized form - fieldspec. + * @param config provide a method to get a field formatter + * @returns field in serialized form - field spec + */ + toSpec(config?: ToSpecConfig): FieldSpec; + /** + * Returns true if composite runtime field + */ + isRuntimeCompositeSubField(): boolean; +} diff --git a/src/platform/plugins/shared/data_views/common/fields/field_list.d.ts b/src/platform/plugins/shared/data_views/common/fields/field_list.d.ts new file mode 100644 index 0000000000000..ab65e9909512a --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/fields/field_list.d.ts @@ -0,0 +1,66 @@ +import { DataViewField } from './data_view_field'; +import type { FieldSpec, DataViewFieldMap } from '../types'; +import type { DataView } from '../data_views'; +interface ToSpecOptions { + getFormatterForField?: DataView['getFormatterForField']; +} +/** + * Interface for data view field list which _extends_ the array class. + */ +export interface IIndexPatternFieldList extends Array { + /** + * Creates a DataViewField instance. Does not add it to the data view. + * @param field field spec to create field instance + * @returns a new data view field instance + */ + create(field: FieldSpec): DataViewField; + /** + * Add field to field list. + * @param field field spec to add field to list + * @returns data view field instance which was added to list + */ + add(field: FieldSpec): DataViewField; + /** + * Returns fields as plain array of data view field instances. + */ + getAll(): DataViewField[]; + /** + * Get field by name. Optimized, uses map to find field. + * @param name name of field to find + * @returns data view field instance if found, undefined otherwise + */ + getByName(name: DataViewField['name']): DataViewField | undefined; + /** + * Get fields by field type. Optimized, uses map to find fields. + * @param type type of field to find + * @returns array of data view field instances if found, empty array otherwise + */ + getByType(type: DataViewField['type']): DataViewField[]; + /** + * Remove field from field list + * @param field field for removal + */ + remove(field: DataViewField | FieldSpec): void; + /** + * Remove all fields from field list. + */ + removeAll(): void; + /** + * Replace all fields in field list with new fields. + * @param specs array of field specs to add to list + */ + replaceAll(specs: FieldSpec[]): void; + /** + * Update a field in the list + * @param field field spec to update + */ + update(field: FieldSpec): void; + /** + * Field list as field spec map by name + * @param options optionally provide a function to get field formatter for fields + * @return map of field specs by name + */ + toSpec(options?: ToSpecOptions): DataViewFieldMap; +} +export declare const fieldList: (specs?: FieldSpec[], shortDotsEnable?: boolean) => IIndexPatternFieldList; +export {}; diff --git a/src/platform/plugins/shared/data_views/common/fields/index.d.ts b/src/platform/plugins/shared/data_views/common/fields/index.d.ts new file mode 100644 index 0000000000000..d8a4d55d2ad4c --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/fields/index.d.ts @@ -0,0 +1,3 @@ +export { isFilterable, isNestedField, isMultiField, getFieldSubtypeMulti, getFieldSubtypeNested, } from './utils'; +export * from './field_list'; +export * from './data_view_field'; diff --git a/src/platform/plugins/shared/data_views/common/fields/utils.d.ts b/src/platform/plugins/shared/data_views/common/fields/utils.d.ts new file mode 100644 index 0000000000000..2ccefe1974411 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/fields/utils.d.ts @@ -0,0 +1,23 @@ +import type { DataViewFieldBase, IFieldSubTypeNested, IFieldSubTypeMulti } from '@kbn/es-query'; +import type { DataViewField } from '.'; +export declare function isFilterable(field: DataViewField): boolean; +export declare const isNestedField: typeof isDataViewFieldSubtypeNested; +export declare const isMultiField: typeof isDataViewFieldSubtypeMulti; +export declare const getFieldSubtypeMulti: typeof getDataViewFieldSubtypeMulti; +export declare const getFieldSubtypeNested: typeof getDataViewFieldSubtypeNested; +/** + * Convert a dot.notated.string into a short + * version (d.n.string) + */ +export declare function shortenDottedString(input: string): string; +type HasSubtype = Pick; +export declare function isDataViewFieldSubtypeNested(field: HasSubtype): boolean; +export declare function getDataViewFieldSubtypeNested(field: HasSubtype): IFieldSubTypeNested | undefined; +export declare function isDataViewFieldSubtypeMulti(field: HasSubtype): boolean; +/** + * Returns subtype data for multi field + * @public + * @param field field to get subtype data from + */ +export declare function getDataViewFieldSubtypeMulti(field: HasSubtype): IFieldSubTypeMulti | undefined; +export {}; diff --git a/src/platform/plugins/shared/data_views/common/index.d.ts b/src/platform/plugins/shared/data_views/common/index.d.ts new file mode 100644 index 0000000000000..df38fc4a7308c --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/index.d.ts @@ -0,0 +1,16 @@ +export { RUNTIME_FIELD_TYPES, PRIMITIVE_RUNTIME_FIELD_TYPES, RUNTIME_FIELD_COMPOSITE_TYPE, DEFAULT_ASSETS_TO_IGNORE, META_FIELDS, DATA_VIEW_SAVED_OBJECT_TYPE, MAX_DATA_VIEW_FIELD_DESCRIPTION_LENGTH, HasEsDataFailureReason, } from './constants'; +export type { PrimitiveRuntimeFieldTypes, RuntimeFieldCompositeType } from './constants'; +export { LATEST_VERSION } from './content_management/v1/constants'; +export type { ToSpecConfig } from './fields'; +export type { IIndexPatternFieldList } from './fields'; +export { isFilterable, fieldList, DataViewField, isNestedField, isMultiField, getFieldSubtypeMulti, getFieldSubtypeNested, } from './fields'; +export type { FieldFormatMap, RuntimeType, RuntimePrimitiveTypes, RuntimeField, RuntimeFieldSpec, RuntimeFieldSubField, RuntimeFieldSubFields, DataViewAttributes, OnNotification, OnError, UiSettingsCommon, PersistenceAPI, GetFieldsOptions, IDataViewsApiClient, SavedObject, AggregationRestrictions, TypeMeta, FieldSpecConflictDescriptions, FieldSpec, DataViewFieldMap, DataViewSpec, SourceFilter, HasDataService, RuntimeFieldBase, FieldConfiguration, SavedObjectsClientCommonFindArgs, FieldAttrs, FieldAttrSet, } from './types'; +export { DataViewType } from './types'; +export type { DataViewsContract, DataViewsServiceDeps, DataViewSavedObjectAttrs, } from './data_views'; +export { DataViewsService, DataViewPersistableStateService } from './data_views'; +export type { DataViewListItem, DataViewsServicePublicMethods, TimeBasedDataView, } from './data_views'; +export { DataView, DataViewLazy, AbstractDataView } from './data_views'; +export { DuplicateDataViewError, DataViewSavedObjectConflictError, DataViewInsufficientAccessError, } from './errors'; +export type { IndexPatternExpressionType, IndexPatternLoadStartDependencies, IndexPatternLoadExpressionFunctionDefinition, } from './expressions'; +export { getIndexPatternLoadMeta } from './expressions'; +export { DataViewMissingIndices } from './lib/errors'; diff --git a/src/platform/plugins/shared/data_views/common/lib/errors.d.ts b/src/platform/plugins/shared/data_views/common/lib/errors.d.ts new file mode 100644 index 0000000000000..5271baf6e5646 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/lib/errors.d.ts @@ -0,0 +1,7 @@ +import { KbnError } from '@kbn/kibana-utils-plugin/common'; +/** + * Tried to call a method that relies on SearchSource having an indexPattern assigned + */ +export declare class DataViewMissingIndices extends KbnError { + constructor(message: string); +} diff --git a/src/platform/plugins/shared/data_views/common/lib/index.d.ts b/src/platform/plugins/shared/data_views/common/lib/index.d.ts new file mode 100644 index 0000000000000..6ae6d06a0378d --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/lib/index.d.ts @@ -0,0 +1,2 @@ +export { DataViewMissingIndices } from './errors'; +export * from '@kbn/data-view-validation'; diff --git a/src/platform/plugins/shared/data_views/common/types.d.ts b/src/platform/plugins/shared/data_views/common/types.d.ts new file mode 100644 index 0000000000000..1a42b62162de3 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/types.d.ts @@ -0,0 +1,521 @@ +import type { estypes } from '@elastic/elasticsearch'; +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { SavedObject } from '@kbn/core/server'; +import type { ErrorToastOptions, ToastInputFields } from '@kbn/core-notifications-browser'; +import type { DataViewFieldBase } from '@kbn/es-query'; +import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; +import type { RUNTIME_FIELD_TYPES } from './constants'; +export type { QueryDslQueryContainer }; +export type { SavedObject }; +export type FieldFormatMap = Record; +/** + * Runtime field types + */ +export type RuntimeType = (typeof RUNTIME_FIELD_TYPES)[number]; +/** + * Runtime field primitive types - excluding composite + */ +export type RuntimePrimitiveTypes = Exclude; +/** + * Runtime field definition + * @public + */ +export type RuntimeFieldBase = { + /** + * Type of runtime field + */ + type: RuntimeType; + /** + * Runtime field script + */ + script?: { + /** + * Script source + */ + source: string; + }; +}; +/** + * The RuntimeField that will be sent in the ES Query "runtime_mappings" object + */ +export type RuntimeFieldSpec = RuntimeFieldBase & { + /** + * Composite subfields + */ + fields?: Record; +}; +/** + * Field attributes that are user configurable + * @public + */ +export interface FieldConfiguration { + /** + * Field format in serialized form + */ + format?: SerializedFieldFormat | null; + /** + * Custom label + */ + customLabel?: string; + /** + * Custom description + */ + customDescription?: string; + /** + * Popularity - used for discover + */ + popularity?: number; +} +/** + * This is the RuntimeField interface enhanced with Data view field + * configuration: field format definition, customLabel or popularity. + * @public + */ +export interface RuntimeField extends RuntimeFieldBase, FieldConfiguration { + /** + * Subfields of composite field + */ + fields?: RuntimeFieldSubFields; +} +export type RuntimeFieldSubFields = Record; +/** + * Runtime field composite subfield + * @public + */ +export interface RuntimeFieldSubField extends FieldConfiguration { + type: RuntimePrimitiveTypes; +} +/** + * Interface for the data view saved object + * @public + */ +export interface DataViewAttributes { + /** + * Fields as a serialized array of field specs + */ + fields?: string; + /** + * Data view title + */ + title: string; + /** + * Data view type, default or rollup + */ + type?: string; + /** + * Type metadata information, serialized. Only used by rollup data views. + */ + typeMeta?: string; + /** + * Time field name + */ + timeFieldName?: string; + /** + * Serialized array of filters. Used by discover to hide fields. + */ + sourceFilters?: string; + /** + * Serialized map of field formats by field name + */ + fieldFormatMap?: string; + /** + * Serialized map of field attributes, currently field count and name + */ + fieldAttrs?: string; + /** + * Serialized map of runtime field definitions, by field name + */ + runtimeFieldMap?: string; + /** + * Prevents errors when index pattern exists before indices + */ + allowNoIndex?: boolean; + /** + * Name of the data view. Human readable name used to differentiate data view. + */ + name?: string; + /** + * Allow hidden and system indices when loading field list + */ + allowHidden?: boolean; +} +/** + * Set of field attributes + * @public + * Storage of field attributes. Necessary since the field list isn't saved. + */ +export type FieldAttrs = Map; +/** + * Field attributes that are stored on the data view + * @public + */ +export type FieldAttrSet = { + /** + * Custom field label + */ + customLabel?: string; + /** + * Custom field description + */ + customDescription?: string; + /** + * Popularity count - used for discover + */ + count?: number; +}; +export type FieldAttrsAsObject = Record; +/** + * Handler for data view notifications + * @public + * @param toastInputFields Toast notif config + * @param key Used to dedupe notifs + */ +export type OnNotification = (toastInputFields: ToastInputFields, key: string) => void; +/** + * Handler for data view errors + * @public + * @param error Error object + * @param toastInputFields Toast notif config + * @param key Used to dedupe notifs + */ +export type OnError = (error: Error, toastInputFields: ErrorToastOptions, key: string) => void; +/** + * Interface for UiSettings common interface {@link UiSettingsClient} + */ +export interface UiSettingsCommon { + /** + * Get a setting value + * @param key name of value + */ + get: (key: string) => Promise; + /** + * Get all settings values + */ + getAll: () => Promise>; + /** + * Set a setting value + * @param key name of value + * @param value value to set + */ + set: (key: string, value: T) => Promise; + /** + * Remove a setting value + * @param key name of value + */ + remove: (key: string) => Promise; +} +/** + * Saved objects common find args + * @public + */ +export interface SavedObjectsClientCommonFindArgs { + /** + * Saved object fields + */ + fields?: string[]; + /** + * Results per page + */ + perPage?: number; + /** + * Query string + */ + search?: string; + /** + * Fields to search + */ + searchFields?: string[]; +} +/** + * Common interface for the saved objects client on server and content management in browser + * @public + */ +export interface PersistenceAPI { + /** + * Search for saved objects + * @param options - options for search + */ + find: (options: SavedObjectsClientCommonFindArgs) => Promise>>; + /** + * Get a single saved object by id + * @param type - type of saved object + * @param id - id of saved object + */ + get: (id: string) => Promise>; + /** + * Update a saved object by id + * @param type - type of saved object + * @param id - id of saved object + * @param attributes - attributes to update + * @param options - client options + */ + update: (id: string, attributes: DataViewAttributes, options: { + version?: string; + }) => Promise; + /** + * Create a saved object + * @param attributes - attributes to set + * @param options - client options + */ + create: (attributes: DataViewAttributes, options: { + id?: string; + initialNamespaces?: string[]; + overwrite?: boolean; + managed?: boolean; + }) => Promise; + /** + * Delete a saved object by id + * @param type - type of saved object + * @param id - id of saved object + */ + delete: (id: string) => Promise; +} +export interface GetFieldsOptions { + pattern: string; + type?: string; + metaFields?: string[]; + rollupIndex?: string; + allowNoIndex?: boolean; + indexFilter?: QueryDslQueryContainer; + includeUnmapped?: boolean; + fields?: string[]; + allowHidden?: boolean; + forceRefresh?: boolean; + fieldTypes?: string[]; + includeEmptyFields?: boolean; + abortSignal?: AbortSignal; + runtimeMappings?: estypes.MappingRuntimeFields; + projectRouting?: string; +} +/** + * FieldsForWildcard response + */ +export interface FieldsForWildcardResponse { + fields: FieldsForWildcardSpec[]; + indices: string[]; + etag?: string; +} +/** + * Existing Indices response + */ +export type ExistingIndicesResponse = string[]; +export interface IDataViewsApiClient { + getFieldsForWildcard: (options: GetFieldsOptions) => Promise; + hasUserDataView: () => Promise; +} +export type AggregationRestrictions = Record; +/** + * Interface for metadata about rollup indices + */ +export type TypeMeta = { + /** + * Aggregation restrictions for rollup fields + */ + aggs?: Record; + /** + * Params for retrieving rollup field data + */ + params?: { + /** + * Rollup index name used for loading field list + */ + rollup_index: string; + }; +}; +/** + * Data View type. Default or rollup + */ +export declare enum DataViewType { + DEFAULT = "default", + ROLLUP = "rollup" +} +export type FieldSpecConflictDescriptions = Record; +type FieldsForWildcardSpec = Omit; +/** + * Serialized version of DataViewField + * @public + */ +export type FieldSpec = DataViewFieldBase & { + /** + * Popularity count is used by discover + */ + count?: number; + /** + * Description of field type conflicts across indices + */ + conflictDescriptions?: Record; + /** + * Field formatting in serialized format + */ + format?: SerializedFieldFormat; + /** + * Elasticsearch field types used by backing indices + */ + esTypes?: string[]; + /** + * True if field is searchable + */ + searchable: boolean; + /** + * True if field is aggregatable + */ + aggregatable: boolean; + /** + * True if field is empty + */ + isNull?: boolean; + /** + * True if field is a computed column, used in ES|QL to distinguish from index fields + */ + isComputedColumn?: boolean; + /** + * True if can be read from doc values + */ + readFromDocValues?: boolean; + /** + * True if field is indexed + */ + indexed?: boolean; + /** + * Custom label for field, used for display in kibana + */ + customLabel?: string; + /** + * Custom description for field, used for display in kibana + */ + customDescription?: string; + /** + * Runtime field definition + */ + runtimeField?: RuntimeFieldSpec; + /** + * list of allowed field intervals for the field + */ + fixedInterval?: string[]; + /** + * List of allowed timezones for the field + */ + timeZone?: string[]; + /** + * set to true if field is a TSDB dimension field + */ + timeSeriesDimension?: boolean; + /** + * set if field is a TSDB metric field + */ + timeSeriesMetric?: estypes.MappingTimeSeriesMetricType; + /** + * Whether short dots are enabled, based on uiSettings. + */ + shortDotsEnable?: boolean; + /** + * Is this field in the mapping? False if a scripted or runtime field defined on the data view. + */ + isMapped?: boolean; + /** + * Name of parent field for composite runtime field subfields. + */ + parentName?: string; + defaultFormatter?: string; + /** + * Indicates whether the field is a metadata field. + */ + metadata_field?: boolean; +}; +export type DataViewFieldMap = Record; +/** + * Static data view format + * Serialized data object, representing data view attributes and state + */ +export type DataViewSpec = { + /** + * Saved object id (or generated id if in-memory only) + */ + id?: string; + /** + * Saved object version string + */ + version?: string; + /** + * Contrary to its name, this property sets the index pattern of the data view. (e.g. `logs-*,metrics-*`) + * + * Use the `name` property instead to set a human readable name for the data view. + */ + title?: string; + /** + * Name of timestamp field + */ + timeFieldName?: string; + /** + * List of filters which discover uses to hide fields + */ + sourceFilters?: SourceFilter[]; + /** + * Map of fields by name + */ + fields?: DataViewFieldMap; + /** + * Metadata about data view, only used by rollup data views + */ + typeMeta?: TypeMeta; + /** + * Default or rollup + */ + type?: string; + /** + * Map of serialized field formats by field name + */ + fieldFormats?: Record; + /** + * Map of runtime fields by field name + */ + runtimeFieldMap?: Record; + /** + * Map of field attributes by field name, currently customName and count + */ + fieldAttrs?: FieldAttrsAsObject; + /** + * Determines whether failure to load field list should be reported as error + */ + allowNoIndex?: boolean; + /** + * Array of namespace ids + */ + namespaces?: string[]; + /** + * Human readable name used to differentiate the data view. + */ + name?: string; + /** + * Allow hidden and system indices when loading field list + */ + allowHidden?: boolean; + /** + * Whether the data view is managed by the application. + */ + managed?: boolean; +}; +export type SourceFilter = { + value: string; + clientId?: string | number; +}; +export interface HasDataService { + hasESData: () => Promise; + hasUserDataView: () => Promise; + hasDataView: () => Promise; +} +export interface ClientConfigType { + scriptedFieldsEnabled?: boolean; + dataTiersExcludedForFields?: string; + fieldListCachingEnabled?: boolean; + hasEsDataTimeout: number; +} diff --git a/src/platform/plugins/shared/data_views/common/utils.d.ts b/src/platform/plugins/shared/data_views/common/utils.d.ts new file mode 100644 index 0000000000000..209cc91693835 --- /dev/null +++ b/src/platform/plugins/shared/data_views/common/utils.d.ts @@ -0,0 +1,10 @@ +import type { PersistenceAPI } from './types'; +/** + * Returns an object matching a given name + * + * @param client {SavedObjectsClientCommon} + * @param name {string} + * @returns {SavedObject|undefined} + */ +export declare function findByName(client: PersistenceAPI, name: string): Promise | undefined>; +export declare function unwrapEtag(ifNoneMatch: string): string; diff --git a/src/platform/plugins/shared/data_views/public/content_management_wrapper.d.ts b/src/platform/plugins/shared/data_views/public/content_management_wrapper.d.ts new file mode 100644 index 0000000000000..e7ae6c1f1cf93 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/content_management_wrapper.d.ts @@ -0,0 +1,12 @@ +import type { ContentClient } from '@kbn/content-management-plugin/public'; +import type { DataViewAttributes, SavedObject, PersistenceAPI, SavedObjectsClientCommonFindArgs } from '../common/types'; +import type { DataViewCrudTypes } from '../common/content_management'; +export declare class ContentMagementWrapper implements PersistenceAPI { + private contentManagementClient; + constructor(contentManagementClient: ContentClient); + find(options: SavedObjectsClientCommonFindArgs): Promise[]>; + get(id: string): Promise>; + update(id: string, attributes: DataViewAttributes, options: DataViewCrudTypes['UpdateOptions']): Promise>; + create(attributes: DataViewAttributes, options: DataViewCrudTypes['CreateOptions']): Promise>; + delete(id: string): Promise; +} diff --git a/src/platform/plugins/shared/data_views/public/data_views/data_views_api_client.d.ts b/src/platform/plugins/shared/data_views/public/data_views/data_views_api_client.d.ts new file mode 100644 index 0000000000000..a2fa11d960bb2 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/data_views/data_views_api_client.d.ts @@ -0,0 +1,63 @@ +import type { HttpSetup } from '@kbn/core/public'; +import type { ProjectRouting } from '@kbn/es-query'; +import type { GetFieldsOptions, IDataViewsApiClient } from '../../common'; +/** + * Helper function to get the request body for the getFieldsForWildcard request + * @param options options for fields request + * @returns string | undefined + */ +export declare function getFieldsForWildcardRequestBody(options: GetFieldsOptions): string | undefined; +/** + * Data Views API Client - client implementation + */ +export declare class DataViewsApiClient implements IDataViewsApiClient { + private http; + private getCurrentUserId; + private getGlobalProjectRouting?; + /** + * constructor + * @param http http dependency + * @param getCurrentUserId function that returns the current user id + * @param getGlobalProjectRouting function that returns the global project routing, used if override is not provided in the options of a request + */ + constructor(http: HttpSetup, getCurrentUserId: () => Promise, getGlobalProjectRouting?: () => ProjectRouting); + private _request; + private _getUrl; + /** + * Get field list for a given index pattern + * @param options options for fields request + */ + getFieldsForWildcard(options: GetFieldsOptions): Promise<{ + indices: string[]; + fields: { + subType?: import("@kbn/es-query").IFieldSubType | undefined; + name: string; + type: string; + script?: string | undefined; + lang?: import("@elastic/elasticsearch/lib/api/types").ScriptLanguage | undefined; + scripted?: boolean | undefined; + esTypes?: string[] | undefined; + conflictDescriptions?: Record | undefined; + searchable: boolean; + aggregatable: boolean; + isNull?: boolean | undefined; + isComputedColumn?: boolean | undefined; + readFromDocValues?: boolean | undefined; + indexed?: boolean | undefined; + fixedInterval?: string[] | undefined; + timeZone?: string[] | undefined; + timeSeriesDimension?: boolean | undefined; + timeSeriesMetric?: import("@elastic/elasticsearch/lib/api/types").MappingTimeSeriesMetricType | undefined; + shortDotsEnable?: boolean | undefined; + isMapped?: boolean | undefined; + parentName?: string | undefined; + defaultFormatter?: string | undefined; + metadata_field?: boolean | undefined; + }[]; + etag: string; + }>; + /** + * Does a user created data view exist? + */ + hasUserDataView(): Promise; +} diff --git a/src/platform/plugins/shared/data_views/public/data_views/index.d.ts b/src/platform/plugins/shared/data_views/public/data_views/index.d.ts new file mode 100644 index 0000000000000..461b67bc34960 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/data_views/index.d.ts @@ -0,0 +1,2 @@ +export * from '../../common/data_views'; +export * from './data_views_api_client'; diff --git a/src/platform/plugins/shared/data_views/public/data_views/sha256.d.ts b/src/platform/plugins/shared/data_views/public/data_views/sha256.d.ts new file mode 100644 index 0000000000000..d52b21c712424 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/data_views/sha256.d.ts @@ -0,0 +1 @@ +export declare const sha256: (str: string) => Promise; diff --git a/src/platform/plugins/shared/data_views/public/data_views_service_public.d.ts b/src/platform/plugins/shared/data_views/public/data_views_service_public.d.ts new file mode 100644 index 0000000000000..1de1b1da2bda8 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/data_views_service_public.d.ts @@ -0,0 +1,58 @@ +import type { HttpStart } from '@kbn/core/public'; +import type { MatchedItem } from '.'; +import { DataViewsService } from '.'; +import type { DataViewsServiceDeps } from '../common/data_views/data_views'; +import type { HasDataService } from '../common'; +import type { ExistingIndicesResponse } from '../common/types'; +/** + * Data Views public service dependencies + * @public + */ +export interface DataViewsServicePublicDeps extends DataViewsServiceDeps { + /** + * Get can user save data view - sync version + */ + getCanSaveSync: () => boolean; + /** + * Has data service + */ + hasData: HasDataService; + getIndices: (props: { + pattern: string; + showAllIndices?: boolean; + isRollupIndex: (indexName: string) => boolean; + projectRouting?: string; + }) => Promise; + getRollupsEnabled: () => boolean; + scriptedFieldsEnabled: boolean; + http: HttpStart; +} +/** + * Data Views public service + * @public + */ +export declare class DataViewsServicePublic extends DataViewsService { + getCanSaveSync: () => boolean; + getIndices: (props: { + pattern: string; + showAllIndices?: boolean; + isRollupIndex: (indexName: string) => boolean; + projectRouting?: string; + }) => Promise; + hasData: HasDataService; + private rollupsEnabled; + private readonly http; + readonly scriptedFieldsEnabled: boolean; + /** + * Constructor + * @param deps Service dependencies + */ + constructor(deps: DataViewsServicePublicDeps); + getRollupsEnabled(): boolean; + /** + * Get existing index pattern list by providing string array index pattern list. + * @param indices - index pattern list + * @returns index pattern list of index patterns that match indices + */ + getExistingIndices(indices: string[]): Promise; +} diff --git a/src/platform/plugins/shared/data_views/public/debounce_by_key.d.ts b/src/platform/plugins/shared/data_views/public/debounce_by_key.d.ts new file mode 100644 index 0000000000000..ae989b6d7514b --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/debounce_by_key.d.ts @@ -0,0 +1,9 @@ +/** + * Uses a debouncer collector behind a debouncing factory to work on a set of functions + * + * @template F - function type + * @param {F} fn - function to debounce + * @param {number} waitInMs + * @returns {(key: string) => Function} + */ +export declare const debounceByKey: unknown>(fn: F, waitInMs: number) => ((key: string) => Function); diff --git a/src/platform/plugins/shared/data_views/public/expressions/index.d.ts b/src/platform/plugins/shared/data_views/public/expressions/index.d.ts new file mode 100644 index 0000000000000..47d43af8a29e1 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/expressions/index.d.ts @@ -0,0 +1 @@ +export * from './load_index_pattern'; diff --git a/src/platform/plugins/shared/data_views/public/expressions/load_index_pattern.d.ts b/src/platform/plugins/shared/data_views/public/expressions/load_index_pattern.d.ts new file mode 100644 index 0000000000000..8e8ce9900130f --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/expressions/load_index_pattern.d.ts @@ -0,0 +1,35 @@ +import type { StartServicesAccessor } from '@kbn/core/public'; +import type { IndexPatternLoadExpressionFunctionDefinition, IndexPatternLoadStartDependencies } from '../../common/expressions'; +import type { DataViewsPublicPluginStart, DataViewsPublicStartDependencies } from '../types'; +/** + * Returns the expression function definition. Any stateful dependencies are accessed + * at runtime via the `getStartDependencies` param, which provides the specific services + * needed for this function to run. + * + * This function is an implementation detail of this module, and is exported separately + * only for testing purposes. + * + * @param getStartDependencies - async function that resolves with IndexPatternLoadStartDependencies + * + * @internal + */ +export declare function getFunctionDefinition({ getStartDependencies, }: { + getStartDependencies: () => Promise; +}): () => IndexPatternLoadExpressionFunctionDefinition; +/** + * This is some glue code that takes in `core.getStartServices`, extracts the dependencies + * needed for this function, and wraps them behind a `getStartDependencies` function that + * is then called at runtime. + * + * We do this so that we can be explicit about exactly which dependencies the function + * requires, without cluttering up the top-level `plugin.ts` with this logic. It also + * makes testing the expression function a bit easier since `getStartDependencies` is + * the only thing you should need to mock. + * + * @param getStartServices - core's StartServicesAccessor for this plugin + * + * @internal + */ +export declare function getIndexPatternLoad({ getStartServices, }: { + getStartServices: StartServicesAccessor; +}): () => IndexPatternLoadExpressionFunctionDefinition; diff --git a/src/platform/plugins/shared/data_views/public/index.d.ts b/src/platform/plugins/shared/data_views/public/index.d.ts new file mode 100644 index 0000000000000..d2556f86986dc --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/index.d.ts @@ -0,0 +1,16 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +export { ILLEGAL_CHARACTERS_KEY, CONTAINS_SPACES_KEY, ILLEGAL_CHARACTERS_VISIBLE, ILLEGAL_CHARACTERS, validateDataView, } from '@kbn/data-view-validation'; +export type { IIndexPatternFieldList, TypeMeta, RuntimeType } from '../common'; +export type { DataViewSpec, FieldSpec, DataViewAttributes, PersistenceAPI, RuntimeField, } from '../common'; +export { DataViewField, DataViewType, DataViewSavedObjectConflictError, META_FIELDS, DATA_VIEW_SAVED_OBJECT_TYPE, getFieldSubtypeMulti, getFieldSubtypeNested, } from '../common'; +export type { DataViewsPublicSetupDependencies, DataViewsPublicStartDependencies, MatchedItem, Tag, } from './types'; +export { INDEX_PATTERN_TYPE } from './types'; +export type { IndexKind } from './types'; +export type { DataViewsServicePublic, DataViewsServicePublicDeps, } from './data_views_service_public'; +export { DataViewsApiClient, DataViewsService, DataView, DataViewLazy } from './data_views'; +export type { DataViewListItem } from './data_views'; +export { UiSettingsPublicToCommon } from './ui_settings_wrapper'; +import { DataViewsPublicPlugin } from './plugin'; +export declare function plugin(initializerContext: PluginInitializerContext): DataViewsPublicPlugin; +export type { DataViewsPublicPluginSetup, DataViewsPublicPluginStart, DataViewsContract, HasDataViewsResponse, IndicesViaSearchResponse, } from './types'; +export type { DataViewsPublicPlugin as DataViewsPlugin }; diff --git a/src/platform/plugins/shared/data_views/public/plugin.d.ts b/src/platform/plugins/shared/data_views/public/plugin.d.ts new file mode 100644 index 0000000000000..3a0c11a29dfe7 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/plugin.d.ts @@ -0,0 +1,12 @@ +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { DataViewsPublicPluginSetup, DataViewsPublicPluginStart, DataViewsPublicSetupDependencies, DataViewsPublicStartDependencies } from './types'; +export declare class DataViewsPublicPlugin implements Plugin { + private readonly initializerContext; + private readonly hasData; + private rollupsEnabled; + private readonly callResolveCluster; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup, { expressions, contentManagement }: DataViewsPublicSetupDependencies): DataViewsPublicPluginSetup; + start(core: CoreStart, { fieldFormats, contentManagement, cps }: DataViewsPublicStartDependencies): DataViewsPublicPluginStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/data_views/public/services/get_indices.d.ts b/src/platform/plugins/shared/data_views/public/services/get_indices.d.ts new file mode 100644 index 0000000000000..0e23330f0e05a --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/services/get_indices.d.ts @@ -0,0 +1,17 @@ +import type { HttpStart } from '@kbn/core/public'; +import type { Tag, MatchedItem, ResolveIndexResponse } from '../types'; +export declare const getIndicesViaResolve: ({ http, pattern, showAllIndices, isRollupIndex, projectRouting, }: { + http: HttpStart; + pattern: string; + showAllIndices: boolean; + isRollupIndex: (indexName: string) => boolean; + projectRouting?: string; +}) => Promise; +export declare function getIndices({ http, pattern: rawPattern, showAllIndices, isRollupIndex, projectRouting, }: { + http: HttpStart; + pattern: string; + showAllIndices?: boolean; + isRollupIndex: (indexName: string) => boolean; + projectRouting?: string; +}): Promise; +export declare const responseToItemArray: (response: ResolveIndexResponse, getTags: (indexName: string) => Tag[]) => MatchedItem[]; diff --git a/src/platform/plugins/shared/data_views/public/services/has_data.d.ts b/src/platform/plugins/shared/data_views/public/services/has_data.d.ts new file mode 100644 index 0000000000000..cafad081f2b19 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/services/has_data.d.ts @@ -0,0 +1,39 @@ +import type { CoreStart } from '@kbn/core/public'; +import type { ResponseErrorBody } from '@kbn/core-http-browser'; +import type { ICPSManager } from '@kbn/cps-utils'; +export interface HasEsDataParams { + /** + * Callback to handle the case where checking for remote data times out. + * If not provided, the default behavior is to show a toast notification. + * @param body The error response body + */ + onRemoteDataTimeout?: (body: ResponseErrorBody) => void; +} +export declare class HasData { + private removeAliases; + private isUserDataSource; + start(core: CoreStart, callResolveCluster: boolean, cpsManager?: ICPSManager): { + /** + * Check to see if ES data exists + */ + hasESData: ({ onRemoteDataTimeout, }?: HasEsDataParams) => Promise; + /** + * Check to see if a data view exists + */ + hasDataView: () => Promise; + /** + * Check to see if user created data views exist + */ + hasUserDataView: () => Promise; + }; + private isResponseError; + private responseToItemArray; + private getIndicesViaSearch; + private getIndices; + private checkLocalESData; + private checkRemoteESData; + private getHasDataViews; + private hasDataViews; + private hasUserDataViews; +} +export type HasDataStart = ReturnType; diff --git a/src/platform/plugins/shared/data_views/public/services/index.d.ts b/src/platform/plugins/shared/data_views/public/services/index.d.ts new file mode 100644 index 0000000000000..7b386486d21f7 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/services/index.d.ts @@ -0,0 +1,10 @@ +import type { HttpStart } from '@kbn/core/public'; +import type { MatchedItem } from '../types'; +export * from './has_data'; +export declare function getIndices(props: { + http: HttpStart; + pattern: string; + showAllIndices?: boolean; + isRollupIndex: (indexName: string) => boolean; + projectRouting?: string; +}): Promise; diff --git a/src/platform/plugins/shared/data_views/public/types.d.ts b/src/platform/plugins/shared/data_views/public/types.d.ts new file mode 100644 index 0000000000000..b99e5bc0f9f28 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/types.d.ts @@ -0,0 +1,175 @@ +import type { ExpressionsSetup } from '@kbn/expressions-plugin/public'; +import type { FieldFormatsSetup, FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import type { ContentManagementPublicSetup, ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; +import type { CPSPluginStart } from '@kbn/cps/public'; +import type { DataViewsServicePublicMethods } from './data_views'; +import type { HasDataService } from '../common'; +export declare enum INDEX_PATTERN_TYPE { + ROLLUP = "rollup", + DEFAULT = "default" +} +/** + * Discriminator for the entries returned by `dataViews.getIndices()` (backed + * by the Elasticsearch `_resolve/index` endpoint). Written to each + * `MatchedItem.tags[].key`. Exported as a type-only union so consumers can + * narrow against it without forcing a runtime dependency on `dataViews`. + */ +export type IndexKind = 'index' | 'alias' | 'data_stream' | 'frozen' | 'rollup'; +export declare enum IndicesResponseItemIndexAttrs { + OPEN = "open", + CLOSED = "closed", + HIDDEN = "hidden", + FROZEN = "frozen" +} +export interface IndicesResponseModified { + name: string; + item: { + name: string; + backing_indices?: string[]; + timestamp_field?: string; + indices?: string[]; + aliases?: string[]; + attributes?: IndicesResponseItemIndexAttrs[]; + data_stream?: string; + }; +} +export interface IndicesResponseItem { + name: string; +} +export interface IndicesResponseItemAlias extends IndicesResponseItem { + indices: string[]; +} +export interface IndicesResponseItemDataStream extends IndicesResponseItem { + backing_indices: string[]; + timestamp_field: string; +} +export interface IndicesResponseItemIndex extends IndicesResponseItem { + aliases?: string[]; + attributes?: IndicesResponseItemIndexAttrs[]; + data_stream?: string; +} +export interface IndicesResponse { + indices?: IndicesResponseItemIndex[]; + aliases?: IndicesResponseItemAlias[]; + data_streams?: IndicesResponseItemDataStream[]; +} +export interface IndicesViaSearchResponse { + total: number; +} +export interface HasDataViewsResponse { + hasDataView: boolean; + hasUserDataView: boolean; +} +/** + * Data views public setup dependencies + */ +export interface DataViewsPublicSetupDependencies { + /** + * Expressions + */ + expressions: ExpressionsSetup; + /** + * Field formats + */ + fieldFormats: FieldFormatsSetup; + /** + * Content management + */ + contentManagement: ContentManagementPublicSetup; +} +/** + * Data views public start dependencies + */ +export interface DataViewsPublicStartDependencies { + /** + * Field formats + */ + fieldFormats: FieldFormatsStart; + /** + * Content management + */ + contentManagement: ContentManagementPublicStart; + /** + * CPS plugin (optional) + */ + cps?: CPSPluginStart; +} +/** + * Data plugin public Setup contract + */ +export interface DataViewsPublicPluginSetup { + enableRollups: () => void; +} +export interface DataViewsServicePublic extends DataViewsServicePublicMethods { + getCanSaveSync: () => boolean; + hasData: HasDataService; + getIndices: (props: { + pattern: string; + showAllIndices?: boolean; + isRollupIndex: (indexName: string) => boolean; + projectRouting?: string; + }) => Promise; + getRollupsEnabled: () => boolean; + scriptedFieldsEnabled: boolean; + /** + * Get existing index pattern list by providing string array index pattern list. + * @param indices - index pattern list + * @returns index pattern list of index patterns that match indices + */ + getExistingIndices: (indices: string[]) => Promise; +} +export type DataViewsContract = DataViewsServicePublic; +/** + * Data views plugin public Start contract + */ +export type DataViewsPublicPluginStart = DataViewsServicePublic; +export interface MatchedItem { + name: string; + tags: Tag[]; + item: { + name: string; + backing_indices?: string[]; + timestamp_field?: string; + indices?: string[]; + aliases?: string[]; + attributes?: ResolveIndexResponseItemIndexAttrs[]; + data_stream?: string; + mode?: string; + }; +} +export interface ResolveIndexResponse { + indices?: ResolveIndexResponseItemIndex[]; + aliases?: ResolveIndexResponseItemAlias[]; + data_streams?: ResolveIndexResponseItemDataStream[]; +} +export interface ResolveIndexResponseItem { + name: string; +} +export interface ResolveIndexResponseItemDataStream extends ResolveIndexResponseItem { + backing_indices: string[]; + timestamp_field: string; +} +export interface ResolveIndexResponseItemAlias extends ResolveIndexResponseItem { + indices: string[]; +} +export interface ResolveIndexResponseItemIndex extends ResolveIndexResponseItem { + aliases?: string[]; + attributes?: ResolveIndexResponseItemIndexAttrs[]; + data_stream?: string; +} +/** + * UI tag attached to each entry returned by `dataViews.getIndices()`. + * + * @see IndexKind for the discriminator written to `key`. + */ +export interface Tag { + name: string; + key: IndexKind; + color: string; +} +export declare enum ResolveIndexResponseItemIndexAttrs { + OPEN = "open", + CLOSED = "closed", + HIDDEN = "hidden", + FROZEN = "frozen" +} diff --git a/src/platform/plugins/shared/data_views/public/ui_settings_wrapper.d.ts b/src/platform/plugins/shared/data_views/public/ui_settings_wrapper.d.ts new file mode 100644 index 0000000000000..ee43678481f60 --- /dev/null +++ b/src/platform/plugins/shared/data_views/public/ui_settings_wrapper.d.ts @@ -0,0 +1,10 @@ +import type { IUiSettingsClient, PublicUiSettingsParams, UserProvidedValues } from '@kbn/core/public'; +import type { UiSettingsCommon } from '../common'; +export declare class UiSettingsPublicToCommon implements UiSettingsCommon { + private uiSettings; + constructor(uiSettings: IUiSettingsClient); + get(key: string): Promise; + getAll(): Promise) | undefined>>; + set(key: string, value: unknown): Promise; + remove(key: string): Promise; +} diff --git a/src/platform/plugins/shared/expressions/common/ast/build_expression.d.ts b/src/platform/plugins/shared/expressions/common/ast/build_expression.d.ts new file mode 100644 index 0000000000000..35fa8d40d5dce --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/ast/build_expression.d.ts @@ -0,0 +1,68 @@ +import type { AnyExpressionFunctionDefinition } from '../expression_functions/types'; +import type { ExpressionAstExpression } from './types'; +import type { ExpressionAstFunctionBuilder, InferFunctionDefinition } from './build_function'; +/** + * Type guard that checks whether a given value is an + * `ExpressionAstExpressionBuilder`. This is useful when working + * with subexpressions, where you might be retrieving a function + * argument, and need to know whether it is an expression builder + * instance which you can perform operations on. + * + * @example + * const arg = myFunction.getArgument('foo'); + * if (isExpressionAstBuilder(foo)) { + * foo.toAst(); + * } + * + * @param val Value you want to check. + * @return boolean + */ +export declare function isExpressionAstBuilder(val: unknown): val is ExpressionAstExpressionBuilder; +/** @internal */ +export declare function isExpressionAst(val: unknown): val is ExpressionAstExpression; +export interface ExpressionAstExpressionBuilder { + /** + * Used to identify expression builder objects. + */ + type: 'expression_builder'; + /** + * Array of each of the `buildExpressionFunction()` instances + * in this expression. Use this to remove or reorder functions + * in the expression. + */ + functions: ExpressionAstFunctionBuilder[]; + /** + * Recursively searches expression for all ocurrences of the + * function, including in subexpressions. + * + * Useful when performing migrations on a specific function, + * as you can iterate over the array of references and update + * all functions at once. + * + * @param fnName Name of the function to search for. + * @return `ExpressionAstFunctionBuilder[]` + */ + findFunction: (fnName: InferFunctionDefinition['name']) => Array> | []; + /** + * Converts expression to an AST. + * + * @return `ExpressionAstExpression` + */ + toAst: () => ExpressionAstExpression; + /** + * Converts expression to an expression string. + * + * @return `string` + */ + toString: () => string; +} +/** + * Makes it easy to progressively build, update, and traverse an + * expression AST. You can either start with an empty AST, or + * provide an expression string, AST, or array of expression + * function builders to use as initial state. + * + * @param initialState Optional. An expression string, AST, or array of `ExpressionAstFunctionBuilder[]`. + * @return `this` + */ +export declare function buildExpression(initialState?: ExpressionAstFunctionBuilder[] | ExpressionAstExpression | string): ExpressionAstExpressionBuilder; diff --git a/src/platform/plugins/shared/expressions/common/ast/build_function.d.ts b/src/platform/plugins/shared/expressions/common/ast/build_function.d.ts new file mode 100644 index 0000000000000..73775c1faccc0 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/ast/build_function.d.ts @@ -0,0 +1,116 @@ +import type { ExpressionAstExpression, ExpressionAstFunction } from './types'; +import type { AnyExpressionFunctionDefinition, ExpressionFunctionDefinition } from '../expression_functions/types'; +import type { ExpressionAstExpressionBuilder } from './build_expression'; +export type InferFunctionDefinition = FnDef extends ExpressionFunctionDefinition ? { + name: Name; + input: Input; + arguments: Arguments; + output: Output; + context: Context; +} : never; +type FunctionArgs = InferFunctionDefinition['arguments']; +type FunctionArgName = { + [A in keyof FunctionArgs]: A extends string ? A : never; +}[keyof FunctionArgs]; +type OptionalKeys = { + [K in keyof T]-?: {} extends Pick ? (K extends string ? K : never) : never; +}[keyof T]; +interface FunctionBuilderArguments { + [key: string]: Array[string] | ExpressionAstExpressionBuilder>; +} +export interface ExpressionAstFunctionBuilder { + /** + * Used to identify expression function builder objects. + */ + type: 'expression_function_builder'; + /** + * Name of this expression function. + */ + name: InferFunctionDefinition['name']; + /** + * Object of all args currently added to the function. This is + * structured similarly to `ExpressionAstFunction['arguments']`, + * however any subexpressions are returned as expression builder + * instances instead of expression ASTs. + */ + arguments: FunctionBuilderArguments; + /** + * Adds an additional argument to the function. For multi-args, + * this should be called once for each new arg. Note that TS + * will not enforce whether multi-args are available, so only + * use this to update an existing arg if you are certain it + * is a multi-arg. + * + * @param name The name of the argument to add. + * @param value The value of the argument to add. + * @return `this` + */ + addArgument: >(name: A, value: FunctionArgs[A] | ExpressionAstExpressionBuilder) => this; + /** + * Retrieves an existing argument by name. + * Useful when you want to retrieve the current array of args and add + * something to it before calling `replaceArgument`. Any subexpression + * arguments will be returned as expression builder instances. + * + * @param name The name of the argument to retrieve. + * @return `ExpressionAstFunctionBuilderArgument[] | undefined` + */ + getArgument: >(name: A) => Array[A] | ExpressionAstExpressionBuilder> | undefined; + /** + * Overwrites an existing argument with a new value. + * In order to support multi-args, the value given must always be + * an array. + * + * @param name The name of the argument to replace. + * @param value The value of the argument. Must always be an array. + * @return `this` + */ + replaceArgument: >(name: A, value: Array[A] | ExpressionAstExpressionBuilder>) => this; + /** + * Removes an (optional) argument from the function. + * + * TypeScript will enforce that you only remove optional + * arguments. For manipulating required args, use `replaceArgument`. + * + * @param name The name of the argument to remove. + * @return `this` + */ + removeArgument: >>(name: A) => this; + /** + * Converts function to an AST. + * + * @return `ExpressionAstFunction` + */ + toAst: () => ExpressionAstFunction; + /** + * Converts function to an expression string. + * + * @return `string` + */ + toString: () => string; +} +/** + * Manages an AST for a single expression function. The return value + * can be provided to `buildExpression` to add this function to an + * expression. + * + * Note that to preserve type safety and ensure no args are missing, + * all required arguments for the specified function must be provided + * up front. If desired, they can be changed or removed later. + * + * @param fnName String representing the name of this expression function. + * @param initialArgs Object containing the arguments to this function. + * @return `this` + */ +export declare function buildExpressionFunction(fnName: InferFunctionDefinition['name'], +/** + * To support subexpressions, we override all args to also accept an + * ExpressionBuilder. This isn't perfectly typesafe since we don't + * know with certainty that the builder's output matches the required + * argument input, so we trust that folks using subexpressions in the + * builder know what they're doing. + */ +initialArgs: { + [K in keyof FunctionArgs]: FunctionArgs[K] | ExpressionAstExpressionBuilder | ExpressionAstExpressionBuilder[] | ExpressionAstExpression | ExpressionAstExpression[]; +}): ExpressionAstFunctionBuilder; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/ast/format.d.ts b/src/platform/plugins/shared/expressions/common/ast/format.d.ts new file mode 100644 index 0000000000000..d296d3b91807d --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/ast/format.d.ts @@ -0,0 +1,2 @@ +import type { ExpressionAstExpression, ExpressionAstArgument } from './types'; +export declare function format(ast: T, type: T extends ExpressionAstExpression ? 'expression' : 'argument'): string; diff --git a/src/platform/plugins/shared/expressions/common/ast/format_expression.d.ts b/src/platform/plugins/shared/expressions/common/ast/format_expression.d.ts new file mode 100644 index 0000000000000..d6c0f2ce79c09 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/ast/format_expression.d.ts @@ -0,0 +1,7 @@ +import type { ExpressionAstExpression } from './types'; +/** + * Given expression pipeline AST, returns formatted string. + * + * @param ast Expression pipeline AST. + */ +export declare function formatExpression(ast: ExpressionAstExpression): string; diff --git a/src/platform/plugins/shared/expressions/common/ast/index.d.ts b/src/platform/plugins/shared/expressions/common/ast/index.d.ts new file mode 100644 index 0000000000000..3427512887cd9 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/ast/index.d.ts @@ -0,0 +1,7 @@ +export * from './build_expression'; +export * from './build_function'; +export * from './format_expression'; +export * from './format'; +export * from './parse_expression'; +export * from './parse'; +export type * from './types'; diff --git a/src/platform/plugins/shared/expressions/common/ast/parse.d.ts b/src/platform/plugins/shared/expressions/common/ast/parse.d.ts new file mode 100644 index 0000000000000..636aa35c24cc5 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/ast/parse.d.ts @@ -0,0 +1,2 @@ +import type { ExpressionAstExpression, ExpressionAstArgument } from './types'; +export declare function parse(expression: E, startRule: S): S extends 'expression' ? ExpressionAstExpression : ExpressionAstArgument; diff --git a/src/platform/plugins/shared/expressions/common/ast/parse_expression.d.ts b/src/platform/plugins/shared/expressions/common/ast/parse_expression.d.ts new file mode 100644 index 0000000000000..82f93ea667879 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/ast/parse_expression.d.ts @@ -0,0 +1,7 @@ +import type { ExpressionAstExpression } from './types'; +/** + * Given expression pipeline string, returns parsed AST. + * + * @param expression Expression pipeline string. + */ +export declare function parseExpression(expression: string): ExpressionAstExpression; diff --git a/src/platform/plugins/shared/expressions/common/ast/types.d.ts b/src/platform/plugins/shared/expressions/common/ast/types.d.ts new file mode 100644 index 0000000000000..79cc2e579c5e3 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/ast/types.d.ts @@ -0,0 +1,51 @@ +import type { Ast, AstFunction } from '@kbn/interpreter'; +import type { ExpressionValue, ExpressionValueError } from '../expression_types'; +export type ExpressionAstNode = ExpressionAstExpression | ExpressionAstFunction | ExpressionAstArgument; +export type ExpressionAstExpression = Omit & { + chain: ExpressionAstFunction[]; +}; +export type ExpressionAstFunction = Omit & { + arguments: Record; + /** + * Debug information added to each function when expression is executed in *debug mode*. + */ + debug?: ExpressionAstFunctionDebug; +}; +export type ExpressionAstFunctionDebug = { + /** + * True if function successfully returned output, false if function threw. + */ + success: boolean; + /** + * Id of expression function. + */ + fn: string; + /** + * Input that expression function received as its first argument. + */ + input: ExpressionValue; + /** + * Map of resolved arguments expression function received as its second argument. + */ + args: Record; + /** + * Result returned by the expression function. Including an error result + * if it was returned by the function (not thrown). + */ + output?: ExpressionValue; + /** + * Error that function threw normalized to `ExpressionValueError`. + */ + error?: ExpressionValueError; + /** + * Raw error that was thrown by the function, if any. + */ + rawError?: any | Error; + /** + * Time in milliseconds it took to execute the function. Duration can be + * `undefined` if error happened during argument resolution, because function + * timing starts after the arguments have been resolved. + */ + duration: number | undefined; +}; +export type ExpressionAstArgument = string | boolean | number | ExpressionAstExpression; diff --git a/src/platform/plugins/shared/expressions/common/execution/container.d.ts b/src/platform/plugins/shared/expressions/common/execution/container.d.ts new file mode 100644 index 0000000000000..60d911605f3f6 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/execution/container.d.ts @@ -0,0 +1,32 @@ +import type { StateContainer } from '@kbn/kibana-utils-plugin/common/state_containers'; +import type { ExecutorState } from '../executor'; +import type { ExpressionAstExpression } from '../ast'; +import type { ExpressionValue } from '../expression_types'; +export interface ExecutionState extends ExecutorState { + ast: ExpressionAstExpression; + /** + * Tracks state of execution. + * + * - `not-started` - before .start() method was called. + * - `pending` - immediately after .start() method is called. + * - `result` - when expression execution completed. + * - `error` - when execution failed with error. + */ + state: 'not-started' | 'pending' | 'result' | 'error'; + /** + * Result of the expression execution. + */ + result?: Output; + /** + * Error happened during the execution. + */ + error?: Error; +} +export interface ExecutionPureTransitions { + start: (state: ExecutionState) => () => ExecutionState; + setResult: (state: ExecutionState) => (result: Output) => ExecutionState; + setError: (state: ExecutionState) => (error: Error) => ExecutionState; +} +export declare const executionPureTransitions: ExecutionPureTransitions; +export type ExecutionContainer = StateContainer, ExecutionPureTransitions>; +export declare const createExecutionContainer: (state?: ExecutionState) => ExecutionContainer; diff --git a/src/platform/plugins/shared/expressions/common/execution/execution.d.ts b/src/platform/plugins/shared/expressions/common/execution/execution.d.ts new file mode 100644 index 0000000000000..0413a0efffb6c --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/execution/execution.d.ts @@ -0,0 +1,109 @@ +import type { Logger } from '@kbn/logging'; +import type { ObservableLike, UnwrapObservable } from '@kbn/utility-types'; +import { Observable } from 'rxjs'; +import { AbortReason } from '@kbn/kibana-utils-plugin/common'; +import type { Adapters } from '@kbn/inspector-plugin/common'; +import type { Executor } from '../executor'; +import type { ExecutionContainer } from './container'; +import type { ExpressionValueError } from '../expression_types/specs/error'; +import type { ExpressionAstArgument, ExpressionAstExpression, ExpressionAstFunction, ExpressionAstNode } from '../ast'; +import type { DefaultInspectorAdapters, ExecutionContext } from './types'; +import type { ExpressionFunction, ExpressionFunctionParameter } from '../expression_functions'; +import { ExecutionContract } from './execution_contract'; +import type { ExpressionExecutionParams } from '../service'; +type UnwrapReturnType unknown> = ReturnType extends ObservableLike ? UnwrapObservable> : Awaited>; +export interface FunctionCacheItem { + value: unknown; + time: number; + sideEffectFn?: () => void; +} +/** + * The result returned after an expression function execution. + */ +export interface ExecutionResult { + /** + * Partial result flag. + */ + partial: boolean; + /** + * The expression function result. + */ + result: Output; +} +export interface ExecutionParams { + executor: Executor; + ast?: ExpressionAstExpression; + expression?: string; + params: ExpressionExecutionParams; +} +export declare class Execution { + #private; + readonly execution: ExecutionParams; + private readonly logger?; + private readonly functionCache; + /** + * Dynamic state of the execution. + */ + readonly state: ExecutionContainer>; + /** + * Initial input of the execution. + * + * N.B. It is initialized to `null` rather than `undefined` for legacy reasons, + * because in legacy interpreter it was set to `null` by default. + */ + input: Input; + /** + * Input of the started execution. + */ + private input$; + /** + * Execution context - object that allows to do side-effects. Context is passed + * to every function. + */ + readonly context: ExecutionContext; + /** + * AbortController to cancel this Execution. + */ + private readonly abortController; + /** + * Whether .start() method has been called. + */ + private hasStarted; + /** + * Future that tracks result or error of this execution. + */ + readonly result: Observable>; + /** + * Keeping track of any child executions + * Needed to cancel child executions in case parent execution is canceled + * @internal + */ + private readonly childExecutions; + private cacheTimeout; + /** + * Contract is a public representation of `Execution` instances. Contract we + * can return to other plugins for their consumption. + */ + readonly contract: ExecutionContract; + readonly expression: string; + get inspectorAdapters(): InspectorAdapters; + constructor(execution: ExecutionParams, logger?: Logger | undefined, functionCache?: Map); + /** + * Stop execution of expression. + */ + cancel(reason?: AbortReason): void; + /** + * Call this method to start execution. + * + * N.B. `input` is initialized to `null` rather than `undefined` for legacy reasons, + * because in legacy interpreter it was set to `null` by default. + */ + start(input?: Input, isSubExpression?: boolean): Observable>; + invokeChain([head, ...tail]: ExpressionAstFunction[], input: unknown): Observable; + invokeFunction(fn: Fn, input: unknown, args: Record): Observable>; + cast(value: unknown, toTypeNames?: string[]): Type; + validate(value: Type, argDef: ExpressionFunctionParameter): void; + resolveArgs(fnDef: Fn, input: unknown, argAsts: Record): Observable | ExpressionValueError>; + interpret(ast: ExpressionAstNode, input: T): Observable>; +} +export {}; diff --git a/src/platform/plugins/shared/expressions/common/execution/execution_contract.d.ts b/src/platform/plugins/shared/expressions/common/execution/execution_contract.d.ts new file mode 100644 index 0000000000000..70ae2a733dd63 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/execution/execution_contract.d.ts @@ -0,0 +1,42 @@ +import type { Observable } from 'rxjs'; +import type { Adapters } from '@kbn/inspector-plugin/common/adapters'; +import type { AbortReason } from '@kbn/kibana-utils-plugin/common'; +import type { Execution, ExecutionResult } from './execution'; +import type { ExpressionValueError } from '../expression_types/specs'; +import type { ExpressionAstExpression } from '../ast'; +/** + * `ExecutionContract` is a wrapper around `Execution` class. It provides the + * same functionality but does not expose Expressions plugin internals. + */ +export declare class ExecutionContract { + get isPending(): boolean; + protected readonly execution: Execution; + constructor(execution: Execution); + /** + * Cancel the execution of the expression. This will set abort signal + * (available in execution context) to aborted state, letting expression + * functions to stop their execution. + */ + cancel: (reason?: AbortReason) => void; + /** + * Returns the final output of expression, if any error happens still + * wraps that error into `ExpressionValueError` type and returns that. + * This function never throws. + */ + getData: () => Observable>; + /** + * Get string representation of the expression. Returns the original string + * if execution was started from a string. If execution was started from an + * AST this method returns a string generated from AST. + */ + getExpression: () => string; + /** + * Get AST used to execute the expression. + */ + getAst: () => ExpressionAstExpression; + /** + * Get Inspector adapters provided to all functions of expression through + * execution context. + */ + inspect: () => Adapters; +} diff --git a/src/platform/plugins/shared/expressions/common/execution/index.d.ts b/src/platform/plugins/shared/expressions/common/execution/index.d.ts new file mode 100644 index 0000000000000..d18f67e4bcccd --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/execution/index.d.ts @@ -0,0 +1,4 @@ +export type * from './types'; +export * from './container'; +export * from './execution'; +export * from './execution_contract'; diff --git a/src/platform/plugins/shared/expressions/common/execution/types.d.ts b/src/platform/plugins/shared/expressions/common/execution/types.d.ts new file mode 100644 index 0000000000000..ebd33c459f06f --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/execution/types.d.ts @@ -0,0 +1,75 @@ +import type { KibanaRequest } from '@kbn/core/server'; +import type { KibanaExecutionContext } from '@kbn/core/public'; +import type { Adapters, RequestAdapter } from '@kbn/inspector-plugin/common'; +import type { ExecutionContextSearch } from '@kbn/es-query'; +import type { Datatable, ExpressionType } from '../expression_types'; +import type { TablesAdapter } from '../util/tables_adapter'; +import type { ExpressionsInspectorAdapter } from '../util'; +/** + * `ExecutionContext` is an object available to all functions during a single execution; + * it provides various methods to perform side-effects. + */ +export interface ExecutionContext { + /** + * Get search context of the expression. + */ + getSearchContext: () => ExecutionContextSearch; + /** + * Context variables that can be consumed using `var` and `var_set` functions. + */ + variables: Record; + /** + * A map of available expression types. + */ + types: Record; + /** + * Allow caching in the current execution. + */ + allowCache?: boolean; + /** + * Adds ability to abort current execution. + */ + abortSignal: AbortSignal; + /** + * Adapters for `inspector` plugin. + */ + inspectorAdapters: InspectorAdapters; + /** + * Search context in which expression should operate. + */ + getSearchSessionId: () => string | undefined; + /** + * Getter to retrieve the `KibanaRequest` object inside an expression function. + * Useful for functions which are running on the server and need to perform + * operations that are scoped to a specific user. + */ + getKibanaRequest?: () => KibanaRequest; + /** + * Returns the state (true|false) of the sync colors across panels switch. + */ + isSyncColorsEnabled?: () => boolean; + /** + * Returns the state (true|false) of the sync cursor across panels switch. + */ + isSyncCursorEnabled?: () => boolean; + /** + * Returns the state (true|false) of the sync tooltips across panels switch. + */ + isSyncTooltipsEnabled?: () => boolean; + /** + * Contains the meta-data about the source of the expression. + */ + getExecutionContext: () => KibanaExecutionContext | undefined; + /** + * Logs datatable. + */ + logDatatable?(name: string, datatable: Datatable): void; +} +/** + * Default inspector adapters created if inspector adapters are not set explicitly. + */ +export interface DefaultInspectorAdapters { + requests: RequestAdapter; + tables: TablesAdapter; + expression: ExpressionsInspectorAdapter; +} diff --git a/src/platform/plugins/shared/expressions/common/executor/container.d.ts b/src/platform/plugins/shared/expressions/common/executor/container.d.ts new file mode 100644 index 0000000000000..dcecc7cf05a0b --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/executor/container.d.ts @@ -0,0 +1,22 @@ +import type { StateContainer } from '@kbn/kibana-utils-plugin/common/state_containers'; +import type { ExpressionFunction } from '../expression_functions'; +import type { ExpressionType } from '../expression_types'; +export interface ExecutorState = Record> { + functions: Record; + types: Record; + context: Context; +} +export declare const defaultState: ExecutorState; +export interface ExecutorPureTransitions { + addFunction: (state: ExecutorState) => (fn: ExpressionFunction) => ExecutorState; + addType: (state: ExecutorState) => (type: ExpressionType) => ExecutorState; +} +export declare const pureTransitions: ExecutorPureTransitions; +export interface ExecutorPureSelectors { + getFunction: (state: ExecutorState) => (id: string) => ExpressionFunction | null; + getType: (state: ExecutorState) => (id: string) => ExpressionType | null; + getContext: (state: ExecutorState) => () => ExecutorState['context']; +} +export declare const pureSelectors: ExecutorPureSelectors; +export type ExecutorContainer = Record> = StateContainer, ExecutorPureTransitions, ExecutorPureSelectors>; +export declare const createExecutorContainer: = Record>(state?: ExecutorState) => ExecutorContainer; diff --git a/src/platform/plugins/shared/expressions/common/executor/executor.d.ts b/src/platform/plugins/shared/expressions/common/executor/executor.d.ts new file mode 100644 index 0000000000000..f16765a1ae3c4 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/executor/executor.d.ts @@ -0,0 +1,83 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/logging'; +import type { SavedObjectReference } from '@kbn/core/types'; +import type { MigrateFunctionsObject, PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common'; +import type { ExecutorState, ExecutorContainer } from './container'; +import type { AnyExpressionFunctionDefinition } from '../expression_functions'; +import { ExpressionFunction } from '../expression_functions'; +import type { ExecutionResult, FunctionCacheItem } from '../execution/execution'; +import { Execution } from '../execution/execution'; +import type { IRegistry } from '../types'; +import { ExpressionType } from '../expression_types/expression_type'; +import type { AnyExpressionTypeDefinition } from '../expression_types/types'; +import type { ExpressionAstExpression } from '../ast'; +import type { ExpressionValueError } from '../expression_types/specs'; +import type { ExpressionExecutionParams } from '../service'; +export interface ExpressionExecOptions { + /** + * Whether to execute expression in *debug mode*. In *debug mode* inputs and + * outputs as well as all resolved arguments and time it took to execute each + * function are saved and are available for introspection. + */ + debug?: boolean; +} +export declare class TypesRegistry implements IRegistry { + private readonly executor; + constructor(executor: Executor); + register(typeDefinition: AnyExpressionTypeDefinition | (() => AnyExpressionTypeDefinition)): void; + get(id: string): ExpressionType | null; + toJS(): Record; + toArray(): ExpressionType[]; +} +export declare class FunctionsRegistry implements IRegistry { + private readonly executor; + constructor(executor: Executor); + register(functionDefinition: AnyExpressionFunctionDefinition | (() => AnyExpressionFunctionDefinition)): void; + get(id: string): ExpressionFunction | null; + toJS(): Record; + toArray(): ExpressionFunction[]; +} +export declare class Executor = Record> implements PersistableStateService { + private readonly logger?; + static createWithDefaults = Record>(logger?: Logger, state?: ExecutorState): Executor; + readonly container: ExecutorContainer; + /** + * @deprecated + */ + readonly functions: FunctionsRegistry; + /** + * @deprecated + */ + readonly types: TypesRegistry; + private functionCache; + constructor(logger?: Logger | undefined, state?: ExecutorState, functionCache?: Map); + get state(): ExecutorState; + registerFunction(functionDefinition: AnyExpressionFunctionDefinition | (() => AnyExpressionFunctionDefinition)): void; + getFunction(name: string, namespace?: string): ExpressionFunction | undefined; + getFunctions(namespace?: string): Record; + registerType(typeDefinition: AnyExpressionTypeDefinition | (() => AnyExpressionTypeDefinition)): void; + getType(name: string): ExpressionType | undefined; + getTypes(): Record; + get context(): Record; + /** + * Execute expression and return result. + * + * @param ast Expression AST or a string representing expression. + * @param input Initial input to the first expression function. + * @param context Extra global context object that will be merged into the + * expression global context object that is provided to each function to allow side-effects. + */ + run(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): Observable>; + createExecution(ast: string | ExpressionAstExpression, params?: ExpressionExecutionParams): Execution; + private walkAst; + private walkAstAndTransform; + inject(ast: ExpressionAstExpression, references: SavedObjectReference[]): ExpressionAstExpression; + extract(ast: ExpressionAstExpression): { + state: ExpressionAstExpression; + references: import("@kbn/core/packages/saved-objects/api-server").SavedObjectReference[]; + }; + telemetry(ast: ExpressionAstExpression, telemetryData: Record): Record; + getAllMigrations(): MigrateFunctionsObject; + migrateToLatest(state: VersionedState): ExpressionAstExpression; + private migrate; +} diff --git a/src/platform/plugins/shared/expressions/common/executor/index.d.ts b/src/platform/plugins/shared/expressions/common/executor/index.d.ts new file mode 100644 index 0000000000000..65aeae07d9f24 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/executor/index.d.ts @@ -0,0 +1,2 @@ +export * from './container'; +export * from './executor'; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/arguments.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/arguments.d.ts new file mode 100644 index 0000000000000..f3391ed85a3bb --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/arguments.d.ts @@ -0,0 +1,109 @@ +import type { KnownTypeToString, TypeString, UnmappedTypeStrings } from '../types/common'; +/** + * This type represents all of the possible combinations of properties of an + * Argument in an Expression Function. The presence or absence of certain fields + * influence the shape and presence of others within each `arg` in the specification. + */ +export type ArgumentType = SingleArgumentType | MultipleArgumentType | UnresolvedSingleArgumentType | UnresolvedMultipleArgumentType; +/** + * Map the type within the the generic array to a string-based + * representation of the type. + */ +type ArrayTypeToArgumentString = T extends Array ? TypeString : T extends null ? 'null' : never; +/** + * Map the return type of the function within the generic to a + * string-based representation of the return type. + */ +type UnresolvedTypeToArgumentString = T extends (...args: any[]) => infer ElementType ? TypeString : T extends null ? 'null' : never; +/** + * Map the array-based return type of the function within the generic to a + * string-based representation of the return type. + */ +type UnresolvedArrayTypeToArgumentString = T extends Array<(...args: any[]) => infer ElementType> ? TypeString : T extends (...args: any[]) => infer ElementType ? ArrayTypeToArgumentString : T extends null ? 'null' : never; +/** A type containing properties common to all Function Arguments. */ +interface BaseArgumentType { + /** Alternate names for the Function valid for use in the Expression Editor */ + aliases?: string[]; + /** + * The flag to mark the function parameter as deprecated. + */ + deprecated?: boolean; + /** Help text for the Argument to be displayed in the Expression Editor */ + help: string; + /** Default options for the Argument */ + options?: T[]; + /** + * Is this Argument required? + * @default false + */ + required?: boolean; + /** + * If false, the Argument is supplied as a function to be invoked in the + * implementation, rather than a value. + * @default true + */ + resolve?: boolean; + /** + * Turns on strict options checking. + * @default false + * @deprecated This option is added for backward compatibility and will be removed + * as soon as all the functions list all the available options. + */ + strict?: boolean; + /** Names of types that are valid values of the Argument. */ + types?: string[]; + /** The optional default value of the Argument. */ + default?: T | string; + /** + * If true, multiple values may be supplied to the Argument. + * @default false + */ + multi?: boolean; +} +/** + * The `types` array in a `FunctionSpec` should contain string + * representations of the `ArgumentsSpec` types: + * + * `someArgument: boolean | string` results in `types: ['boolean', 'string']` + */ +type SingleArgumentType = BaseArgumentType & { + multi?: false; + resolve?: true; + types?: Array | UnmappedTypeStrings>; +}; +/** + * If the `multi` property on the argument is true, the `types` array should + * contain string representations of the `ArgumentsSpec` array types: + * + * `someArgument: boolean[] | string[]` results in: `types: ['boolean', 'string']` + */ +type MultipleArgumentType = BaseArgumentType & { + multi: true; + resolve?: true; + types?: Array | UnmappedTypeStrings>; +}; +/** + * If the `resolve` property on the arugument is false, the `types` array, if + * present, should contain string representations of the result of the argument + * function: + * + * `someArgument: () => string` results in `types: ['string']` + */ +type UnresolvedSingleArgumentType = BaseArgumentType & { + multi?: false; + resolve: false; + types?: Array | UnmappedTypeStrings>; +}; +/** + * If the `resolve` property on the arugument is false, the `types` array, if + * present, should contain string representations of the result of the argument + * function: + * + * `someArgument: () => string[]` results in `types: ['string']` + */ +type UnresolvedMultipleArgumentType = BaseArgumentType & { + multi: true; + resolve: false; + types?: Array | UnmappedTypeStrings>; +}; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/expression_function.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/expression_function.d.ts new file mode 100644 index 0000000000000..ba704d7945ade --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/expression_function.d.ts @@ -0,0 +1,59 @@ +import type { SavedObjectReference } from '@kbn/core/types'; +import type { MigrateFunctionsObject, GetMigrationFunctionObjectFn, PersistableState } from '@kbn/kibana-utils-plugin/common'; +import type { AnyExpressionFunctionDefinition } from './types'; +import { ExpressionFunctionParameter } from './expression_function_parameter'; +import type { ExpressionValue } from '../expression_types/types'; +import type { ExpressionAstFunction } from '../ast'; +export declare class ExpressionFunction implements PersistableState { + /** + * Name of function + */ + name: string; + namespace?: string; + /** + * Aliases that can be used instead of `name`. + */ + aliases: string[]; + /** + * Return type of function. This SHOULD be supplied. We use it for UI + * and autocomplete hinting. We may also use it for optimizations in + * the future. + */ + type: string; + /** + * Opt-in to caching this function. By default function outputs are cached and given the same inputs cached result is returned. + */ + allowCache: boolean | { + withSideEffects: (params: Record, handlers: object) => () => void; + }; + /** + * Function to run function (context, args) + */ + fn: (input: ExpressionValue, params: Record, handlers: object) => ExpressionValue; + /** + * A short help text. + */ + help: string; + /** + * Specification of expression function parameters. + */ + args: Record; + /** + * Type of inputs that this function supports. + */ + inputTypes: string[] | undefined; + disabled: boolean; + /** + * Deprecation flag. + */ + deprecated: boolean; + telemetry: (state: ExpressionAstFunction['arguments'], telemetryData: Record) => Record; + extract: (state: ExpressionAstFunction['arguments']) => { + state: ExpressionAstFunction['arguments']; + references: SavedObjectReference[]; + }; + inject: (state: ExpressionAstFunction['arguments'], references: SavedObjectReference[]) => ExpressionAstFunction['arguments']; + migrations: MigrateFunctionsObject | GetMigrationFunctionObjectFn; + constructor(functionDefinition: AnyExpressionFunctionDefinition); + accepts: (type: string) => boolean; +} diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/expression_function_parameter.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/expression_function_parameter.d.ts new file mode 100644 index 0000000000000..b7d91c62a3e97 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/expression_function_parameter.d.ts @@ -0,0 +1,19 @@ +import type { ArgumentType } from './arguments'; +export declare class ExpressionFunctionParameter { + name: string; + required: boolean; + help: string; + types: ArgumentType['types']; + default?: ArgumentType['default']; + aliases: string[]; + deprecated: boolean; + multi: boolean; + resolve: boolean; + /** + * @deprecated + */ + strict?: boolean; + options: T[]; + constructor(name: string, arg: ArgumentType); + accepts(type: string): boolean; +} diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/index.d.ts new file mode 100644 index 0000000000000..f81e44dba45d2 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/index.d.ts @@ -0,0 +1,6 @@ +export type * from './types'; +export type * from './arguments'; +export * from './expression_function_parameter'; +export * from './expression_function'; +export * from './specs'; +export * from './series_calculation_helpers'; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/series_calculation_helpers.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/series_calculation_helpers.d.ts new file mode 100644 index 0000000000000..74cc1209b599c --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/series_calculation_helpers.d.ts @@ -0,0 +1,20 @@ +import type { Datatable, DatatableRow } from '../expression_types'; +/** + * Returns a string identifying the group of a row by a list of columns to group by + */ +export declare function getBucketIdentifier(row: DatatableRow, groupColumns?: string[]): string; +/** + * Checks whether input and output columns are defined properly + * and builds column array of the output table if that's the case. + * + * * Throws an error if the output column exists already. + * * Returns undefined if the input column doesn't exist. + * @param input Input datatable + * @param outputColumnId Id of the output column + * @param inputColumnId Id of the input column + * @param outputColumnName Optional name of the output column + * @param options Optional options, set `allowColumnOverwrite` to true to not raise an exception if the output column exists already + */ +export declare function buildResultColumns(input: Datatable, outputColumnId: string, inputColumnId: string, outputColumnName: string | undefined, options?: { + allowColumnOverwrite: boolean; +}): import("../expression_types").DatatableColumn[] | undefined; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/clog.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/clog.d.ts new file mode 100644 index 0000000000000..aca138282f45b --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/clog.d.ts @@ -0,0 +1,3 @@ +import type { ExpressionFunctionDefinition } from '../types'; +export type ExpressionFunctionClog = ExpressionFunctionDefinition<'clog', unknown, {}, unknown>; +export declare const clog: ExpressionFunctionClog; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/create_table.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/create_table.d.ts new file mode 100644 index 0000000000000..6bf741028ac6b --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/create_table.d.ts @@ -0,0 +1,8 @@ +import type { ExpressionFunctionDefinition } from '../types'; +import type { Datatable } from '../../expression_types'; +export interface CreateTableArguments { + ids?: string[]; + names?: string[] | null; + rowCount?: number; +} +export declare const createTable: ExpressionFunctionDefinition<'createTable', null, CreateTableArguments, Datatable>; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum.d.ts new file mode 100644 index 0000000000000..49a7f53fc1b71 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum.d.ts @@ -0,0 +1,37 @@ +import type { ExpressionFunctionDefinition } from '../types'; +import type { Datatable } from '../../expression_types'; +export interface CumulativeSumArgs { + by?: string[]; + inputColumnId: string; + outputColumnId: string; + outputColumnName?: string; +} +export type ExpressionFunctionCumulativeSum = ExpressionFunctionDefinition<'cumulative_sum', Datatable, CumulativeSumArgs, Promise>; +/** + * Calculates the cumulative sum of a specified column in the data table. + * + * Also supports multiple series in a single data table - use the `by` argument + * to specify the columns to split the calculation by. + * For each unique combination of all `by` columns a separate cumulative sum will be calculated. + * The order of rows won't be changed - this function is not modifying any existing columns, it's only + * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. + * + * Behavior: + * * Will write the cumulative sum of `inputColumnId` into `outputColumnId` + * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` + * * Cumulative sums always start with 0, a cell will contain its own value plus the values of + * all cells of the same series further up in the table. + * + * Edge cases: + * * Will return the input table if `inputColumnId` does not exist + * * Will throw an error if `outputColumnId` exists already in provided data table + * * If the row value contains `null` or `undefined`, it will be ignored and overwritten with the cumulative sum of + * all cells of the same series further up in the table. + * * For all values besides `null` and `undefined`, the value will be cast to a number before it's added to the + * cumulative sum of the current series - if this results in `NaN` (like in case of objects), all cells of the + * current series will be set to `NaN`. + * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings + * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. + * Missing values (`null` and `undefined`) will be treated as empty strings. + */ +export declare const cumulativeSum: ExpressionFunctionCumulativeSum; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum_fn.d.ts new file mode 100644 index 0000000000000..cd5df51a982a6 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/cumulative_sum_fn.d.ts @@ -0,0 +1,3 @@ +import type { Datatable } from '../../expression_types'; +import type { CumulativeSumArgs } from './cumulative_sum'; +export declare const cumulativeSumFn: (input: Datatable, { by, inputColumnId, outputColumnId, outputColumnName }: CumulativeSumArgs) => Datatable; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative.d.ts new file mode 100644 index 0000000000000..4b56eab96721f --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative.d.ts @@ -0,0 +1,38 @@ +import type { ExpressionFunctionDefinition } from '../types'; +import type { Datatable } from '../../expression_types'; +export interface DerivativeArgs { + by?: string[]; + inputColumnId: string; + outputColumnId: string; + outputColumnName?: string; +} +export type ExpressionFunctionDerivative = ExpressionFunctionDefinition<'derivative', Datatable, DerivativeArgs, Promise>; +/** + * Calculates the derivative of a specified column in the data table. + * + * Also supports multiple series in a single data table - use the `by` argument + * to specify the columns to split the calculation by. + * For each unique combination of all `by` columns a separate derivative will be calculated. + * The order of rows won't be changed - this function is not modifying any existing columns, it's only + * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. + * + * Behavior: + * * Will write the derivative of `inputColumnId` into `outputColumnId` + * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` + * * Derivative always start with an undefined value for the first row of a series, a cell will contain its own value minus the + * value of the previous cell of the same series. + * + * Edge cases: + * * Will return the input table if `inputColumnId` does not exist + * * Will throw an error if `outputColumnId` exists already in provided data table + * * If there is no previous row of the current series with a non `null` or `undefined` value, the output cell of the current row + * will be set to `undefined`. + * * If the row value contains `null` or `undefined`, it will be ignored and the output cell will be set to `undefined` + * * If the value of the previous row of the same series contains `null` or `undefined`, the output cell of the current row will be set to `undefined` as well + * * For all values besides `null` and `undefined`, the value will be cast to a number before it's used in the + * calculation of the current series even if this results in `NaN` (like in case of objects). + * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings + * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. + * Missing values (`null` and `undefined`) will be treated as empty strings. + */ +export declare const derivative: ExpressionFunctionDerivative; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative_fn.d.ts new file mode 100644 index 0000000000000..ef1f332776f67 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/derivative_fn.d.ts @@ -0,0 +1,31 @@ +import type { Datatable } from '../../expression_types'; +import type { DerivativeArgs } from './derivative'; +/** + * Calculates the derivative of a specified column in the data table. + * + * Also supports multiple series in a single data table - use the `by` argument + * to specify the columns to split the calculation by. + * For each unique combination of all `by` columns a separate derivative will be calculated. + * The order of rows won't be changed - this function is not modifying any existing columns, it's only + * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. + * + * Behavior: + * * Will write the derivative of `inputColumnId` into `outputColumnId` + * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` + * * Derivative always start with an undefined value for the first row of a series, a cell will contain its own value minus the + * value of the previous cell of the same series. + * + * Edge cases: + * * Will return the input table if `inputColumnId` does not exist + * * Will throw an error if `outputColumnId` exists already in provided data table + * * If there is no previous row of the current series with a non `null` or `undefined` value, the output cell of the current row + * will be set to `undefined`. + * * If the row value contains `null` or `undefined`, it will be ignored and the output cell will be set to `undefined` + * * If the value of the previous row of the same series contains `null` or `undefined`, the output cell of the current row will be set to `undefined` as well + * * For all values besides `null` and `undefined`, the value will be cast to a number before it's used in the + * calculation of the current series even if this results in `NaN` (like in case of objects). + * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings + * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. + * Missing values (`null` and `undefined`) will be treated as empty strings. + */ +export declare const derivativeFn: (input: Datatable, { by, inputColumnId, outputColumnId, outputColumnName }: DerivativeArgs) => Datatable; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/font.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/font.d.ts new file mode 100644 index 0000000000000..5f18104a3de21 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/font.d.ts @@ -0,0 +1,17 @@ +import type { ExpressionFunctionDefinition } from '../types'; +import type { FontLabel as FontFamily } from '../../fonts'; +import type { Style } from '../../types'; +import { FontWeight, TextAlignment } from '../../types'; +export interface FontArguments { + align?: TextAlignment; + color?: string; + family?: FontFamily; + italic?: boolean; + lHeight?: number | null; + size?: number; + underline?: boolean; + weight?: FontWeight; + sizeUnit?: string; +} +export type ExpressionFunctionFont = ExpressionFunctionDefinition<'font', null, FontArguments, Style>; +export declare const font: ExpressionFunctionFont; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/index.d.ts new file mode 100644 index 0000000000000..a49f009a33d3d --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/index.d.ts @@ -0,0 +1,18 @@ +export * from './clog'; +export * from './create_table'; +export * from './font'; +export * from './var_set'; +export * from './var'; +export * from './theme'; +export * from './cumulative_sum'; +export * from './overall_metric'; +export * from './derivative'; +export * from './moving_average'; +export * from './ui_setting'; +export * from './math_column'; +export type { MapColumnArguments } from './map_column'; +export { mapColumn } from './map_column'; +export type { MathArguments, MathInput } from './math'; +export { math } from './math'; +export type { MathColumnArguments } from './math_column'; +export { mathColumn } from './math_column'; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/map_column.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/map_column.d.ts new file mode 100644 index 0000000000000..c2c836e925501 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/map_column.d.ts @@ -0,0 +1,10 @@ +import type { Observable } from 'rxjs'; +import type { ExpressionFunctionDefinition } from '../types'; +import type { Datatable } from '../../expression_types'; +export interface MapColumnArguments { + id?: string | null; + name: string; + expression(datatable: Datatable): Observable; + copyMetaFrom?: string | null; +} +export declare const mapColumn: ExpressionFunctionDefinition<'mapColumn', Datatable, MapColumnArguments, Observable>; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math.d.ts new file mode 100644 index 0000000000000..fb63dfa78f294 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math.d.ts @@ -0,0 +1,8 @@ +import type { ExpressionFunctionDefinition } from '../types'; +import type { Datatable } from '../../expression_types'; +export type MathArguments = { + expression: string; + onError?: 'null' | 'zero' | 'false' | 'throw'; +}; +export type MathInput = number | Datatable; +export declare const math: ExpressionFunctionDefinition<'math', MathInput, MathArguments, Promise>; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_column.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_column.d.ts new file mode 100644 index 0000000000000..61b9d6693da00 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_column.d.ts @@ -0,0 +1,11 @@ +import type { ExpressionFunctionDefinition } from '../types'; +import type { MathArguments } from './math'; +import type { Datatable } from '../../expression_types'; +export type MathColumnArguments = MathArguments & { + id: string; + name?: string; + castColumns?: string[]; + copyMetaFrom?: string | null; +}; +export type ExpressionFunctionMathColumn = ExpressionFunctionDefinition<'mathColumn', Datatable, MathColumnArguments, Promise>; +export declare const mathColumn: ExpressionFunctionMathColumn; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_fn.d.ts new file mode 100644 index 0000000000000..cb997a7d47ff3 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/math_fn.d.ts @@ -0,0 +1,8 @@ +import type { MathArguments, MathInput } from './math'; +export declare const errors: { + emptyExpression: () => Error; + tooManyResults: () => Error; + executionFailed: () => Error; + emptyDatatable: () => Error; +}; +export declare const mathFn: (input: MathInput, args: MathArguments) => boolean | number | null; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average.d.ts new file mode 100644 index 0000000000000..1e4446a7bd67e --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average.d.ts @@ -0,0 +1,36 @@ +import type { ExpressionFunctionDefinition } from '../types'; +import type { Datatable } from '../../expression_types'; +export interface MovingAverageArgs { + by?: string[]; + inputColumnId: string; + outputColumnId: string; + outputColumnName?: string; + window: number; +} +export type ExpressionFunctionMovingAverage = ExpressionFunctionDefinition<'moving_average', Datatable, MovingAverageArgs, Promise>; +/** + * Calculates the moving average of a specified column in the data table. + * + * Also supports multiple series in a single data table - use the `by` argument + * to specify the columns to split the calculation by. + * For each unique combination of all `by` columns a separate moving average will be calculated. + * The order of rows won't be changed - this function is not modifying any existing columns, it's only + * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. + * + * Behavior: + * * Will write the moving average of `inputColumnId` into `outputColumnId` + * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` + * * Moving average always starts with an undefined value for the first row of a series. Each next cell will contain sum of the last + * * [window] of values divided by [window] excluding the current bucket. + * If either of window edges moves outside the borders of data series, the window shrinks to include available values only. + * + * Edge cases: + * * Will return the input table if `inputColumnId` does not exist + * * Will throw an error if `outputColumnId` exists already in provided data table + * * If null or undefined value is encountered, skip the current row and do not change the window + * * For all values besides `null` and `undefined`, the value will be cast to a number before it's used in the + * calculation of the current series even if this results in `NaN` (like in case of objects). + * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings + * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. + */ +export declare const movingAverage: ExpressionFunctionMovingAverage; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average_fn.d.ts new file mode 100644 index 0000000000000..2de0bd6131809 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/moving_average_fn.d.ts @@ -0,0 +1,28 @@ +import type { Datatable } from '../../expression_types'; +import type { MovingAverageArgs } from './moving_average'; +/** + * Calculates the moving average of a specified column in the data table. + * + * Also supports multiple series in a single data table - use the `by` argument + * to specify the columns to split the calculation by. + * For each unique combination of all `by` columns a separate moving average will be calculated. + * The order of rows won't be changed - this function is not modifying any existing columns, it's only + * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. + * + * Behavior: + * * Will write the moving average of `inputColumnId` into `outputColumnId` + * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` + * * Moving average always starts with an undefined value for the first row of a series. Each next cell will contain sum of the last + * * [window] of values divided by [window] excluding the current bucket. + * If either of window edges moves outside the borders of data series, the window shrinks to include available values only. + * + * Edge cases: + * * Will return the input table if `inputColumnId` does not exist + * * Will throw an error if `outputColumnId` exists already in provided data table + * * If null or undefined value is encountered, skip the current row and do not change the window + * * For all values besides `null` and `undefined`, the value will be cast to a number before it's used in the + * calculation of the current series even if this results in `NaN` (like in case of objects). + * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings + * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. + */ +export declare const movingAverageFn: (input: Datatable, { by, inputColumnId, outputColumnId, outputColumnName, window }: MovingAverageArgs) => Datatable; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric.d.ts new file mode 100644 index 0000000000000..bbba36f5fbb32 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric.d.ts @@ -0,0 +1,37 @@ +import type { ExpressionFunctionDefinition } from '../types'; +import type { Datatable } from '../../expression_types'; +export interface OverallMetricArgs { + by?: string[]; + inputColumnId: string; + outputColumnId: string; + outputColumnName?: string; + metric: 'sum' | 'min' | 'max' | 'average'; +} +export type ExpressionFunctionOverallMetric = ExpressionFunctionDefinition<'overall_metric', Datatable, OverallMetricArgs, Promise>; +/** + * Calculates the overall metric of a specified column in the data table. + * + * Also supports multiple series in a single data table - use the `by` argument + * to specify the columns to split the calculation by. + * For each unique combination of all `by` columns a separate overall metric will be calculated. + * The order of rows won't be changed - this function is not modifying any existing columns, it's only + * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. + * + * Behavior: + * * Will write the overall metric of `inputColumnId` into `outputColumnId` + * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` + * * Each cell will contain the calculated metric based on the values of all cells belonging to the current series. + * + * Edge cases: + * * Will return the input table if `inputColumnId` does not exist + * * Will throw an error if `outputColumnId` exists already in provided data table + * * If the row value contains `null` or `undefined`, it will be ignored and overwritten with the overall metric of + * all cells of the same series. + * * For all values besides `null` and `undefined`, the value will be cast to a number before it's added to the + * overall metric of the current series - if this results in `NaN` (like in case of objects), all cells of the + * current series will be set to `NaN`. + * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings + * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. + * Missing values (`null` and `undefined`) will be treated as empty strings. + */ +export declare const overallMetric: ExpressionFunctionOverallMetric; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric_fn.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric_fn.d.ts new file mode 100644 index 0000000000000..a6e5c8b7ccc7c --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/overall_metric_fn.d.ts @@ -0,0 +1,29 @@ +import type { Datatable } from '../../expression_types'; +import type { OverallMetricArgs } from './overall_metric'; +/** + * Calculates the overall metric of a specified column in the data table. + * + * Also supports multiple series in a single data table - use the `by` argument + * to specify the columns to split the calculation by. + * For each unique combination of all `by` columns a separate overall metric will be calculated. + * The order of rows won't be changed - this function is not modifying any existing columns, it's only + * adding the specified `outputColumnId` column to every row of the table without adding or removing rows. + * + * Behavior: + * * Will write the overall metric of `inputColumnId` into `outputColumnId` + * * If provided will use `outputColumnName` as name for the newly created column. Otherwise falls back to `outputColumnId` + * * Each cell will contain the calculated metric based on the values of all cells belonging to the current series. + * + * Edge cases: + * * Will return the input table if `inputColumnId` does not exist + * * Will throw an error if `outputColumnId` exists already in provided data table + * * If the row value contains `null` or `undefined`, it will be ignored and overwritten with the overall metric of + * all cells of the same series. + * * For all values besides `null` and `undefined`, the value will be cast to a number before it's added to the + * overall metric of the current series - if this results in `NaN` (like in case of objects), all cells of the + * current series will be set to `NaN`. + * * To determine separate series defined by the `by` columns, the values of these columns will be cast to strings + * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. + * Missing values (`null` and `undefined`) will be treated as empty strings. + */ +export declare const overallMetricFn: (input: Datatable, { by, inputColumnId, outputColumnId, outputColumnName, metric }: OverallMetricArgs) => Datatable; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/theme.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/theme.d.ts new file mode 100644 index 0000000000000..01151e2654a7d --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/theme.d.ts @@ -0,0 +1,9 @@ +import type { ExpressionFunctionDefinition } from '../types'; +interface Arguments { + variable: string; + default?: string | number | boolean; +} +type Output = unknown; +export type ExpressionFunctionTheme = ExpressionFunctionDefinition<'theme', null, Arguments, Output>; +export declare const theme: ExpressionFunctionTheme; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/ui_setting.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/ui_setting.d.ts new file mode 100644 index 0000000000000..9ba3085d4c412 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/ui_setting.d.ts @@ -0,0 +1,35 @@ +import type { KibanaRequest } from '@kbn/core/server'; +import type { ExpressionFunctionDefinition } from '../..'; +import type { UiSetting } from '../../expression_types/specs/ui_setting'; +/** + * Note: The UiSettings client interface is different between the browser and server. + * For that reason we can't expose a common getUiSettingFn for both environments. + * To maintain the consistency with the current file structure, we expose 2 separate functions + * from this file inside the "common" folder. + */ +interface UiSettingsClientBrowser { + get(key: string, defaultValue?: T): T | Promise; +} +interface UiSettingStartDependenciesBrowser { + uiSettings: UiSettingsClientBrowser; +} +interface UiSettingFnArgumentsBrowser { + getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; +} +interface UiSettingsClientServer { + get(key: string): T | Promise; +} +interface UiSettingStartDependenciesServer { + uiSettings: UiSettingsClientServer; +} +interface UiSettingFnArgumentsServer { + getStartDependencies(getKibanaRequest: () => KibanaRequest): Promise; +} +export interface UiSettingArguments { + default?: unknown; + parameter: string; +} +export type ExpressionFunctionUiSetting = ExpressionFunctionDefinition<'uiSetting', unknown, UiSettingArguments, Promise>; +export declare function getUiSettingFnBrowser({ getStartDependencies, }: UiSettingFnArgumentsBrowser): ExpressionFunctionUiSetting; +export declare function getUiSettingFnServer({ getStartDependencies, }: UiSettingFnArgumentsServer): ExpressionFunctionUiSetting; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/var.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/var.d.ts new file mode 100644 index 0000000000000..4877c7f314f57 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/var.d.ts @@ -0,0 +1,7 @@ +import type { ExpressionFunctionDefinition } from '../types'; +interface Arguments { + name: string; +} +export type ExpressionFunctionVar = ExpressionFunctionDefinition<'var', unknown, Arguments, unknown>; +export declare const variable: ExpressionFunctionVar; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/specs/var_set.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/specs/var_set.d.ts new file mode 100644 index 0000000000000..68aa040854c0c --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/specs/var_set.d.ts @@ -0,0 +1,9 @@ +import type { Serializable } from '@kbn/utility-types'; +import type { ExpressionFunctionDefinition } from '../types'; +interface Arguments { + name: string[]; + value?: Serializable[]; +} +export type ExpressionFunctionVarSet = ExpressionFunctionDefinition<'var_set', unknown, Arguments, unknown>; +export declare const variableSet: ExpressionFunctionVarSet; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_functions/types.d.ts b/src/platform/plugins/shared/expressions/common/expression_functions/types.d.ts new file mode 100644 index 0000000000000..7856ec0342f55 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_functions/types.d.ts @@ -0,0 +1,111 @@ +import type { PersistableStateDefinition } from '@kbn/kibana-utils-plugin/common'; +import type { ArgumentType } from './arguments'; +import type { TypeToString, TypeString, UnmappedTypeStrings } from '../types/common'; +import type { ExecutionContext } from '../execution/types'; +import type { ExpressionFunctionClog, ExpressionFunctionFont, ExpressionFunctionVarSet, ExpressionFunctionVar, ExpressionFunctionTheme, ExpressionFunctionCumulativeSum, ExpressionFunctionDerivative, ExpressionFunctionMovingAverage, ExpressionFunctionOverallMetric, ExpressionFunctionMathColumn } from './specs'; +import type { ExpressionAstFunction } from '../ast'; +/** + * `ExpressionFunctionDefinition` is the interface plugins have to implement to + * register a function in `expressions` plugin. + */ +export interface ExpressionFunctionDefinition, Output, Context extends ExecutionContext = ExecutionContext> extends PersistableStateDefinition { + /** + * The name of the function, as will be used in expression. + */ + name: Name; + /** + * The flag to mark the function as deprecated. + */ + deprecated?: boolean; + /** + * if set to true function will be disabled (but its migrate function will still be available) + */ + disabled?: boolean; + namespace?: string; + /** + * Name of type of value this function outputs. + */ + type?: TypeString | UnmappedTypeStrings; + /** + * Opt-in to caching this function. By default function outputs are cached and given the same inputs cached result is returned. + * + * It is possible to collect side effects produced by the function + * (e.g. logging, sending events to the server, etc.) and return a + * handler to reproduce such side effects when the function cache is used + * instead of the original function implementation. + * @param args Parameters set for this function in expression. + * @param context Object with functions to perform side effects. This object + * is created for the duration of the execution of expression and is the + * same for all functions in expression chain. + * @returns A handler to be called to reproduce side effects when the function cache is used. + * + */ + allowCache?: boolean | { + withSideEffects(args: Arguments, context: Context): () => void; + }; + /** + * List of allowed type names for input value of this function. If this + * property is set the input of function will be cast to the first possible + * type in this list. If this property is missing the input will be provided + * to the function as-is. + */ + inputTypes?: Array>; + /** + * Specification of arguments that function supports. This list will also be + * used for autocomplete functionality when your function is being edited. + */ + args: { + [key in keyof Arguments]: ArgumentType; + }; + /** + * @todo What is this? + */ + aliases?: string[]; + /** + * Help text displayed in the Expression editor. This text should be + * internationalized. + */ + help: string; + /** + * The actual implementation of the function. + * + * @param input Output of the previous function, or initial input. + * @param args Parameters set for this function in expression. + * @param context Object with functions to perform side effects. This object + * is created for the duration of the execution of expression and is the + * same for all functions in expression chain. + */ + fn(input: Input, args: Arguments, context: Context): Output; + /** + * @deprecated Use `inputTypes` instead. + */ + context?: { + /** + * @deprecated This is alias for `inputTypes`, use `inputTypes` instead. + */ + types: AnyExpressionFunctionDefinition['inputTypes']; + }; +} +/** + * Type to capture every possible expression function definition. + */ +export type AnyExpressionFunctionDefinition = ExpressionFunctionDefinition, any>; +/** + * A mapping of `ExpressionFunctionDefinition`s for functions which the + * Expressions services provides out-of-the-box. Any new functions registered + * by the Expressions plugin should have their types added here. + * + * @public + */ +export interface ExpressionFunctionDefinitions { + clog: ExpressionFunctionClog; + font: ExpressionFunctionFont; + var_set: ExpressionFunctionVarSet; + var: ExpressionFunctionVar; + theme: ExpressionFunctionTheme; + cumulative_sum: ExpressionFunctionCumulativeSum; + overall_metric: ExpressionFunctionOverallMetric; + derivative: ExpressionFunctionDerivative; + moving_average: ExpressionFunctionMovingAverage; + math_column: ExpressionFunctionMathColumn; +} diff --git a/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer.d.ts b/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer.d.ts new file mode 100644 index 0000000000000..4b4a3b0990556 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer.d.ts @@ -0,0 +1,11 @@ +import type { ExpressionRenderDefinition } from './types'; +export declare class ExpressionRenderer { + readonly name: string; + readonly namespace?: string; + readonly displayName: string; + readonly help: string; + readonly validate: () => void | Error; + readonly reuseDomNode: boolean; + readonly render: ExpressionRenderDefinition['render']; + constructor(config: ExpressionRenderDefinition); +} diff --git a/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer_registry.d.ts b/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer_registry.d.ts new file mode 100644 index 0000000000000..bfa562f4c9985 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_renderers/expression_renderer_registry.d.ts @@ -0,0 +1,10 @@ +import type { IRegistry } from '../types'; +import { ExpressionRenderer } from './expression_renderer'; +import type { AnyExpressionRenderDefinition } from './types'; +export declare class ExpressionRendererRegistry implements IRegistry { + private readonly renderers; + register(definition: AnyExpressionRenderDefinition | (() => AnyExpressionRenderDefinition)): void; + get(id: string): ExpressionRenderer | null; + toJS(): Record; + toArray(): ExpressionRenderer[]; +} diff --git a/src/platform/plugins/shared/expressions/common/expression_renderers/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_renderers/index.d.ts new file mode 100644 index 0000000000000..ee7055431edc6 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_renderers/index.d.ts @@ -0,0 +1,3 @@ +export type * from './types'; +export * from './expression_renderer'; +export * from './expression_renderer_registry'; diff --git a/src/platform/plugins/shared/expressions/common/expression_renderers/types.d.ts b/src/platform/plugins/shared/expressions/common/expression_renderers/types.d.ts new file mode 100644 index 0000000000000..15c2666830fc3 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_renderers/types.d.ts @@ -0,0 +1,79 @@ +import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; +import type { ExpressionAstExpression } from '../ast'; +export interface ExpressionRenderDefinition { + /** + * Technical name of the renderer, used as ID to identify renderer in + * expression renderer registry. This must match the name of the expression + * function that is used to create the `type: render` object. + */ + name: string; + namespace?: string; + /** + * A user friendly name of the renderer as will be displayed to user in UI. + */ + displayName?: string; + /** + * Help text as will be displayed to user. A sentence or few about what this + * element does. + */ + help?: string; + /** + * Used to validate the data before calling the render function. + */ + validate?: () => undefined | Error; + /** + * Tell the renderer if the dom node should be reused, it's recreated each + * time by default. + */ + reuseDomNode: boolean; + /** + * The function called to render the output data of an expression. + */ + render: (domNode: HTMLElement, config: Config, handlers: IInterpreterRenderHandlers) => void | Promise; +} +export type AnyExpressionRenderDefinition = ExpressionRenderDefinition; +/** + * Mode of the expression render environment. + * This value can be set from a consumer embedding an expression renderer and is accessible + * from within the active render function as part of the handlers. + * The following modes are supported: + * * view (default): The chart is rendered in a container with the main purpose of viewing the chart (e.g. in a container like dashboard or canvas) + * * preview: The chart is rendered in very restricted space (below 100px width and height) and should only show a rough outline + * * edit: The chart is rendered within an editor and configuration elements within the chart should be displayed + */ +export type RenderMode = 'edit' | 'preview' | 'view'; +export interface IInterpreterRenderUpdateParams { + newExpression?: string | ExpressionAstExpression; + newParams: Params; +} +export interface IInterpreterRenderEvent { + name: string; + data?: Context; +} +export interface IInterpreterRenderHandlers { + /** + * Done increments the number of rendering successes + */ + done(): void; + onDestroy(fn: () => void): void; + reload(): void; + update(params: IInterpreterRenderUpdateParams): void; + event(event: IInterpreterRenderEvent): void; + hasCompatibleActions?(event: IInterpreterRenderEvent): Promise; + getCompatibleCellValueActions?(data: object[]): Promise; + getRenderMode(): RenderMode; + /** + * The chart is rendered in a non-interactive environment and should not provide any affordances for interaction like brushing. + */ + isInteractive(): boolean; + isSyncColorsEnabled(): boolean; + isSyncCursorEnabled(): boolean; + isSyncTooltipsEnabled(): boolean; + /** + * This uiState interface is actually `PersistedState` from the visualizations plugin, + * but expressions cannot know about vis or it creates a mess of circular dependencies. + * Downstream consumers of the uiState handler will need to cast for now. + */ + uiState?: unknown; + getExecutionContext(): KibanaExecutionContext | undefined; +} diff --git a/src/platform/plugins/shared/expressions/common/expression_types/expression_type.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/expression_type.d.ts new file mode 100644 index 0000000000000..f15326a3215c3 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/expression_type.d.ts @@ -0,0 +1,28 @@ +import type { Serializable } from '@kbn/utility-types'; +import type { AnyExpressionTypeDefinition, ExpressionValue, ExpressionValueConverter } from './types'; +export declare class ExpressionType { + name: string; + namespace?: string; + /** + * A short help text. + */ + help: string; + /** + * Type validation, useful for checking function output. + */ + validate: (type: unknown) => void | Error; + create: unknown; + /** + * Optional serialization (used when passing context around client/server). + */ + serialize?: (value: Serializable) => unknown; + deserialize?: (serialized: unknown[]) => Serializable; + private readonly definition; + constructor(definition: AnyExpressionTypeDefinition); + getToFn: (typeName: string) => undefined | ExpressionValueConverter; + getFromFn: (typeName: string) => undefined | ExpressionValueConverter; + castsTo: (value: ExpressionValue) => boolean; + castsFrom: (value: ExpressionValue) => boolean; + to: (value: ExpressionValue, toTypeName: string, types: Record) => any; + from: (value: ExpressionValue, types: Record) => any; +} diff --git a/src/platform/plugins/shared/expressions/common/expression_types/get_type.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/get_type.d.ts new file mode 100644 index 0000000000000..a0320d31f63c9 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/get_type.d.ts @@ -0,0 +1 @@ +export declare function getType(node: unknown): string; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/index.d.ts new file mode 100644 index 0000000000000..74010559242e4 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/index.d.ts @@ -0,0 +1,6 @@ +export type * from './types'; +export * from './get_type'; +export * from './serialize_provider'; +export * from './expression_type'; +export * from './specs'; +export * from './unbox_expression_value'; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/serialize_provider.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/serialize_provider.d.ts new file mode 100644 index 0000000000000..4c2790d67fb77 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/serialize_provider.d.ts @@ -0,0 +1,6 @@ +import type { ExpressionType } from './expression_type'; +import type { ExpressionValue } from './types'; +export declare const serializeProvider: (types: Record) => { + serialize: (value: ExpressionValue) => unknown; + deserialize: (value: ExpressionValue) => any; +}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/boolean.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/boolean.d.ts new file mode 100644 index 0000000000000..42da96cca52cd --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/boolean.d.ts @@ -0,0 +1,2 @@ +import type { ExpressionTypeDefinition } from '../types'; +export declare const boolean: ExpressionTypeDefinition<'boolean', boolean>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.d.ts new file mode 100644 index 0000000000000..ad917a0914e4c --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/datatable.d.ts @@ -0,0 +1,128 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; +import type { ExpressionTypeDefinition } from '../types'; +export declare enum DimensionType { + Y_AXIS = "y", + X_AXIS = "x", + REFERENCE_LINE = "reference", + BREAKDOWN = "breakdown", + MARK_SIZE = "markSize", + SPLIT_COLUMN = "splitCol", + SPLIT_ROW = "splitRow" +} +declare const name = "datatable"; +/** + * A Utility function that Typescript can use to determine if an object is a Datatable. + * @param datatable + */ +export declare const isDatatable: (datatable: unknown) => datatable is Datatable; +/** + * This type represents the `type` of any `DatatableColumn` in a `Datatable`. + * its duplicated from KBN_FIELD_TYPES + */ +export type DatatableColumnType = '_source' | 'attachment' | 'boolean' | 'date' | 'geo_point' | 'geo_shape' | 'ip' | 'murmur3' | 'number' | 'string' | 'unknown' | 'conflict' | 'object' | 'nested' | 'histogram' | 'flattened' | 'null'; +/** + * This type represents a row in a `Datatable`. + */ +export type DatatableRow = Record; +/** + * Datatable column meta information + */ +export interface DatatableColumnMeta { + /** + * The Kibana normalized type of the column + */ + type: DatatableColumnType; + /** + * The original type of the column from ES + */ + esType?: string; + /** + * field this column is based on + */ + field?: string; + /** + * index/table this column is based on + */ + index?: string; + /** + * i18nized names the domain this column represents + */ + dimensionName?: string; + /** + * types of dimension this column represents + */ + dimensionType?: string; + /** + * serialized field format + */ + params?: SerializedFieldFormat; + /** + * source function that produced this column + */ + source?: string; + /** + * any extra parameters for the source that produced this column + */ + sourceParams?: SerializableRecord; +} +interface SourceParamsESQL extends Record { + indexPattern: string; + sourceField: string; + operationType: string; + interval?: number; +} +export declare function isSourceParamsESQL(obj: Record): obj is SourceParamsESQL; +/** + * This type represents the shape of a column in a `Datatable`. + */ +export interface DatatableColumn { + id: string; + name: string; + meta: DatatableColumnMeta; + isNull?: boolean; + isComputedColumn?: boolean; + variable?: string; +} +/** + * Metadata with statistics about the `Datatable` source. + */ +export interface DatatableMetaStatistics { + /** + * Total hits number returned for the request generated the `Datatable`. + */ + totalCount?: number; +} +/** + * The `Datatable` meta information. + */ +export interface DatatableMeta { + /** + * Statistics about the `Datatable` source. + */ + statistics?: DatatableMetaStatistics; + /** + * The `Datatable` type (e.g. `essql`, `eql`, `esdsl`, etc.). + */ + type?: string; + /** + * The `Datatable` data source. + */ + source?: string; + [key: string]: unknown; +} +/** + * A `Datatable` in Canvas is a unique structure that represents tabulated data. + */ +export interface Datatable { + type: typeof name; + columns: DatatableColumn[]; + meta?: DatatableMeta; + rows: DatatableRow[]; + warning?: string; +} +export interface SerializedDatatable extends Datatable { + rows: string[][]; +} +export declare const datatable: ExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/error.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/error.d.ts new file mode 100644 index 0000000000000..157d11752a27a --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/error.d.ts @@ -0,0 +1,15 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; +import type { ErrorLike } from '../../util'; +export type ExpressionValueError = ExpressionValueBoxed<'error', { + error: ErrorLike; + info?: SerializableRecord; +}>; +export declare const isExpressionValueError: (value: unknown) => value is ExpressionValueError; +/** + * @deprecated + * + * Exported for backwards compatibility. + */ +export type InterpreterErrorType = ExpressionValueError; +export declare const error: ExpressionTypeDefinition<'error', ExpressionValueError>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/filter.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/filter.d.ts new file mode 100644 index 0000000000000..239698931e181 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/filter.d.ts @@ -0,0 +1,15 @@ +import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; +/** + * Represents an object that is a Filter. + */ +export type ExpressionValueFilter = ExpressionValueBoxed<'filter', { + filterType?: string; + filterGroup?: string; + value?: string; + column?: string; + and: ExpressionValueFilter[]; + to?: string; + from?: string; + query?: string | null; +}>; +export declare const filter: ExpressionTypeDefinition<'filter', ExpressionValueFilter>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/image.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/image.d.ts new file mode 100644 index 0000000000000..d1033f94c9b47 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/image.d.ts @@ -0,0 +1,9 @@ +import type { ExpressionTypeDefinition } from '../types'; +declare const name = "image"; +export interface ExpressionImage { + type: 'image'; + mode: string; + dataurl: string; +} +export declare const image: ExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/index.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/index.d.ts new file mode 100644 index 0000000000000..2c7ddfad31b11 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/index.d.ts @@ -0,0 +1,17 @@ +import type { AnyExpressionTypeDefinition } from '../types'; +export declare const typeSpecs: AnyExpressionTypeDefinition[]; +export * from './boolean'; +export * from './datatable'; +export * from './error'; +export * from './filter'; +export * from './image'; +export * from './null'; +export * from './num'; +export * from './number'; +export * from './pointseries'; +export * from './range'; +export * from './render'; +export * from './shape'; +export * from './string'; +export * from './style'; +export * from './ui_setting'; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/null.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/null.d.ts new file mode 100644 index 0000000000000..1554c2a27ffbe --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/null.d.ts @@ -0,0 +1,4 @@ +import type { ExpressionTypeDefinition } from '../types'; +declare const name = "null"; +export declare const nullType: ExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/num.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/num.d.ts new file mode 100644 index 0000000000000..d0120a5f7c6d2 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/num.d.ts @@ -0,0 +1,5 @@ +import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; +export type ExpressionValueNum = ExpressionValueBoxed<'num', { + value: number; +}>; +export declare const num: ExpressionTypeDefinition<'num', ExpressionValueNum>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/number.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/number.d.ts new file mode 100644 index 0000000000000..b77f71993a375 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/number.d.ts @@ -0,0 +1,4 @@ +import type { ExpressionTypeDefinition } from '../types'; +declare const name = "number"; +export declare const number: ExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/pointseries.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/pointseries.d.ts new file mode 100644 index 0000000000000..d9a7c465bb7d6 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/pointseries.d.ts @@ -0,0 +1,35 @@ +import type { $Values } from '@kbn/utility-types'; +import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; +import type { DatatableRow } from './datatable'; +export declare const PointSeriesColumnNames: { + readonly X: "x"; + readonly Y: "y"; + readonly COLOR: "color"; + readonly SIZE: "size"; + readonly TEXT: "text"; +}; +/** + * Allowed column names in a PointSeries + */ +export type PointSeriesColumnName = $Values; +/** + * Column in a PointSeries + */ +export interface PointSeriesColumn { + type: 'number' | 'string'; + role: 'measure' | 'dimension'; + expression: string; +} +/** + * Represents a collection of valid Columns in a PointSeries + */ +export type PointSeriesColumns = Record | {}; +export type PointSeriesRow = DatatableRow; +/** + * A `PointSeries` is a unique structure that represents dots on a chart. + */ +export type PointSeries = ExpressionValueBoxed<'pointseries', { + columns: PointSeriesColumns; + rows: PointSeriesRow[]; +}>; +export declare const pointseries: ExpressionTypeDefinition<'pointseries', PointSeries>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/range.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/range.d.ts new file mode 100644 index 0000000000000..7e83a68d53686 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/range.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionTypeDefinition } from '../types'; +declare const name = "range"; +export interface Range { + type: typeof name; + from: number; + to: number; + label?: string; +} +export declare const range: ExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/render.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/render.d.ts new file mode 100644 index 0000000000000..a3a39035fcf27 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/render.d.ts @@ -0,0 +1,17 @@ +import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; +declare const name = "render"; +/** + * Represents an object that is intended to be rendered. + */ +export type ExpressionValueRender = ExpressionValueBoxed; +/** + * @deprecated + * + * Use `ExpressionValueRender` instead. + */ +export type Render = ExpressionValueRender; +export declare const render: ExpressionTypeDefinition>; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/shape.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/shape.d.ts new file mode 100644 index 0000000000000..0b5b8d7cfea93 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/shape.d.ts @@ -0,0 +1,5 @@ +import type { ExpressionTypeDefinition } from '../types'; +import type { ExpressionValueRender } from './render'; +declare const name = "shape"; +export declare const shape: ExpressionTypeDefinition>; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/string.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/string.d.ts new file mode 100644 index 0000000000000..bb92451c5c377 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/string.d.ts @@ -0,0 +1,4 @@ +import type { ExpressionTypeDefinition } from '../types'; +declare const name = "string"; +export declare const string: ExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/style.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/style.d.ts new file mode 100644 index 0000000000000..5c2b2670fb9f7 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/style.d.ts @@ -0,0 +1,5 @@ +import type { ExpressionTypeDefinition } from '../types'; +import type { ExpressionTypeStyle } from '../../types/style'; +declare const name = "style"; +export declare const style: ExpressionTypeDefinition; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/specs/ui_setting.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/specs/ui_setting.d.ts new file mode 100644 index 0000000000000..6030201085fad --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/specs/ui_setting.d.ts @@ -0,0 +1,6 @@ +import type { ExpressionTypeDefinition, ExpressionValueBoxed } from '../types'; +export type UiSetting = ExpressionValueBoxed<'ui_setting', { + key: string; + value: unknown; +}>; +export declare const uiSetting: ExpressionTypeDefinition<'ui_setting', UiSetting>; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/types.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/types.d.ts new file mode 100644 index 0000000000000..89b41876d8c89 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/types.d.ts @@ -0,0 +1,26 @@ +import type { ExpressionType } from './expression_type'; +export type ExpressionValueUnboxed = any; +export type ExpressionValueBoxed = { + type: Type; +} & Value; +export type ExpressionValue = ExpressionValueUnboxed | ExpressionValueBoxed; +export type ExpressionValueConverter = (input: I, availableTypes: Record) => O; +/** + * A generic type which represents a custom Expression Type Definition that's + * registered to the Interpreter. + */ +export interface ExpressionTypeDefinition { + name: Name; + namespace?: string; + validate?(type: unknown): void | Error; + serialize?(type: Value): SerializedType; + deserialize?(type: SerializedType): Value; + from?: { + [type: string]: ExpressionValueConverter; + }; + to?: { + [type: string]: ExpressionValueConverter; + }; + help?: string; +} +export type AnyExpressionTypeDefinition = ExpressionTypeDefinition; diff --git a/src/platform/plugins/shared/expressions/common/expression_types/unbox_expression_value.d.ts b/src/platform/plugins/shared/expressions/common/expression_types/unbox_expression_value.d.ts new file mode 100644 index 0000000000000..c3141103c6d3d --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/expression_types/unbox_expression_value.d.ts @@ -0,0 +1,2 @@ +import type { ExpressionValueBoxed } from './types'; +export declare function unboxExpressionValue({ type, ...value }: ExpressionValueBoxed): T; diff --git a/src/platform/plugins/shared/expressions/common/fonts.d.ts b/src/platform/plugins/shared/expressions/common/fonts.d.ts new file mode 100644 index 0000000000000..4dd19d760a91c --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/fonts.d.ts @@ -0,0 +1,141 @@ +/** + * This type contains a unions of all supported font labels, or the the name of + * the font the user would see in a UI. + */ +export type FontLabel = (typeof fonts)[number]['label']; +/** + * This type contains a union of all supported font values, equivalent to the CSS + * `font-value` property. + */ +export type FontValue = (typeof fonts)[number]['value']; +/** + * An interface representing a font in Canvas, with a textual label and the CSS + * `font-value`. + */ +export interface Font { + label: FontLabel; + value: FontValue; +} +export declare const americanTypewriter: { + label: "American Typewriter"; + value: "'American Typewriter', 'Courier New', Courier, Monaco, mono"; +}; +export declare const arial: { + label: "Arial"; + value: "Arial, sans-serif"; +}; +export declare const baskerville: { + label: "Baskerville"; + value: "Baskerville, Georgia, Garamond, 'Times New Roman', Times, serif"; +}; +export declare const bookAntiqua: { + label: "Book Antiqua"; + value: "'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif"; +}; +export declare const brushScript: { + label: "Brush Script"; + value: "'Brush Script MT', 'Comic Sans', sans-serif"; +}; +export declare const chalkboard: { + label: "Chalkboard"; + value: "Chalkboard, 'Comic Sans', sans-serif"; +}; +export declare const didot: { + label: "Didot"; + value: "Didot, Georgia, Garamond, 'Times New Roman', Times, serif"; +}; +export declare const futura: { + label: "Futura"; + value: "Futura, Impact, Helvetica, Arial, sans-serif"; +}; +export declare const gillSans: { + label: "Gill Sans"; + value: "'Gill Sans', 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif"; +}; +export declare const helveticaNeue: { + label: "Helvetica Neue"; + value: "'Helvetica Neue', Helvetica, Arial, sans-serif"; +}; +export declare const hoeflerText: { + label: "Hoefler Text"; + value: "'Hoefler Text', Garamond, Georgia, 'Times New Roman', Times, serif"; +}; +export declare const inter: { + label: "Inter"; + value: "'Inter', 'Inter UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"; +}; +export declare const lucidaGrande: { + label: "Lucida Grande"; + value: "'Lucida Grande', 'Lucida Sans Unicode', Lucida, Verdana, Helvetica, Arial, sans-serif"; +}; +export declare const myriad: { + label: "Myriad"; + value: "Myriad, Helvetica, Arial, sans-serif"; +}; +export declare const openSans: { + label: "Open Sans"; + value: "'Open Sans', Helvetica, Arial, sans-serif"; +}; +export declare const optima: { + label: "Optima"; + value: "Optima, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif"; +}; +export declare const palatino: { + label: "Palatino"; + value: "Palatino, 'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif"; +}; +/** + * A collection of supported fonts. + */ +export declare const fonts: ({ + label: "American Typewriter"; + value: "'American Typewriter', 'Courier New', Courier, Monaco, mono"; +} | { + label: "Arial"; + value: "Arial, sans-serif"; +} | { + label: "Baskerville"; + value: "Baskerville, Georgia, Garamond, 'Times New Roman', Times, serif"; +} | { + label: "Book Antiqua"; + value: "'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif"; +} | { + label: "Brush Script"; + value: "'Brush Script MT', 'Comic Sans', sans-serif"; +} | { + label: "Chalkboard"; + value: "Chalkboard, 'Comic Sans', sans-serif"; +} | { + label: "Didot"; + value: "Didot, Georgia, Garamond, 'Times New Roman', Times, serif"; +} | { + label: "Futura"; + value: "Futura, Impact, Helvetica, Arial, sans-serif"; +} | { + label: "Gill Sans"; + value: "'Gill Sans', 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif"; +} | { + label: "Helvetica Neue"; + value: "'Helvetica Neue', Helvetica, Arial, sans-serif"; +} | { + label: "Hoefler Text"; + value: "'Hoefler Text', Garamond, Georgia, 'Times New Roman', Times, serif"; +} | { + label: "Inter"; + value: "'Inter', 'Inter UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"; +} | { + label: "Lucida Grande"; + value: "'Lucida Grande', 'Lucida Sans Unicode', Lucida, Verdana, Helvetica, Arial, sans-serif"; +} | { + label: "Myriad"; + value: "Myriad, Helvetica, Arial, sans-serif"; +} | { + label: "Open Sans"; + value: "'Open Sans', Helvetica, Arial, sans-serif"; +} | { + label: "Optima"; + value: "Optima, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif"; +} | { + label: "Palatino"; + value: "Palatino, 'Book Antiqua', Georgia, Garamond, 'Times New Roman', Times, serif"; +})[]; diff --git a/src/platform/plugins/shared/expressions/common/index.d.ts b/src/platform/plugins/shared/expressions/common/index.d.ts new file mode 100644 index 0000000000000..964c17f72853f --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/index.d.ts @@ -0,0 +1,20 @@ +export { BackgroundRepeat, BackgroundSize, Overflow, FontStyle, FontWeight, FontSizeUnit, TextDecoration, TextAlignment, } from './types'; +export type { ExpressionTypeStyle, CSSStyle, Style, TypeString, TypeToString, UnmappedTypeStrings, KnownTypeToString, IRegistry, ContainerStyle, } from './types'; +export { buildExpression, buildExpressionFunction, formatExpression, isExpressionAstBuilder, parseExpression, parse, isExpressionAst, format, } from './ast'; +export type { ExpressionAstExpression, ExpressionAstExpressionBuilder, ExpressionAstFunction, ExpressionAstFunctionBuilder, ExpressionAstNode, ExpressionAstArgument, ExpressionAstFunctionDebug, InferFunctionDefinition, } from './ast'; +export { americanTypewriter, inter, arial, fonts, bookAntiqua, brushScript, didot, futura, chalkboard, gillSans, openSans, helveticaNeue, hoeflerText, lucidaGrande, myriad, optima, palatino, baskerville, } from './fonts'; +export type { Font, FontLabel, FontValue } from './fonts'; +export { num, filter, error, image, render, number, datatable, nullType, range, pointseries, serializeProvider, typeSpecs, string, shape, style, uiSetting, boolean, isExpressionValueError, getType, unboxExpressionValue, isDatatable, ExpressionType, PointSeriesColumnNames, DimensionType, } from './expression_types'; +export type { AnyExpressionTypeDefinition, ExpressionValueError, ExpressionValueNum, ExpressionValueRender, ExpressionValueUnboxed, ExpressionValueFilter, ExpressionTypeDefinition, ExpressionValueConverter, ExpressionValueBoxed, ExpressionValue, Render, ExpressionImage, DatatableColumnType, DatatableRow, Datatable, DatatableColumn, DatatableColumnMeta, InterpreterErrorType, SerializedDatatable, PointSeries, PointSeriesColumn, PointSeriesColumnName, PointSeriesColumns, PointSeriesRow, Range, UiSetting, } from './expression_types'; +export { derivative, movingAverage, mapColumn, math, mathColumn, clog, createTable, font, variableSet, variable, theme, cumulativeSum, overallMetric, getUiSettingFnBrowser, getUiSettingFnServer, buildResultColumns, getBucketIdentifier, ExpressionFunction, } from './expression_functions'; +export type { AnyExpressionFunctionDefinition, ExpressionFunctionDefinition, ExpressionFunctionDefinitions, ExpressionFunctionParameter, ExpressionFunctionDerivative, ExpressionFunctionClog, CreateTableArguments, CumulativeSumArgs, ExpressionFunctionFont, ExpressionFunctionTheme, ExpressionFunctionUiSetting, ExpressionFunctionVar, ExpressionFunctionVarSet, DerivativeArgs, ExpressionFunctionCumulativeSum, ExpressionFunctionMovingAverage, ExpressionFunctionOverallMetric, FontArguments, MapColumnArguments, MathColumnArguments, MathArguments, MovingAverageArgs, OverallMetricArgs, ArgumentType, MathInput, UiSettingArguments, } from './expression_functions'; +export { ExpressionRenderer } from './expression_renderers'; +export type { AnyExpressionRenderDefinition, ExpressionRendererRegistry, ExpressionRenderDefinition, IInterpreterRenderEvent, IInterpreterRenderHandlers, IInterpreterRenderUpdateParams, RenderMode, } from './expression_renderers'; +export { createExecutorContainer, pureSelectors, pureTransitions, defaultState } from './executor'; +export type { Executor, ExecutorContainer, ExecutorState, ExecutorPureSelectors, ExecutorPureTransitions, ExpressionExecOptions, FunctionsRegistry, TypesRegistry, } from './executor'; +export { createExecutionContainer, executionPureTransitions } from './execution'; +export type { Execution, ExecutionContract, ExecutionContainer, ExecutionContext, ExecutionParams, ExecutionState, ExecutionPureTransitions, ExecutionResult, DefaultInspectorAdapters, } from './execution'; +export { ExpressionsService } from './service'; +export type { ExpressionsServiceSetup, ExpressionsServiceStart, ExpressionExecutionParams, ExpressionServiceParams, } from './service'; +export { createDefaultInspectorAdapters, createMockContext, createError, getByAlias, ExpressionsInspectorAdapter, TablesAdapter, } from './util'; +export type { SerializedError, ErrorLike } from './util'; diff --git a/src/platform/plugins/shared/expressions/common/service/expressions_fork.d.ts b/src/platform/plugins/shared/expressions/common/service/expressions_fork.d.ts new file mode 100644 index 0000000000000..18b0daf6c62cd --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/service/expressions_fork.d.ts @@ -0,0 +1,53 @@ +import type { ExpressionExecutionParams, ExpressionsService, ExpressionsServiceSetup, ExpressionsServiceStart } from '.'; +import type { ExpressionAstExpression } from '../ast'; +import type { AnyExpressionFunctionDefinition } from '../expression_functions'; +import type { AnyExpressionTypeDefinition } from '../expression_types'; +import type { AnyExpressionRenderDefinition } from '../expression_renderers'; +export interface ExpressionServiceFork { + setup(): ExpressionsServiceSetup; + start(): ExpressionsServiceStart; +} +/** + * `ExpressionsService` class is used for multiple purposes: + * + * 1. It implements the same Expressions service that can be used on both: + * (1) server-side and (2) browser-side. + * 2. It implements the same Expressions service that users can fork/clone, + * thus have their own instance of the Expressions plugin. + * 3. `ExpressionsService` defines the public contracts of *setup* and *start* + * Kibana Platform life-cycles for ease-of-use on server-side and browser-side. + * 4. `ExpressionsService` creates a bound version of all exported contract functions. + * 5. Functions are bound the way there are: + * + * ```ts + * registerFunction = (...args: Parameters + * ): ReturnType => this.executor.registerFunction(...args); + * ``` + * + * so that JSDoc appears in developers IDE when they use those `plugins.expressions.registerFunction(`. + */ +export declare class ExpressionsServiceFork implements ExpressionServiceFork { + private namespace; + private expressionsService; + /** + * @note Workaround since the expressions service is frozen. + */ + constructor(namespace: string, expressionsService: ExpressionsService); + protected registerFunction(definition: AnyExpressionFunctionDefinition | (() => AnyExpressionFunctionDefinition)): void; + protected registerRenderer(definition: AnyExpressionRenderDefinition | (() => AnyExpressionRenderDefinition)): void; + protected registerType(definition: AnyExpressionTypeDefinition | (() => AnyExpressionTypeDefinition)): void; + protected run(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): import("rxjs").Observable>; + protected execute(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): import("..").ExecutionContract; + protected getFunction(name: string): import("../expression_functions").ExpressionFunction | undefined; + protected getFunctions(): Record; + /** + * Returns Kibana Platform *setup* life-cycle contract. Useful to return the + * same contract on server-side and browser-side. + */ + setup(): ExpressionsServiceSetup; + /** + * Returns Kibana Platform *start* life-cycle contract. Useful to return the + * same contract on server-side and browser-side. + */ + start(): ExpressionsServiceStart; +} diff --git a/src/platform/plugins/shared/expressions/common/service/expressions_services.d.ts b/src/platform/plugins/shared/expressions/common/service/expressions_services.d.ts new file mode 100644 index 0000000000000..8057ef2d1d7aa --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/service/expressions_services.d.ts @@ -0,0 +1,292 @@ +import type { Observable } from 'rxjs'; +import type { Logger } from '@kbn/logging'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { KibanaExecutionContext } from '@kbn/core/public'; +import type { SavedObjectReference } from '@kbn/core/types'; +import type { MigrateFunctionsObject, PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common'; +import type { Adapters } from '@kbn/inspector-plugin/common/adapters'; +import type { ExecutionContextSearch } from '@kbn/es-query'; +import { Executor } from '../executor'; +import type { AnyExpressionRenderDefinition } from '../expression_renderers'; +import { ExpressionRendererRegistry } from '../expression_renderers'; +import type { ExpressionAstExpression } from '../ast'; +import type { ExecutionContract, ExecutionResult } from '../execution'; +import type { AnyExpressionTypeDefinition, ExpressionValueError } from '../expression_types'; +import type { AnyExpressionFunctionDefinition } from '../expression_functions'; +import { ExpressionsServiceFork } from './expressions_fork'; +/** + * The public contract that `ExpressionsService` provides to other plugins + * in Kibana Platform in *setup* life-cycle. + */ +export interface ExpressionsServiceSetup { + /** + * Get a registered `ExpressionFunction` by its name, which was registered + * using the `registerFunction` method. The returned `ExpressionFunction` + * instance is an internal representation of the function in Expressions + * service - do not mutate that object. + * @deprecated Use start contract instead. + */ + getFunction(name: string, namespace?: string): ReturnType; + /** + * Returns POJO map of all registered expression functions, where keys are + * names of the functions and values are `ExpressionFunction` instances. + * @deprecated Use start contract instead. + */ + getFunctions(namespace?: string): ReturnType; + /** + * Returns POJO map of all registered expression types, where keys are + * names of the types and values are `ExpressionType` instances. + * @deprecated Use start contract instead. + */ + getTypes(): ReturnType; + /** + * Create a new instance of `ExpressionsService`. The new instance inherits + * all state of the original `ExpressionsService`, including all expression + * types, expression functions and context. Also, all new types and functions + * registered in the original services AFTER the forking event will be + * available in the forked instance. However, all new types and functions + * registered in the forked instances will NOT be available to the original + * service. + * @param name A fork name that can be used to get fork instance later. + */ + fork(namespace: string): ExpressionsServiceFork; + /** + * Register an expression function, which will be possible to execute as + * part of the expression pipeline. + * + * Below we register a function which simply sleeps for given number of + * milliseconds to delay the execution and outputs its input as-is. + * + * ```ts + * expressions.registerFunction({ + * name: 'sleep', + * args: { + * time: { + * aliases: ['_'], + * help: 'Time in milliseconds for how long to sleep', + * types: ['number'], + * }, + * }, + * help: '', + * fn: async (input, args, context) => { + * await new Promise(r => setTimeout(r, args.time)); + * return input; + * }, + * } + * ``` + * + * The actual function is defined in the `fn` key. The function can be *async*. + * It receives three arguments: (1) `input` is the output of the previous function + * or the initial input of the expression if the function is first in chain; + * (2) `args` are function arguments as defined in expression string, that can + * be edited by user (e.g in case of Canvas); (3) `context` is a shared object + * passed to all functions that can be used for side-effects. + */ + registerFunction(functionDefinition: AnyExpressionFunctionDefinition | (() => AnyExpressionFunctionDefinition)): void; + registerType(typeDefinition: AnyExpressionTypeDefinition | (() => AnyExpressionTypeDefinition)): void; + registerRenderer(definition: AnyExpressionRenderDefinition | (() => AnyExpressionRenderDefinition)): void; + getAllMigrations(): MigrateFunctionsObject; +} +export interface ExpressionExecutionParams { + searchContext?: ExecutionContextSearch; + variables?: Record; + /** + * Whether to execute expression in *debug mode*. In *debug mode* inputs and + * outputs as well as all resolved arguments and time it took to execute each + * function are saved and are available for introspection. + */ + debug?: boolean; + /** + * Makes a `KibanaRequest` object available to expression functions. Useful for + * functions which are running on the server and need to perform operations that + * are scoped to a specific user. + */ + kibanaRequest?: KibanaRequest; + searchSessionId?: string; + syncColors?: boolean; + syncCursor?: boolean; + syncTooltips?: boolean; + inspectorAdapters?: Adapters; + executionContext?: KibanaExecutionContext; + namespace?: string; + /** + * Toggles the partial results support. + * @default false + */ + partial?: boolean; + /** + * Throttling of partial results in milliseconds. 0 is disabling the throttling. + * @deafult 0 + */ + throttle?: number; + allowCache?: boolean; +} +/** + * The public contract that `ExpressionsService` provides to other plugins + * in Kibana Platform in *start* life-cycle. + */ +export interface ExpressionsServiceStart { + /** + * Get a registered `ExpressionFunction` by its name, which was registered + * using the `registerFunction` method. The returned `ExpressionFunction` + * instance is an internal representation of the function in Expressions + * service - do not mutate that object. + */ + getFunction(name: string, namespace?: string): ReturnType; + /** + * Returns POJO map of all registered expression functions, where keys are + * names of the functions and values are `ExpressionFunction` instances. + */ + getFunctions(namespace?: string): ReturnType; + /** + * Get a registered `ExpressionRenderer` by its name, which was registered + * using the `registerRenderer` method. The returned `ExpressionRenderer` + * instance is an internal representation of the renderer in Expressions + * service - do not mutate that object. + */ + getRenderer(name: string): ReturnType; + /** + * Returns POJO map of all registered expression renderers, where keys are + * names of the renderers and values are `ExpressionRenderer` instances. + */ + getRenderers(): ReturnType; + /** + * Get a registered `ExpressionType` by its name, which was registered + * using the `registerType` method. The returned `ExpressionType` + * instance is an internal representation of the type in Expressions + * service - do not mutate that object. + */ + getType(name: string): ReturnType; + /** + * Returns POJO map of all registered expression types, where keys are + * names of the types and values are `ExpressionType` instances. + */ + getTypes(): ReturnType; + /** + * Executes expression string or a parsed expression AST and immediately + * returns the result. + * + * Below example will execute `sleep 100 | clog` expression with `123` initial + * input to the first function. + * + * ```ts + * expressions.run('sleep 100 | clog', 123); + * ``` + * + * - `sleep 100` will delay execution by 100 milliseconds and pass the `123` input as + * its output. + * - `clog` will print to console `123` and pass it as its output. + * - The final result of the execution will be `123`. + * + * Optionally, you can pass an object as the third argument which will be used + * to extend the `ExecutionContext`—an object passed to each function + * as the third argument, that allows functions to perform side-effects. + * + * ```ts + * expressions.run('...', null, { elasticsearchClient }); + * ``` + */ + run(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): Observable>; + /** + * Starts expression execution and immediately returns `ExecutionContract` + * instance that tracks the progress of the execution and can be used to + * interact with the execution. + */ + execute(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): ExecutionContract; + extract(state: ExpressionAstExpression): { + state: ExpressionAstExpression; + references: SavedObjectReference[]; + }; + inject(state: ExpressionAstExpression, references: SavedObjectReference[]): ExpressionAstExpression; + telemetry(state: ExpressionAstExpression, telemetryData: Record): Record; + getAllMigrations(): MigrateFunctionsObject; +} +export interface ExpressionServiceParams { + executor?: Executor; + logger?: Logger; + renderers?: ExpressionRendererRegistry; +} +/** + * `ExpressionsService` class is used for multiple purposes: + * + * 1. It implements the same Expressions service that can be used on both: + * (1) server-side and (2) browser-side. + * 2. It implements the same Expressions service that users can fork/clone, + * thus have their own instance of the Expressions plugin. + * 3. `ExpressionsService` defines the public contracts of *setup* and *start* + * Kibana Platform life-cycles for ease-of-use on server-side and browser-side. + * 4. `ExpressionsService` creates a bound version of all exported contract functions. + * 5. Functions are bound the way there are: + * + * ```ts + * registerFunction = (...args: Parameters + * ): ReturnType => this.executor.registerFunction(...args); + * ``` + * + * so that JSDoc appears in developers IDE when they use those `plugins.expressions.registerFunction(`. + */ +export declare class ExpressionsService implements PersistableStateService, ExpressionsServiceSetup, ExpressionsServiceStart { + /** + * @note Workaround since the expressions service is frozen. + */ + private static started; + readonly executor: Executor; + readonly renderers: ExpressionRendererRegistry; + constructor({ logger, executor, renderers, }?: ExpressionServiceParams); + private isStarted; + private assertSetup; + private assertStart; + readonly getFunction: ExpressionsServiceStart['getFunction']; + readonly getFunctions: ExpressionsServiceStart['getFunctions']; + readonly getRenderer: ExpressionsServiceStart['getRenderer']; + readonly getRenderers: ExpressionsServiceStart['getRenderers']; + readonly getType: ExpressionsServiceStart['getType']; + readonly getTypes: ExpressionsServiceStart['getTypes']; + readonly registerFunction: ExpressionsServiceSetup['registerFunction']; + readonly registerType: ExpressionsServiceSetup['registerType']; + readonly registerRenderer: ExpressionsServiceSetup['registerRenderer']; + readonly fork: ExpressionsServiceSetup['fork']; + readonly execute: ExpressionsServiceStart['execute']; + readonly run: ExpressionsServiceStart['run']; + /** + * Extracts telemetry from expression AST + * @param state expression AST to extract references from + */ + readonly telemetry: (state: ExpressionAstExpression, telemetryData?: Record) => Record; + /** + * Extracts saved object references from expression AST + * @param state expression AST to extract references from + * @returns new expression AST with references removed and array of references + */ + readonly extract: (state: ExpressionAstExpression) => { + state: ExpressionAstExpression; + references: import("@kbn/core/server").SavedObjectReference[]; + }; + /** + * Injects saved object references into expression AST + * @param state expression AST to update + * @param references array of saved object references + * @returns new expression AST with references injected + */ + readonly inject: (state: ExpressionAstExpression, references: SavedObjectReference[]) => ExpressionAstExpression; + /** + * gets an object with semver mapped to a migration function + */ + getAllMigrations: () => MigrateFunctionsObject; + /** + * migrates an old expression to latest version + * @param state + */ + migrateToLatest: (state: VersionedState) => ExpressionAstExpression; + /** + * Returns Kibana Platform *setup* life-cycle contract. Useful to return the + * same contract on server-side and browser-side. + */ + setup(...args: unknown[]): ExpressionsServiceSetup; + /** + * Returns Kibana Platform *start* life-cycle contract. Useful to return the + * same contract on server-side and browser-side. + */ + start(...args: unknown[]): ExpressionsServiceStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/expressions/common/service/index.d.ts b/src/platform/plugins/shared/expressions/common/service/index.d.ts new file mode 100644 index 0000000000000..5b55853bc3424 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/service/index.d.ts @@ -0,0 +1 @@ +export * from './expressions_services'; diff --git a/src/platform/plugins/shared/expressions/common/types/common.d.ts b/src/platform/plugins/shared/expressions/common/types/common.d.ts new file mode 100644 index 0000000000000..62be31fe9ac6c --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/types/common.d.ts @@ -0,0 +1,29 @@ +import type { ObservableLike, UnwrapObservable } from '@kbn/utility-types'; +/** + * This can convert a type into a known Expression string representation of + * that type. For example, `TypeToString` will resolve to `'datatable'`. + * This allows Expression Functions to continue to specify their type in a + * simple string format. + */ +export type TypeToString = KnownTypeToString | UnmappedTypeStrings; +/** + * Map the type of the generic to a string-based representation of the type. + * + * If the provided generic is its own type interface, we use the value of + * the `type` key as a string literal type for it. + */ +export type KnownTypeToString = T extends string ? 'string' : T extends boolean ? 'boolean' : T extends number ? 'number' : T extends null ? 'null' : T extends { + type: string; +} ? T['type'] : never; +/** + * If the type extends a Promise, we still need to return the string representation: + * + * `someArgument: Promise` results in `types: ['boolean', 'string']` + */ +export type TypeString = KnownTypeToString ? UnwrapObservable : Awaited>; +/** + * Types used in Expressions that don't map to a primitive cleanly: + * + * `date` is typed as a number or string, and represents a date + */ +export type UnmappedTypeStrings = 'date' | 'filter'; diff --git a/src/platform/plugins/shared/expressions/common/types/index.d.ts b/src/platform/plugins/shared/expressions/common/types/index.d.ts new file mode 100644 index 0000000000000..0072761cd7819 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/types/index.d.ts @@ -0,0 +1,3 @@ +export type { TypeToString, KnownTypeToString, TypeString, UnmappedTypeStrings } from './common'; +export * from './style'; +export type * from './registry'; diff --git a/src/platform/plugins/shared/expressions/common/types/registry.d.ts b/src/platform/plugins/shared/expressions/common/types/registry.d.ts new file mode 100644 index 0000000000000..b869581ac25db --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/types/registry.d.ts @@ -0,0 +1,5 @@ +export interface IRegistry { + get(id: string): T | null; + toJS(): Record; + toArray(): T[]; +} diff --git a/src/platform/plugins/shared/expressions/common/types/style.d.ts b/src/platform/plugins/shared/expressions/common/types/style.d.ts new file mode 100644 index 0000000000000..8bf818428a67b --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/types/style.d.ts @@ -0,0 +1,111 @@ +import type { FontLabel } from '../fonts'; +/** + * Enum of supported CSS `background-repeat` properties. + */ +export declare enum BackgroundRepeat { + REPEAT = "repeat", + REPEAT_NO = "no-repeat", + REPEAT_X = "repeat-x", + REPEAT_Y = "repeat-y", + ROUND = "round", + SPACE = "space" +} +/** + * Enum of supported CSS `background-size` properties. + */ +export declare enum BackgroundSize { + AUTO = "auto", + CONTAIN = "contain", + COVER = "cover" +} +/** + * Enum of supported CSS `font-style` properties. + */ +export declare enum FontStyle { + ITALIC = "italic", + NORMAL = "normal" +} +/** + * Enum of supported CSS `font-weight` properties. + */ +export declare enum FontWeight { + NORMAL = "normal", + BOLD = "bold", + BOLDER = "bolder", + LIGHTER = "lighter", + ONE = "100", + TWO = "200", + THREE = "300", + FOUR = "400", + FIVE = "500", + SIX = "600", + SEVEN = "700", + EIGHT = "800", + NINE = "900" +} +/** + * Enum of supported CSS `overflow` properties. + */ +export declare enum Overflow { + AUTO = "auto", + HIDDEN = "hidden", + SCROLL = "scroll", + VISIBLE = "visible" +} +/** + * Enum of supported CSS `text-align` properties. + */ +export declare enum TextAlignment { + CENTER = "center", + JUSTIFY = "justify", + LEFT = "left", + RIGHT = "right" +} +/** + * Enum of supported CSS `text-decoration` properties. + */ +export declare enum TextDecoration { + NONE = "none", + UNDERLINE = "underline" +} +export declare enum FontSizeUnit { + PX = "px", + PT = "pt" +} +/** + * Represents the various style properties that can be applied to an element. + */ +export interface CSSStyle { + color?: string; + fill?: string; + fontFamily?: FontLabel; + fontSize?: string; + fontStyle?: FontStyle; + fontWeight?: FontWeight; + lineHeight?: number | string; + textAlign?: TextAlignment; + textDecoration?: TextDecoration; +} +/** + * Represents an object containing style information for a Container. + */ +export interface ContainerStyle { + border: string | null; + borderRadius: string | null; + padding: string | null; + backgroundColor: string | null; + backgroundImage: string | null; + backgroundSize: BackgroundSize; + backgroundRepeat: BackgroundRepeat; + opacity: number | null; + overflow: Overflow; +} +/** + * An object that represents style information, typically CSS. + */ +export interface ExpressionTypeStyle { + type: 'style'; + spec: CSSStyle; + css: string; +} +export type Style = ExpressionTypeStyle; diff --git a/src/platform/plugins/shared/expressions/common/util/create_default_inspector_adapters.d.ts b/src/platform/plugins/shared/expressions/common/util/create_default_inspector_adapters.d.ts new file mode 100644 index 0000000000000..146ad7aaf7545 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/util/create_default_inspector_adapters.d.ts @@ -0,0 +1,2 @@ +import type { DefaultInspectorAdapters } from '../execution'; +export declare const createDefaultInspectorAdapters: () => DefaultInspectorAdapters; diff --git a/src/platform/plugins/shared/expressions/common/util/create_error.d.ts b/src/platform/plugins/shared/expressions/common/util/create_error.d.ts new file mode 100644 index 0000000000000..9fffa87787d4b --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/util/create_error.d.ts @@ -0,0 +1,10 @@ +import type { ExpressionValueError } from '..'; +export type SerializedError = { + name: string; + message: string; + stack?: string; +}; +export type ErrorLike = SerializedError & { + original?: SerializedError; +}; +export declare const createError: (err: string | ErrorLike) => ExpressionValueError; diff --git a/src/platform/plugins/shared/expressions/common/util/expressions_inspector_adapter.d.ts b/src/platform/plugins/shared/expressions/common/util/expressions_inspector_adapter.d.ts new file mode 100644 index 0000000000000..f77e76dd13685 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/util/expressions_inspector_adapter.d.ts @@ -0,0 +1,7 @@ +import { EventEmitter } from 'events'; +import type { ExpressionAstNode } from '..'; +export declare class ExpressionsInspectorAdapter extends EventEmitter { + private _ast; + logAST(ast: ExpressionAstNode): void; + get ast(): ExpressionAstNode; +} diff --git a/src/platform/plugins/shared/expressions/common/util/get_by_alias.d.ts b/src/platform/plugins/shared/expressions/common/util/get_by_alias.d.ts new file mode 100644 index 0000000000000..c4a1e20925ae3 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/util/get_by_alias.d.ts @@ -0,0 +1,13 @@ +/** + * This is used for looking up function/argument definitions. It looks through + * the given object/array for a case-insensitive match, which could be either the + * `name` itself, or something under the `aliases` property. + */ +export declare const ALL_NAMESPACES = "*"; +interface Node { + name?: string; + aliases?: string[]; + namespace?: string; +} +export declare function getByAlias(node: T[] | Record, nodeName: string, nodeNamespace?: string): T | undefined; +export {}; diff --git a/src/platform/plugins/shared/expressions/common/util/index.d.ts b/src/platform/plugins/shared/expressions/common/util/index.d.ts new file mode 100644 index 0000000000000..a8a67588443cf --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/util/index.d.ts @@ -0,0 +1,6 @@ +export * from './create_error'; +export * from './get_by_alias'; +export * from './tables_adapter'; +export * from './expressions_inspector_adapter'; +export * from './test_utils'; +export * from './create_default_inspector_adapters'; diff --git a/src/platform/plugins/shared/expressions/common/util/tables_adapter.d.ts b/src/platform/plugins/shared/expressions/common/util/tables_adapter.d.ts new file mode 100644 index 0000000000000..766e8a07bb279 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/util/tables_adapter.d.ts @@ -0,0 +1,13 @@ +import { EventEmitter } from 'events'; +import type { Datatable } from '../expression_types/specs'; +export declare class TablesAdapter extends EventEmitter { + #private; + allowCsvExport: boolean; + /** Key of table to set as initial selection */ + initialSelectedTable?: string; + logDatatable(key: string, datatable: Datatable): void; + reset(): void; + get tables(): { + [key: string]: Datatable; + }; +} diff --git a/src/platform/plugins/shared/expressions/common/util/test_utils.d.ts b/src/platform/plugins/shared/expressions/common/util/test_utils.d.ts new file mode 100644 index 0000000000000..189bfaf1c30f2 --- /dev/null +++ b/src/platform/plugins/shared/expressions/common/util/test_utils.d.ts @@ -0,0 +1,2 @@ +import type { ExecutionContext } from '../execution'; +export declare const createMockContext: () => ExecutionContext; diff --git a/src/platform/plugins/shared/expressions/public/expression_functions/index.d.ts b/src/platform/plugins/shared/expressions/public/expression_functions/index.d.ts new file mode 100644 index 0000000000000..3907793105295 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/expression_functions/index.d.ts @@ -0,0 +1 @@ +export * from './ui_setting'; diff --git a/src/platform/plugins/shared/expressions/public/expression_functions/ui_setting.d.ts b/src/platform/plugins/shared/expressions/public/expression_functions/ui_setting.d.ts new file mode 100644 index 0000000000000..0e69cd53798de --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/expression_functions/ui_setting.d.ts @@ -0,0 +1,2 @@ +import type { CoreSetup } from '@kbn/core/public'; +export declare function getUiSettingFn({ getStartServices }: Pick): import("../../common").ExpressionFunctionUiSetting; diff --git a/src/platform/plugins/shared/expressions/public/index.d.ts b/src/platform/plugins/shared/expressions/public/index.d.ts new file mode 100644 index 0000000000000..5673b52e2ba2b --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/index.d.ts @@ -0,0 +1,13 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import { ExpressionsPublicPlugin } from './plugin'; +export { ExpressionsPublicPlugin as Plugin }; +export type { ExpressionsSetup, ExpressionsStart } from './plugin'; +export declare function plugin(initializerContext: PluginInitializerContext): ExpressionsPublicPlugin; +export type { ExpressionExecutor, IExpressionLoaderParams, ExpressionRenderError, ExpressionRendererEvent, } from './types'; +export type { ExpressionLoader } from './loader'; +export type { ExpressionRenderHandler } from './render'; +export type { ExpressionRendererComponent, ExpressionRendererParams, ReactExpressionRendererProps, ReactExpressionRendererType, } from './react_expression_renderer'; +export { useExpressionRenderer } from './react_expression_renderer'; +export type { AnyExpressionFunctionDefinition, AnyExpressionTypeDefinition, ArgumentType, Datatable, DatatableColumn, DatatableColumnType, DatatableRow, Execution, ExecutionContract, ExecutionContainer, ExecutionContext, ExecutionParams, ExecutionState, Executor, ExecutorContainer, ExecutorState, ExpressionAstArgument, ExpressionAstExpression, ExpressionAstExpressionBuilder, ExpressionAstFunction, ExpressionAstFunctionBuilder, ExpressionAstNode, ExpressionFunction, ExpressionFunctionDefinition, ExpressionFunctionDefinitions, ExpressionFunctionParameter, ExpressionImage, ExpressionRenderDefinition, ExpressionRenderer, ExpressionRendererRegistry, ExpressionType, ExpressionTypeDefinition, ExpressionTypeStyle, ExpressionValue, ExpressionValueBoxed, ExpressionValueConverter, ExpressionValueError, ExpressionValueNum, ExpressionValueRender, ExpressionValueUnboxed, ExpressionValueFilter, Font, FontLabel, FontStyle, FontValue, FontWeight, FunctionsRegistry, IInterpreterRenderHandlers, InterpreterErrorType, IRegistry, KnownTypeToString, Overflow, PointSeries, PointSeriesColumn, PointSeriesColumnName, PointSeriesColumns, PointSeriesRow, Range, SerializedDatatable, Style, TextAlignment, TextDecoration, TypesRegistry, TypeString, TypeToString, UnmappedTypeStrings, ExpressionValueRender as Render, ExpressionsService, ExpressionsServiceSetup, ExpressionsServiceStart, TablesAdapter, } from '../common'; +export { buildExpression, buildExpressionFunction, formatExpression, isExpressionAstBuilder, parseExpression, createDefaultInspectorAdapters, } from '../common'; +export { isSourceParamsESQL } from '../common/expression_types'; diff --git a/src/platform/plugins/shared/expressions/public/loader.d.ts b/src/platform/plugins/shared/expressions/public/loader.d.ts new file mode 100644 index 0000000000000..a1ff429d85d4c --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/loader.d.ts @@ -0,0 +1,34 @@ +import type { Observable } from 'rxjs'; +import type { Adapters } from '@kbn/inspector-plugin/public'; +import { AbortReason } from '@kbn/kibana-utils-plugin/common'; +import type { IExpressionLoaderParams } from './types'; +import type { ExpressionAstExpression } from '../common'; +import type { ExecutionContract } from '../common/execution/execution_contract'; +import { ExpressionRenderHandler } from './render'; +export declare class ExpressionLoader { + data$: ReturnType; + update$: ExpressionRenderHandler['update$']; + render$: ExpressionRenderHandler['render$']; + events$: ExpressionRenderHandler['events$']; + loading$: Observable; + private execution; + private renderHandler; + private dataSubject; + private loadingSubject; + private data; + private params; + private subscription?; + constructor(element: HTMLElement, expression?: string | ExpressionAstExpression, params?: IExpressionLoaderParams); + destroy(): void; + cancel(reason?: AbortReason): void; + getExpression(): string | undefined; + getAst(): ExpressionAstExpression | undefined; + getElement(): HTMLElement; + inspect(): Adapters | undefined; + update(expression?: string | ExpressionAstExpression, params?: IExpressionLoaderParams): void; + private loadData; + private render; + private setParams; +} +export type IExpressionLoader = (element: HTMLElement, expression?: string | ExpressionAstExpression, params?: IExpressionLoaderParams) => Promise; +export declare const loader: IExpressionLoader; diff --git a/src/platform/plugins/shared/expressions/public/plugin.d.ts b/src/platform/plugins/shared/expressions/public/plugin.d.ts new file mode 100644 index 0000000000000..99db9de6b675e --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/plugin.d.ts @@ -0,0 +1,25 @@ +import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import type { ExpressionsServiceSetup, ExpressionsServiceStart } from '../common'; +import { ReactExpressionRenderer } from './react_expression_renderer_wrapper'; +import type { IExpressionLoader } from './loader'; +import type { IExpressionRenderer } from './render'; +/** + * Expressions public setup contract, extends {@link ExpressionsServiceSetup} + */ +export type ExpressionsSetup = ExpressionsServiceSetup; +/** + * Expressions public start contrect, extends {@link ExpressionServiceStart} + */ +export interface ExpressionsStart extends ExpressionsServiceStart { + loader: IExpressionLoader; + render: IExpressionRenderer; + ReactExpressionRenderer: typeof ReactExpressionRenderer; +} +export declare class ExpressionsPublicPlugin implements Plugin { + private static logger; + private readonly expressions; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup): ExpressionsSetup; + start(core: CoreStart): ExpressionsStart; + stop(): void; +} diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/index.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/index.d.ts new file mode 100644 index 0000000000000..d08e15c741dc4 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/react_expression_renderer/index.d.ts @@ -0,0 +1,2 @@ +export * from './react_expression_renderer'; +export * from './use_expression_renderer'; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/react_expression_renderer.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/react_expression_renderer.d.ts new file mode 100644 index 0000000000000..0aeb049076027 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/react_expression_renderer/react_expression_renderer.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import type { ExpressionRenderError } from '../types'; +import type { ExpressionRendererParams } from './use_expression_renderer'; +export interface ReactExpressionRendererProps extends Omit { + className?: string; + dataAttrs?: string[]; + renderError?: (message?: string | null, error?: ExpressionRenderError | null) => React.ReactElement | React.ReactElement[]; + padding?: 'xs' | 's' | 'm' | 'l' | 'xl'; + paddingTop?: boolean; +} +export type ReactExpressionRendererType = React.ComponentType; +export type ExpressionRendererComponent = React.FC; +export declare function ReactExpressionRenderer({ className, dataAttrs, padding, paddingTop, renderError, abortController, ...expressionRendererOptions }: ReactExpressionRendererProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_debounced_value.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_debounced_value.d.ts new file mode 100644 index 0000000000000..465c0ff0ab643 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_debounced_value.d.ts @@ -0,0 +1 @@ +export declare function useDebouncedValue(value: T, timeout?: number): [T, boolean]; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.d.ts new file mode 100644 index 0000000000000..d5c7872b69ca2 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.d.ts @@ -0,0 +1,24 @@ +import type { RefObject } from 'react'; +import type { Observable } from 'rxjs'; +import type { ExpressionAstExpression } from '../../common'; +import type { IExpressionLoaderParams, ExpressionRenderError, ExpressionRendererEvent } from '../types'; +export interface ExpressionRendererParams extends IExpressionLoaderParams { + debounce?: number; + expression: string | ExpressionAstExpression; + hasCustomErrorRenderer?: boolean; + onData$?(data: TData, adapters?: TInspectorAdapters, partial?: boolean): void; + onEvent?(event: ExpressionRendererEvent): void; + onRender$?(item: number): void; + /** + * An observable which can be used to re-run the expression without destroying the component + */ + reload$?: Observable; + abortController?: AbortController; +} +interface ExpressionRendererState { + isEmpty: boolean; + isLoading: boolean; + error: null | ExpressionRenderError; +} +export declare function useExpressionRenderer(nodeRef: RefObject, { debounce, expression, hasCustomErrorRenderer, onData$, onEvent, onRender$, reload$, abortController, ...loaderParams }: ExpressionRendererParams): ExpressionRendererState; +export {}; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_shallow_memo.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_shallow_memo.d.ts new file mode 100644 index 0000000000000..7a615fcdf6801 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_shallow_memo.d.ts @@ -0,0 +1 @@ +export declare function useShallowMemo(value: T): T; diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer_wrapper.d.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer_wrapper.d.ts new file mode 100644 index 0000000000000..e6df347276d68 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/react_expression_renderer_wrapper.d.ts @@ -0,0 +1,3 @@ +import React from 'react'; +import type { ReactExpressionRendererProps } from './react_expression_renderer'; +export declare const ReactExpressionRenderer: (props: ReactExpressionRendererProps) => React.JSX.Element; diff --git a/src/platform/plugins/shared/expressions/public/render.d.ts b/src/platform/plugins/shared/expressions/public/render.d.ts new file mode 100644 index 0000000000000..f7810a2c54bbe --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/render.d.ts @@ -0,0 +1,39 @@ +import type { Observable } from 'rxjs'; +import type { SerializableRecord } from '@kbn/utility-types'; +import type { KibanaExecutionContext } from '@kbn/core-execution-context-common'; +import type { ExpressionRenderError, RenderErrorHandlerFnType, IExpressionLoaderParams, ExpressionRendererEvent } from './types'; +import type { IInterpreterRenderUpdateParams, RenderMode } from '../common'; +export type IExpressionRendererExtraHandlers = Record; +export interface ExpressionRenderHandlerParams { + onRenderError?: RenderErrorHandlerFnType; + renderMode?: RenderMode; + syncColors?: boolean; + syncCursor?: boolean; + syncTooltips?: boolean; + interactive?: boolean; + hasCompatibleActions?: (event: ExpressionRendererEvent) => Promise; + getCompatibleCellValueActions?: (data: object[]) => Promise; + executionContext?: KibanaExecutionContext; +} +type UpdateValue = IInterpreterRenderUpdateParams; +export declare class ExpressionRenderHandler { + render$: Observable; + update$: Observable; + events$: Observable; + private element; + private destroyFn?; + private renderCount; + private renderSubject; + private eventsSubject; + private updateSubject; + private handlers; + private onRenderError; + constructor(element: HTMLElement, { onRenderError, renderMode, syncColors, syncTooltips, syncCursor, interactive, hasCompatibleActions, getCompatibleCellValueActions, executionContext, }?: ExpressionRenderHandlerParams); + render: (value: SerializableRecord, uiState?: unknown) => Promise; + destroy: () => void; + getElement: () => HTMLElement; + handleRenderError: (error: ExpressionRenderError) => void; +} +export type IExpressionRenderer = (element: HTMLElement, data: unknown, options?: ExpressionRenderHandlerParams) => Promise; +export declare const render: IExpressionRenderer; +export {}; diff --git a/src/platform/plugins/shared/expressions/public/render_error_handler.d.ts b/src/platform/plugins/shared/expressions/public/render_error_handler.d.ts new file mode 100644 index 0000000000000..35b7328f030f8 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/render_error_handler.d.ts @@ -0,0 +1,2 @@ +import type { RenderErrorHandlerFnType } from './types'; +export declare const renderErrorHandler: RenderErrorHandlerFnType; diff --git a/src/platform/plugins/shared/expressions/public/services/expressions_services.d.ts b/src/platform/plugins/shared/expressions/public/services/expressions_services.d.ts new file mode 100644 index 0000000000000..7e3c63004d7a3 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/services/expressions_services.d.ts @@ -0,0 +1,5 @@ +import type { CoreSetup } from '@kbn/core/public'; +import { ExpressionsService as CommonExpressionsService } from '../../common'; +export declare class ExpressionsService extends CommonExpressionsService { + setup({ getStartServices }: Pick): import("../../common").ExpressionsServiceSetup; +} diff --git a/src/platform/plugins/shared/expressions/public/services/index.d.ts b/src/platform/plugins/shared/expressions/public/services/index.d.ts new file mode 100644 index 0000000000000..3f158fe1af28a --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/services/index.d.ts @@ -0,0 +1,6 @@ +import type { NotificationsStart } from '@kbn/core/public'; +import type { ExpressionsService, ExpressionRendererRegistry } from '../../common'; +export declare const getNotifications: import("@kbn/kibana-utils-plugin/public").Get, setNotifications: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getRenderersRegistry: import("@kbn/kibana-utils-plugin/public").Get, setRenderersRegistry: import("@kbn/kibana-utils-plugin/public").Set; +export declare const getExpressionsService: import("@kbn/kibana-utils-plugin/public").Get, setExpressionsService: import("@kbn/kibana-utils-plugin/public").Set; +export * from './expressions_services'; diff --git a/src/platform/plugins/shared/expressions/public/types/index.d.ts b/src/platform/plugins/shared/expressions/public/types/index.d.ts new file mode 100644 index 0000000000000..44015114fc0c9 --- /dev/null +++ b/src/platform/plugins/shared/expressions/public/types/index.d.ts @@ -0,0 +1,57 @@ +import type { KibanaExecutionContext } from '@kbn/core/public'; +import type { Adapters } from '@kbn/inspector-plugin/public'; +import type { ExecutionContextSearch } from '@kbn/es-query'; +import type { IInterpreterRenderHandlers, ExpressionValue, ExpressionsService, RenderMode, IInterpreterRenderEvent } from '../../common'; +import type { ExpressionRenderHandlerParams } from '../render'; +/** + * @deprecated + * + * This type if remainder from legacy platform, will be deleted going further. + */ +export interface ExpressionExecutor { + interpreter: ExpressionInterpreter; +} +/** + * @deprecated + */ +export interface ExpressionInterpreter { + interpretAst: ExpressionsService['run']; +} +export interface IExpressionLoaderParams { + searchContext?: ExecutionContextSearch; + context?: ExpressionValue; + variables?: Record; + debug?: boolean; + customFunctions?: []; + customRenderers?: []; + uiState?: unknown; + inspectorAdapters?: Adapters; + interactive?: boolean; + onRenderError?: RenderErrorHandlerFnType; + searchSessionId?: string; + renderMode?: RenderMode; + syncColors?: boolean; + syncCursor?: boolean; + syncTooltips?: boolean; + hasCompatibleActions?: ExpressionRenderHandlerParams['hasCompatibleActions']; + getCompatibleCellValueActions?: ExpressionRenderHandlerParams['getCompatibleCellValueActions']; + executionContext?: KibanaExecutionContext; + abortController?: AbortController; + /** + * The flag to toggle on emitting partial results. + * By default, the partial results are disabled. + */ + partial?: boolean; + /** + * Throttling of partial results in milliseconds. 0 is disabling the throttling. + * By default, it equals 1000. + */ + throttle?: number; + allowCache?: boolean; +} +export interface ExpressionRenderError extends Error { + type?: string; + original?: Error; +} +export type RenderErrorHandlerFnType = (domNode: HTMLElement, error: ExpressionRenderError, handlers: IInterpreterRenderHandlers) => void; +export type ExpressionRendererEvent = IInterpreterRenderEvent; diff --git a/src/platform/plugins/shared/home/common/constants.d.ts b/src/platform/plugins/shared/home/common/constants.d.ts new file mode 100644 index 0000000000000..4ddd44994f1c5 --- /dev/null +++ b/src/platform/plugins/shared/home/common/constants.d.ts @@ -0,0 +1,8 @@ +export declare const PLUGIN_ID = "home"; +export declare const HOME_APP_BASE_PATH = "/app/home"; +export declare enum TutorialsCategory { + LOGGING = "logging", + SECURITY_SOLUTION = "security", + METRICS = "metrics", + OTHER = "other" +} diff --git a/src/platform/plugins/shared/home/common/instruction_variant.d.ts b/src/platform/plugins/shared/home/common/instruction_variant.d.ts new file mode 100644 index 0000000000000..17e7054743cbe --- /dev/null +++ b/src/platform/plugins/shared/home/common/instruction_variant.d.ts @@ -0,0 +1,29 @@ +export declare const INSTRUCTION_VARIANT: { + ESC: string; + OSX: string; + DEB: string; + RPM: string; + DOCKER: string; + WINDOWS: string; + NODE: string; + DJANGO: string; + FLASK: string; + RAILS: string; + RACK: string; + JS: string; + GO: string; + JAVA: string; + DOTNET: string; + LINUX: string; + PHP: string; + FLEET: string; + OPEN_TELEMETRY: string; + OTHER_LINUX: string; +}; +/** + * Convert instruction variant id into display text. + * + * @params {String} id - instruction variant id as defined from INSTRUCTION_VARIANT + * @return {String} display name + */ +export declare function getDisplayText(id: keyof typeof INSTRUCTION_VARIANT): string; diff --git a/src/platform/plugins/shared/home/public/application/application.d.ts b/src/platform/plugins/shared/home/public/application/application.d.ts new file mode 100644 index 0000000000000..99a2f05cae41c --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/application.d.ts @@ -0,0 +1,2 @@ +import type { ScopedHistory, CoreStart } from '@kbn/core/public'; +export declare const renderApp: (element: HTMLElement, coreStart: CoreStart, history: ScopedHistory) => Promise<() => void>; diff --git a/src/platform/plugins/shared/home/public/application/components/add_data/add_data.d.ts b/src/platform/plugins/shared/home/public/application/components/add_data/add_data.d.ts new file mode 100644 index 0000000000000..a231ba5786470 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/add_data/add_data.d.ts @@ -0,0 +1,10 @@ +import type { FC } from 'react'; +import type { ApplicationStart } from '@kbn/core/public'; +interface Props { + addBasePath: (path: string) => string; + application: ApplicationStart; + isDarkMode: boolean; + isCloudEnabled: boolean; +} +export declare const AddData: FC; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/add_data/index.d.ts b/src/platform/plugins/shared/home/public/application/components/add_data/index.d.ts new file mode 100644 index 0000000000000..e191c405f8aea --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/add_data/index.d.ts @@ -0,0 +1 @@ +export * from './add_data'; diff --git a/src/platform/plugins/shared/home/public/application/components/app_navigation_handler.d.ts b/src/platform/plugins/shared/home/public/application/components/app_navigation_handler.d.ts new file mode 100644 index 0000000000000..161a67bc8ea56 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/app_navigation_handler.d.ts @@ -0,0 +1,2 @@ +import type { MouseEvent } from 'react'; +export declare const createAppNavigationHandler: (targetUrl: string) => (event: MouseEvent) => void; diff --git a/src/platform/plugins/shared/home/public/application/components/home.d.ts b/src/platform/plugins/shared/home/public/application/components/home.d.ts new file mode 100644 index 0000000000000..e06e5ae2f7b25 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/home.d.ts @@ -0,0 +1,33 @@ +import React, { Component } from 'react'; +import type { FeatureCatalogueEntry, FeatureCatalogueSolution } from '../../services'; +export declare const KEY_ENABLE_WELCOME = "home:welcome:show"; +export interface HomeProps { + addBasePath: (url: string) => string; + directories: FeatureCatalogueEntry[]; + solutions: FeatureCatalogueSolution[]; + localStorage: Storage; + urlBasePath: string; + hasUserDataView: () => Promise; + isCloudEnabled: boolean; +} +interface State { + isLoading: boolean; + isNewKibanaInstance: boolean; + isWelcomeEnabled: boolean; +} +export declare class Home extends Component { + private _isMounted; + constructor(props: HomeProps); + componentWillUnmount(): void; + componentDidMount(): void; + private fetchIsNewKibanaInstance; + private endLoading; + skipWelcome(): void; + private findDirectoryById; + private getFeaturesByCategory; + private renderNormal; + private renderLoading; + private renderWelcome; + render(): string | React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/home_app.d.ts b/src/platform/plugins/shared/home/public/application/components/home_app.d.ts new file mode 100644 index 0000000000000..bf1db3c6d68ea --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/home_app.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { FeatureCatalogueEntry, FeatureCatalogueSolution } from '../../services'; +export interface HomeAppProps { + directories: FeatureCatalogueEntry[]; + solutions: FeatureCatalogueSolution[]; +} +export declare function HomeApp({ directories, solutions }: HomeAppProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/home/public/application/components/manage_data/index.d.ts b/src/platform/plugins/shared/home/public/application/components/manage_data/index.d.ts new file mode 100644 index 0000000000000..4cb51f7acffaa --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/manage_data/index.d.ts @@ -0,0 +1 @@ +export * from './manage_data'; diff --git a/src/platform/plugins/shared/home/public/application/components/manage_data/manage_data.d.ts b/src/platform/plugins/shared/home/public/application/components/manage_data/manage_data.d.ts new file mode 100644 index 0000000000000..d5cb0fde33725 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/manage_data/manage_data.d.ts @@ -0,0 +1,10 @@ +import type { FC } from 'react'; +import type { ApplicationStart } from '@kbn/core/public'; +import type { FeatureCatalogueEntry } from '../../../services'; +interface Props { + addBasePath: (path: string) => string; + application: ApplicationStart; + features: FeatureCatalogueEntry[]; +} +export declare const ManageData: FC; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/move_data/index.d.ts b/src/platform/plugins/shared/home/public/application/components/move_data/index.d.ts new file mode 100644 index 0000000000000..c9c63d147a30f --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/move_data/index.d.ts @@ -0,0 +1 @@ +export * from './move_data'; diff --git a/src/platform/plugins/shared/home/public/application/components/move_data/move_data.d.ts b/src/platform/plugins/shared/home/public/application/components/move_data/move_data.d.ts new file mode 100644 index 0000000000000..9bfa476ea29c2 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/move_data/move_data.d.ts @@ -0,0 +1,6 @@ +import type { FC } from 'react'; +interface Props { + addBasePath: (path: string) => string; +} +export declare const MoveData: FC; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/sample_data/index.d.ts b/src/platform/plugins/shared/home/public/application/components/sample_data/index.d.ts new file mode 100644 index 0000000000000..fcaff2c368c2f --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/sample_data/index.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +interface Props { + urlBasePath: string; + onDecline: () => void; + onConfirm: () => void; +} +export declare function SampleDataCard({ urlBasePath, onDecline, onConfirm }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/callout_skeleton.d.ts b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/callout_skeleton.d.ts new file mode 100644 index 0000000000000..f6e7cacab4735 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/callout_skeleton.d.ts @@ -0,0 +1,2 @@ +import type { FC } from 'react'; +export declare const CalloutSkeleton: FC; diff --git a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/index.d.ts b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/index.d.ts new file mode 100644 index 0000000000000..6ea8a1c94c18a --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/index.d.ts @@ -0,0 +1,2 @@ +export * from './setup_cloud_connect'; +export * from './callout_skeleton'; diff --git a/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/setup_cloud_connect.d.ts b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/setup_cloud_connect.d.ts new file mode 100644 index 0000000000000..261d674fa3f2f --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/setup_cloud_connect/setup_cloud_connect.d.ts @@ -0,0 +1,8 @@ +import type { FC } from 'react'; +import type { ApplicationStart } from '@kbn/core/public'; +interface Props { + addBasePath: (path: string) => string; + application: ApplicationStart; +} +export declare const SetupCloudConnect: FC; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/solutions_section/index.d.ts b/src/platform/plugins/shared/home/public/application/components/solutions_section/index.d.ts new file mode 100644 index 0000000000000..5a4f338c2425d --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/solutions_section/index.d.ts @@ -0,0 +1 @@ +export * from './solutions_section'; diff --git a/src/platform/plugins/shared/home/public/application/components/solutions_section/solution_panel.d.ts b/src/platform/plugins/shared/home/public/application/components/solutions_section/solution_panel.d.ts new file mode 100644 index 0000000000000..9884ccb92a6ae --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/solutions_section/solution_panel.d.ts @@ -0,0 +1,8 @@ +import type { FC } from 'react'; +import type { FeatureCatalogueSolution } from '../../..'; +interface Props { + addBasePath: (path: string) => string; + solution: FeatureCatalogueSolution; +} +export declare const SolutionPanel: FC; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/solutions_section/solutions_section.d.ts b/src/platform/plugins/shared/home/public/application/components/solutions_section/solutions_section.d.ts new file mode 100644 index 0000000000000..c94c71bfc3ca4 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/solutions_section/solutions_section.d.ts @@ -0,0 +1,8 @@ +import type { FC } from 'react'; +import type { FeatureCatalogueSolution } from '../../..'; +interface Props { + addBasePath: (path: string) => string; + solutions: FeatureCatalogueSolution[]; +} +export declare const SolutionsSection: FC; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/synopsis.d.ts b/src/platform/plugins/shared/home/public/application/components/synopsis.d.ts new file mode 100644 index 0000000000000..ed030f1758b42 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/synopsis.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import type { EuiCardProps, IconType } from '@elastic/eui'; +export interface SynopsisProps { + id: string; + title: string; + description: string; + iconUrl?: string; + iconType?: IconType; + url?: string; + isBeta?: boolean; + onClick?: EuiCardProps['onClick']; +} +export declare function Synopsis({ id, description, iconUrl, iconType, title, url, onClick, isBeta, }: SynopsisProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/content.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/content.d.ts new file mode 100644 index 0000000000000..320f5902b66db --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial/content.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +interface ContentProps { + text: string; +} +export declare function Content({ text }: ContentProps): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/footer.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/footer.d.ts new file mode 100644 index 0000000000000..7657f17527264 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial/footer.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +interface FooterProps { + url: string; + label: string; +} +export declare function Footer({ url, label }: FooterProps): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/instruction.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/instruction.d.ts new file mode 100644 index 0000000000000..f6012a2eace82 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial/instruction.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import type { InstructionType } from '../../../services/tutorials/types'; +export interface InstructionProps extends InstructionType { + variantId: string; + isCloudEnabled: boolean; + replaceTemplateStrings: (text: string) => string; +} +export declare function Instruction({ commands, textPost, textPre, replaceTemplateStrings, customComponentName, variantId, isCloudEnabled, }: InstructionProps): React.JSX.Element; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/instruction_set.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/instruction_set.d.ts new file mode 100644 index 0000000000000..b0d0a344bd642 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial/instruction_set.d.ts @@ -0,0 +1,18 @@ +import React from 'react'; +import type { InjectedIntl } from '@kbn/i18n-react'; +import * as StatusCheckStates from './status_check_states'; +import type { InstructionSetType } from '../../../services/tutorials/types'; +interface InstructionSetProps extends InstructionSetType { + instructionVariants: InstructionSetType['instructionVariants']; + statusCheckConfig: InstructionSetType['statusCheck']; + statusCheckState: keyof typeof StatusCheckStates; + onStatusCheck: () => void; + offset: number; + replaceTemplateStrings: (text: string) => string; + isCloudEnabled: boolean; + intl: InjectedIntl; +} +export declare const InstructionSet: React.FC> & { + WrappedComponent: React.ComponentType; +}; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/introduction.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/introduction.d.ts new file mode 100644 index 0000000000000..95c1f5913f2d7 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial/introduction.d.ts @@ -0,0 +1,20 @@ +import React from 'react'; +import type { IBasePath } from '@kbn/core-http-browser'; +import type { InjectedIntl } from '@kbn/i18n-react'; +import { TutorialsCategory } from '../../../../common/constants'; +export interface IntroductionProps { + description: string; + title: string; + intl: InjectedIntl; + basePath: IBasePath; + previewUrl?: string; + exportedFieldUrl?: string; + iconType?: string; + isBeta?: boolean; + notices?: React.ReactNode; + exportedFieldsUrl?: string; + category?: TutorialsCategory; +} +export declare const Introduction: React.FC> & { + WrappedComponent: React.ComponentType; +}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.d.ts new file mode 100644 index 0000000000000..b05050e828bcc --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.d.ts @@ -0,0 +1 @@ +export declare function replaceTemplateStrings(text: string): string; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/status_check_states.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/status_check_states.d.ts new file mode 100644 index 0000000000000..a5a0c6e22b4ea --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial/status_check_states.d.ts @@ -0,0 +1,5 @@ +export declare const HAS_DATA = "HAS_DATA"; +export declare const FETCHING = "FETCHING"; +export declare const NO_DATA = "NO_DATA"; +export declare const NOT_CHECKED = "NOT_CHECKED"; +export declare const ERROR = "ERROR"; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial/tutorial.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial/tutorial.d.ts new file mode 100644 index 0000000000000..cc269ee10bd70 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial/tutorial.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; +import type { InjectedIntl } from '@kbn/i18n-react'; +import type { TutorialType } from '../../../services/tutorials/types'; +import type { HomeKibanaServices } from '../../kibana_services'; +interface TutorialProps { + addBasePath: HomeKibanaServices['addBasePath']; + isCloudEnabled: boolean; + getTutorial: (id: string) => Promise; + replaceTemplateStrings: (text: string) => string; + tutorialId: string; + intl: InjectedIntl; +} +export declare const Tutorial: React.FC> & { + WrappedComponent: React.ComponentType; +}; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/tutorial_directory.d.ts b/src/platform/plugins/shared/home/public/application/components/tutorial_directory.d.ts new file mode 100644 index 0000000000000..053148ffd53d7 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/tutorial_directory.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import type { InjectedIntl } from '@kbn/i18n-react'; +import type { HomeKibanaServices } from '../kibana_services'; +interface TutorialDirectoryUiProps { + addBasePath: HomeKibanaServices['addBasePath']; + openTab: string; + isCloudEnabled: boolean; + intl: InjectedIntl; +} +export declare const TutorialDirectory: React.FC> & { + WrappedComponent: React.ComponentType; +}; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/components/welcome.d.ts b/src/platform/plugins/shared/home/public/application/components/welcome.d.ts new file mode 100644 index 0000000000000..5c99a830a7db9 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/components/welcome.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; +interface WelcomeProps { + urlBasePath: string; + onSkip: () => void; +} +/** + * Shows a full-screen welcome page that gives helpful quick links to beginners. + */ +export declare const Welcome: React.FC; +export {}; diff --git a/src/platform/plugins/shared/home/public/application/index.d.ts b/src/platform/plugins/shared/home/public/application/index.d.ts new file mode 100644 index 0000000000000..14ee74b26446f --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/index.d.ts @@ -0,0 +1 @@ +export { renderApp } from './application'; diff --git a/src/platform/plugins/shared/home/public/application/kibana_services.d.ts b/src/platform/plugins/shared/home/public/application/kibana_services.d.ts new file mode 100644 index 0000000000000..146305b2d8f84 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/kibana_services.d.ts @@ -0,0 +1,44 @@ +import type { ChromeStart, DocLinksStart, HttpStart, NotificationsSetup, NotificationsStart, OverlayStart, IUiSettingsClient, ApplicationStart, ThemeServiceStart, I18nStart, AppMountParameters } from '@kbn/core/public'; +import type { UiCounterMetricType } from '@kbn/analytics'; +import type { UrlForwardingStart } from '@kbn/url-forwarding-plugin/public'; +import type { DataViewsContract } from '@kbn/data-views-plugin/public'; +import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; +import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; +import type { TutorialService } from '../services/tutorials'; +import type { AddDataService } from '../services/add_data'; +import type { FeatureCatalogueRegistry } from '../services/feature_catalogue'; +import type { EnvironmentService } from '../services/environment'; +import type { ConfigSchema } from '../../server/config'; +import type { WelcomeService } from '../services/welcome'; +export interface HomeKibanaServices { + dataViewsService: DataViewsContract; + kibanaVersion: string; + share: SharePluginSetup; + shareStart: SharePluginStart; + chrome: ChromeStart; + application: ApplicationStart; + uiSettings: IUiSettingsClient; + urlForwarding: UrlForwardingStart; + homeConfig: ConfigSchema; + featureCatalogue: FeatureCatalogueRegistry; + http: HttpStart; + notifications: NotificationsStart; + toastNotifications: NotificationsSetup['toasts']; + banners: OverlayStart['banners']; + trackUiMetric: (type: UiCounterMetricType, eventNames: string | string[], count?: number) => void; + getBasePath: () => string; + docLinks: DocLinksStart; + addBasePath: (url: string) => string; + environmentService: EnvironmentService; + tutorialService: TutorialService; + addDataService: AddDataService; + welcomeService: WelcomeService; + cloud: CloudSetup; + cloudStart: CloudStart; + overlays: OverlayStart; + theme: ThemeServiceStart; + i18nStart: I18nStart; + history: AppMountParameters['history']; +} +export declare function setServices(newServices: HomeKibanaServices): void; +export declare function getServices(): HomeKibanaServices; diff --git a/src/platform/plugins/shared/home/public/application/load_tutorials.d.ts b/src/platform/plugins/shared/home/public/application/load_tutorials.d.ts new file mode 100644 index 0000000000000..3208a0b422884 --- /dev/null +++ b/src/platform/plugins/shared/home/public/application/load_tutorials.d.ts @@ -0,0 +1,3 @@ +import type { TutorialType } from '../services/tutorials/types'; +export declare function getTutorials(): Promise; +export declare function getTutorial(id: string): Promise; diff --git a/src/platform/plugins/shared/home/public/index.d.ts b/src/platform/plugins/shared/home/public/index.d.ts new file mode 100644 index 0000000000000..cb9025762312c --- /dev/null +++ b/src/platform/plugins/shared/home/public/index.d.ts @@ -0,0 +1,7 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +export type { FeatureCatalogueSetup, EnvironmentSetup, TutorialSetup, HomePublicPluginSetup, HomePublicPluginStart, } from './plugin'; +export type { AddDataTab, FeatureCatalogueCategory, FeatureCatalogueEntry, FeatureCatalogueRegistry, FeatureCatalogueSolution, Environment, TutorialVariables, TutorialDirectoryHeaderLinkComponent, TutorialModuleNoticeComponent, WelcomeRenderTelemetryNotice, WelcomeServiceSetup, } from './services'; +export type { CustomComponentProps } from './services/tutorials/tutorial_service'; +export { INSTRUCTION_VARIANT, getDisplayText } from '../common/instruction_variant'; +import { HomePublicPlugin } from './plugin'; +export declare const plugin: (initializerContext: PluginInitializerContext) => HomePublicPlugin; diff --git a/src/platform/plugins/shared/home/public/plugin.d.ts b/src/platform/plugins/shared/home/public/plugin.d.ts new file mode 100644 index 0000000000000..59c3801b250f8 --- /dev/null +++ b/src/platform/plugins/shared/home/public/plugin.d.ts @@ -0,0 +1,60 @@ +import type { AppMountParameters, CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import type { UrlForwardingSetup, UrlForwardingStart } from '@kbn/url-forwarding-plugin/public'; +import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; +import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; +import type { ConfigSchema } from '../server/config'; +import type { EnvironmentServiceSetup, FeatureCatalogueRegistrySetup, TutorialServiceSetup, AddDataServiceSetup, WelcomeServiceSetup } from './services'; +import { FeatureCatalogueRegistry } from './services'; +export interface HomePluginStartDependencies { + dataViews: DataViewsPublicPluginStart; + urlForwarding: UrlForwardingStart; + cloud: CloudStart; + share: SharePluginStart; + history: AppMountParameters['history']; +} +export interface HomePluginSetupDependencies { + cloud: CloudSetup; + share: SharePluginSetup; + usageCollection?: UsageCollectionSetup; + urlForwarding: UrlForwardingSetup; +} +export declare class HomePublicPlugin implements Plugin { + private readonly initializerContext; + private readonly featuresCatalogueRegistry; + private readonly environmentService; + private readonly tutorialService; + private readonly addDataService; + private readonly welcomeService; + constructor(initializerContext: PluginInitializerContext); + setup(core: CoreSetup, { cloud, share, urlForwarding, usageCollection }: HomePluginSetupDependencies): HomePublicPluginSetup; + start({ application: { capabilities } }: CoreStart): { + featureCatalogue: FeatureCatalogueRegistry; + }; +} +/** @public */ +export type FeatureCatalogueSetup = FeatureCatalogueRegistrySetup; +/** @public */ +export type EnvironmentSetup = EnvironmentServiceSetup; +/** @public */ +export type TutorialSetup = TutorialServiceSetup; +/** @public */ +export type AddDataSetup = AddDataServiceSetup; +/** @public */ +export interface HomePublicPluginSetup { + tutorials: TutorialServiceSetup; + addData: AddDataServiceSetup; + featureCatalogue: FeatureCatalogueSetup; + welcomeScreen: WelcomeServiceSetup; + /** + * The environment service is only available for a transition period and will + * be replaced by display specific extension points. + * @deprecated + * @removeBy 8.8.0 + */ + environment: EnvironmentSetup; +} +export interface HomePublicPluginStart { + featureCatalogue: FeatureCatalogueRegistry; +} diff --git a/src/platform/plugins/shared/home/public/services/add_data/add_data_service.d.ts b/src/platform/plugins/shared/home/public/services/add_data/add_data_service.d.ts new file mode 100644 index 0000000000000..99bd53abd379c --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/add_data/add_data_service.d.ts @@ -0,0 +1,31 @@ +/** @public */ +export interface AddDataTab { + id: string; + name: string; + getComponent: () => JSX.Element; +} +/** @public */ +export interface CloudConnectStatusResult { + isCloudConnected: boolean; + isLoading: boolean; +} +/** @public */ +export type CloudConnectStatusHook = () => CloudConnectStatusResult; +export declare class AddDataService { + private addDataTabs; + private cloudConnectStatusHook; + setup(): { + /** + * Registers a component that will be rendered as a new tab in the Add data page + */ + registerAddDataTab: (tab: AddDataTab) => void; + /** + * Registers a hook that returns the cloud connect status. + * Used by the cloud_connect plugin to provide connection status to the home page. + */ + registerCloudConnectStatusHook: (hook: CloudConnectStatusHook) => void; + }; + getAddDataTabs(): AddDataTab[]; + getCloudConnectStatusHook(): CloudConnectStatusHook; +} +export type AddDataServiceSetup = ReturnType; diff --git a/src/platform/plugins/shared/home/public/services/add_data/index.d.ts b/src/platform/plugins/shared/home/public/services/add_data/index.d.ts new file mode 100644 index 0000000000000..3d578c82dd3da --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/add_data/index.d.ts @@ -0,0 +1,2 @@ +export { AddDataService } from './add_data_service'; +export type { AddDataServiceSetup, AddDataTab } from './add_data_service'; diff --git a/src/platform/plugins/shared/home/public/services/environment/environment.d.ts b/src/platform/plugins/shared/home/public/services/environment/environment.d.ts new file mode 100644 index 0000000000000..08f0ef41a2f52 --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/environment/environment.d.ts @@ -0,0 +1,35 @@ +/** @public */ +export interface Environment { + /** + * Flag whether the home app should advertise cloud features + */ + readonly cloud: boolean; + /** + * Flag whether the home app should advertise apm features + */ + readonly apmUi: boolean; + /** + * Flag whether the home app should advertise ml features + */ + readonly ml: boolean; +} +export declare class EnvironmentService { + private environment; + setup(): { + /** + * Update the environment to influence how the home app is presenting available features. + * This API should not be extended for new features and will be removed in future versions + * in favor of display specific extension apis. + * @deprecated + * @removeBy 8.8.0 + * @param update + */ + update: (update: Partial) => void; + }; + getEnvironment(): { + cloud: boolean; + apmUi: boolean; + ml: boolean; + }; +} +export type EnvironmentServiceSetup = ReturnType; diff --git a/src/platform/plugins/shared/home/public/services/environment/index.d.ts b/src/platform/plugins/shared/home/public/services/environment/index.d.ts new file mode 100644 index 0000000000000..a364e8fd3fa0e --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/environment/index.d.ts @@ -0,0 +1,2 @@ +export { EnvironmentService } from './environment'; +export type { Environment, EnvironmentServiceSetup } from './environment'; diff --git a/src/platform/plugins/shared/home/public/services/feature_catalogue/feature_catalogue_registry.d.ts b/src/platform/plugins/shared/home/public/services/feature_catalogue/feature_catalogue_registry.d.ts new file mode 100644 index 0000000000000..6e3fb9dde1c04 --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/feature_catalogue/feature_catalogue_registry.d.ts @@ -0,0 +1,68 @@ +import type { Capabilities } from '@kbn/core/public'; +import type { IconType } from '@elastic/eui'; +import type { Observable } from 'rxjs'; +/** @public */ +export type FeatureCatalogueCategory = 'admin' | 'data' | 'other'; +/** @public */ +export interface FeatureCatalogueEntry { + /** Unique string identifier for this feature. */ + readonly id: string; + /** Title of feature displayed to the user. */ + readonly title: string; + /** {@link FeatureCatalogueCategory} to display this feature in. */ + readonly category: FeatureCatalogueCategory; + /** A tagline of feature displayed to the user. */ + readonly subtitle?: string; + /** One-line description of feature displayed to the user. */ + readonly description: string; + /** EUI `IconType` for icon to be displayed to the user. EUI supports any known EUI icon, SVG URL, or ReactElement. */ + readonly icon: IconType; + /** URL path to link to this future. Should not include the basePath. */ + readonly path: string; + /** Whether or not this link should be shown on the front page of Kibana. */ + readonly showOnHomePage: boolean; + /** An ordinal used to sort features relative to one another for display on the home page */ + readonly order?: number; + /** Optional function to control visibility of this feature. */ + readonly visible?: () => boolean; + /** Unique string identifier of the solution this feature belongs to */ + readonly solutionId?: string; +} +/** @public */ +export interface FeatureCatalogueSolution { + /** Unique string identifier for this solution. */ + readonly id: string; + /** Title of solution displayed to the user. */ + readonly title: string; + /** One-line description of the solution displayed to the user. */ + readonly description: string; + /** EUI `IconType` for icon to be displayed to the user. EUI supports any known EUI icon, SVG URL, or ReactElement. */ + readonly icon: IconType; + /** URL path to link to this future. Should not include the basePath. */ + readonly path: string; + /** An ordinal used to sort solutions relative to one another for display on the home page */ + readonly order: number; + /** Optional function to control visibility of this solution. */ + readonly isVisible?: (capabilities: Capabilities) => boolean; +} +export declare class FeatureCatalogueRegistry { + private capabilities; + private solutions; + private featuresSubject; + setup(): { + register: (feature: FeatureCatalogueEntry) => void; + registerSolution: (solution: FeatureCatalogueSolution) => void; + }; + start({ capabilities }: { + capabilities: Capabilities; + }): void; + /** + * @deprecated + * Use getFeatures$() instead + */ + get(features?: Map): FeatureCatalogueEntry[]; + getFeatures$(): Observable; + getSolutions(): FeatureCatalogueSolution[]; + removeFeature(appId: string): void; +} +export type FeatureCatalogueRegistrySetup = ReturnType; diff --git a/src/platform/plugins/shared/home/public/services/feature_catalogue/index.d.ts b/src/platform/plugins/shared/home/public/services/feature_catalogue/index.d.ts new file mode 100644 index 0000000000000..75e10f7c1ab3b --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/feature_catalogue/index.d.ts @@ -0,0 +1,2 @@ +export { FeatureCatalogueRegistry } from './feature_catalogue_registry'; +export type { FeatureCatalogueCategory, FeatureCatalogueEntry, FeatureCatalogueSolution, FeatureCatalogueRegistrySetup, } from './feature_catalogue_registry'; diff --git a/src/platform/plugins/shared/home/public/services/index.d.ts b/src/platform/plugins/shared/home/public/services/index.d.ts new file mode 100644 index 0000000000000..6187ae5b57a70 --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/index.d.ts @@ -0,0 +1,10 @@ +export { FeatureCatalogueRegistry } from './feature_catalogue'; +export type { FeatureCatalogueCategory, FeatureCatalogueEntry, FeatureCatalogueSolution, FeatureCatalogueRegistrySetup, } from './feature_catalogue'; +export { EnvironmentService } from './environment'; +export type { Environment, EnvironmentServiceSetup } from './environment'; +export { TutorialService } from './tutorials'; +export type { TutorialVariables, TutorialServiceSetup, TutorialDirectoryHeaderLinkComponent, TutorialModuleNoticeComponent, } from './tutorials'; +export { AddDataService } from './add_data'; +export type { AddDataServiceSetup, AddDataTab } from './add_data'; +export { WelcomeService } from './welcome'; +export type { WelcomeServiceSetup, WelcomeRenderTelemetryNotice } from './welcome'; diff --git a/src/platform/plugins/shared/home/public/services/tutorials/index.d.ts b/src/platform/plugins/shared/home/public/services/tutorials/index.d.ts new file mode 100644 index 0000000000000..5c6ae459a24a5 --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/tutorials/index.d.ts @@ -0,0 +1,2 @@ +export { TutorialService } from './tutorial_service'; +export type { TutorialVariables, TutorialServiceSetup, TutorialDirectoryHeaderLinkComponent, TutorialModuleNoticeComponent, } from './tutorial_service'; diff --git a/src/platform/plugins/shared/home/public/services/tutorials/tutorial_service.d.ts b/src/platform/plugins/shared/home/public/services/tutorials/tutorial_service.d.ts new file mode 100644 index 0000000000000..de9a095d0c427 --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/tutorials/tutorial_service.d.ts @@ -0,0 +1,50 @@ +import type React from 'react'; +import type { HomeKibanaServices } from '../../application/kibana_services'; +/** @public */ +export type TutorialVariables = Partial>; +/** @public */ +export type TutorialDirectoryHeaderLinkComponent = React.FC; +/** @public */ +export type TutorialModuleNoticeComponent = React.FC<{ + moduleName: string; +}>; +export type CustomStatusCheckCallback = () => Promise; +export interface CustomComponentProps { + http: HomeKibanaServices['http']; + basePath: string; + isDarkTheme: boolean; + kibanaVersion: string; + variantId: string; + isCloudEnabled: boolean; +} +type CustomComponent = () => Promise>; +export declare class TutorialService { + private tutorialVariables; + private tutorialDirectoryHeaderLinks; + private tutorialModuleNotices; + private customStatusCheck; + private customComponent; + setup(): { + /** + * Set a variable usable in tutorial templates. Access with `{config.}`. + */ + setVariable: (key: string, value: unknown) => void; + /** + * Registers a component that will be rendered next to tutorial directory title/header area. + */ + registerDirectoryHeaderLink: (id: string, component: TutorialDirectoryHeaderLinkComponent) => void; + /** + * Registers a component that will be rendered in the description of a tutorial that is associated with a module. + */ + registerModuleNotice: (id: string, component: TutorialModuleNoticeComponent) => void; + registerCustomStatusCheck: (name: string, fnCallback: CustomStatusCheckCallback) => void; + registerCustomComponent: (name: string, component: CustomComponent) => void; + }; + getVariables(): Partial>; + getDirectoryHeaderLinks(): TutorialDirectoryHeaderLinkComponent[]; + getModuleNotices(): TutorialModuleNoticeComponent[]; + getCustomStatusCheck(customStatusCheckName: string): CustomStatusCheckCallback; + getCustomComponent(customComponentName: string): CustomComponent; +} +export type TutorialServiceSetup = ReturnType; +export {}; diff --git a/src/platform/plugins/shared/home/public/services/tutorials/types.d.ts b/src/platform/plugins/shared/home/public/services/tutorials/types.d.ts new file mode 100644 index 0000000000000..3c17fb0f277dd --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/tutorials/types.d.ts @@ -0,0 +1,7 @@ +import type { TutorialSchema, InstructionSetSchema, StatusCheckSchema, InstructionVariant, Instruction, InstructionsSchema } from '../../../server'; +export type TutorialType = TutorialSchema; +export type InstructionSetType = InstructionSetSchema; +export type InstructionsType = InstructionsSchema; +export type StatusCheckType = StatusCheckSchema; +export type InstructionVariantType = InstructionVariant; +export type InstructionType = Instruction; diff --git a/src/platform/plugins/shared/home/public/services/welcome/index.d.ts b/src/platform/plugins/shared/home/public/services/welcome/index.d.ts new file mode 100644 index 0000000000000..225fe2b7c97cb --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/welcome/index.d.ts @@ -0,0 +1,2 @@ +export type { WelcomeServiceSetup, WelcomeRenderTelemetryNotice } from './welcome_service'; +export { WelcomeService } from './welcome_service'; diff --git a/src/platform/plugins/shared/home/public/services/welcome/welcome_service.d.ts b/src/platform/plugins/shared/home/public/services/welcome/welcome_service.d.ts new file mode 100644 index 0000000000000..6ad9c96f89be5 --- /dev/null +++ b/src/platform/plugins/shared/home/public/services/welcome/welcome_service.d.ts @@ -0,0 +1,19 @@ +export type WelcomeRenderTelemetryNotice = () => null | JSX.Element; +export interface WelcomeServiceSetup { + /** + * Register listeners to be called when the Welcome component is mounted. + * It can be called multiple times to register multiple listeners. + */ + registerOnRendered: (onRendered: () => void) => void; + /** + * Register a renderer of the telemetry notice to be shown below the Welcome page. + */ + registerTelemetryNoticeRenderer: (renderTelemetryNotice: WelcomeRenderTelemetryNotice) => void; +} +export declare class WelcomeService { + private readonly onRenderedHandlers; + private renderTelemetryNoticeHandler?; + setup: () => WelcomeServiceSetup; + onRendered: () => void; + renderTelemetryNotice: () => JSX.Element | null; +} diff --git a/src/platform/plugins/shared/home/server/capabilities_provider.d.ts b/src/platform/plugins/shared/home/server/capabilities_provider.d.ts new file mode 100644 index 0000000000000..ea467c4dbe19f --- /dev/null +++ b/src/platform/plugins/shared/home/server/capabilities_provider.d.ts @@ -0,0 +1,10 @@ +export declare const capabilitiesProvider: () => { + catalogue: { + discover: boolean; + dashboard: boolean; + visualize: boolean; + console: boolean; + advanced_settings: boolean; + indexPatterns: boolean; + }; +}; diff --git a/src/platform/plugins/shared/home/server/config.d.ts b/src/platform/plugins/shared/home/server/config.d.ts new file mode 100644 index 0000000000000..fcf0bdc9c94fb --- /dev/null +++ b/src/platform/plugins/shared/home/server/config.d.ts @@ -0,0 +1,5 @@ +import type { TypeOf } from '@kbn/config-schema'; +export declare const configSchema: import("@kbn/config-schema").ObjectType<{ + disableWelcomeScreen: import("@kbn/config-schema").Type; +}>; +export type ConfigSchema = TypeOf; diff --git a/src/platform/plugins/shared/home/server/index.d.ts b/src/platform/plugins/shared/home/server/index.d.ts new file mode 100644 index 0000000000000..a8b654502bee6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/index.d.ts @@ -0,0 +1,8 @@ +export type { HomeServerPluginSetup, HomeServerPluginStart } from './plugin'; +export { TutorialsCategory } from './services'; +export type { AppLinkData, ArtifactsSchema, TutorialProvider, TutorialSchema, StatusCheckSchema, Instruction, InstructionVariant, InstructionSetSchema, InstructionsSchema, TutorialContext, SampleDatasetProvider, SampleDataRegistrySetup, SampleDatasetDashboardPanel, SampleObject, ScopedTutorialContextFactory, } from './services'; +import type { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server'; +import type { ConfigSchema } from './config'; +export declare const config: PluginConfigDescriptor; +export declare const plugin: (initContext: PluginInitializerContext) => Promise; +export { INSTRUCTION_VARIANT } from '../common/instruction_variant'; diff --git a/src/platform/plugins/shared/home/server/plugin.d.ts b/src/platform/plugins/shared/home/server/plugin.d.ts new file mode 100644 index 0000000000000..452ecb4de4fb9 --- /dev/null +++ b/src/platform/plugins/shared/home/server/plugin.d.ts @@ -0,0 +1,28 @@ +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; +import type { TutorialsRegistrySetup, TutorialsRegistryStart, SampleDataRegistrySetup, SampleDataRegistryStart } from './services'; +export interface HomeServerPluginSetupDependencies { + usageCollection?: UsageCollectionSetup; + customIntegrations?: CustomIntegrationsPluginSetup; +} +export declare class HomeServerPlugin implements Plugin { + private readonly initContext; + private readonly tutorialsRegistry; + private readonly sampleDataRegistry; + private customIntegrations?; + private readonly isDevMode; + constructor(initContext: PluginInitializerContext); + setup(core: CoreSetup, plugins: HomeServerPluginSetupDependencies): HomeServerPluginSetup; + start(core: CoreStart): HomeServerPluginStart; +} +/** @public */ +export interface HomeServerPluginSetup { + tutorials: TutorialsRegistrySetup; + sampleData: SampleDataRegistrySetup; +} +/** @public */ +export interface HomeServerPluginStart { + tutorials: TutorialsRegistryStart; + sampleData: SampleDataRegistryStart; +} diff --git a/src/platform/plugins/shared/home/server/routes/fetch_es_hits_status.d.ts b/src/platform/plugins/shared/home/server/routes/fetch_es_hits_status.d.ts new file mode 100644 index 0000000000000..1fe7b56f213a4 --- /dev/null +++ b/src/platform/plugins/shared/home/server/routes/fetch_es_hits_status.d.ts @@ -0,0 +1,2 @@ +import type { IRouter } from '@kbn/core/server'; +export declare const registerHitsStatusRoute: (router: IRouter) => void; diff --git a/src/platform/plugins/shared/home/server/routes/index.d.ts b/src/platform/plugins/shared/home/server/routes/index.d.ts new file mode 100644 index 0000000000000..595b0535c36a6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/routes/index.d.ts @@ -0,0 +1,2 @@ +import type { IRouter } from '@kbn/core/server'; +export declare const registerRoutes: (router: IRouter) => void; diff --git a/src/platform/plugins/shared/home/server/saved_objects/index.d.ts b/src/platform/plugins/shared/home/server/saved_objects/index.d.ts new file mode 100644 index 0000000000000..7b3073b37b2a8 --- /dev/null +++ b/src/platform/plugins/shared/home/server/saved_objects/index.d.ts @@ -0,0 +1 @@ +export { sampleDataTelemetry } from './sample_data_telemetry'; diff --git a/src/platform/plugins/shared/home/server/saved_objects/sample_data_telemetry.d.ts b/src/platform/plugins/shared/home/server/saved_objects/sample_data_telemetry.d.ts new file mode 100644 index 0000000000000..49ffeae8052cd --- /dev/null +++ b/src/platform/plugins/shared/home/server/saved_objects/sample_data_telemetry.d.ts @@ -0,0 +1,2 @@ +import type { SavedObjectsType } from '@kbn/core/server'; +export declare const sampleDataTelemetry: SavedObjectsType; diff --git a/src/platform/plugins/shared/home/server/services/index.d.ts b/src/platform/plugins/shared/home/server/services/index.d.ts new file mode 100644 index 0000000000000..3be00e7b4b2c9 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/index.d.ts @@ -0,0 +1,5 @@ +export { TutorialsRegistry, TutorialsCategory } from './tutorials'; +export type { TutorialsRegistrySetup, TutorialsRegistryStart } from './tutorials'; +export type { InstructionSetSchema, InstructionsSchema, DashboardSchema, ArtifactsSchema, StatusCheckSchema, InstructionVariant, Instruction, TutorialSchema, TutorialProvider, TutorialContext, TutorialContextFactory, ScopedTutorialContextFactory, } from './tutorials'; +export { SampleDataRegistry } from './sample_data'; +export type { AppLinkData, SampleDataRegistrySetup, SampleDataRegistryStart, SampleDatasetDashboardPanel, SampleDatasetProvider, SampleDatasetSchema, SampleObject, } from './sample_data'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/field_mappings.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/field_mappings.d.ts new file mode 100644 index 0000000000000..9746be9627ade --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/field_mappings.d.ts @@ -0,0 +1,202 @@ +export declare const fieldMappings: { + category: { + type: string; + fields: { + keyword: { + type: string; + }; + }; + }; + currency: { + type: string; + }; + customer_birth_date: { + type: string; + }; + customer_first_name: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + customer_full_name: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + customer_gender: { + type: string; + }; + customer_id: { + type: string; + }; + customer_last_name: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + customer_phone: { + type: string; + }; + day_of_week: { + type: string; + }; + day_of_week_i: { + type: string; + }; + email: { + type: string; + }; + manufacturer: { + type: string; + fields: { + keyword: { + type: string; + }; + }; + }; + order_date: { + type: string; + }; + order_id: { + type: string; + }; + products: { + properties: { + base_price: { + type: string; + }; + discount_percentage: { + type: string; + }; + quantity: { + type: string; + }; + manufacturer: { + type: string; + fields: { + keyword: { + type: string; + }; + }; + }; + tax_amount: { + type: string; + }; + product_id: { + type: string; + }; + category: { + type: string; + fields: { + keyword: { + type: string; + }; + }; + }; + sku: { + type: string; + }; + taxless_price: { + type: string; + }; + unit_discount_amount: { + type: string; + }; + min_price: { + type: string; + }; + _id: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + discount_amount: { + type: string; + }; + created_on: { + type: string; + }; + product_name: { + type: string; + analyzer: string; + fields: { + keyword: { + type: string; + }; + }; + }; + price: { + type: string; + }; + taxful_price: { + type: string; + }; + base_unit_price: { + type: string; + }; + }; + }; + sku: { + type: string; + }; + taxful_total_price: { + type: string; + }; + taxless_total_price: { + type: string; + }; + total_quantity: { + type: string; + }; + total_unique_products: { + type: string; + }; + type: { + type: string; + }; + user: { + type: string; + }; + geoip: { + properties: { + country_iso_code: { + type: string; + }; + location: { + type: string; + }; + region_name: { + type: string; + }; + continent_name: { + type: string; + }; + city_name: { + type: string; + }; + }; + }; + event: { + properties: { + dataset: { + type: string; + }; + }; + }; +}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/index.d.ts new file mode 100644 index 0000000000000..ac80e91fc4fa6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/index.d.ts @@ -0,0 +1,2 @@ +import type { SampleDatasetProvider } from '../../lib/sample_dataset_registry_types'; +export declare const ecommerceSpecProvider: SampleDatasetProvider; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/saved_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/saved_objects.d.ts new file mode 100644 index 0000000000000..ae8dff6cc46e7 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/ecommerce/saved_objects.d.ts @@ -0,0 +1,2 @@ +import type { SavedObject } from '@kbn/core/server'; +export declare const getSavedObjects: () => SavedObject[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/field_mappings.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/field_mappings.d.ts new file mode 100644 index 0000000000000..a48137c4787c6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/field_mappings.d.ts @@ -0,0 +1,83 @@ +export declare const fieldMappings: { + timestamp: { + type: string; + }; + dayOfWeek: { + type: string; + }; + Carrier: { + type: string; + }; + FlightNum: { + type: string; + }; + Origin: { + type: string; + }; + OriginAirportID: { + type: string; + }; + OriginCityName: { + type: string; + }; + OriginRegion: { + type: string; + }; + OriginCountry: { + type: string; + }; + OriginLocation: { + type: string; + }; + Dest: { + type: string; + }; + DestAirportID: { + type: string; + }; + DestCityName: { + type: string; + }; + DestRegion: { + type: string; + }; + DestCountry: { + type: string; + }; + DestLocation: { + type: string; + }; + AvgTicketPrice: { + type: string; + }; + OriginWeather: { + type: string; + }; + DestWeather: { + type: string; + }; + Cancelled: { + type: string; + }; + DistanceMiles: { + type: string; + }; + DistanceKilometers: { + type: string; + }; + FlightDelayMin: { + type: string; + }; + FlightDelay: { + type: string; + }; + FlightDelayType: { + type: string; + }; + FlightTimeMin: { + type: string; + }; + FlightTimeHour: { + type: string; + }; +}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/index.d.ts new file mode 100644 index 0000000000000..1135d354e71f3 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/index.d.ts @@ -0,0 +1,2 @@ +import type { SampleDatasetProvider } from '../../lib/sample_dataset_registry_types'; +export declare const flightsSpecProvider: SampleDatasetProvider; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/saved_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/saved_objects.d.ts new file mode 100644 index 0000000000000..ae8dff6cc46e7 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/flights/saved_objects.d.ts @@ -0,0 +1,2 @@ +import type { SavedObject } from '@kbn/core/server'; +export declare const getSavedObjects: () => SavedObject[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/index.d.ts new file mode 100644 index 0000000000000..f65170eb95de4 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/index.d.ts @@ -0,0 +1,4 @@ +export { flightsSpecProvider } from './flights'; +export { logsSpecProvider } from './logs'; +export { ecommerceSpecProvider } from './ecommerce'; +export { logsTSDBSpecProvider } from './logs_tsdb'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/field_mappings.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/field_mappings.d.ts new file mode 100644 index 0000000000000..3497d39b08843 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/field_mappings.d.ts @@ -0,0 +1,155 @@ +export declare const fieldMappings: { + request: { + type: string; + fields: { + keyword: { + type: string; + time_series_dimension: boolean; + }; + }; + }; + geo: { + properties: { + srcdest: { + type: string; + }; + src: { + type: string; + }; + dest: { + type: string; + }; + coordinates: { + type: string; + }; + }; + }; + utc_time: { + type: string; + }; + url: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + message: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + host: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + clientip: { + type: string; + }; + response: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + machine: { + properties: { + ram: { + type: string; + }; + os: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + }; + }; + agent: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + bytes: { + type: string; + }; + tags: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + referer: { + type: string; + }; + ip: { + type: string; + }; + ip_range: { + type: string; + }; + '@timestamp': { + type: string; + }; + timestamp: { + type: string; + path: string; + }; + timestamp_range: { + type: string; + }; + phpmemory: { + type: string; + }; + bytes_counter: { + type: string; + time_series_metric: string; + }; + bytes_gauge: { + type: string; + time_series_metric: string; + }; + memory: { + type: string; + }; + extension: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + event: { + properties: { + dataset: { + type: string; + }; + }; + }; +}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/index.d.ts new file mode 100644 index 0000000000000..46b3ff12dbe6b --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/index.d.ts @@ -0,0 +1,2 @@ +import type { SampleDatasetProvider } from '../../lib/sample_dataset_registry_types'; +export declare const logsSpecProvider: SampleDatasetProvider; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/saved_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/saved_objects.d.ts new file mode 100644 index 0000000000000..ae8dff6cc46e7 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs/saved_objects.d.ts @@ -0,0 +1,2 @@ +import type { SavedObject } from '@kbn/core/server'; +export declare const getSavedObjects: () => SavedObject[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/field_mappings.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/field_mappings.d.ts new file mode 100644 index 0000000000000..66faa398b22ca --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/field_mappings.d.ts @@ -0,0 +1,141 @@ +export declare const fieldMappings: { + request: { + type: string; + }; + geo: { + properties: { + srcdest: { + type: string; + }; + src: { + type: string; + }; + dest: { + type: string; + }; + coordinates: { + type: string; + }; + }; + }; + utc_time: { + type: string; + }; + url: { + type: string; + }; + message: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + host: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + clientip: { + type: string; + }; + response: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + machine: { + properties: { + ram: { + type: string; + }; + os: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + }; + }; + agent: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + bytes: { + type: string; + }; + tags: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + referer: { + type: string; + }; + ip: { + type: string; + }; + '@timestamp': { + type: string; + }; + timestamp: { + type: string; + path: string; + }; + phpmemory: { + type: string; + }; + bytes_counter: { + type: string; + time_series_metric: string; + }; + bytes_normal_counter: { + type: string; + }; + bytes_gauge: { + type: string; + time_series_metric: string; + }; + memory: { + type: string; + }; + extension: { + type: string; + fields: { + keyword: { + type: string; + ignore_above: number; + }; + }; + }; + event: { + properties: { + dataset: { + type: string; + time_series_dimension: boolean; + }; + }; + }; +}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/index.d.ts new file mode 100644 index 0000000000000..8a78418ac5e92 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/index.d.ts @@ -0,0 +1,3 @@ +import type { SampleDatasetProvider } from '../../lib/sample_dataset_registry_types'; +export declare const GLOBE_ICON_PATH = "/platform/plugins/shared/home/assets/sample_data_resources/logs/icon.svg"; +export declare const logsTSDBSpecProvider: SampleDatasetProvider; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/saved_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/saved_objects.d.ts new file mode 100644 index 0000000000000..ae8dff6cc46e7 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/data_sets/logs_tsdb/saved_objects.d.ts @@ -0,0 +1,2 @@ +import type { SavedObject } from '@kbn/core/server'; +export declare const getSavedObjects: () => SavedObject[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/errors.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/errors.d.ts new file mode 100644 index 0000000000000..bcc7db21bd8a3 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/errors.d.ts @@ -0,0 +1,4 @@ +export declare class SampleDataInstallError extends Error { + readonly httpCode: number; + constructor(message: string, httpCode: number); +} diff --git a/src/platform/plugins/shared/home/server/services/sample_data/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/index.d.ts new file mode 100644 index 0000000000000..bd5c330bdc595 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/index.d.ts @@ -0,0 +1,3 @@ +export { SampleDataRegistry } from './sample_data_registry'; +export type { SampleDataRegistrySetup, SampleDataRegistryStart } from './sample_data_registry'; +export type { AppLinkData, SampleDatasetDashboardPanel, SampleDatasetProvider, SampleDatasetSchema, SampleObject, } from './lib/sample_dataset_registry_types'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/create_index_name.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/create_index_name.d.ts new file mode 100644 index 0000000000000..ba7c611fa8fc7 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/create_index_name.d.ts @@ -0,0 +1 @@ +export declare const createIndexName: (sampleDataSetId: string, dataIndexId: string) => string; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/find_sample_objects.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/find_sample_objects.d.ts new file mode 100644 index 0000000000000..e49fe3fcd06e4 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/find_sample_objects.d.ts @@ -0,0 +1,21 @@ +import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; +export interface FindSampleObjectsParams { + client: SavedObjectsClientContract; + logger: Logger; + objects: SampleObject[]; +} +export interface SampleObject { + type: string; + id: string; +} +export interface FindSampleObjectsResponseObject { + type: string; + id: string; + /** Contains a string if this sample data object was found, or undefined if it was not. */ + foundObjectId: string | undefined; +} +/** + * Given an array of objects in a sample dataset, this function attempts to find if those objects exist in the current space. + * It attempts to find objects with an origin of the sample data (e.g., matching `id` or `originId`). + */ +export declare function findSampleObjects({ client, logger, objects }: FindSampleObjectsParams): Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/insert_data_into_index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/insert_data_into_index.d.ts new file mode 100644 index 0000000000000..8a51e7732283a --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/insert_data_into_index.d.ts @@ -0,0 +1,9 @@ +import type { IScopedClusterClient, Logger } from '@kbn/core/server'; +import type { DataIndexSchema } from './sample_dataset_registry_types'; +export declare const insertDataIntoIndex: ({ dataIndexConfig, logger, esClient, index, nowReference, }: { + dataIndexConfig: DataIndexSchema; + index: string; + nowReference: string; + esClient: IScopedClusterClient; + logger: Logger; +}) => Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/load_data.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/load_data.d.ts new file mode 100644 index 0000000000000..74e187b76ea1d --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/load_data.d.ts @@ -0,0 +1 @@ +export declare function loadData(path: string, bulkInsert: (docs: unknown[]) => Promise): Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/register_with_integrations.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/register_with_integrations.d.ts new file mode 100644 index 0000000000000..cd1376c816e62 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/register_with_integrations.d.ts @@ -0,0 +1,3 @@ +import type { CoreSetup } from '@kbn/core/server'; +import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; +export declare function registerSampleDatasetWithIntegration(customIntegrations: CustomIntegrationsPluginSetup, core: CoreSetup): void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types.d.ts new file mode 100644 index 0000000000000..808a8ab981eae --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_registry_types.d.ts @@ -0,0 +1,56 @@ +import type { IStaticAssets } from '@kbn/core/server'; +import type { SampleDatasetSchema } from './sample_dataset_schema'; +export type { SampleDatasetSchema, DataIndexSchema } from './sample_dataset_schema'; +export declare enum DatasetStatusTypes { + NOT_INSTALLED = "not_installed", + INSTALLED = "installed", + UNKNOWN = "unknown" +} +export interface SampleDatasetDashboardPanel { + sampleDataId: string; + dashboardId: string; + oldEmbeddableId: string; + embeddableId: string; + embeddableType: string; + embeddableConfig: object; +} +export interface SampleDatasetProviderContext { + staticAssets: IStaticAssets; +} +export type SampleDatasetProvider = (context: SampleDatasetProviderContext) => SampleDatasetSchema; +/** This type is used to identify an object in a sample dataset. */ +export interface SampleObject { + /** The type of the sample object. */ + type: string; + /** The ID of the sample object. */ + id: string; +} +/** + * This type is used by consumers to register a new app link for a sample dataset. + */ +export interface AppLinkData { + /** + * The sample object that is used for this app link's path; if the path does not use an object ID, set this to null. + */ + sampleObject: SampleObject | null; + /** + * Function that returns the path for this app link. Note that the `objectId` can be different than the given `sampleObject.id`, depending + * on how the sample data was installed. If the `sampleObject` is null, the `objectId` argument will be an empty string. + */ + getPath: (objectId: string) => string; + /** + * The label for this app link. + */ + label: string; + /** + * The icon for this app link. + */ + icon: string; + /** + * Index of the links (ascending order, smallest will be displayed first). + * Used for ordering in the dropdown. + * + * @remark links without order defined will be displayed last + */ + order?: number; +} diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_schema.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_schema.d.ts new file mode 100644 index 0000000000000..78e55585b1565 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/sample_dataset_schema.d.ts @@ -0,0 +1,46 @@ +import type { Writable } from '@kbn/utility-types'; +import type { TypeOf } from '@kbn/config-schema'; +declare const dataIndexSchema: import("@kbn/config-schema").ObjectType<{ + id: import("@kbn/config-schema").Type; + dataPath: import("@kbn/config-schema").Type; + fields: import("@kbn/config-schema").Type>; + timeFields: import("@kbn/config-schema").Type; + isDataStream: import("@kbn/config-schema").Type; + indexSettings: import("@kbn/config-schema").Type | undefined>; + currentTimeMarker: import("@kbn/config-schema").Type; + preserveDayOfWeekTimeOfDay: import("@kbn/config-schema").Type; +}>; +export type DataIndexSchema = TypeOf; +export declare const sampleDataSchema: import("@kbn/config-schema").ObjectType<{ + id: import("@kbn/config-schema").Type; + name: import("@kbn/config-schema").Type; + description: import("@kbn/config-schema").Type; + previewImagePath: import("@kbn/config-schema").Type; + darkPreviewImagePath: import("@kbn/config-schema").Type; + iconPath: import("@kbn/config-schema").Type; + overviewDashboard: import("@kbn/config-schema").Type; + defaultIndex: import("@kbn/config-schema").Type; + savedObjects: import("@kbn/config-schema").Type[]>; + dataIndices: import("@kbn/config-schema").Type | undefined; + isDataStream?: boolean | undefined; + } & { + fields: Record; + id: string; + dataPath: string; + timeFields: string[]; + currentTimeMarker: string; + preserveDayOfWeekTimeOfDay: boolean; + }>[]>; + status: import("@kbn/config-schema").Type; + statusMsg: import("@kbn/config-schema").Type; +}>; +export type SampleDatasetSchema = Writable>; +export {}; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/translate_timestamp.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/translate_timestamp.d.ts new file mode 100644 index 0000000000000..75079ce55ba25 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/translate_timestamp.d.ts @@ -0,0 +1,3 @@ +export declare function dateToIso8601IgnoringTime(date: Date): string; +export declare function translateTimeRelativeToDifference(source: string, sourceReference: any, targetReference: any): string; +export declare function translateTimeRelativeToWeek(source: string, sourceReference: any, targetReference: any): string; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/lib/utils.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/lib/utils.d.ts new file mode 100644 index 0000000000000..f2ea9e410c414 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/lib/utils.d.ts @@ -0,0 +1,2 @@ +import type { SampleObject } from './sample_dataset_registry_types'; +export declare function getUniqueObjectTypes(objects: SampleObject[]): string[]; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/index.d.ts new file mode 100644 index 0000000000000..4a7585928a6e9 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/routes/index.d.ts @@ -0,0 +1,3 @@ +export { createListRoute } from './list'; +export { createInstallRoute } from './install'; +export { createUninstallRoute } from './uninstall'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/install.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/install.d.ts new file mode 100644 index 0000000000000..7bf530c62d6cf --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/routes/install.d.ts @@ -0,0 +1,5 @@ +import type { IRouter, Logger } from '@kbn/core/server'; +import type { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; +import type { SampleDatasetSchema } from '../lib/sample_dataset_registry_types'; +import type { SampleDataUsageTracker } from '../usage/usage'; +export declare function createInstallRoute(router: IRouter, sampleDatasets: SampleDatasetSchema[], logger: Logger, usageTracker: SampleDataUsageTracker, analytics: AnalyticsServiceSetup): void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/list.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/list.d.ts new file mode 100644 index 0000000000000..58df59f9eed8c --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/routes/list.d.ts @@ -0,0 +1,3 @@ +import type { IRouter, Logger } from '@kbn/core/server'; +import type { AppLinkData, SampleDatasetSchema } from '../lib/sample_dataset_registry_types'; +export declare const createListRoute: (router: IRouter, sampleDatasets: SampleDatasetSchema[], appLinksMap: Map, logger: Logger) => void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/uninstall.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/uninstall.d.ts new file mode 100644 index 0000000000000..3e76a0b02e385 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/routes/uninstall.d.ts @@ -0,0 +1,5 @@ +import type { IRouter, Logger } from '@kbn/core/server'; +import type { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; +import type { SampleDatasetSchema } from '../lib/sample_dataset_registry_types'; +import type { SampleDataUsageTracker } from '../usage/usage'; +export declare function createUninstallRoute(router: IRouter, sampleDatasets: SampleDatasetSchema[], logger: Logger, usageTracker: SampleDataUsageTracker, analytics: AnalyticsServiceSetup): void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/routes/utils.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/routes/utils.d.ts new file mode 100644 index 0000000000000..0799e5fbe6910 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/routes/utils.d.ts @@ -0,0 +1,12 @@ +import type { RequestHandlerContext, Logger } from '@kbn/core/server'; +import type { SampleDatasetSchema } from '../lib/sample_dataset_registry_types'; +import { SampleDataInstaller } from '../sample_data_installer'; +export declare const SAMPLE_DATA_INSTALLED_EVENT = "sample_data_installed"; +export declare const SAMPLE_DATA_UNINSTALLED_EVENT = "sample_data_uninstalled"; +export declare const getSampleDataInstaller: ({ datasetId, context, sampleDatasets, logger, }: { + datasetId: string; + context: RequestHandlerContext; + sampleDatasets: SampleDatasetSchema[]; + logger: Logger; +}) => Promise; +export declare const getSavedObjectsClient: (context: RequestHandlerContext, objectTypes: string[]) => Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/sample_data_installer.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/sample_data_installer.d.ts new file mode 100644 index 0000000000000..4cb1b0a69cecc --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/sample_data_installer.d.ts @@ -0,0 +1,32 @@ +import type { IScopedClusterClient, ISavedObjectsImporter, Logger, SavedObjectsClientContract } from '@kbn/core/server'; +import type { SampleDatasetSchema } from './lib/sample_dataset_registry_types'; +export interface SampleDataInstallerOptions { + esClient: IScopedClusterClient; + soClient: SavedObjectsClientContract; + soImporter: ISavedObjectsImporter; + sampleDatasets: SampleDatasetSchema[]; + logger: Logger; +} +export interface SampleDataInstallResult { + createdDocsPerIndex: Record; + createdSavedObjects: number; +} +/** + * Utility class in charge of installing and uninstalling sample datasets + */ +export declare class SampleDataInstaller { + private readonly esClient; + private readonly soClient; + private readonly soImporter; + private readonly sampleDatasets; + private readonly logger; + constructor({ esClient, soImporter, soClient, sampleDatasets, logger, }: SampleDataInstallerOptions); + install(datasetId: string, installDate?: Date): Promise; + uninstall(datasetId: string): Promise<{ + deletedSavedObjects: number; + }>; + private uninstallDataIndex; + private installDataIndex; + private importSavedObjects; + private deleteSavedObjects; +} diff --git a/src/platform/plugins/shared/home/server/services/sample_data/sample_data_registry.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/sample_data_registry.d.ts new file mode 100644 index 0000000000000..e8bf6675b95a7 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/sample_data_registry.d.ts @@ -0,0 +1,55 @@ +import type { CoreSetup, PluginInitializerContext } from '@kbn/core/server'; +import type { SavedObject } from '@kbn/core/public'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; +import type { SampleDatasetDashboardPanel, AppLinkData } from './lib/sample_dataset_registry_types'; +export declare class SampleDataRegistry { + private readonly initContext; + constructor(initContext: PluginInitializerContext); + private readonly sampleDatasets; + private readonly appLinksMap; + private sampleDataProviderContext?; + private registerSampleDataSet; + setup(core: CoreSetup, usageCollections: UsageCollectionSetup | undefined, customIntegrations?: CustomIntegrationsPluginSetup, isDevMode?: boolean): { + getSampleDatasets: () => import("@kbn/utility-types").Writable[]; + dataIndices: Readonly<{ + indexSettings?: Record | undefined; + isDataStream?: boolean | undefined; + } & { + fields: Record; + id: string; + dataPath: string; + timeFields: string[]; + currentTimeMarker: string; + preserveDayOfWeekTimeOfDay: boolean; + }>[]; + }>>[]; + addSavedObjectsToSampleDataset: (id: string, savedObjects: SavedObject[]) => void; + addAppLinksToSampleDataset: (id: string, appLinks: AppLinkData[]) => void; + replacePanelInSampleDatasetDashboard: ({ sampleDataId, dashboardId, oldEmbeddableId, embeddableId, embeddableType, embeddableConfig, }: SampleDatasetDashboardPanel) => void; + }; + start(): {}; +} +/** @public */ +export type SampleDataRegistrySetup = ReturnType; +/** @public */ +export type SampleDataRegistryStart = ReturnType; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/usage/collector.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/usage/collector.d.ts new file mode 100644 index 0000000000000..7732988b07618 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/usage/collector.d.ts @@ -0,0 +1,2 @@ +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +export declare function makeSampleDataUsageCollector(usageCollection: UsageCollectionSetup, getIndexForType: (type: string) => Promise): void; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/usage/collector_fetch.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/usage/collector_fetch.d.ts new file mode 100644 index 0000000000000..141b0ea989e44 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/usage/collector_fetch.d.ts @@ -0,0 +1,11 @@ +import moment from 'moment'; +import type { CollectorFetchContext } from '@kbn/usage-collection-plugin/server'; +export interface TelemetryResponse { + installed: string[]; + uninstalled: string[]; + last_install_date: moment.Moment | null; + last_install_set: string | null; + last_uninstall_date: moment.Moment | null; + last_uninstall_set: string | null; +} +export declare function fetchProvider(getIndexForType: (type: string) => Promise): ({ esClient }: CollectorFetchContext) => Promise; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/usage/index.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/usage/index.d.ts new file mode 100644 index 0000000000000..bbd37c5dc805c --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/usage/index.d.ts @@ -0,0 +1,2 @@ +export { makeSampleDataUsageCollector } from './collector'; +export { usage } from './usage'; diff --git a/src/platform/plugins/shared/home/server/services/sample_data/usage/usage.d.ts b/src/platform/plugins/shared/home/server/services/sample_data/usage/usage.d.ts new file mode 100644 index 0000000000000..534cfc77dd7cc --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/sample_data/usage/usage.d.ts @@ -0,0 +1,6 @@ +import type { Logger, SavedObjectsServiceStart } from '@kbn/core/server'; +export interface SampleDataUsageTracker { + addInstall(dataSet: string): void; + addUninstall(dataSet: string): void; +} +export declare function usage(savedObjects: Promise, logger: Logger): SampleDataUsageTracker; diff --git a/src/platform/plugins/shared/home/server/services/tutorials/index.d.ts b/src/platform/plugins/shared/home/server/services/tutorials/index.d.ts new file mode 100644 index 0000000000000..2ce75130bc6ad --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/tutorials/index.d.ts @@ -0,0 +1,4 @@ +export { TutorialsRegistry } from './tutorials_registry'; +export type { TutorialsRegistrySetup, TutorialsRegistryStart } from './tutorials_registry'; +export { TutorialsCategory } from './lib/tutorials_registry_types'; +export type { InstructionSetSchema, StatusCheckSchema, InstructionsSchema, InstructionVariant, Instruction, DashboardSchema, ArtifactsSchema, TutorialSchema, TutorialProvider, TutorialContext, TutorialContextFactory, ScopedTutorialContextFactory, } from './lib/tutorials_registry_types'; diff --git a/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.d.ts b/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.d.ts new file mode 100644 index 0000000000000..730697f06509b --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.d.ts @@ -0,0 +1,268 @@ +import type { TypeOf } from '@kbn/config-schema'; +declare const dashboardSchema: import("@kbn/config-schema").ObjectType<{ + id: import("@kbn/config-schema").Type; + isOverview: import("@kbn/config-schema").Type; + linkLabel: import("@kbn/config-schema").ConditionalType; +}>; +export type DashboardSchema = TypeOf; +declare const artifactsSchema: import("@kbn/config-schema").ObjectType<{ + exportedFields: import("@kbn/config-schema").Type | undefined>; + dashboards: import("@kbn/config-schema").Type[]>; + application: import("@kbn/config-schema").Type | undefined>; +}>; +export type ArtifactsSchema = TypeOf; +declare const statusCheckSchema: import("@kbn/config-schema").ObjectType<{ + title: import("@kbn/config-schema").Type; + text: import("@kbn/config-schema").Type; + btnLabel: import("@kbn/config-schema").Type; + success: import("@kbn/config-schema").Type; + error: import("@kbn/config-schema").Type; + esHitsCheck: import("@kbn/config-schema").ObjectType<{ + index: import("@kbn/config-schema").Type; + query: import("@kbn/config-schema").Type>; + }>; +}>; +export type StatusCheckSchema = TypeOf; +declare const instructionSchema: import("@kbn/config-schema").ObjectType<{ + title: import("@kbn/config-schema").Type; + textPre: import("@kbn/config-schema").Type; + commands: import("@kbn/config-schema").Type; + textPost: import("@kbn/config-schema").Type; + customComponentName: import("@kbn/config-schema").Type; +}>; +export type Instruction = TypeOf; +declare const instructionVariantSchema: import("@kbn/config-schema").ObjectType<{ + id: import("@kbn/config-schema").Type; + instructions: import("@kbn/config-schema").Type[]>; + initialSelected: import("@kbn/config-schema").Type; +}>; +export type InstructionVariant = TypeOf; +declare const instructionSetSchema: import("@kbn/config-schema").ObjectType<{ + title: import("@kbn/config-schema").Type; + callOut: import("@kbn/config-schema").Type | undefined>; + instructionVariants: import("@kbn/config-schema").Type[]; + }>[]>; + statusCheck: import("@kbn/config-schema").Type; + index: string | string[]; + }>; + }> | undefined>; +}>; +export type InstructionSetSchema = TypeOf; +declare const instructionsSchema: import("@kbn/config-schema").ObjectType<{ + instructionSets: import("@kbn/config-schema").Type | undefined; + statusCheck?: Readonly<{ + text?: string | undefined; + error?: string | undefined; + title?: string | undefined; + success?: string | undefined; + btnLabel?: string | undefined; + } & { + esHitsCheck: Readonly<{} & { + query: Record; + index: string | string[]; + }>; + }> | undefined; + } & { + instructionVariants: Readonly<{ + initialSelected?: boolean | undefined; + } & { + id: string; + instructions: Readonly<{ + commands?: string[] | undefined; + title?: string | undefined; + textPre?: string | undefined; + textPost?: string | undefined; + customComponentName?: string | undefined; + } & {}>[]; + }>[]; + }>[]>; +}>; +export type InstructionsSchema = TypeOf; +export declare const tutorialSchema: import("@kbn/config-schema").ObjectType<{ + id: import("@kbn/config-schema").Type; + category: import("@kbn/config-schema").Type<"security" | "logging" | "metrics" | "other">; + name: import("@kbn/config-schema").Type; + moduleName: import("@kbn/config-schema").Type; + isBeta: import("@kbn/config-schema").Type; + shortDescription: import("@kbn/config-schema").Type; + euiIconType: import("@kbn/config-schema").Type; + longDescription: import("@kbn/config-schema").Type; + completionTimeMinutes: import("@kbn/config-schema").Type; + previewImagePath: import("@kbn/config-schema").Type; + onPrem: import("@kbn/config-schema").ObjectType<{ + instructionSets: import("@kbn/config-schema").Type | undefined; + statusCheck?: Readonly<{ + text?: string | undefined; + error?: string | undefined; + title?: string | undefined; + success?: string | undefined; + btnLabel?: string | undefined; + } & { + esHitsCheck: Readonly<{} & { + query: Record; + index: string | string[]; + }>; + }> | undefined; + } & { + instructionVariants: Readonly<{ + initialSelected?: boolean | undefined; + } & { + id: string; + instructions: Readonly<{ + commands?: string[] | undefined; + title?: string | undefined; + textPre?: string | undefined; + textPost?: string | undefined; + customComponentName?: string | undefined; + } & {}>[]; + }>[]; + }>[]>; + }>; + elasticCloud: import("@kbn/config-schema").Type | undefined; + statusCheck?: Readonly<{ + text?: string | undefined; + error?: string | undefined; + title?: string | undefined; + success?: string | undefined; + btnLabel?: string | undefined; + } & { + esHitsCheck: Readonly<{} & { + query: Record; + index: string | string[]; + }>; + }> | undefined; + } & { + instructionVariants: Readonly<{ + initialSelected?: boolean | undefined; + } & { + id: string; + instructions: Readonly<{ + commands?: string[] | undefined; + title?: string | undefined; + textPre?: string | undefined; + textPost?: string | undefined; + customComponentName?: string | undefined; + } & {}>[]; + }>[]; + }>[]; + }> | undefined>; + onPremElasticCloud: import("@kbn/config-schema").Type | undefined; + statusCheck?: Readonly<{ + text?: string | undefined; + error?: string | undefined; + title?: string | undefined; + success?: string | undefined; + btnLabel?: string | undefined; + } & { + esHitsCheck: Readonly<{} & { + query: Record; + index: string | string[]; + }>; + }> | undefined; + } & { + instructionVariants: Readonly<{ + initialSelected?: boolean | undefined; + } & { + id: string; + instructions: Readonly<{ + commands?: string[] | undefined; + title?: string | undefined; + textPre?: string | undefined; + textPost?: string | undefined; + customComponentName?: string | undefined; + } & {}>[]; + }>[]; + }>[]; + }> | undefined>; + artifacts: import("@kbn/config-schema").Type | undefined; + exportedFields?: Readonly<{} & { + documentationUrl: string; + }> | undefined; + } & { + dashboards: Readonly<{ + linkLabel?: string | undefined; + } & { + id: string; + isOverview: boolean; + }>[]; + }> | undefined>; + omitServerless: import("@kbn/config-schema").Type; + customStatusCheckName: import("@kbn/config-schema").Type; + integrationBrowserCategories: import("@kbn/config-schema").Type; + eprPackageOverlap: import("@kbn/config-schema").Type; +}>; +export type TutorialSchema = TypeOf; +export {}; diff --git a/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorials_registry_types.d.ts b/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorials_registry_types.d.ts new file mode 100644 index 0000000000000..ea3207638eea6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorials_registry_types.d.ts @@ -0,0 +1,16 @@ +import type { KibanaRequest, IStaticAssets } from '@kbn/core/server'; +import type { TutorialSchema } from './tutorial_schema'; +export { TutorialsCategory } from '../../../../common/constants'; +export type { TutorialSchema, ArtifactsSchema, DashboardSchema, InstructionsSchema, StatusCheckSchema, InstructionSetSchema, InstructionVariant, Instruction, } from './tutorial_schema'; +export type Platform = 'WINDOWS' | 'OSX' | 'DEB' | 'RPM'; +export interface TutorialContext { + kibanaBranch: string; + staticAssets: IStaticAssets; + isServerless?: boolean; + [key: string]: unknown; +} +export type TutorialProvider = (context: TutorialContext) => TutorialSchema; +export type TutorialContextFactory = (req: KibanaRequest) => { + [key: string]: unknown; +}; +export type ScopedTutorialContextFactory = (...args: any[]) => any; diff --git a/src/platform/plugins/shared/home/server/services/tutorials/tutorials_registry.d.ts b/src/platform/plugins/shared/home/server/services/tutorials/tutorials_registry.d.ts new file mode 100644 index 0000000000000..be85dbc55ef59 --- /dev/null +++ b/src/platform/plugins/shared/home/server/services/tutorials/tutorials_registry.d.ts @@ -0,0 +1,22 @@ +import type { CoreSetup, CoreStart, PluginInitializerContext } from '@kbn/core/server'; +import type { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; +import type { TutorialProvider, ScopedTutorialContextFactory } from './lib/tutorials_registry_types'; +export declare class TutorialsRegistry { + private readonly initContext; + private tutorialProviders; + private readonly scopedTutorialContextFactories; + private staticAssets; + private readonly isServerless; + constructor(initContext: PluginInitializerContext); + setup(core: CoreSetup, customIntegrations?: CustomIntegrationsPluginSetup): { + registerTutorial: (specProvider: TutorialProvider) => void; + unregisterTutorial: (specProvider: TutorialProvider) => void; + addScopedTutorialContextFactory: (scopedTutorialContextFactory: ScopedTutorialContextFactory) => void; + }; + start(core: CoreStart, customIntegrations?: CustomIntegrationsPluginSetup): {}; + private get baseTutorialContext(); +} +/** @public */ +export type TutorialsRegistrySetup = ReturnType; +/** @public */ +export type TutorialsRegistryStart = ReturnType; diff --git a/src/platform/plugins/shared/home/server/tutorials/activemq_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/activemq_logs/index.d.ts new file mode 100644 index 0000000000000..8e2b69cd91cff --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/activemq_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function activemqLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/activemq_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/activemq_metrics/index.d.ts new file mode 100644 index 0000000000000..ffb3d05c37069 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/activemq_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function activemqMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/aerospike_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/aerospike_metrics/index.d.ts new file mode 100644 index 0000000000000..dce2e0b1aab0b --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/aerospike_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function aerospikeMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/apache_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/apache_logs/index.d.ts new file mode 100644 index 0000000000000..b60dbe914fdc6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/apache_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function apacheLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/apache_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/apache_metrics/index.d.ts new file mode 100644 index 0000000000000..d653b4e4076f6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/apache_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function apacheMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/auditbeat/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/auditbeat/index.d.ts new file mode 100644 index 0000000000000..c8b9bc42ca7e9 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/auditbeat/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function auditbeatSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/auditd_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/auditd_logs/index.d.ts new file mode 100644 index 0000000000000..3a88d473fcd21 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/auditd_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function auditdLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/aws_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/aws_logs/index.d.ts new file mode 100644 index 0000000000000..f291fa9722f0a --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/aws_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function awsLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/aws_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/aws_metrics/index.d.ts new file mode 100644 index 0000000000000..f2dd900b3b023 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/aws_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function awsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/azure_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/azure_logs/index.d.ts new file mode 100644 index 0000000000000..d66ec6ac20830 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/azure_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function azureLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/azure_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/azure_metrics/index.d.ts new file mode 100644 index 0000000000000..434307a7fb7a7 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/azure_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function azureMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/barracuda_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/barracuda_logs/index.d.ts new file mode 100644 index 0000000000000..26d6c6d80b10c --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/barracuda_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function barracudaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/bluecoat_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/bluecoat_logs/index.d.ts new file mode 100644 index 0000000000000..a028cdc9bdf6d --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/bluecoat_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function bluecoatLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/cef_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/cef_logs/index.d.ts new file mode 100644 index 0000000000000..b6c2b1973dcdf --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/cef_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function cefLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/ceph_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/ceph_metrics/index.d.ts new file mode 100644 index 0000000000000..81eb671d58259 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/ceph_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function cephMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/checkpoint_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/checkpoint_logs/index.d.ts new file mode 100644 index 0000000000000..b5b56256f538e --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/checkpoint_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function checkpointLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/cisco_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/cisco_logs/index.d.ts new file mode 100644 index 0000000000000..b172875778ff3 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/cisco_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function ciscoLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/cockroachdb_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/cockroachdb_metrics/index.d.ts new file mode 100644 index 0000000000000..3e62d26993dc0 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/cockroachdb_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function cockroachdbMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/consul_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/consul_metrics/index.d.ts new file mode 100644 index 0000000000000..106b818ca0b90 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/consul_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function consulMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/coredns_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/coredns_logs/index.d.ts new file mode 100644 index 0000000000000..1c593970cd8d5 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/coredns_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function corednsLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/coredns_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/coredns_metrics/index.d.ts new file mode 100644 index 0000000000000..b673952085ab5 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/coredns_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function corednsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/couchbase_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/couchbase_metrics/index.d.ts new file mode 100644 index 0000000000000..56911d4e624a6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/couchbase_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function couchbaseMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/couchdb_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/couchdb_metrics/index.d.ts new file mode 100644 index 0000000000000..a5b34df7749fc --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/couchdb_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function couchdbMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/crowdstrike_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/crowdstrike_logs/index.d.ts new file mode 100644 index 0000000000000..425a978f59b19 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/crowdstrike_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function crowdstrikeLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/cylance_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/cylance_logs/index.d.ts new file mode 100644 index 0000000000000..380d5c88d733a --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/cylance_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function cylanceLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/docker_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/docker_metrics/index.d.ts new file mode 100644 index 0000000000000..ff25bf6c077a9 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/docker_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function dockerMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/dropwizard_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/dropwizard_metrics/index.d.ts new file mode 100644 index 0000000000000..a4ffc1f71e3f6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/dropwizard_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function dropwizardMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/elasticsearch_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/elasticsearch_logs/index.d.ts new file mode 100644 index 0000000000000..dabfa142bcae6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/elasticsearch_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function elasticsearchLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/elasticsearch_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/elasticsearch_metrics/index.d.ts new file mode 100644 index 0000000000000..a78a97e2c7489 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/elasticsearch_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function elasticsearchMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/envoyproxy_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/envoyproxy_logs/index.d.ts new file mode 100644 index 0000000000000..77b3f5d12df5f --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/envoyproxy_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function envoyproxyLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/envoyproxy_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/envoyproxy_metrics/index.d.ts new file mode 100644 index 0000000000000..16272ca64d6c6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/envoyproxy_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function envoyproxyMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/etcd_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/etcd_metrics/index.d.ts new file mode 100644 index 0000000000000..d0ff3b81e4081 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/etcd_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function etcdMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/f5_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/f5_logs/index.d.ts new file mode 100644 index 0000000000000..c177bda276022 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/f5_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function f5LogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/fortinet_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/fortinet_logs/index.d.ts new file mode 100644 index 0000000000000..128abd848b9f6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/fortinet_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function fortinetLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/gcp_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/gcp_logs/index.d.ts new file mode 100644 index 0000000000000..f5f67299047f6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/gcp_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function gcpLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/gcp_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/gcp_metrics/index.d.ts new file mode 100644 index 0000000000000..11f752d4c203d --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/gcp_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function gcpMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/golang_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/golang_metrics/index.d.ts new file mode 100644 index 0000000000000..7c921db173f09 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/golang_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function golangMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/gsuite_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/gsuite_logs/index.d.ts new file mode 100644 index 0000000000000..fdd5b6acf259b --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/gsuite_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function gsuiteLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/haproxy_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/haproxy_logs/index.d.ts new file mode 100644 index 0000000000000..d927b910b4d96 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/haproxy_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function haproxyLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/haproxy_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/haproxy_metrics/index.d.ts new file mode 100644 index 0000000000000..3b1face1f41b9 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/haproxy_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function haproxyMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/ibmmq_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/ibmmq_logs/index.d.ts new file mode 100644 index 0000000000000..2bcb85ffa891e --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/ibmmq_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function ibmmqLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/ibmmq_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/ibmmq_metrics/index.d.ts new file mode 100644 index 0000000000000..073069bd6120e --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/ibmmq_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function ibmmqMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/icinga_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/icinga_logs/index.d.ts new file mode 100644 index 0000000000000..347115de50919 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/icinga_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function icingaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/iis_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/iis_logs/index.d.ts new file mode 100644 index 0000000000000..071362401c45b --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/iis_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function iisLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/iis_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/iis_metrics/index.d.ts new file mode 100644 index 0000000000000..0656a3fe71057 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/iis_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function iisMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/imperva_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/imperva_logs/index.d.ts new file mode 100644 index 0000000000000..d8474c55d945a --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/imperva_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function impervaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/infoblox_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/infoblox_logs/index.d.ts new file mode 100644 index 0000000000000..607a222231bc1 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/infoblox_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function infobloxLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/auditbeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/auditbeat_instructions.d.ts new file mode 100644 index 0000000000000..fdbab1424fbfb --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/instructions/auditbeat_instructions.d.ts @@ -0,0 +1,246 @@ +import type { Platform, TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare const createAuditbeatInstructions: (context: TutorialContext) => { + INSTALL: { + OSX: { + title: string; + textPre: string; + commands: string[]; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; + START: { + OSX: { + title: string; + textPre: string; + commands: string[]; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + }; + }; + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare const createAuditbeatCloudInstructions: () => { + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare const createAuditbeatCloudInstructionsServerless: () => { + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare function auditbeatStatusCheck(): { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'agent.type': string; + }; + }; + }; + }; + }; +}; +export declare function onPremInstructions(platforms: readonly Platform[], context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + commands: string[]; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'agent.type': string; + }; + }; + }; + }; + }; + }; + }[]; +}; +export declare function onPremCloudInstructions(platforms: readonly Platform[], context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'agent.type': string; + }; + }; + }; + }; + }; + }; + }[]; +}; +export declare function cloudInstructions(platforms: readonly Platform[], context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + commands: string[]; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'agent.type': string; + }; + }; + }; + }; + }; + }; + }[]; +}; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/cloud_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/cloud_instructions.d.ts new file mode 100644 index 0000000000000..0bcd214cc4174 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/instructions/cloud_instructions.d.ts @@ -0,0 +1,2 @@ +export declare const cloudPasswordAndResetLink: () => string; +export declare const cloudServerlessApiKeyNote: () => string; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/filebeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/filebeat_instructions.d.ts new file mode 100644 index 0000000000000..c68007a3e28f6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/instructions/filebeat_instructions.d.ts @@ -0,0 +1,282 @@ +import type { Platform, TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare const createFilebeatInstructions: (context: TutorialContext) => { + INSTALL: { + OSX: { + title: string; + textPre: string; + commands: string[]; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; + START: { + OSX: { + title: string; + textPre: string; + commands: string[]; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + }; + }; + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare const createFilebeatCloudInstructions: () => { + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare const createFilebeatCloudInstructionsServerless: () => { + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare function filebeatEnableInstructions(moduleName: string): { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; +}; +export declare function filebeatStatusCheck(moduleName: string): { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'event.module': string; + }; + }; + }; + }; + }; +}; +export declare function onPremInstructions(moduleName: string, platforms: readonly Platform[] | undefined, context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: ({ + title: string; + commands: string[]; + textPost: string; + } | { + title: string; + textPre: string; + commands: string[]; + })[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'event.module': string; + }; + }; + }; + }; + }; + }; + }[]; +}; +export declare function onPremCloudInstructions(moduleName: string, platforms: readonly Platform[] | undefined, context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: ({ + title: string; + textPre: string; + } | { + title: string; + commands: string[]; + textPost: string; + })[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'event.module': string; + }; + }; + }; + }; + }; + }; + }[]; +}; +export declare function cloudInstructions(moduleName: string, platforms: readonly Platform[] | undefined, context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: ({ + title: string; + commands: string[]; + textPost: string; + } | { + title: string; + textPre: string; + commands: string[]; + })[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'event.module': string; + }; + }; + }; + }; + }; + }; + }[]; +}; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/get_space_id_for_beats_tutorial.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/get_space_id_for_beats_tutorial.d.ts new file mode 100644 index 0000000000000..222f262512f42 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/instructions/get_space_id_for_beats_tutorial.d.ts @@ -0,0 +1,8 @@ +import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; +/** + * Returns valid configuration for a beat.yml file for adding the space id + * if there is an active space and that space is not the default one. + * + * @param {object} context - Context object generated from tutorial factory (see #22760) + */ +export declare function getSpaceIdForBeatsTutorial(context?: TutorialContext): string; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/heartbeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/heartbeat_instructions.d.ts new file mode 100644 index 0000000000000..971e13aecf455 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/instructions/heartbeat_instructions.d.ts @@ -0,0 +1,273 @@ +import type { Platform, TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare const createHeartbeatInstructions: (context: TutorialContext) => { + INSTALL: { + OSX: { + title: string; + textPre: string; + commands: string[]; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + }; + }; + START: { + OSX: { + title: string; + textPre: string; + commands: string[]; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + }; + }; + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare const createHeartbeatCloudInstructions: () => { + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare const createHeartbeatCloudInstructionsServerless: () => { + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare function heartbeatEnableInstructionsOnPrem(): { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; +}; +export declare function heartbeatEnableInstructionsCloud(): { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; +}; +export declare function heartbeatStatusCheck(): { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + match_all: {}; + }; + }; +}; +export declare function onPremInstructions(platforms: Platform[], context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + commands: string[]; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + match_all: {}; + }; + }; + }; + }[]; +}; +export declare function onPremCloudInstructions(context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + match_all: {}; + }; + }; + }; + }[]; +}; +export declare function cloudInstructions(context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + commands: string[]; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + match_all: {}; + }; + }; + }; + }[]; +}; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/metricbeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/metricbeat_instructions.d.ts new file mode 100644 index 0000000000000..700f1d250c2d4 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/instructions/metricbeat_instructions.d.ts @@ -0,0 +1,282 @@ +import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare const createMetricbeatInstructions: ((context: TutorialContext) => { + INSTALL: { + OSX: { + title: string; + textPre: string; + commands: string[]; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; + START: { + OSX: { + title: string; + textPre: string; + commands: string[]; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + }; + }; + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}) & import("lodash").MemoizedFunction; +export declare const createMetricbeatCloudInstructions: (() => { + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}) & import("lodash").MemoizedFunction; +export declare const createMetricbeatCloudInstructionsServerless: () => { + CONFIG: { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare function metricbeatEnableInstructions(moduleName: string): { + OSX: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + DEB: { + title: string; + commands: string[]; + textPost: string; + }; + RPM: { + title: string; + commands: string[]; + textPost: string; + }; + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; +}; +export declare function metricbeatStatusCheck(moduleName: string): { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'event.module': string; + }; + }; + }; + }; + }; +}; +export declare function onPremInstructions(moduleName: string, context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: ({ + title: string; + textPre: string; + commands: string[]; + } | { + title: string; + commands: string[]; + textPost: string; + })[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'event.module': string; + }; + }; + }; + }; + }; + }; + }[]; +}; +export declare function onPremCloudInstructions(moduleName: string, context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: ({ + title: string; + textPre: string; + } | { + title: string; + commands: string[]; + textPost: string; + })[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'event.module': string; + }; + }; + }; + }; + }; + }; + }[]; +}; +export declare function cloudInstructions(moduleName: string, context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: ({ + title: string; + textPre: string; + commands: string[]; + } | { + title: string; + commands: string[]; + textPost: string; + })[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'event.module': string; + }; + }; + }; + }; + }; + }; + }[]; +}; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/onprem_cloud_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/onprem_cloud_instructions.d.ts new file mode 100644 index 0000000000000..ae3f5bd1ef6d2 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/instructions/onprem_cloud_instructions.d.ts @@ -0,0 +1,8 @@ +export declare const createTrycloudOption1: (() => { + title: string; + textPre: string; +}) & import("lodash").MemoizedFunction; +export declare const createTrycloudOption2: (() => { + title: string; + textPre: string; +}) & import("lodash").MemoizedFunction; diff --git a/src/platform/plugins/shared/home/server/tutorials/instructions/winlogbeat_instructions.d.ts b/src/platform/plugins/shared/home/server/tutorials/instructions/winlogbeat_instructions.d.ts new file mode 100644 index 0000000000000..a81100cc51605 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/instructions/winlogbeat_instructions.d.ts @@ -0,0 +1,160 @@ +import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare const createWinlogbeatInstructions: (context: TutorialContext) => { + INSTALL: { + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; + START: { + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + }; + }; + CONFIG: { + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare const createWinlogbeatCloudInstructions: () => { + CONFIG: { + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare const createWinlogbeatCloudInstructionsServerless: () => { + CONFIG: { + WINDOWS: { + title: string; + textPre: string; + commands: string[]; + textPost: string; + }; + }; +}; +export declare function winlogbeatStatusCheck(): { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'agent.type': string; + }; + }; + }; + }; + }; +}; +export declare function onPremInstructions(context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + commands: string[]; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'agent.type': string; + }; + }; + }; + }; + }; + }; + }[]; +}; +export declare function onPremCloudInstructions(context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'agent.type': string; + }; + }; + }; + }; + }; + }; + }[]; +}; +export declare function cloudInstructions(context: TutorialContext): { + instructionSets: { + title: string; + instructionVariants: { + id: string; + instructions: { + title: string; + textPre: string; + commands: string[]; + }[]; + }[]; + statusCheck: { + title: string; + text: string; + btnLabel: string; + success: string; + error: string; + esHitsCheck: { + index: string; + query: { + bool: { + filter: { + term: { + 'agent.type': string; + }; + }; + }; + }; + }; + }; + }[]; +}; diff --git a/src/platform/plugins/shared/home/server/tutorials/iptables_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/iptables_logs/index.d.ts new file mode 100644 index 0000000000000..26ea6b5a75f1f --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/iptables_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function iptablesLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/juniper_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/juniper_logs/index.d.ts new file mode 100644 index 0000000000000..bb466be014d76 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/juniper_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function juniperLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kafka_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kafka_logs/index.d.ts new file mode 100644 index 0000000000000..4b9b792070808 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/kafka_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function kafkaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kafka_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kafka_metrics/index.d.ts new file mode 100644 index 0000000000000..14613b10c2a55 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/kafka_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function kafkaMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kibana_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kibana_logs/index.d.ts new file mode 100644 index 0000000000000..a94ae30ae90a9 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/kibana_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function kibanaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kibana_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kibana_metrics/index.d.ts new file mode 100644 index 0000000000000..9ef4440bd34b3 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/kibana_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function kibanaMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/kubernetes_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/kubernetes_metrics/index.d.ts new file mode 100644 index 0000000000000..2f6735c7c95db --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/kubernetes_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function kubernetesMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/logstash_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/logstash_logs/index.d.ts new file mode 100644 index 0000000000000..99a12848ea766 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/logstash_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function logstashLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/logstash_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/logstash_metrics/index.d.ts new file mode 100644 index 0000000000000..70e4dd65eeb6e --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/logstash_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function logstashMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/memcached_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/memcached_metrics/index.d.ts new file mode 100644 index 0000000000000..324f8babd3ad4 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/memcached_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function memcachedMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/microsoft_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/microsoft_logs/index.d.ts new file mode 100644 index 0000000000000..4d60b1b5964bd --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/microsoft_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function microsoftLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/misp_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/misp_logs/index.d.ts new file mode 100644 index 0000000000000..eec1cb3dd33fc --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/misp_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function mispLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mongodb_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mongodb_logs/index.d.ts new file mode 100644 index 0000000000000..73a74b7c9b3be --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/mongodb_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function mongodbLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mongodb_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mongodb_metrics/index.d.ts new file mode 100644 index 0000000000000..f95e5d21fe0f2 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/mongodb_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function mongodbMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mssql_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mssql_logs/index.d.ts new file mode 100644 index 0000000000000..c33a9ee23ab0d --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/mssql_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function mssqlLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mssql_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mssql_metrics/index.d.ts new file mode 100644 index 0000000000000..bfb2e98785911 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/mssql_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function mssqlMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/munin_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/munin_metrics/index.d.ts new file mode 100644 index 0000000000000..7e0ba9380b5cb --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/munin_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function muninMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mysql_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mysql_logs/index.d.ts new file mode 100644 index 0000000000000..de8b017f67e2e --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/mysql_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function mysqlLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/mysql_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/mysql_metrics/index.d.ts new file mode 100644 index 0000000000000..bee74bc7ba92c --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/mysql_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function mysqlMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/nats_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/nats_logs/index.d.ts new file mode 100644 index 0000000000000..84b6fc96a1236 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/nats_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function natsLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/nats_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/nats_metrics/index.d.ts new file mode 100644 index 0000000000000..475bc568354b2 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/nats_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function natsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/netflow_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/netflow_logs/index.d.ts new file mode 100644 index 0000000000000..4f96cdcd9bd8a --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/netflow_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function netflowLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/netscout_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/netscout_logs/index.d.ts new file mode 100644 index 0000000000000..664cc5ea3bcd1 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/netscout_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function netscoutLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/nginx_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/nginx_logs/index.d.ts new file mode 100644 index 0000000000000..95bddedda0c97 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/nginx_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function nginxLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/nginx_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/nginx_metrics/index.d.ts new file mode 100644 index 0000000000000..52c378f14760a --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/nginx_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function nginxMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/o365_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/o365_logs/index.d.ts new file mode 100644 index 0000000000000..22487e18440e2 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/o365_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function o365LogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/okta_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/okta_logs/index.d.ts new file mode 100644 index 0000000000000..4ce1125d0a070 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/okta_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function oktaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/openmetrics_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/openmetrics_metrics/index.d.ts new file mode 100644 index 0000000000000..ffb2886fbdc27 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/openmetrics_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function openmetricsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/oracle_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/oracle_metrics/index.d.ts new file mode 100644 index 0000000000000..82af102eed83f --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/oracle_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function oracleMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/osquery_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/osquery_logs/index.d.ts new file mode 100644 index 0000000000000..a95d06c1c744d --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/osquery_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function osqueryLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/panw_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/panw_logs/index.d.ts new file mode 100644 index 0000000000000..f206acb4a0986 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/panw_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function panwLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/php_fpm_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/php_fpm_metrics/index.d.ts new file mode 100644 index 0000000000000..1bdee2e2c8f80 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/php_fpm_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function phpfpmMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/postgresql_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/postgresql_logs/index.d.ts new file mode 100644 index 0000000000000..dc0ca5df44604 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/postgresql_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function postgresqlLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/postgresql_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/postgresql_metrics/index.d.ts new file mode 100644 index 0000000000000..644057f691dbd --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/postgresql_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function postgresqlMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/prometheus_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/prometheus_metrics/index.d.ts new file mode 100644 index 0000000000000..97d0884bf65c5 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/prometheus_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function prometheusMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/rabbitmq_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/rabbitmq_logs/index.d.ts new file mode 100644 index 0000000000000..0b5b8fc8b4a06 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/rabbitmq_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function rabbitmqLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/rabbitmq_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/rabbitmq_metrics/index.d.ts new file mode 100644 index 0000000000000..98cd538a05f1f --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/rabbitmq_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function rabbitmqMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/radware_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/radware_logs/index.d.ts new file mode 100644 index 0000000000000..6f16c96fde36a --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/radware_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function radwareLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/redis_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/redis_logs/index.d.ts new file mode 100644 index 0000000000000..ac05f6fdf8720 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/redis_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function redisLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/redis_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/redis_metrics/index.d.ts new file mode 100644 index 0000000000000..af0e7eb9013f1 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/redis_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function redisMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/redisenterprise_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/redisenterprise_metrics/index.d.ts new file mode 100644 index 0000000000000..14aad4cc84662 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/redisenterprise_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function redisenterpriseMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/register.d.ts b/src/platform/plugins/shared/home/server/tutorials/register.d.ts new file mode 100644 index 0000000000000..64afaffb4d99d --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/register.d.ts @@ -0,0 +1,2 @@ +import { systemLogsSpecProvider } from './system_logs'; +export declare const builtInTutorials: (typeof systemLogsSpecProvider)[]; diff --git a/src/platform/plugins/shared/home/server/tutorials/santa_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/santa_logs/index.d.ts new file mode 100644 index 0000000000000..ed3e94b8237c4 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/santa_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function santaLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/sonicwall_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/sonicwall_logs/index.d.ts new file mode 100644 index 0000000000000..3b2150703b419 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/sonicwall_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function sonicwallLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/sophos_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/sophos_logs/index.d.ts new file mode 100644 index 0000000000000..95e3d149ef568 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/sophos_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function sophosLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/stan_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/stan_metrics/index.d.ts new file mode 100644 index 0000000000000..1912baa258d25 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/stan_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function stanMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/statsd_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/statsd_metrics/index.d.ts new file mode 100644 index 0000000000000..20b3963bc0ac6 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/statsd_metrics/index.d.ts @@ -0,0 +1,3 @@ +import type { TutorialSchema } from '../../services/tutorials'; +import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function statsdMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/suricata_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/suricata_logs/index.d.ts new file mode 100644 index 0000000000000..b874a7fc4c265 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/suricata_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function suricataLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/system_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/system_logs/index.d.ts new file mode 100644 index 0000000000000..7ded169860802 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/system_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function systemLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/system_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/system_metrics/index.d.ts new file mode 100644 index 0000000000000..0e3edb0d980a9 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/system_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function systemMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/tomcat_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/tomcat_logs/index.d.ts new file mode 100644 index 0000000000000..9d841e73cad93 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/tomcat_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function tomcatLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/traefik_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/traefik_logs/index.d.ts new file mode 100644 index 0000000000000..5065d67f99b33 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/traefik_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function traefikLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/traefik_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/traefik_metrics/index.d.ts new file mode 100644 index 0000000000000..95bfab8584868 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/traefik_metrics/index.d.ts @@ -0,0 +1,3 @@ +import type { TutorialSchema } from '../../services/tutorials'; +import type { TutorialContext } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function traefikMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/uptime_monitors/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/uptime_monitors/index.d.ts new file mode 100644 index 0000000000000..d768ceefd8693 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/uptime_monitors/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function uptimeMonitorsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/uwsgi_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/uwsgi_metrics/index.d.ts new file mode 100644 index 0000000000000..77869eb7481a1 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/uwsgi_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function uwsgiMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/vsphere_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/vsphere_metrics/index.d.ts new file mode 100644 index 0000000000000..90f47d0e01728 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/vsphere_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function vSphereMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/windows_event_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/windows_event_logs/index.d.ts new file mode 100644 index 0000000000000..6607a07e1038a --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/windows_event_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function windowsEventLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/windows_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/windows_metrics/index.d.ts new file mode 100644 index 0000000000000..14b17bb3d8d74 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/windows_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function windowsMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/zeek_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/zeek_logs/index.d.ts new file mode 100644 index 0000000000000..10e897982964f --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/zeek_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function zeekLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/zookeeper_metrics/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/zookeeper_metrics/index.d.ts new file mode 100644 index 0000000000000..248533640d33d --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/zookeeper_metrics/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function zookeeperMetricsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/home/server/tutorials/zscaler_logs/index.d.ts b/src/platform/plugins/shared/home/server/tutorials/zscaler_logs/index.d.ts new file mode 100644 index 0000000000000..331dbdd2bb3b7 --- /dev/null +++ b/src/platform/plugins/shared/home/server/tutorials/zscaler_logs/index.d.ts @@ -0,0 +1,2 @@ +import type { TutorialContext, TutorialSchema } from '../../services/tutorials/lib/tutorials_registry_types'; +export declare function zscalerLogsSpecProvider(context: TutorialContext): TutorialSchema; diff --git a/src/platform/plugins/shared/inspector/common/adapters/index.d.ts b/src/platform/plugins/shared/inspector/common/adapters/index.d.ts new file mode 100644 index 0000000000000..ec4cf008591e0 --- /dev/null +++ b/src/platform/plugins/shared/inspector/common/adapters/index.d.ts @@ -0,0 +1,2 @@ +export * from './request'; +export type * from './types'; diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/index.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/index.d.ts new file mode 100644 index 0000000000000..e7d38e48ec8bc --- /dev/null +++ b/src/platform/plugins/shared/inspector/common/adapters/request/index.d.ts @@ -0,0 +1,4 @@ +export type { Request, RequestStatistic, RequestStatistics } from './types'; +export { RequestStatus } from './types'; +export { RequestAdapter } from './request_adapter'; +export { RequestResponder } from './request_responder'; diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/move_request_params_to_top_level.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/move_request_params_to_top_level.d.ts new file mode 100644 index 0000000000000..a957f2271413c --- /dev/null +++ b/src/platform/plugins/shared/inspector/common/adapters/request/move_request_params_to_top_level.d.ts @@ -0,0 +1,2 @@ +import type { Response } from './types'; +export declare function moveRequestParamsToTopLevel(response: Response): Response; diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/request_adapter.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/request_adapter.d.ts new file mode 100644 index 0000000000000..974ef7fdb16e6 --- /dev/null +++ b/src/platform/plugins/shared/inspector/common/adapters/request/request_adapter.d.ts @@ -0,0 +1,34 @@ +import { EventEmitter } from 'events'; +import { RequestResponder } from './request_responder'; +import type { Request, RequestParams } from './types'; +/** + * An generic inspector adapter to log requests. + * These can be presented in the inspector using the requests view. + * The adapter is not coupled to a specific implementation or even Elasticsearch + * instead it offers a generic API to log requests of any kind. + * @extends EventEmitter + */ +export declare class RequestAdapter extends EventEmitter { + private requests; + private responses; + constructor(); + /** + * Start logging a new request into this request adapter. The new request will + * by default be in a processing state unless you explicitly finish it via + * {@link RequestResponder#finish}, {@link RequestResponder#ok} or + * {@link RequestResponder#error}. + * + * @param {string} name The name of this request as it should be shown in the UI. + * @param {RequestParams} params Additional arguments for the request. + * @param {number} [startTime] Set an optional start time for the request + * @return {RequestResponder} An instance to add information to the request and finish it. + */ + start(name: string, params?: RequestParams, startTime?: number): RequestResponder; + loadFromEntries(requests: Map, responses: WeakMap): void; + reset(): void; + resetRequest(id: string): void; + getRequests(): Request[]; + getRequestsSince(time: number): Request[]; + getRequestEntries(): Array<[Request, RequestResponder]>; + private _onChange; +} diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/request_responder.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/request_responder.d.ts new file mode 100644 index 0000000000000..7712a26974ef0 --- /dev/null +++ b/src/platform/plugins/shared/inspector/common/adapters/request/request_responder.d.ts @@ -0,0 +1,16 @@ +import type { Request, RequestStatistics, Response } from './types'; +import { RequestStatus } from './types'; +/** + * An API to specify information about a specific request that will be logged. + * Create a new instance to log a request using {@link RequestAdapter#start}. + */ +export declare class RequestResponder { + private readonly request; + private readonly onChange; + constructor(request: Request, onChange: () => void); + json(reqJson: object): RequestResponder; + stats(stats: RequestStatistics): RequestResponder; + finish(status: RequestStatus, response: Response): void; + ok(response: Response): void; + error(response: Response): void; +} diff --git a/src/platform/plugins/shared/inspector/common/adapters/request/types.d.ts b/src/platform/plugins/shared/inspector/common/adapters/request/types.d.ts new file mode 100644 index 0000000000000..e95fd3037b392 --- /dev/null +++ b/src/platform/plugins/shared/inspector/common/adapters/request/types.d.ts @@ -0,0 +1,46 @@ +import type { ConnectionRequestParams } from '@elastic/transport'; +/** + * The status a request can have. + */ +export declare enum RequestStatus { + /** + * The request hasn't finished yet. + */ + PENDING = 0, + /** + * The request has successfully finished. + */ + OK = 1, + /** + * The request failed. + */ + ERROR = 2 +} +export interface Request extends RequestParams { + id: string; + name: string; + json?: object; + response?: Response; + startTime: number; + stats?: RequestStatistics; + status: RequestStatus; + time?: number; +} +export interface RequestParams { + id?: string; + description?: string; + searchSessionId?: string; +} +export interface RequestStatistics { + [key: string]: RequestStatistic; +} +export interface RequestStatistic { + label: string; + description?: string; + value: any; +} +export interface Response { + json?: object; + requestParams?: ConnectionRequestParams; + time?: number; +} diff --git a/src/platform/plugins/shared/inspector/common/adapters/types.d.ts b/src/platform/plugins/shared/inspector/common/adapters/types.d.ts new file mode 100644 index 0000000000000..873c02c3cffd2 --- /dev/null +++ b/src/platform/plugins/shared/inspector/common/adapters/types.d.ts @@ -0,0 +1,8 @@ +import type { RequestAdapter } from './request'; +/** + * The interface that the adapters used to open an inspector have to fullfill. + */ +export interface Adapters { + requests?: RequestAdapter; + [key: string]: any; +} diff --git a/src/platform/plugins/shared/inspector/common/index.d.ts b/src/platform/plugins/shared/inspector/common/index.d.ts new file mode 100644 index 0000000000000..0e73b1994c6c7 --- /dev/null +++ b/src/platform/plugins/shared/inspector/common/index.d.ts @@ -0,0 +1,2 @@ +export type { Adapters, Request, RequestStatistic, RequestStatistics } from './adapters'; +export { RequestAdapter, RequestStatus, RequestResponder } from './adapters'; diff --git a/src/platform/plugins/shared/inspector/public/adapters/has_inspector_adapters.d.ts b/src/platform/plugins/shared/inspector/public/adapters/has_inspector_adapters.d.ts new file mode 100644 index 0000000000000..598d08f0f2430 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/adapters/has_inspector_adapters.d.ts @@ -0,0 +1,5 @@ +import type { Adapters } from '../../common'; +export interface HasInspectorAdapters { + getInspectorAdapters: () => Adapters | undefined; +} +export declare const apiHasInspectorAdapters: (api: unknown | null) => api is HasInspectorAdapters; diff --git a/src/platform/plugins/shared/inspector/public/async_services.d.ts b/src/platform/plugins/shared/inspector/public/async_services.d.ts new file mode 100644 index 0000000000000..33bfa8e9705b0 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/async_services.d.ts @@ -0,0 +1,2 @@ +export { RequestsViewComponent } from './views/requests/components/requests_view'; +export { InspectorPanel } from './ui/inspector_panel'; diff --git a/src/platform/plugins/shared/inspector/public/index.d.ts b/src/platform/plugins/shared/inspector/public/index.d.ts new file mode 100644 index 0000000000000..8559984628b25 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/index.d.ts @@ -0,0 +1,8 @@ +import type { PluginInitializerContext } from '@kbn/core/public'; +import { InspectorPublicPlugin } from './plugin'; +export declare function plugin(initializerContext: PluginInitializerContext): InspectorPublicPlugin; +export { type Adapters, type Request, type RequestStatistic, type RequestStatistics, RequestAdapter, RequestStatus, RequestResponder, } from '../common'; +export { apiHasInspectorAdapters, type HasInspectorAdapters, } from './adapters/has_inspector_adapters'; +export { InspectorPublicPlugin as Plugin } from './plugin'; +export type { Setup, Start } from './plugin'; +export type { InspectorViewProps, InspectorViewDescription, InspectorOptions, InspectorSession, } from './types'; diff --git a/src/platform/plugins/shared/inspector/public/plugin.d.ts b/src/platform/plugins/shared/inspector/public/plugin.d.ts new file mode 100644 index 0000000000000..34f9ccc26fe57 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/plugin.d.ts @@ -0,0 +1,48 @@ +import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import { InspectorViewRegistry } from './view_registry'; +import type { InspectorOptions, InspectorSession } from './types'; +import type { Adapters } from '../common'; +export interface InspectorPluginStartDeps { + share: SharePluginStart; +} +export interface Setup { + registerView: InspectorViewRegistry['register']; +} +export interface Start { + /** + * Checks if a inspector panel could be shown based on the passed adapters. + * + * @param {object} adapters - An object of adapters. This should be the same + * you would pass into `open`. + * @returns {boolean} True, if a call to `open` with the same adapters + * would have shown the inspector panel, false otherwise. + */ + isAvailable: (adapters?: Adapters) => boolean; + /** + * Opens the inspector panel for the given adapters and close any previously opened + * inspector panel. The previously panel will be closed also if no new panel will be + * opened (e.g. because of the passed adapters no view is available). You can use + * {@link InspectorSession#close} on the return value to close that opened panel again. + * + * @param {object} adapters - An object of adapters for which you want to show + * the inspector panel. + * @param {InspectorOptions} options - Options that configure the inspector. See InspectorOptions type. + * @param {unknown} parentApi - Optional parent api for trackingOverlays. + * @return {InspectorSession} The session instance for the opened inspector. + * @throws {Error} + */ + open: (adapters: Adapters, options?: InspectorOptions, parentApi?: unknown) => InspectorSession; +} +export declare class InspectorPublicPlugin implements Plugin { + views: InspectorViewRegistry | undefined; + constructor(_initializerContext: PluginInitializerContext); + setup(_core: CoreSetup): { + registerView: (view: import("./types").InspectorViewDescription) => void; + }; + start(core: CoreStart, startDeps: InspectorPluginStartDeps): { + isAvailable: (adapters?: Adapters) => boolean; + open: (adapters: Adapters, options?: InspectorOptions, parentApi?: unknown) => InspectorSession; + }; + stop(): void; +} diff --git a/src/platform/plugins/shared/inspector/public/types.d.ts b/src/platform/plugins/shared/inspector/public/types.d.ts new file mode 100644 index 0000000000000..566c3daa7b65f --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/types.d.ts @@ -0,0 +1,57 @@ +import type { OverlayFlyoutOpenOptions, OverlayRef } from '@kbn/core/public'; +import type { Adapters } from '../common'; +/** + * The props interface that a custom inspector view component, that will be passed + * to {@link InspectorViewDescription#component}, must use. + */ +export interface InspectorViewProps { + /** + * Adapters used to open the inspector. + */ + adapters: TAdapters; + /** + * The title that the inspector is currently using e.g. a visualization name. + */ + title: string; + /** + * A set of specific options for each view. + */ + options?: unknown; +} +/** + * An object describing an inspector view. + * @typedef {object} InspectorViewDescription + * @property {string} title - The title that will be used to present that view. + * @property {string} icon - An icon name to present this view. Must match an EUI icon. + * @property {React.ComponentType} component - The actual React component to render that view. + * @property {number} [order=9000] - An order for this view. Views are ordered from lower + * order values to higher order values in the UI. + * @property {string} [help=''] - An help text for this view, that gives a brief description + * of this view. + * @property {viewShouldShowFunc} [shouldShow] - A function, that determines whether + * this view should be visible for a given collection of adapters. If not specified + * the view will always be visible. + */ +export interface InspectorViewDescription { + component: React.ComponentType; + help?: string; + order?: number; + shouldShow?: (adapters: Adapters) => boolean; + title: string; +} +/** + * Options that can be specified when opening the inspector. + * @property {string} title - An optional title, that will be shown in the header + * of the inspector. Can be used to give more context about what is being inspected. + * @property {unknown} options - A set of specific payload to be passed to inspector views + * @property {object} flyoutProps - Optional props passed to `openLazyFlyout` (e.g. size, className, etc). + */ +export interface InspectorOptions { + title?: string; + options?: unknown; + flyoutProps?: Partial & { + triggerId?: string; + focusedPanelId?: string; + }; +} +export type InspectorSession = OverlayRef; diff --git a/src/platform/plugins/shared/inspector/public/ui/inspector_panel.d.ts b/src/platform/plugins/shared/inspector/public/ui/inspector_panel.d.ts new file mode 100644 index 0000000000000..4e577b0aeeb22 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/ui/inspector_panel.d.ts @@ -0,0 +1,39 @@ +import React, { Component } from 'react'; +import type { ApplicationStart, HttpStart, IUiSettingsClient, ThemeServiceStart } from '@kbn/core/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { SettingsStart } from '@kbn/core-ui-settings-browser'; +import type { InspectorViewDescription } from '../types'; +import type { Adapters } from '../../common'; +interface InspectorPanelProps { + adapters: Adapters; + title?: string; + options?: unknown; + views: InspectorViewDescription[]; + dependencies: { + application: ApplicationStart; + http: HttpStart; + uiSettings: IUiSettingsClient; + share: SharePluginStart; + settings: SettingsStart; + theme: ThemeServiceStart; + }; +} +interface InspectorPanelState { + selectedView: InspectorViewDescription; + views: InspectorViewDescription[]; + adapters: Adapters; +} +export declare class InspectorPanel extends Component { + static defaultProps: { + title: string; + }; + state: InspectorPanelState; + static getDerivedStateFromProps(nextProps: InspectorPanelProps, prevState: InspectorPanelState): { + views: InspectorViewDescription[]; + selectedView: InspectorViewDescription; + }; + onViewSelected: (view: InspectorViewDescription) => void; + renderSelectedPanel(): React.JSX.Element; + render(): React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/inspector/public/ui/inspector_view_chooser.d.ts b/src/platform/plugins/shared/inspector/public/ui/inspector_view_chooser.d.ts new file mode 100644 index 0000000000000..a6565d4132e57 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/ui/inspector_view_chooser.d.ts @@ -0,0 +1,20 @@ +import React, { Component } from 'react'; +import type { InspectorViewDescription } from '../types'; +interface Props { + views: InspectorViewDescription[]; + onViewSelected: (view: InspectorViewDescription) => void; + selectedView: InspectorViewDescription; +} +interface State { + isSelectorOpen: boolean; +} +export declare class InspectorViewChooser extends Component { + state: State; + toggleSelector: () => void; + closeSelector: () => void; + renderView: (view: InspectorViewDescription, index: number) => React.JSX.Element; + renderViewButton(): React.JSX.Element; + renderSingleView(): React.JSX.Element; + render(): React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/inspector/public/view_registry.d.ts b/src/platform/plugins/shared/inspector/public/view_registry.d.ts new file mode 100644 index 0000000000000..27148efcbbc60 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/view_registry.d.ts @@ -0,0 +1,36 @@ +import { EventEmitter } from 'events'; +import type { InspectorViewDescription } from './types'; +import type { Adapters } from '../common'; +/** + * @callback viewShouldShowFunc + * @param {object} adapters - A list of adapters to check whether or not this view + * should be shown for. + * @returns {boolean} true - if this view should be shown for the given adapters. + */ +/** + * A registry that will hold inspector views. + */ +export declare class InspectorViewRegistry extends EventEmitter { + private views; + /** + * Register a new inspector view to the registry. Check the README.md in the + * inspector directory for more information of the object format to register + * here. This will also emit a 'change' event on the registry itself. + * + * @param {InspectorViewDescription} view - The view description to add to the registry. + */ + register(view: InspectorViewDescription): void; + /** + * Retrieve all views currently registered with the registry. + * @returns {InspectorViewDescription[]} A by `order` sorted list of all registered + * inspector views. + */ + getAll(): InspectorViewDescription[]; + /** + * Retrieve all registered views, that want to be visible for the specified adapters. + * @param {object} adapters - an adapter configuration + * @returns {InspectorViewDescription[]} All inespector view descriptions visible + * for the specific adapters. + */ + getVisible(adapters?: Adapters): InspectorViewDescription[]; +} diff --git a/src/platform/plugins/shared/inspector/public/views/index.d.ts b/src/platform/plugins/shared/inspector/public/views/index.d.ts new file mode 100644 index 0000000000000..35efc2c2050b3 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/index.d.ts @@ -0,0 +1 @@ +export { getRequestsViewDescription } from './requests'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/cluster_health.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/cluster_health.d.ts new file mode 100644 index 0000000000000..d9a11d5161cf3 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/cluster_health.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +import type { EuiTextProps } from '@elastic/eui'; +interface Props { + count?: number; + status: string; + textProps?: EuiTextProps; +} +export declare function ClusterHealth({ count, status, textProps }: Props): React.JSX.Element | null; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/clusters_health.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/clusters_health.d.ts new file mode 100644 index 0000000000000..6e4779706a5fb --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/clusters_health.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +interface Props { + clusters: Record; +} +export declare function ClustersHealth({ clusters }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/gradient.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/gradient.d.ts new file mode 100644 index 0000000000000..a22e2ea83e773 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/gradient.d.ts @@ -0,0 +1,7 @@ +export declare function useHealthHexCodes(): { + successful: string; + partial: string; + skipped: string; + failed: string; +}; +export declare function useHeathBarLinearGradient(successful: number, partial: number, skipped: number, failed: number): string; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/index.d.ts new file mode 100644 index 0000000000000..8d7c07e8f737d --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_health/index.d.ts @@ -0,0 +1,2 @@ +export { ClustersHealth } from './clusters_health'; +export { ClusterHealth } from './cluster_health'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/cluster_view.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/cluster_view.d.ts new file mode 100644 index 0000000000000..e1d77dd8a197e --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/cluster_view.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +interface Props { + clusterDetails: estypes.ClusterDetails; +} +export declare function ClusterView({ clusterDetails }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.d.ts new file mode 100644 index 0000000000000..892b8787a2232 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/clusters_table.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +interface Props { + clusters: Record; +} +export declare function ClustersTable({ clusters }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/index.d.ts new file mode 100644 index 0000000000000..3225257e5e314 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/index.d.ts @@ -0,0 +1 @@ +export { ClustersTable } from './clusters_table'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/index.d.ts new file mode 100644 index 0000000000000..9eec3220a7c85 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/index.d.ts @@ -0,0 +1,2 @@ +export { ShardsView } from './shards_view'; +export { OpenShardFailureFlyoutButton } from './open_shard_failure_flyout_button'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/open_shard_failure_flyout_button.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/open_shard_failure_flyout_button.d.ts new file mode 100644 index 0000000000000..dbe9c598504f4 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/open_shard_failure_flyout_button.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +interface Props { + failures: estypes.ShardFailure[]; +} +export declare function OpenShardFailureFlyoutButton({ failures }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_details.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_details.d.ts new file mode 100644 index 0000000000000..f5c3b294ba943 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_details.d.ts @@ -0,0 +1,20 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +/** + * Provides pretty formatting of a given key string + * e.g. formats "this_key.is_nice" to "This key is nice" + * @param key + */ +export declare function formatKey(key: string): string; +/** + * Adds a EuiCodeBlock to values of `script` and `script_stack` key + * Values of other keys are handled a strings + * @param value + * @param key + */ +export declare function formatValueByKey(value: unknown, key: string): JSX.Element; +interface Props { + failure: estypes.ShardFailure; +} +export declare function ShardFailureDetails({ failure }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_flyout.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_flyout.d.ts new file mode 100644 index 0000000000000..9f0dbdf2e9d47 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_flyout.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +interface Props { + failures: estypes.ShardFailure[]; + onClose: () => void; +} +export declare function ShardFailureFlyout({ failures, onClose }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.d.ts new file mode 100644 index 0000000000000..ae1df3c16f5d0 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shard_failure_table.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +interface Props { + failures: estypes.ShardFailure[]; +} +export declare function ShardFailureTable({ failures }: Props): React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shards_view.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shards_view.d.ts new file mode 100644 index 0000000000000..6be76b6b569a9 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_table/shards_view/shards_view.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +interface Props { + failures: estypes.ShardFailure[]; + shardStats?: estypes.ShardStatistics; +} +export declare function ShardsView({ failures, shardStats }: Props): React.JSX.Element | null; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_view.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_view.d.ts new file mode 100644 index 0000000000000..db3596cf96b00 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/clusters_view.d.ts @@ -0,0 +1,16 @@ +import React, { Component } from 'react'; +import type { estypes } from '@elastic/elasticsearch'; +import { type EuiSearchBarOnChangeArgs } from '@elastic/eui'; +import type { Request } from '../../../../../../common/adapters/request/types'; +import type { DetailViewProps } from '../types'; +interface State { + clusters: Record; + showSearchAndStatusBar: boolean; +} +export declare class ClustersView extends Component { + static shouldShow: (request: Request) => boolean; + constructor(props: DetailViewProps); + _onSearchChange: ({ query, error }: EuiSearchBarOnChangeArgs) => void; + render(): React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/find_clusters.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/find_clusters.d.ts new file mode 100644 index 0000000000000..9d7c240cab89a --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/find_clusters.d.ts @@ -0,0 +1,4 @@ +import type { estypes } from '@elastic/elasticsearch'; +import { type Query } from '@elastic/eui'; +import type { Request } from '../../../../../../common/adapters/request/types'; +export declare function findClusters(request: Request, query?: Query): Record; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/index.d.ts new file mode 100644 index 0000000000000..70763c70f103c --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/index.d.ts @@ -0,0 +1 @@ +export { ClustersView } from './clusters_view'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/local_cluster.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/local_cluster.d.ts new file mode 100644 index 0000000000000..c751e1bbde8a5 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/clusters_view/local_cluster.d.ts @@ -0,0 +1,16 @@ +import type { estypes } from '@elastic/elasticsearch'; +export declare const LOCAL_CLUSTER_KEY = "(local)"; +export declare function getLocalClusterDetails(rawResponse: estypes.SearchResponse): { + status: estypes.ClusterSearchStatus; + indices: string; + took: number; + timed_out: boolean; + _shards: { + failed: estypes.uint; + successful: estypes.uint; + total: estypes.uint; + failures?: estypes.ShardFailure[]; + skipped?: estypes.uint; + }; + failures: estypes.ShardFailure[] | undefined; +}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/index.d.ts new file mode 100644 index 0000000000000..642b40b5bc397 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/index.d.ts @@ -0,0 +1,5 @@ +export type { DetailViewProps } from './types'; +export { RequestDetailsRequest } from './req_details_request'; +export { RequestDetailsResponse } from './req_details_response'; +export { RequestDetailsStats } from './req_details_stats'; +export { ClustersView } from './clusters_view'; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_code_viewer.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_code_viewer.d.ts new file mode 100644 index 0000000000000..8fe532d1e68db --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_code_viewer.d.ts @@ -0,0 +1,14 @@ +import type { ReactNode } from 'react'; +import React from 'react'; +interface RequestCodeViewerProps { + value: string; + actions?: Array<{ + name: string; + action: ReactNode; + }>; +} +/** + * @internal + */ +export declare const RequestCodeViewer: ({ value, actions }: RequestCodeViewerProps) => React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request.d.ts new file mode 100644 index 0000000000000..37e38b80299db --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request.d.ts @@ -0,0 +1,7 @@ +import React, { Component } from 'react'; +import type { Request } from '../../../../../common/adapters/request/types'; +import type { DetailViewProps } from './types'; +export declare class RequestDetailsRequest extends Component { + static shouldShow: (request: Request) => boolean; + render(): React.JSX.Element | null; +} diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request_content.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request_content.d.ts new file mode 100644 index 0000000000000..7b8d222851b29 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_request_content.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +import type { ConnectionRequestParams } from '@elastic/transport'; +interface RequestDetailsRequestContentProps { + indexPattern?: string; + requestParams?: ConnectionRequestParams; + json: string; +} +export declare const RequestDetailsRequestContent: React.FC; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_response.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_response.d.ts new file mode 100644 index 0000000000000..aad9b7b93fc56 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_response.d.ts @@ -0,0 +1,8 @@ +import React, { Component } from 'react'; +import type { Request } from '../../../../../common/adapters/request/types'; +import type { DetailViewProps } from './types'; +export declare class RequestDetailsResponse extends Component { + static shouldShow: (request: Request) => boolean; + static getResponseJson: (request: Request) => object | null | undefined; + render(): React.JSX.Element | null; +} diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_stats.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_stats.d.ts new file mode 100644 index 0000000000000..0b02f4c89d3dc --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/req_details_stats.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import type { DetailViewProps } from './types'; +import type { Request } from '../../../../../common/adapters/request/types'; +export declare const RequestDetailsStats: { + ({ request }: DetailViewProps): React.JSX.Element | null; + shouldShow(request: Request): boolean; +}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/details/types.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/details/types.d.ts new file mode 100644 index 0000000000000..d7474c4921ea2 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/details/types.d.ts @@ -0,0 +1,4 @@ +import type { Request } from '../../../../../common/adapters/request/types'; +export interface DetailViewProps { + request: Request; +} diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/disambiguate_request_names.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/disambiguate_request_names.d.ts new file mode 100644 index 0000000000000..3f2a5e2623bba --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/disambiguate_request_names.d.ts @@ -0,0 +1,2 @@ +import type { Request } from '../../../../common/adapters/request/types'; +export declare function disambiguateRequestNames(requests: Request[]): Request[]; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/get_next_tab.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/get_next_tab.d.ts new file mode 100644 index 0000000000000..880e9e2f56b49 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/get_next_tab.d.ts @@ -0,0 +1,2 @@ +import type { DetailViewData } from './types'; +export declare function getNextTab(currentTab: DetailViewData | null, tabs: DetailViewData[], preferredTabs?: string[]): DetailViewData | null; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/request_details.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/request_details.d.ts new file mode 100644 index 0000000000000..7f2d3eda65183 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/request_details.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import type { Request } from '../../../../common/adapters/request/types'; +interface Props { + initialTabs?: string[]; + request: Request; +} +export declare function RequestDetails(props: Props): React.JSX.Element | null; +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/request_selector.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/request_selector.d.ts new file mode 100644 index 0000000000000..20166c20d4bd4 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/request_selector.d.ts @@ -0,0 +1,14 @@ +import React, { Component } from 'react'; +import type { EuiComboBoxOptionOption } from '@elastic/eui'; +import type { Request } from '../../../../common/adapters/request/types'; +interface RequestSelectorProps { + requests: Request[]; + selectedRequest: Request; + onRequestChanged: (request: Request) => void; +} +export declare class RequestSelector extends Component { + handleSelected: (selectedOptions: Array>) => void; + renderRequestCombobox(): React.JSX.Element; + render(): React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/requests_view.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/requests_view.d.ts new file mode 100644 index 0000000000000..ad55650ca5f26 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/requests_view.d.ts @@ -0,0 +1,17 @@ +import React, { Component } from 'react'; +import type { Request } from '../../../../common/adapters/request/types'; +import type { InspectorViewProps } from '../../../types'; +interface RequestSelectorState { + requests: Request[]; + request: Request | null; +} +export declare class RequestsViewComponent extends Component { + constructor(props: InspectorViewProps); + getRequests(): Request[]; + _onRequestsChange: () => void; + selectRequest: (request: Request) => void; + componentWillUnmount(): void; + static renderEmptyRequests(): React.JSX.Element; + render(): React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/inspector/public/views/requests/components/types.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/components/types.d.ts new file mode 100644 index 0000000000000..b7fccb5cdb34c --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/components/types.d.ts @@ -0,0 +1,15 @@ +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { CoreStart } from '@kbn/core-lifecycle-browser'; +export interface DetailViewData { + name: string; + label: string; + component: any; +} +export interface InspectorKibanaServices { + share: SharePluginStart; + application: CoreStart['application']; + http: CoreStart['http']; + uiSettings: CoreStart['uiSettings']; + settings: CoreStart['settings']; + theme: CoreStart['theme']; +} diff --git a/src/platform/plugins/shared/inspector/public/views/requests/index.d.ts b/src/platform/plugins/shared/inspector/public/views/requests/index.d.ts new file mode 100644 index 0000000000000..52b66957a44c5 --- /dev/null +++ b/src/platform/plugins/shared/inspector/public/views/requests/index.d.ts @@ -0,0 +1,2 @@ +import type { InspectorViewDescription } from '../../types'; +export declare const getRequestsViewDescription: () => InspectorViewDescription; diff --git a/src/platform/plugins/shared/kibana_react/public/context/context.d.ts b/src/platform/plugins/shared/kibana_react/public/context/context.d.ts new file mode 100644 index 0000000000000..904c7b9b29ca5 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/context/context.d.ts @@ -0,0 +1,12 @@ +import type { FC, PropsWithChildren } from 'react'; +import React from 'react'; +import type { KibanaReactContext, KibanaReactContextValue, KibanaServices } from './types'; +export declare const context: React.Context>>; +export declare const useKibana: () => KibanaReactContextValue; +export declare const withKibana: ; +}>(type: React.ComponentType) => FC>; +export declare const createKibanaReactContext: (services: Services) => KibanaReactContext; +export declare const KibanaContextProvider: FC>; diff --git a/src/platform/plugins/shared/kibana_react/public/context/index.d.ts b/src/platform/plugins/shared/kibana_react/public/context/index.d.ts new file mode 100644 index 0000000000000..db4e8e86689cb --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/context/index.d.ts @@ -0,0 +1,2 @@ +export { context, createKibanaReactContext, KibanaContextProvider, useKibana, withKibana, } from './context'; +export type { KibanaReactContext, KibanaReactContextValue, KibanaServices } from './types'; diff --git a/src/platform/plugins/shared/kibana_react/public/context/types.d.ts b/src/platform/plugins/shared/kibana_react/public/context/types.d.ts new file mode 100644 index 0000000000000..0129daf09e8bb --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/context/types.d.ts @@ -0,0 +1,16 @@ +import type { FC, PropsWithChildren } from 'react'; +import type React from 'react'; +import type { CoreStart } from '@kbn/core/public'; +import type { KibanaReactOverlays } from '../overlays'; +export type KibanaServices = Partial; +export interface KibanaReactContextValue { + readonly services: Services; + readonly overlays: KibanaReactOverlays; +} +export interface KibanaReactContext { + value: KibanaReactContextValue; + Provider: FC>; + Consumer: React.Consumer>; +} diff --git a/src/platform/plugins/shared/kibana_react/public/dark_mode/use_dark_mode.d.ts b/src/platform/plugins/shared/kibana_react/public/dark_mode/use_dark_mode.d.ts new file mode 100644 index 0000000000000..023f1a2e87869 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/dark_mode/use_dark_mode.d.ts @@ -0,0 +1,7 @@ +/** + * This should only be used to pass the darkMode to a theme provider which is outside + * of the global theme provider scope. For example when used with `EuiThemeProvider`. + * + * @deprecated + */ +export declare const useDarkMode: (defaultValue?: boolean) => boolean; diff --git a/src/platform/plugins/shared/kibana_react/public/index.d.ts b/src/platform/plugins/shared/kibana_react/public/index.d.ts new file mode 100644 index 0000000000000..ca8b9dc4ee96f --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/index.d.ts @@ -0,0 +1,26 @@ +export type { UrlTemplateEditorVariable, UrlTemplateEditorProps } from './url_template_editor'; +export { UrlTemplateEditor } from './url_template_editor'; +export type { KibanaReactContext, KibanaReactContextValue, KibanaServices } from './context'; +export { context, createKibanaReactContext, KibanaContextProvider, useKibana, withKibana, } from './context'; +export { overviewPageActions, OverviewPageFooter } from './overview_page'; +export type { KibanaReactOverlays } from './overlays'; +export { createReactOverlays } from './overlays'; +export { useUiSetting, useGlobalUiSetting, useUiSetting$, useGlobalUiSetting$, } from './ui_settings'; +export { useDarkMode } from './dark_mode/use_dark_mode'; +export { useExecutionContext } from './use_execution_context'; +export { reactRouterNavigate, reactRouterOnClickHandler } from './react_router_navigate'; +export type { NoDataPageActions, NoDataPageActionsProps, NoDataPageProps, ElasticAgentCardProps, } from './page_template'; +export { KibanaPageTemplateSolutionNavAvatar, NO_DATA_RECOMMENDED, NoDataPage, ElasticAgentCard, NoDataCard, } from './page_template'; +export type { Value } from './validated_range'; +export { ValidatedDualRange } from './validated_range'; +/** @deprecated use `Markdown` from `@kbn/shared-ux-markdown` */ +export { Markdown, MarkdownSimple } from './markdown'; +export { toMountPoint } from './util'; +export type { ToMountPointOptions } from './util'; +/** @deprecated Use `KibanaThemeProvider`, `wrapWithTheme` from `@kbn/react-kibana-context-theme` */ +export { KibanaThemeProvider, wrapWithTheme, type KibanaThemeProviderProps } from './theme'; +/** dummy plugin, we just want kibanaReact to have its own bundle */ +export declare function plugin(): { + setup(): void; + start(): void; +}; diff --git a/src/platform/plugins/shared/kibana_react/public/markdown/index.d.ts b/src/platform/plugins/shared/kibana_react/public/markdown/index.d.ts new file mode 100644 index 0000000000000..92be1f3f8f889 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/markdown/index.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; +import type { MarkdownSimpleProps } from './markdown_simple'; +import type { MarkdownProps } from './markdown'; +export declare const MarkdownSimple: (props: MarkdownSimpleProps) => React.JSX.Element; +export declare const Markdown: (props: MarkdownProps) => React.JSX.Element; diff --git a/src/platform/plugins/shared/kibana_react/public/markdown/markdown.d.ts b/src/platform/plugins/shared/kibana_react/public/markdown/markdown.d.ts new file mode 100644 index 0000000000000..72b9cf8703407 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/markdown/markdown.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; +/** + * Return a memoized markdown rendering function that use the specified + * whiteListedRules and openLinksInNewTab configurations. + * @param {Array of Strings} whiteListedRules - white list of markdown rules + * list of rules can be found at https://github.com/markdown-it/markdown-it/issues/361 + * @param {Boolean} openLinksInNewTab + * @return {Function} Returns an Object to use with dangerouslySetInnerHTML + * with the rendered markdown HTML + */ +export declare const markdownFactory: ((whiteListedRules?: string[], openLinksInNewTab?: boolean) => (markdown: string) => string) & import("lodash").MemoizedFunction; +export interface MarkdownProps extends React.HTMLAttributes { + className?: string; + markdown?: string; + openLinksInNewTab?: boolean; + whiteListedRules?: string[]; + onRender?: () => void; + isReversed?: boolean; +} +export declare const Markdown: (props: MarkdownProps) => React.JSX.Element; +export default Markdown; diff --git a/src/platform/plugins/shared/kibana_react/public/markdown/markdownStyles.d.ts b/src/platform/plugins/shared/kibana_react/public/markdown/markdownStyles.d.ts new file mode 100644 index 0000000000000..d1e2b8cc751c9 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/markdown/markdownStyles.d.ts @@ -0,0 +1,2 @@ +import type { UseEuiTheme } from '@elastic/eui'; +export declare const markdownStyles: (euiTheme: UseEuiTheme["euiTheme"], isReversed: boolean) => import("@emotion/react").SerializedStyles; diff --git a/src/platform/plugins/shared/kibana_react/public/markdown/markdown_simple.d.ts b/src/platform/plugins/shared/kibana_react/public/markdown/markdown_simple.d.ts new file mode 100644 index 0000000000000..c80af1bea76ca --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/markdown/markdown_simple.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +export interface MarkdownSimpleProps { + children: string; +} +export declare const MarkdownSimple: ({ children }: MarkdownSimpleProps) => React.JSX.Element; +export default MarkdownSimple; diff --git a/src/platform/plugins/shared/kibana_react/public/overlays/create_react_overlays.d.ts b/src/platform/plugins/shared/kibana_react/public/overlays/create_react_overlays.d.ts new file mode 100644 index 0000000000000..aed801d8dc524 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/overlays/create_react_overlays.d.ts @@ -0,0 +1,3 @@ +import type { KibanaServices } from '../context/types'; +import type { KibanaReactOverlays } from './types'; +export declare const createReactOverlays: (services: KibanaServices) => KibanaReactOverlays; diff --git a/src/platform/plugins/shared/kibana_react/public/overlays/index.d.ts b/src/platform/plugins/shared/kibana_react/public/overlays/index.d.ts new file mode 100644 index 0000000000000..570273146e9ea --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/overlays/index.d.ts @@ -0,0 +1,2 @@ +export type * from './types'; +export * from './create_react_overlays'; diff --git a/src/platform/plugins/shared/kibana_react/public/overlays/types.d.ts b/src/platform/plugins/shared/kibana_react/public/overlays/types.d.ts new file mode 100644 index 0000000000000..b3a1e08adbf6a --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/overlays/types.d.ts @@ -0,0 +1,6 @@ +import type * as React from 'react'; +import type { CoreStart } from '@kbn/core/public'; +export interface KibanaReactOverlays { + openFlyout: (node: React.ReactNode, options?: Parameters['1']) => ReturnType; + openModal: (node: React.ReactNode, options?: Parameters['1']) => ReturnType; +} diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/index.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/index.d.ts new file mode 100644 index 0000000000000..8ba768b07e2bd --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/overview_page/index.d.ts @@ -0,0 +1,2 @@ +export * from './overview_page_actions'; +export * from './overview_page_footer'; diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/index.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/index.d.ts new file mode 100644 index 0000000000000..4a812f1962ddf --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/index.d.ts @@ -0,0 +1 @@ +export * from './overview_page_actions'; diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.d.ts new file mode 100644 index 0000000000000..51f439c3cfbf5 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import type { ApplicationStart } from '@kbn/core/public'; +interface Props { + addDataHref: string; + application: ApplicationStart; + devToolsHref?: string; + hidden?: boolean; + managementHref?: string; + showDevToolsLink?: boolean; + showManagementLink?: boolean; +} +export declare const overviewPageActions: ({ addDataHref, application, devToolsHref, hidden, managementHref, showDevToolsLink, showManagementLink, }: Props) => (React.JSX.Element | null)[]; +export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/index.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/index.d.ts new file mode 100644 index 0000000000000..644bc785481cc --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/index.d.ts @@ -0,0 +1 @@ +export * from './overview_page_footer'; diff --git a/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.d.ts b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.d.ts new file mode 100644 index 0000000000000..17db4a5ad3272 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.d.ts @@ -0,0 +1,12 @@ +import type { FC, MouseEvent } from 'react'; +interface Props { + addBasePath: (path: string) => string; + /** The path to set as the new default route in advanced settings */ + path: string; + /** Callback function to invoke when the user wants to set their default route to the current page */ + onSetDefaultRoute?: (event: MouseEvent) => void; + /** Callback function to invoke when the user wants to change their default route button is changed */ + onChangeDefaultRoute?: (event: MouseEvent) => void; +} +export declare const OverviewPageFooter: FC; +export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/index.d.ts new file mode 100644 index 0000000000000..92a3d981c8a7b --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/index.d.ts @@ -0,0 +1,2 @@ +export { KibanaPageTemplateSolutionNavAvatar } from './solution_nav'; +export * from './no_data_page'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/action_cards.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/action_cards.d.ts new file mode 100644 index 0000000000000..297a5f72cfb59 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/action_cards.d.ts @@ -0,0 +1,8 @@ +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ElasticAgentCard, NoDataCard } from '../no_data_card'; +interface ActionCardsProps { + actionCards: Array | ReactElement>; +} +export declare const ActionCards: ({ actionCards }: ActionCardsProps) => React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/index.d.ts new file mode 100644 index 0000000000000..e2f86e9e39ace --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/action_cards/index.d.ts @@ -0,0 +1 @@ +export { ActionCards } from './action_cards'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/index.d.ts new file mode 100644 index 0000000000000..a77d9e1ae4dd3 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/index.d.ts @@ -0,0 +1,2 @@ +export * from './no_data_page'; +export * from './no_data_card'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.d.ts new file mode 100644 index 0000000000000..9ca262d11a5aa --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.d.ts @@ -0,0 +1,9 @@ +import type { FunctionComponent } from 'react'; +import type { NoDataPageActions } from '../no_data_page'; +export type ElasticAgentCardProps = NoDataPageActions & { + solution: string; +}; +/** + * Applies extra styling to a typical EuiAvatar + */ +export declare const ElasticAgentCard: FunctionComponent; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/index.d.ts new file mode 100644 index 0000000000000..e27571ab6e985 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/index.d.ts @@ -0,0 +1,3 @@ +export * from './elastic_agent_card'; +/** @deprecated Use `NoDataCard` from `src/plugins/shared_ux/page_template`. */ +export * from './no_data_card'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/no_data_card.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/no_data_card.d.ts new file mode 100644 index 0000000000000..54360d2d6e0f7 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/no_data_card.d.ts @@ -0,0 +1,3 @@ +import type { FunctionComponent } from 'react'; +import type { NoDataPageActions } from '../no_data_page'; +export declare const NoDataCard: FunctionComponent; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page.d.ts new file mode 100644 index 0000000000000..fda41852c3a66 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page.d.ts @@ -0,0 +1,47 @@ +import type { ReactNode, FunctionComponent, MouseEventHandler } from 'react'; +import type { EuiCardProps, CommonProps } from '@elastic/eui'; +export declare const NO_DATA_RECOMMENDED: string; +export type NoDataPageActions = Partial & { + /** + * Applies the `Recommended` beta badge and makes the button `fill` + */ + recommended?: boolean; + /** + * Provide just a string for the button's label, or a whole component + */ + button?: string | ReactNode; + /** + * Remapping `onClick` to any element + */ + onClick?: MouseEventHandler; + /** + * Category to auto-select within Fleet + */ + category?: string; +}; +export type NoDataPageActionsProps = Record; +export interface NoDataPageProps extends CommonProps { + /** + * Single name for the current solution, used to auto-generate the title, logo, description, and button label + */ + solution: string; + /** + * Optionally replace the auto-generated logo + */ + logo?: string; + /** + * Required to set the docs link for the whole solution + */ + docsLink: string; + /** + * Optionally replace the auto-generated page title (h1) + */ + pageTitle?: string; + /** + * An object of `NoDataPageActions` configurations with unique primary keys. + * Use `elasticAgent` or `beats` as the primary key for pre-configured cards of this type. + * Otherwise use a custom key that contains `EuiCard` props. + */ + actions: NoDataPageActionsProps; +} +export declare const NoDataPage: FunctionComponent; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page_body/no_data_page_body.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page_body/no_data_page_body.d.ts new file mode 100644 index 0000000000000..649a1776c0efb --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_page_body/no_data_page_body.d.ts @@ -0,0 +1,9 @@ +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NoDataPageProps } from '../no_data_page'; +import type { ElasticAgentCard, NoDataCard } from '../no_data_card'; +type NoDataPageBodyProps = { + actionCards: Array | ReactElement>; +} & Omit; +export declare const NoDataPageBody: (props: NoDataPageBodyProps) => React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/index.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/index.d.ts new file mode 100644 index 0000000000000..05caaf584029e --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/index.d.ts @@ -0,0 +1,2 @@ +export type { KibanaPageTemplateSolutionNavAvatarProps } from './solution_nav_avatar'; +export { KibanaPageTemplateSolutionNavAvatar } from './solution_nav_avatar'; diff --git a/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/solution_nav_avatar.d.ts b/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/solution_nav_avatar.d.ts new file mode 100644 index 0000000000000..785580a2d4879 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/page_template/solution_nav/solution_nav_avatar.d.ts @@ -0,0 +1,12 @@ +import type { FunctionComponent } from 'react'; +import type { DistributiveOmit, EuiAvatarProps } from '@elastic/eui'; +export type KibanaPageTemplateSolutionNavAvatarProps = DistributiveOmit & { + /** + * Any EuiAvatar size available, of `xxl` for custom large, brand-focused version + */ + size?: EuiAvatarProps['size'] | 'xxl'; +}; +/** + * Applies extra styling to a typical EuiAvatar + */ +export declare const KibanaPageTemplateSolutionNavAvatar: FunctionComponent; diff --git a/src/platform/plugins/shared/kibana_react/public/react_router_navigate/index.d.ts b/src/platform/plugins/shared/kibana_react/public/react_router_navigate/index.d.ts new file mode 100644 index 0000000000000..ef1eeb4f3a726 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/react_router_navigate/index.d.ts @@ -0,0 +1 @@ +export { reactRouterNavigate, reactRouterOnClickHandler } from './react_router_navigate'; diff --git a/src/platform/plugins/shared/kibana_react/public/react_router_navigate/react_router_navigate.d.ts b/src/platform/plugins/shared/kibana_react/public/react_router_navigate/react_router_navigate.d.ts new file mode 100644 index 0000000000000..555f52bf2de6d --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/react_router_navigate/react_router_navigate.d.ts @@ -0,0 +1,15 @@ +import type { ScopedHistory } from '@kbn/core/public'; +import type { MouseEvent } from 'react'; +import type { History } from 'history'; +interface LocationObject { + pathname?: string; + search?: string; + hash?: string; +} +export declare const toLocationObject: (to: string | LocationObject) => LocationObject; +export declare const reactRouterNavigate: (history: ScopedHistory | History, to: string | LocationObject, onClickCallback?: Function) => { + href: string; + onClick: (event: MouseEvent) => void; +}; +export declare const reactRouterOnClickHandler: (history: ScopedHistory | History, to: string | LocationObject, onClickCallback?: Function) => (event: MouseEvent) => void; +export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/theme.d.ts b/src/platform/plugins/shared/kibana_react/public/theme.d.ts new file mode 100644 index 0000000000000..59e79b52de84f --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/theme.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import type { KibanaThemeProviderProps as KbnThemeProviderProps } from '@kbn/react-kibana-context-theme'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +/** @deprecated Use `KibanaThemeProviderProps` from `@kbn/react-kibana-context-theme` */ +export type KibanaThemeProviderProps = Pick & KbnThemeProviderProps['theme']; +/** @deprecated Use `KibanaThemeProvider` from `@kbn/react-kibana-context-theme` */ +export declare const KibanaThemeProvider: ({ children, theme$, userProfile, modify, }: KibanaThemeProviderProps) => React.JSX.Element; +type Theme = KbnThemeProviderProps['theme']['theme$']; +/** @deprecated Use `wrapWithTheme` from `@kbn/react-kibana-context-theme` */ +export declare const wrapWithTheme: (node: React.ReactNode, theme$: Theme, userProfile?: UserProfileService) => React.JSX.Element; +export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/ui_settings/index.d.ts b/src/platform/plugins/shared/kibana_react/public/ui_settings/index.d.ts new file mode 100644 index 0000000000000..86cca6acb95e7 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/ui_settings/index.d.ts @@ -0,0 +1 @@ +export * from './use_ui_setting'; diff --git a/src/platform/plugins/shared/kibana_react/public/ui_settings/use_ui_setting.d.ts b/src/platform/plugins/shared/kibana_react/public/ui_settings/use_ui_setting.d.ts new file mode 100644 index 0000000000000..63121b0d439e3 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/ui_settings/use_ui_setting.d.ts @@ -0,0 +1,50 @@ +/** + * Returns the current UI-settings value. + * + * Usage: + * + * ```js + * const darkMode = useUiSetting('theme:darkMode'); + * ``` + */ +export declare const useUiSetting: (key: string, defaultValue?: T) => T; +/** + * Returns the current global UI-settings value. + * + * Usage: + * + * ```js + * const customBranding = useGlobalUiSetting('customBranding:pageTitle'); + * ``` + */ +export declare const useGlobalUiSetting: (key: string, defaultValue?: T) => T; +type Setter = (newValue: T) => Promise; +/** + * Returns a 2-tuple, where first entry is the setting value and second is a + * function to update the setting value. + * + * Synchronously returns the most current value of the setting and subscribes + * to all subsequent updates, which will re-render your component on new values. + * + * Usage: + * + * ```js + * const [darkMode, setDarkMode] = useUiSetting$('theme:darkMode'); + * ``` + */ +export declare const useUiSetting$: (key: string, defaultValue?: T) => [T, Setter]; +/** + * Returns a 2-tuple, where first entry is the setting value and second is a + * function to update the setting value. + * + * Synchronously returns the most current value of the setting and subscribes + * to all subsequent updates, which will re-render your component on new values. + * + * Usage: + * + * ```js + * const [customBranding, setCustomBranding] = useGlobalUiSetting$('customBranding:pageTitle'); + * ``` + */ +export declare const useGlobalUiSetting$: (key: string, defaultValue?: T) => [T, Setter]; +export {}; diff --git a/src/platform/plugins/shared/kibana_react/public/url_template_editor/index.d.ts b/src/platform/plugins/shared/kibana_react/public/url_template_editor/index.d.ts new file mode 100644 index 0000000000000..a53049d12f39d --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/url_template_editor/index.d.ts @@ -0,0 +1 @@ +export * from './url_template_editor'; diff --git a/src/platform/plugins/shared/kibana_react/public/url_template_editor/url_template_editor.d.ts b/src/platform/plugins/shared/kibana_react/public/url_template_editor/url_template_editor.d.ts new file mode 100644 index 0000000000000..b57133352823f --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/url_template_editor/url_template_editor.d.ts @@ -0,0 +1,20 @@ +import * as React from 'react'; +import { monaco, type CodeEditorProps } from '@kbn/code-editor'; +export interface UrlTemplateEditorVariable { + label: string; + title?: string; + documentation?: string; + kind?: monaco.languages.CompletionItemKind; + sortText?: string; +} +export interface UrlTemplateEditorProps { + value: string; + height?: CodeEditorProps['height']; + fitToContent?: CodeEditorProps['fitToContent']; + variables?: UrlTemplateEditorVariable[]; + onChange: CodeEditorProps['onChange']; + onEditor?: (editor: monaco.editor.IStandaloneCodeEditor) => void; + placeholder?: string; + Editor?: React.ComponentType; +} +export declare const UrlTemplateEditor: React.FC; diff --git a/src/platform/plugins/shared/kibana_react/public/use_execution_context/index.d.ts b/src/platform/plugins/shared/kibana_react/public/use_execution_context/index.d.ts new file mode 100644 index 0000000000000..b8ce9879bed57 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/use_execution_context/index.d.ts @@ -0,0 +1 @@ +export { useExecutionContext } from './use_execution_context'; diff --git a/src/platform/plugins/shared/kibana_react/public/use_execution_context/use_execution_context.d.ts b/src/platform/plugins/shared/kibana_react/public/use_execution_context/use_execution_context.d.ts new file mode 100644 index 0000000000000..62b1269c46688 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/use_execution_context/use_execution_context.d.ts @@ -0,0 +1,7 @@ +import type { KibanaExecutionContext, CoreStart } from '@kbn/core/public'; +/** + * Set and clean up application level execution context + * @param executionContext + * @param context + */ +export declare function useExecutionContext(executionContext: CoreStart['executionContext'] | undefined, context: KibanaExecutionContext): void; diff --git a/src/platform/plugins/shared/kibana_react/public/util/index.d.ts b/src/platform/plugins/shared/kibana_react/public/util/index.d.ts new file mode 100644 index 0000000000000..e79ccf9d90fdd --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/util/index.d.ts @@ -0,0 +1,18 @@ +import React from 'react'; +import { type Observable } from 'rxjs'; +import type { MountPoint } from '@kbn/core/public'; +import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; +import type { CoreTheme } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; +/** + * @deprecated use `ToMountPointParams` from `@kbn/react-kibana-mount` + */ +export interface ToMountPointOptions { + analytics?: AnalyticsServiceStart; + theme$?: Observable; + userProfile?: UserProfileService; +} +/** + * @deprecated use `toMountPoint` from `@kbn/react-kibana-mount` + */ +export declare const toMountPoint: (node: React.ReactNode, { analytics, theme$, userProfile }?: ToMountPointOptions) => MountPoint; diff --git a/src/platform/plugins/shared/kibana_react/public/validated_range/index.d.ts b/src/platform/plugins/shared/kibana_react/public/validated_range/index.d.ts new file mode 100644 index 0000000000000..8a79ce3517b70 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/validated_range/index.d.ts @@ -0,0 +1,2 @@ +export type { Value } from './validated_dual_range'; +export { ValidatedDualRange } from './validated_dual_range'; diff --git a/src/platform/plugins/shared/kibana_react/public/validated_range/is_range_valid.d.ts b/src/platform/plugins/shared/kibana_react/public/validated_range/is_range_valid.d.ts new file mode 100644 index 0000000000000..7a2a62c8f0260 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/validated_range/is_range_valid.d.ts @@ -0,0 +1,5 @@ +import type { ValueMember, Value } from './validated_dual_range'; +export declare function isRangeValid(value?: Value, min?: ValueMember, max?: ValueMember, allowEmptyRange?: boolean): { + isValid: boolean; + errorMessage: string; +}; diff --git a/src/platform/plugins/shared/kibana_react/public/validated_range/validated_dual_range.d.ts b/src/platform/plugins/shared/kibana_react/public/validated_range/validated_dual_range.d.ts new file mode 100644 index 0000000000000..99de9c2abdb84 --- /dev/null +++ b/src/platform/plugins/shared/kibana_react/public/validated_range/validated_dual_range.d.ts @@ -0,0 +1,36 @@ +import type { ReactNode } from 'react'; +import React, { Component } from 'react'; +import type { EuiDualRangeProps } from '@elastic/eui'; +import type { EuiFormRowDisplayKeys } from '@elastic/eui/src/components/form/form_row/form_row'; +export type Value = EuiDualRangeProps['value']; +export type ValueMember = EuiDualRangeProps['value'][0]; +interface Props extends Omit { + value?: Value; + allowEmptyRange?: boolean; + label?: string | ReactNode; + formRowDisplay?: EuiFormRowDisplayKeys; + onChange?: (val: [string, string]) => void; +} +interface State { + isValid?: boolean; + errorMessage?: string; + value: [ValueMember, ValueMember]; + prevValue?: Value; +} +export declare class ValidatedDualRange extends Component { + static defaultProps: { + fullWidth: boolean; + allowEmptyRange: boolean; + compressed: boolean; + }; + static getDerivedStateFromProps(nextProps: Props, prevState: State): { + value: [string | number, string | number] | undefined; + prevValue: [string | number, string | number] | undefined; + isValid: boolean; + errorMessage: string; + } | null; + state: State; + _onChange: (value: Value) => void; + render(): React.JSX.Element; +} +export {}; diff --git a/src/platform/plugins/shared/kibana_utils/common/abort_utils.d.ts b/src/platform/plugins/shared/kibana_utils/common/abort_utils.d.ts new file mode 100644 index 0000000000000..b991d0b56dfdf --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/abort_utils.d.ts @@ -0,0 +1,36 @@ +export declare enum AbortReason { + /** + * The request was aborted due to reaching the `search:timeout` advanced setting. + */ + TIMEOUT = "timeout", + /** + * The request was aborted because the data was replaced by a new request (refreshed/re-fetched). + */ + REPLACED = "replaced", + /** + * The request was aborted because the component unmounted or the execution context was destroyed. + */ + CLEANUP = "cleanup", + /** + * The request was aborted because the user explicitly canceled it. + */ + CANCELED = "canceled" +} +/** + * Class used to signify that something was aborted. Useful for applications to conditionally handle + * this type of error differently than other errors. + */ +export declare class AbortError extends Error { + constructor(message?: string); +} +/** + * Returns a `Promise` corresponding with when the given `AbortSignal` is aborted. Useful for + * situations when you might need to `Promise.race` multiple `AbortSignal`s, or an `AbortSignal` + * with any other expected errors (or completions). + * + * @param signal The `AbortSignal` to generate the `Promise` from + */ +export declare function abortSignalToPromise(signal: AbortSignal): { + promise: Promise; + cleanup: () => void; +}; diff --git a/src/platform/plugins/shared/kibana_utils/common/calculate_object_hash.d.ts b/src/platform/plugins/shared/kibana_utils/common/calculate_object_hash.d.ts new file mode 100644 index 0000000000000..f3d24c7753467 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/calculate_object_hash.d.ts @@ -0,0 +1,3 @@ +declare function sum(o: object): string; +export declare const calculateObjectHash: typeof sum; +export {}; diff --git a/src/platform/plugins/shared/kibana_utils/common/create_getter_setter.d.ts b/src/platform/plugins/shared/kibana_utils/common/create_getter_setter.d.ts new file mode 100644 index 0000000000000..662d1a336588f --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/create_getter_setter.d.ts @@ -0,0 +1,3 @@ +export type Get = () => T; +export type Set = (value: T) => void; +export declare const createGetterSetter: (name: string, isValueRequired?: boolean) => [Get, Set]; diff --git a/src/platform/plugins/shared/kibana_utils/common/defer.d.ts b/src/platform/plugins/shared/kibana_utils/common/defer.d.ts new file mode 100644 index 0000000000000..c981925dc3a4b --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/defer.d.ts @@ -0,0 +1,18 @@ +/** + * An externally resolvable/rejectable "promise". Use it to resolve/reject + * promise at any time. + * + * ```ts + * const future = new Defer(); + * + * future.promise.then(value => console.log(value)); + * + * future.resolve(123); + * ``` + */ +export declare class Defer { + readonly resolve: (data: T) => void; + readonly reject: (error: any) => void; + readonly promise: Promise; +} +export declare const defer: () => Defer; diff --git a/src/platform/plugins/shared/kibana_utils/common/distinct_until_changed_with_initial_value.d.ts b/src/platform/plugins/shared/kibana_utils/common/distinct_until_changed_with_initial_value.d.ts new file mode 100644 index 0000000000000..419b2f581a38d --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/distinct_until_changed_with_initial_value.d.ts @@ -0,0 +1,2 @@ +import type { MonoTypeOperatorFunction } from 'rxjs'; +export declare function distinctUntilChangedWithInitialValue(initialValue: T | Promise, compare?: (x: T, y: T) => boolean): MonoTypeOperatorFunction; diff --git a/src/platform/plugins/shared/kibana_utils/common/errors/errors.d.ts b/src/platform/plugins/shared/kibana_utils/common/errors/errors.d.ts new file mode 100644 index 0000000000000..66683fa53e0ee --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/errors/errors.d.ts @@ -0,0 +1,53 @@ +export declare class KbnError extends Error { + constructor(message: string); +} +/** + * when a mapping already exists for a field the user is attempting to add + * @param {String} name - the field name + */ +export declare class DuplicateField extends KbnError { + constructor(name: string); +} +/** + * when a user is attempting to create a field with disallowed character in the name, like * + * @param {String} character - the character not allowed in name + * @param {String} name - the field name + */ +export declare class CharacterNotAllowedInField extends KbnError { + constructor(character: string, name: string); +} +/** + * A saved object was not found + */ +export declare class SavedObjectNotFound extends KbnError { + savedObjectType: string; + savedObjectTypeDisplayName: string; + savedObjectId?: string; + constructor({ type, typeDisplayName, id, link, customMessage, }: { + type: string; + typeDisplayName?: string; + id?: string; + link?: string; + customMessage?: string; + }); +} +/** + * A saved field doesn't exist anymore + */ +export declare class SavedFieldNotFound extends KbnError { + constructor(message: string); +} +/** + * A saved field type isn't compatible with aggregation + */ +export declare class SavedFieldTypeInvalidForAgg extends KbnError { + constructor(message: string); +} +/** + * This error is for scenarios where a saved object is detected that has invalid JSON properties. + * There was a scenario where we were importing objects with double-encoded JSON, and the system + * was silently failing. This error is now thrown in those scenarios. + */ +export declare class InvalidJSONProperty extends KbnError { + constructor(message: string); +} diff --git a/src/platform/plugins/shared/kibana_utils/common/errors/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/errors/index.d.ts new file mode 100644 index 0000000000000..0bc01a85432ac --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/errors/index.d.ts @@ -0,0 +1,2 @@ +export { KbnError, DuplicateField, CharacterNotAllowedInField, SavedObjectNotFound, SavedFieldNotFound, SavedFieldTypeInvalidForAgg, InvalidJSONProperty, } from './errors'; +export type { KibanaServerError } from './types'; diff --git a/src/platform/plugins/shared/kibana_utils/common/errors/types.d.ts b/src/platform/plugins/shared/kibana_utils/common/errors/types.d.ts new file mode 100644 index 0000000000000..17bb6a7b2967a --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/errors/types.d.ts @@ -0,0 +1,5 @@ +export interface KibanaServerError { + statusCode: number; + message: string; + attributes?: T; +} diff --git a/src/platform/plugins/shared/kibana_utils/common/field_wildcard.d.ts b/src/platform/plugins/shared/kibana_utils/common/field_wildcard.d.ts new file mode 100644 index 0000000000000..e2bbeabc10d46 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/field_wildcard.d.ts @@ -0,0 +1,3 @@ +export declare const makeRegEx: ((glob: string) => RegExp) & import("lodash").MemoizedFunction; +export declare function fieldWildcardMatcher(globs?: string[], metaFields?: unknown[]): (val: unknown) => boolean; +export declare function fieldWildcardFilter(globs?: string[], metaFields?: string[]): (val: unknown) => boolean; diff --git a/src/platform/plugins/shared/kibana_utils/common/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/index.d.ts new file mode 100644 index 0000000000000..1e25f9aeb915d --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/index.d.ts @@ -0,0 +1,18 @@ +export { Defer, defer } from './defer'; +export { fieldWildcardMatcher, fieldWildcardFilter, makeRegEx } from './field_wildcard'; +export { of } from './of'; +export type { BaseState, BaseStateContainer, StateContainer, ReduxLikeStateContainer, Dispatch, Middleware, Selector, Comparator, MapStateToProps, Connect, Reducer, UnboxState, PureSelectorToSelector, PureSelectorsToSelectors, EnsurePureSelector, EnsurePureTransition, PureSelector, PureTransition, CreateStateContainerOptions, } from './state_containers'; +export { setStateToKbnUrl } from './state_management/set_state_to_kbn_url'; +export { replaceUrlHashQuery } from './state_management/format'; +export { createStateContainerReactHelpers, useContainerSelector, useContainerState, createStateContainer, defaultFreeze, } from './state_containers'; +export type { KibanaServerError } from './errors'; +export { KbnError, CharacterNotAllowedInField, SavedFieldNotFound, SavedObjectNotFound, SavedFieldTypeInvalidForAgg, InvalidJSONProperty, DuplicateField, } from './errors'; +export { AbortError, AbortReason, abortSignalToPromise } from './abort_utils'; +export type { Get, Set } from './create_getter_setter'; +export { createGetterSetter } from './create_getter_setter'; +export { distinctUntilChangedWithInitialValue } from './distinct_until_changed_with_initial_value'; +export { url } from './url'; +export { now } from './now'; +export { calculateObjectHash } from './calculate_object_hash'; +export type { VersionedState, PersistableStateService, PersistableStateMigrateFn, MigrateFunction, MigrateFunctionsObject, GetMigrationFunctionObjectFn, PersistableState, PersistableStateDefinition, } from './persistable_state'; +export { migrateToLatest, mergeMigrationFunctionMaps } from './persistable_state'; diff --git a/src/platform/plugins/shared/kibana_utils/common/now.d.ts b/src/platform/plugins/shared/kibana_utils/common/now.d.ts new file mode 100644 index 0000000000000..402d0f414b983 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/now.d.ts @@ -0,0 +1,5 @@ +/** + * Function that returns number in milliseconds since some undefined point in + * time. Use this function for performance measurements. + */ +export declare const now: () => number; diff --git a/src/platform/plugins/shared/kibana_utils/common/of.d.ts b/src/platform/plugins/shared/kibana_utils/common/of.d.ts new file mode 100644 index 0000000000000..bfd57cffa3e76 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/of.d.ts @@ -0,0 +1,10 @@ +/** + * Given a promise awaits it and returns a 3-tuple, with the following members: + * + * - First entry is either the resolved value of the promise or `undefined`. + * - Second entry is either the error thrown by promise or `undefined`. + * - Third entry is a boolean, truthy if promise was resolved and falsy if rejected. + * + * @param promise Promise to convert to 3-tuple. + */ +export declare const of: (promise: Promise) => Promise<[T | undefined, E | undefined, boolean]>; diff --git a/src/platform/plugins/shared/kibana_utils/common/persistable_state/index.d.ts b/src/platform/plugins/shared/kibana_utils/common/persistable_state/index.d.ts new file mode 100644 index 0000000000000..74c6330ffcfcd --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/persistable_state/index.d.ts @@ -0,0 +1,3 @@ +export type { VersionedState, PersistableState, PersistableStateDefinition, PersistableStateMigrateFn, PersistableStateService, MigrateFunctionsObject, MigrateFunction, GetMigrationFunctionObjectFn, } from './types'; +export { migrateToLatest } from './migrate_to_latest'; +export { mergeMigrationFunctionMaps } from './merge_migration_function_map'; diff --git a/src/platform/plugins/shared/kibana_utils/common/persistable_state/merge_migration_function_map.d.ts b/src/platform/plugins/shared/kibana_utils/common/persistable_state/merge_migration_function_map.d.ts new file mode 100644 index 0000000000000..52f9bb4880860 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/persistable_state/merge_migration_function_map.d.ts @@ -0,0 +1,4 @@ +import type { MigrateFunctionsObject, MigrateFunction } from './types'; +export declare const mergeMigrationFunctionMaps: (obj1: MigrateFunctionsObject, obj2: MigrateFunctionsObject) => { + [semver: string]: MigrateFunction; +} & MigrateFunctionsObject; diff --git a/src/platform/plugins/shared/kibana_utils/common/persistable_state/migrate_to_latest.d.ts b/src/platform/plugins/shared/kibana_utils/common/persistable_state/migrate_to_latest.d.ts new file mode 100644 index 0000000000000..ceda3d928649f --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/persistable_state/migrate_to_latest.d.ts @@ -0,0 +1,3 @@ +import type { SerializableRecord } from '@kbn/utility-types'; +import type { VersionedState, MigrateFunctionsObject } from './types'; +export declare function migrateToLatest(migrations: MigrateFunctionsObject, { state, version: oldVersion }: VersionedState, loose?: boolean): S; diff --git a/src/platform/plugins/shared/kibana_utils/common/persistable_state/types.d.ts b/src/platform/plugins/shared/kibana_utils/common/persistable_state/types.d.ts new file mode 100644 index 0000000000000..9c3b8c031b798 --- /dev/null +++ b/src/platform/plugins/shared/kibana_utils/common/persistable_state/types.d.ts @@ -0,0 +1,146 @@ +import type { SerializableRecord, Serializable } from '@kbn/utility-types'; +import type { SavedObjectReference } from '@kbn/core/types'; +/** + * Versioned state is a POJO JavaScript object that can be serialized to JSON, + * and which also contains the version information. The version is stored in + * semver format and corresponds to the Kibana release version when the object + * was created. The version can be used to apply migrations to the object. + * + * For example: + * + * ```ts + * const obj: VersionedState<{ dashboardId: string }> = { + * version: '7.14.0', + * state: { + * dashboardId: '123', + * }, + * }; + * ``` + */ +export interface VersionedState { + version: string; + state: S; +} +/** + * Persistable state interface can be implemented by something that persists + * (stores) state, for example, in a saved object. Once implemented that thing + * will gain ability to "extract" and "inject" saved object references, which + * are necessary for various saved object tasks, such as export. It will also be + * able to do state migrations across Kibana versions, if the shape of the state + * would change over time. + * + * @todo Maybe rename it to `PersistableStateItem`? + */ +export interface PersistableState